# Generated by Django 4.2.20 on 2025-04-17 21:43

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


class Migration(migrations.Migration):
    initial = True

    dependencies = [
        ("contenttypes", "0002_remove_content_type_name"),
        ("member", "0013_auto_20240801_1436"),
    ]

    operations = [
        migrations.CreateModel(
            name="Allergen",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=255, verbose_name="name")),
            ],
            options={
                "verbose_name": "Allergen",
                "verbose_name_plural": "Allergens",
            },
        ),
        migrations.CreateModel(
            name="Food",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=255, verbose_name="name")),
                ("expiry_date", models.DateTimeField(verbose_name="expiry date")),
                (
                    "end_of_life",
                    models.CharField(max_length=255, verbose_name="end of life"),
                ),
                (
                    "is_ready",
                    models.BooleanField(max_length=255, verbose_name="is ready"),
                ),
                ("order", models.CharField(max_length=255, verbose_name="order")),
                (
                    "allergens",
                    models.ManyToManyField(
                        blank=True, to="food.allergen", verbose_name="allergens"
                    ),
                ),
                (
                    "owner",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to="member.club",
                        verbose_name="owner",
                    ),
                ),
                (
                    "polymorphic_ctype",
                    models.ForeignKey(
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="polymorphic_%(app_label)s.%(class)s_set+",
                        to="contenttypes.contenttype",
                    ),
                ),
            ],
            options={
                "verbose_name": "Food",
                "verbose_name_plural": "Foods",
            },
        ),
        migrations.CreateModel(
            name="BasicFood",
            fields=[
                (
                    "food_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="food.food",
                    ),
                ),
                (
                    "arrival_date",
                    models.DateTimeField(
                        default=django.utils.timezone.now, verbose_name="arrival date"
                    ),
                ),
                (
                    "date_type",
                    models.CharField(
                        choices=[("DLC", "DLC"), ("DDM", "DDM")], max_length=255
                    ),
                ),
            ],
            options={
                "verbose_name": "Basic food",
                "verbose_name_plural": "Basic foods",
            },
            bases=("food.food",),
        ),
        migrations.CreateModel(
            name="QRCode",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "qr_code_number",
                    models.PositiveIntegerField(
                        unique=True, verbose_name="qr code number"
                    ),
                ),
                (
                    "food_container",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="QR_code",
                        to="food.food",
                        verbose_name="food container",
                    ),
                ),
            ],
            options={
                "verbose_name": "QR-code",
                "verbose_name_plural": "QR-codes",
            },
        ),
        migrations.CreateModel(
            name="TransformedFood",
            fields=[
                (
                    "food_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="food.food",
                    ),
                ),
                (
                    "creation_date",
                    models.DateTimeField(
                        default=django.utils.timezone.now, verbose_name="creation date"
                    ),
                ),
                (
                    "shelf_life",
                    models.DurationField(
                        default=datetime.timedelta(days=3), verbose_name="shelf life"
                    ),
                ),
                (
                    "ingredients",
                    models.ManyToManyField(
                        blank=True,
                        related_name="transformed_ingredient_inv",
                        to="food.food",
                        verbose_name="transformed ingredient",
                    ),
                ),
            ],
            options={
                "verbose_name": "Transformed food",
                "verbose_name_plural": "Transformed foods",
            },
            bases=("food.food",),
        ),
    ]
