# Generated by Django 5.2.15 on 2026-06-21 15:44

# Django
import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("eveonline", "0025_remove_evecharacter_last_updated_and_more"),
        ("industry_reforged", "0008_alter_corphangarconfig_flag_id_and_more"),
    ]

    operations = [
        migrations.CreateModel(
            name="CorpWalletDivision",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("division", models.IntegerField()),
                ("name", models.CharField(max_length=100)),
                (
                    "balance",
                    models.DecimalField(decimal_places=2, default=0.0, max_digits=20),
                ),
                ("last_updated", models.DateTimeField(auto_now=True)),
                (
                    "corporation",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="wallet_divisions",
                        to="eveonline.evecorporationinfo",
                    ),
                ),
            ],
            options={
                "verbose_name": "Corp Wallet Division",
                "verbose_name_plural": "Corp Wallet Divisions",
                "unique_together": {("corporation", "division")},
            },
        ),
        migrations.CreateModel(
            name="CorpWalletJournal",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("journal_id", models.BigIntegerField()),
                ("date", models.DateTimeField()),
                ("ref_type", models.CharField(max_length=100)),
                (
                    "amount",
                    models.DecimalField(
                        blank=True, decimal_places=2, max_digits=20, null=True
                    ),
                ),
                (
                    "balance",
                    models.DecimalField(
                        blank=True, decimal_places=2, max_digits=20, null=True
                    ),
                ),
                ("reason", models.CharField(blank=True, max_length=255, null=True)),
                (
                    "description",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                ("first_party_id", models.BigIntegerField(blank=True, null=True)),
                ("second_party_id", models.BigIntegerField(blank=True, null=True)),
                (
                    "tax",
                    models.DecimalField(
                        blank=True, decimal_places=2, max_digits=20, null=True
                    ),
                ),
                ("tax_receiver_id", models.BigIntegerField(blank=True, null=True)),
                (
                    "division",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="journal_entries",
                        to="industry_reforged.corpwalletdivision",
                    ),
                ),
            ],
            options={
                "verbose_name": "Corp Wallet Journal",
                "verbose_name_plural": "Corp Wallet Journals",
                "ordering": ["-date"],
                "unique_together": {("division", "journal_id")},
            },
        ),
    ]
