# Generated by Django 5.2.15 on 2026-06-17 20:11

# 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"),
        ("eveuniverse", "0012_alter_evebloodline_eve_ship_type"),
        ("industry_reforged", "0006_alter_general_options_corpmotd_productiontask"),
    ]

    operations = [
        migrations.AddField(
            model_name="productiontask",
            name="bom_parent",
            field=models.ForeignKey(
                blank=True,
                help_text="The parent task that requires this sub-component",
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="bom_children",
                to="industry_reforged.productiontask",
            ),
        ),
        migrations.AddField(
            model_name="productiontask",
            name="hidden",
            field=models.BooleanField(
                default=False, help_text="Hide from standard Industrialist Job Market"
            ),
        ),
        migrations.AddField(
            model_name="productiontask",
            name="priority",
            field=models.CharField(
                choices=[("HIGH", "High"), ("NORMAL", "Normal"), ("LOW", "Low")],
                default="NORMAL",
                max_length=10,
            ),
        ),
        migrations.CreateModel(
            name="CorpHangarConfig",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "location_id",
                    models.BigIntegerField(help_text="The station or structure ID"),
                ),
                (
                    "flag_id",
                    models.IntegerField(
                        help_text="The hangar flag ID (e.g. 4 for Hangar 1)"
                    ),
                ),
                (
                    "description",
                    models.CharField(
                        blank=True,
                        help_text="User friendly name for this hangar",
                        max_length=100,
                        null=True,
                    ),
                ),
                (
                    "corporation",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="hangar_configs",
                        to="eveonline.evecorporationinfo",
                    ),
                ),
            ],
            options={
                "verbose_name": "Corp Hangar Config",
                "verbose_name_plural": "Corp Hangar Configs",
            },
        ),
        migrations.CreateModel(
            name="TaxConfig",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "industry_tax_rate",
                    models.FloatField(
                        default=0.0, help_text="Tax % applied to industry jobs"
                    ),
                ),
                (
                    "broker_fee_rate",
                    models.FloatField(default=0.0, help_text="Broker fee %"),
                ),
                (
                    "corporation",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="tax_config",
                        to="eveonline.evecorporationinfo",
                    ),
                ),
            ],
            options={
                "verbose_name": "Tax Config",
                "verbose_name_plural": "Tax Configs",
            },
        ),
        migrations.CreateModel(
            name="CorpInventory",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("quantity", models.BigIntegerField(default=0)),
                ("location_id", models.BigIntegerField()),
                ("flag_id", models.IntegerField()),
                (
                    "manual_override",
                    models.BooleanField(
                        default=False,
                        help_text="If true, ESI sync will not overwrite this quantity",
                    ),
                ),
                ("last_updated", models.DateTimeField(auto_now=True)),
                (
                    "corporation",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="inventory",
                        to="eveonline.evecorporationinfo",
                    ),
                ),
                (
                    "item_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="eveuniverse.evetype",
                    ),
                ),
            ],
            options={
                "verbose_name": "Corp Inventory",
                "verbose_name_plural": "Corp Inventories",
                "unique_together": {
                    ("corporation", "item_type", "location_id", "flag_id")
                },
            },
        ),
        migrations.CreateModel(
            name="CorpItemConfig",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "manual_me",
                    models.IntegerField(
                        default=0,
                        help_text="Manual Material Efficiency override (0-10)",
                    ),
                ),
                (
                    "manual_te",
                    models.IntegerField(
                        default=0, help_text="Manual Time Efficiency override (0-20)"
                    ),
                ),
                (
                    "manual_price",
                    models.DecimalField(
                        blank=True,
                        decimal_places=2,
                        help_text="Override price, especially useful for Faction items",
                        max_digits=17,
                        null=True,
                    ),
                ),
                (
                    "target_threshold",
                    models.IntegerField(
                        default=0, help_text="Minimum stock level required in Hangars"
                    ),
                ),
                (
                    "auto_produce",
                    models.BooleanField(
                        default=False,
                        help_text="Automatically create ProductionTask if stock < threshold",
                    ),
                ),
                (
                    "build_or_buy",
                    models.CharField(
                        choices=[("BUILD", "Build"), ("BUY", "Buy")],
                        default="BUILD",
                        max_length=10,
                    ),
                ),
                (
                    "bom_source",
                    models.CharField(
                        choices=[
                            ("SDE", "Eve SDE (Database)"),
                            ("FUZZWORK", "Fuzzwork API"),
                        ],
                        default="FUZZWORK",
                        max_length=10,
                    ),
                ),
                (
                    "corporation",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="item_configs",
                        to="eveonline.evecorporationinfo",
                    ),
                ),
                (
                    "item_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="eveuniverse.evetype",
                    ),
                ),
            ],
            options={
                "verbose_name": "Corp Item Config",
                "verbose_name_plural": "Corp Item Configs",
                "unique_together": {("corporation", "item_type")},
            },
        ),
    ]
