# Generated by Django 5.2.15 on 2026-06-17 04:34

# 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", "0004_planetpin_install_time"),
    ]

    operations = [
        migrations.CreateModel(
            name="CorpPricingConfig",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "default_discount_percent",
                    models.FloatField(
                        default=0.0,
                        help_text="Default discount % applied to Jita prices (e.g. 10.0 for 10% off)",
                    ),
                ),
                (
                    "corporation",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="pricing_config",
                        to="eveonline.evecorporationinfo",
                    ),
                ),
            ],
            options={
                "verbose_name": "Corp Pricing Config",
                "verbose_name_plural": "Corp Pricing Configs",
            },
        ),
        migrations.CreateModel(
            name="MemberOrder",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("REQUESTED", "Requested"),
                            ("QUOTED", "Quoted"),
                            ("ACCEPTED", "Accepted"),
                            ("IN_PRODUCTION", "In Production"),
                            ("READY", "Ready for Pickup"),
                            ("DELIVERED", "Delivered"),
                            ("REJECTED", "Rejected"),
                        ],
                        default="REQUESTED",
                        max_length=20,
                    ),
                ),
                (
                    "total_price",
                    models.DecimalField(decimal_places=2, default=0.0, max_digits=17),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("notes", models.TextField(blank=True, null=True)),
                (
                    "character",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="industry_orders",
                        to="eveonline.evecharacter",
                    ),
                ),
            ],
            options={
                "verbose_name": "Member Order",
                "verbose_name_plural": "Member Orders",
            },
        ),
        migrations.CreateModel(
            name="OrderFit",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("raw_fit_text", models.TextField()),
                (
                    "order",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="fit",
                        to="industry_reforged.memberorder",
                    ),
                ),
            ],
            options={
                "verbose_name": "Order Fit",
                "verbose_name_plural": "Order Fits",
            },
        ),
        migrations.CreateModel(
            name="OrderItem",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("quantity", models.IntegerField(default=1)),
                (
                    "price_per_unit",
                    models.DecimalField(decimal_places=2, default=0.0, max_digits=17),
                ),
                ("discount_applied", models.FloatField(default=0.0)),
                (
                    "item_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="eveuniverse.evetype",
                    ),
                ),
                (
                    "order",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="items",
                        to="industry_reforged.memberorder",
                    ),
                ),
            ],
            options={
                "verbose_name": "Order Item",
                "verbose_name_plural": "Order Items",
            },
        ),
        migrations.CreateModel(
            name="CorpTypeDiscount",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "discount_percent",
                    models.FloatField(
                        help_text="Discount % for this specific item type"
                    ),
                ),
                (
                    "config",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="type_discounts",
                        to="industry_reforged.corppricingconfig",
                    ),
                ),
                (
                    "eve_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="eveuniverse.evetype",
                    ),
                ),
            ],
            options={
                "verbose_name": "Corp Type Discount",
                "verbose_name_plural": "Corp Type Discounts",
                "unique_together": {("config", "eve_type")},
            },
        ),
    ]
