# Generated by Django 4.2.11 on 2025-02-06 12:01

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


class Migration(migrations.Migration):

    dependencies = [
        ("eveuniverse", "0010_alter_eveindustryactivityduration_eve_type_and_more"),
        ("taxsystem", "0001_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="CorporationWalletDivision",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(default=None, max_length=100, null=True)),
                ("balance", models.DecimalField(decimal_places=2, max_digits=20)),
                ("division", models.IntegerField()),
                (
                    "corporation",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="corporation_division",
                        to="taxsystem.owneraudit",
                    ),
                ),
            ],
            options={
                "default_permissions": (),
            },
        ),
        migrations.CreateModel(
            name="CorporationWalletJournalEntry",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "amount",
                    models.DecimalField(
                        decimal_places=2, default=None, max_digits=20, null=True
                    ),
                ),
                (
                    "balance",
                    models.DecimalField(
                        decimal_places=2, default=None, max_digits=20, null=True
                    ),
                ),
                ("context_id", models.BigIntegerField(default=None, null=True)),
                (
                    "context_id_type",
                    models.CharField(
                        choices=[
                            ("structure_id", "Structure Id"),
                            ("station_id", "Station Id"),
                            ("market_transaction_id", "Market Transaction Id"),
                            ("character_id", "Character Id"),
                            ("corporation_id", "Corporation Id"),
                            ("alliance_id", "Alliance Id"),
                            ("eve_system", "Eve System"),
                            ("industry_job_id", "Industry Job Id"),
                            ("contract_id", "Contract Id"),
                            ("planet_id", "Planet Id"),
                            ("system_id", "System Id"),
                            ("type_id", "Type Id"),
                        ],
                        default=None,
                        max_length=30,
                        null=True,
                    ),
                ),
                ("date", models.DateTimeField()),
                ("description", models.CharField(max_length=500)),
                ("entry_id", models.BigIntegerField()),
                ("reason", models.CharField(default=None, max_length=500, null=True)),
                ("ref_type", models.CharField(max_length=72)),
                (
                    "tax",
                    models.DecimalField(
                        decimal_places=2, default=None, max_digits=20, null=True
                    ),
                ),
                ("tax_receiver_id", models.IntegerField(default=None, null=True)),
                (
                    "division",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="taxsystem.corporationwalletdivision",
                    ),
                ),
                (
                    "first_party",
                    models.ForeignKey(
                        blank=True,
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.SET_DEFAULT,
                        related_name="+",
                        to="eveuniverse.eveentity",
                    ),
                ),
                (
                    "second_party",
                    models.ForeignKey(
                        blank=True,
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.SET_DEFAULT,
                        related_name="+",
                        to="eveuniverse.eveentity",
                    ),
                ),
            ],
            options={
                "abstract": False,
                "default_permissions": (),
                "indexes": [
                    models.Index(fields=["date"], name="taxsystem_c_date_1a3f46_idx"),
                    models.Index(
                        fields=["amount"], name="taxsystem_c_amount_3f4bd8_idx"
                    ),
                    models.Index(
                        fields=["entry_id"], name="taxsystem_c_entry_i_bd9090_idx"
                    ),
                    models.Index(
                        fields=["ref_type"], name="taxsystem_c_ref_typ_5f82e6_idx"
                    ),
                    models.Index(
                        fields=["first_party"], name="taxsystem_c_first_p_d83db8_idx"
                    ),
                    models.Index(
                        fields=["second_party"], name="taxsystem_c_second__2a759e_idx"
                    ),
                ],
            },
        ),
    ]
