# Generated by Django 4.2.14 on 2025-03-17 18:09

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


class Migration(migrations.Migration):

    dependencies = [
        ("base", "0018_merge_20250307_1944"),
        ("nutritionproducts", "0003_remove_nutritionproductnutrients_allergen"),
        ("supplyrequests", "0001_initial"),
    ]

    operations = [
        migrations.RemoveField(
            model_name="supplyrequestitemreference",
            name="nutrition_order",
        ),
        migrations.AddField(
            model_name="supplyrequestitemreference",
            name="nutrition_product",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="supply_request_item_reference_nutrition_order",
                to="nutritionproducts.nutritionproduct",
            ),
        ),
        migrations.RemoveField(
            model_name="supplyrequest",
            name="reason",
        ),
        migrations.AlterField(
            model_name="supplyrequest",
            name="status",
            field=models.CharField(
                choices=[
                    ("draft", "Draft"),
                    ("active", "Active"),
                    ("suspended", "Suspended"),
                    ("cancelled", "Cancelled"),
                    ("completed", "Completed"),
                    ("entered-in-error", "Entered in error"),
                    ("unknown", "Unknown"),
                ],
                max_length=200,
                null=True,
            ),
        ),
        migrations.RemoveField(
            model_name="supplyrequest",
            name="supplier",
        ),
        migrations.CreateModel(
            name="SupplyRequestReasonCodeableReference",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "concept",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="supply_request_reason_codeable_reference_concept",
                        to="base.codeableconcept",
                    ),
                ),
                (
                    "reference",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="supply_request_reason_codeable_reference_reference",
                        to="supplyrequests.supplyrequestreasonreference",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="SupplyRequestItemCodeableReference",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "concept",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="supply_request_item_codeable_reference_concept",
                        to="base.codeableconcept",
                    ),
                ),
                (
                    "reference",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="supply_request_item_codeable_reference_reference",
                        to="supplyrequests.supplyrequestitemreference",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.AlterField(
            model_name="supplyrequest",
            name="item",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="supply_request_item",
                to="supplyrequests.supplyrequestitemcodeablereference",
            ),
        ),
        migrations.AddField(
            model_name="supplyrequest",
            name="reason",
            field=models.ManyToManyField(
                blank=True,
                related_name="supply_request_reason",
                to="supplyrequests.supplyrequestreasoncodeablereference",
            ),
        ),
        migrations.AddField(
            model_name="supplyrequest",
            name="supplier",
            field=models.ManyToManyField(
                blank=True,
                related_name="supply_request_supplier",
                to="supplyrequests.supplyrequestsupplierreference",
            ),
        ),
    ]
