# Generated by Django 4.2.11 on 2025-02-08 12:47

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("eveuniverse", "0010_alter_eveindustryactivityduration_eve_type_and_more"),
        ("authentication", "0024_alter_userprofile_language"),
        ("eveonline", "0017_alliance_and_corp_names_are_not_unique"),
        ("contenttypes", "0002_remove_content_type_name"),
    ]

    operations = [
        migrations.CreateModel(
            name="General",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
            ],
            options={
                "permissions": (
                    ("basic_access", "Can access this app"),
                    ("manage_access", "Can manage Tax System"),
                    ("create_access", "Can add Corporation"),
                ),
                "managed": False,
                "default_permissions": (),
            },
        ),
        migrations.CreateModel(
            name="FilterAmount",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=100)),
                ("description", models.CharField(max_length=255)),
                ("amount", models.DecimalField(decimal_places=0, max_digits=12)),
            ],
            options={
                "verbose_name": "Filter Amount",
                "verbose_name_plural": "Filter Amounts",
            },
        ),
        migrations.CreateModel(
            name="FilterReason",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=100)),
                ("description", models.CharField(max_length=255)),
                ("reason", models.CharField(max_length=255)),
            ],
            options={
                "verbose_name": "Filter Reason",
                "verbose_name_plural": "Filter Reasons",
            },
        ),
        migrations.CreateModel(
            name="OwnerAudit",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=255)),
                ("active", models.BooleanField(default=False)),
                ("last_update_wallet", models.DateTimeField(blank=True, null=True)),
                ("last_update_members", models.DateTimeField(blank=True, null=True)),
                ("last_update_payments", models.DateTimeField(blank=True, null=True)),
                ("last_update_filters", models.DateTimeField(blank=True, null=True)),
                (
                    "alliance",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="alliance",
                        to="eveonline.eveallianceinfo",
                    ),
                ),
                (
                    "corporation",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="eveonline.evecorporationinfo",
                    ),
                ),
            ],
            options={
                "verbose_name": "Tax System Audit",
                "verbose_name_plural": "Tax System Audits",
                "default_permissions": (),
            },
        ),
        migrations.CreateModel(
            name="SmartFilter",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("object_id", models.PositiveIntegerField()),
                (
                    "content_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="contenttypes.contenttype",
                    ),
                ),
            ],
            options={
                "verbose_name": "Smart Filter Binding",
                "verbose_name_plural": "Smart Filters Catalog",
            },
        ),
        migrations.CreateModel(
            name="SmartGroup",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("description", models.CharField(max_length=255)),
                ("name", models.CharField(max_length=100)),
                ("last_update", models.DateTimeField(auto_now=True)),
                ("enabled", models.BooleanField(default=True)),
                (
                    "corporation",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="filter_sets",
                        to="taxsystem.owneraudit",
                    ),
                ),
                ("filters", models.ManyToManyField(to="taxsystem.smartfilter")),
            ],
        ),
        migrations.CreateModel(
            name="PaymentSystem",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=100)),
                ("date", models.DateTimeField(auto_now_add=True, null=True)),
                (
                    "status",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("active", "Active"),
                            ("inactive", "Inactive"),
                            ("deactivated", "Deactivated"),
                        ],
                        default="",
                        max_length=16,
                        verbose_name="Status",
                    ),
                ),
                ("notice", models.TextField(blank=True, null=True)),
                (
                    "corporation",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="taxsystem.owneraudit",
                    ),
                ),
                (
                    "user",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="authentication.userprofile",
                    ),
                ),
            ],
            options={
                "verbose_name": "Tax Payment System",
                "verbose_name_plural": "Tax Payment Systems",
                "default_permissions": (),
            },
        ),
        migrations.CreateModel(
            name="Payments",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=100)),
                ("entry_id", models.BigIntegerField()),
                (
                    "date",
                    models.DateTimeField(
                        blank=True, default=django.utils.timezone.now, null=True
                    ),
                ),
                ("amount", models.DecimalField(decimal_places=0, max_digits=12)),
                (
                    "payment_status",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("paid", "Paid"),
                            ("pending", "Pending"),
                            ("failed", "Failed"),
                        ],
                        default="",
                        max_length=10,
                        verbose_name="Status",
                    ),
                ),
                ("payment_date", models.DateTimeField(blank=True, null=True)),
                ("reason", models.TextField(blank=True, null=True)),
                (
                    "approved",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("approved", "Approved"),
                            ("pending", "Pending"),
                            ("rejected", "Rejected"),
                        ],
                        default="",
                        max_length=16,
                        verbose_name="Pending",
                    ),
                ),
                (
                    "payment_user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="payment_user",
                        to="taxsystem.paymentsystem",
                    ),
                ),
            ],
            options={
                "verbose_name": "Tax Payments",
                "verbose_name_plural": "Tax Payments",
                "default_permissions": (),
            },
        ),
        migrations.CreateModel(
            name="Members",
            fields=[
                ("character_name", models.CharField(db_index=True, max_length=100)),
                (
                    "character_id",
                    models.PositiveIntegerField(primary_key=True, serialize=False),
                ),
                (
                    "status",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("active", "Active"),
                            ("missing", "Missing"),
                            ("noaccount", "Unregistered"),
                            ("is_alt", "Is Alt"),
                        ],
                        default="active",
                        max_length=10,
                        verbose_name="Status",
                    ),
                ),
                ("notice", models.TextField(blank=True, null=True)),
                (
                    "corporation",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="owner",
                        to="taxsystem.owneraudit",
                    ),
                ),
            ],
            options={
                "verbose_name": "Tax Member System",
                "verbose_name_plural": "Tax Member Systems",
                "default_permissions": (),
            },
        ),
        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"
                    ),
                ],
            },
        ),
    ]
