# Generated by Django 4.2.29 on 2026-03-26 01:33

# Django
import django.core.validators
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    replaces = [
        (
            "georgeforge",
            "0001_squashed_0020_alter_order_deposit_alter_order_paid_and_more",
        ),
        ("georgeforge", "0021_alter_order_deliverysystem"),
        ("georgeforge", "0022_add_order_cart_session_id"),
        ("georgeforge", "0023_remove_cart_session_id_unique"),
        ("georgeforge", "0024_add_order_estimated_delivery_date"),
        ("georgeforge", "0025_alter_estimated_delivery_date_to_string"),
        ("georgeforge", "0026_remove_order_on_behalf_of"),
        ("georgeforge", "0027_alter_order_estimated_delivery_date"),
        ("georgeforge", "0028_alter_order_estimated_delivery_date"),
        ("georgeforge", "0029_alter_order_status"),
        (
            "georgeforge",
            "0030_alter_deliverysystem_system_alter_forsale_eve_type_and_more",
        ),
    ]

    dependencies = [
        ("eve_sde", "0018_blueprintactivity_blueprintactivityproduct_and_more"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="General",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
            ],
            options={
                "permissions": (
                    ("place_order", "Can place an order"),
                    ("manage_store", "Can manage the store"),
                ),
                "managed": False,
                "default_permissions": (),
            },
        ),
        migrations.CreateModel(
            name="Order",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "price",
                    models.DecimalField(
                        decimal_places=2,
                        help_text="Cost per unit",
                        max_digits=15,
                        verbose_name="Price per unit",
                    ),
                ),
                (
                    "totalcost",
                    models.DecimalField(
                        decimal_places=2,
                        help_text="Total Order cost",
                        max_digits=25,
                        verbose_name="Total Order cost",
                    ),
                ),
                (
                    "deposit",
                    models.DecimalField(
                        decimal_places=2,
                        help_text="Deposit required per unit",
                        max_digits=25,
                        verbose_name="Deposit required per unit",
                    ),
                ),
                (
                    "paid",
                    models.DecimalField(
                        decimal_places=2,
                        default=0,
                        help_text="Amount paid",
                        max_digits=25,
                        verbose_name="Amount Paid",
                    ),
                ),
                (
                    "quantity",
                    models.PositiveIntegerField(
                        default=1,
                        validators=[django.core.validators.MinValueValidator(1)],
                        verbose_name="Quantity",
                    ),
                ),
                (
                    "notes",
                    models.TextField(blank=True, max_length=4096, verbose_name="Notes"),
                ),
                (
                    "description",
                    models.TextField(
                        blank=True, max_length=4096, verbose_name="Description"
                    ),
                ),
                (
                    "status",
                    models.IntegerField(
                        choices=[
                            (10, "Pending"),
                            (20, "Awaiting Deposit"),
                            (25, "Deposit Recieved"),
                            (30, "Building Parts"),
                            (35, "Building Hull"),
                            (40, "Contract Up"),
                            (50, "Delivered"),
                            (60, "Rejected"),
                        ],
                        verbose_name="Status",
                    ),
                ),
                (
                    "cart_session_id",
                    models.CharField(
                        db_index=True, max_length=64, verbose_name="Cart Session ID"
                    ),
                ),
                (
                    "estimated_delivery_date",
                    models.CharField(
                        blank=True,
                        help_text="Estimated date when the order will be delivered",
                        max_length=50,
                        verbose_name="Estimated Delivery Date",
                    ),
                ),
                (
                    "deliverysystem",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="eve_sde.solarsystem",
                        verbose_name="Delivery System",
                    ),
                ),
                (
                    "eve_type",
                    models.ForeignKey(
                        limit_choices_to={"published": 1},
                        on_delete=django.db.models.deletion.CASCADE,
                        to="eve_sde.itemtype",
                        verbose_name="EVE Type",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.RESTRICT,
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="Purchaser",
                    ),
                ),
            ],
            options={
                "default_permissions": (),
            },
        ),
        migrations.CreateModel(
            name="ForSale",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "description",
                    models.TextField(
                        blank=True, max_length=4096, verbose_name="Description"
                    ),
                ),
                (
                    "price",
                    models.DecimalField(
                        decimal_places=2,
                        help_text="Cost per unit",
                        max_digits=15,
                        validators=[django.core.validators.MinValueValidator(1)],
                        verbose_name="Price",
                    ),
                ),
                (
                    "deposit",
                    models.DecimalField(
                        decimal_places=2,
                        default=0,
                        help_text="Deposit per unit",
                        max_digits=15,
                        verbose_name="Deposit",
                    ),
                ),
                (
                    "eve_type",
                    models.ForeignKey(
                        limit_choices_to={"published": 1},
                        on_delete=django.db.models.deletion.CASCADE,
                        to="eve_sde.itemtype",
                        verbose_name="EVE Type",
                    ),
                ),
            ],
            options={
                "default_permissions": (),
            },
        ),
        migrations.CreateModel(
            name="DeliverySystem",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "friendly_name",
                    models.TextField(
                        blank=True,
                        default=None,
                        max_length=32,
                        null=True,
                        verbose_name="Friendly Name",
                    ),
                ),
                ("enabled", models.BooleanField(default=True)),
                (
                    "system",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="eve_sde.solarsystem",
                        verbose_name="Solar System",
                    ),
                ),
            ],
            options={
                "default_permissions": (),
            },
        ),
    ]
