# Generated by Django 5.2 on 2025-04-23 12:46

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('base', '0001_initial'),
        ('substances', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='NutritionProductCharacteristic',
            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)),
                ('value_string', models.CharField(max_length=255, null=True)),
                ('value_boolean', models.BooleanField(null=True)),
                ('value_base64_binary', models.TextField(null=True)),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_product_characteristic_type', to='base.codeableconcept')),
                ('value_attachment', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_product_characteristic_value_attachment', to='base.attachment')),
                ('value_codeable_concept', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_product_characteristic_value_codeable_concept', to='base.codeableconcept')),
                ('value_quantity', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_product_characteristic_value_quantity', to='base.quantity')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='NutritionProductCodeableReference',
            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='nutrition_product_codeable_reference_concept', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='NutritionProductIngredient',
            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)),
                ('allergen', models.BooleanField(null=True)),
                ('amount_quantity', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_product_ingredient_amount_quantity', to='base.quantity')),
                ('amount_ratio', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_product_ingredient_amount_ratio', to='base.ratio')),
                ('item', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_product_ingredient_item', to='nutritionproducts.nutritionproductcodeablereference')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='NutritionProductInstance',
            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)),
                ('name', models.CharField(max_length=255, null=True)),
                ('lot_number', models.CharField(max_length=255, null=True)),
                ('expiry', models.DateTimeField(null=True)),
                ('use_by', models.DateTimeField(null=True)),
                ('biological_source_event', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_product_instance_biological_source_event', to='base.identifier')),
                ('identifier', models.ManyToManyField(blank=True, related_name='nutrition_product_instance_identifier', to='base.identifier')),
                ('quantity', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_product_instance_quantity', to='base.quantity')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='NutritionProductNutrients',
            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)),
                ('amount_quantity', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_product_nutrients_amount_quantity', to='base.quantity')),
                ('amount_ratio', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_product_nutrients_amount_ratio', to='base.ratio')),
                ('item', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_product_nutrients_item', to='substances.substancecodeablereference')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='NutritionProduct',
            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)),
                ('status', models.CharField(choices=[('active', 'Active'), ('inactive', 'Inactive'), ('entered-in-error', 'Entered in Error')], max_length=255, null=True)),
                ('ingredient_summary', models.TextField(null=True)),
                ('category', models.ManyToManyField(blank=True, related_name='nutrition_product_category', to='base.codeableconcept')),
                ('code', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_product_code', to='base.codeableconcept')),
                ('energy', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_product_energy', to='base.quantity')),
                ('manufacturer', models.ManyToManyField(blank=True, related_name='nutrition_product_manufacturer', to='base.organizationreference')),
                ('note', models.ManyToManyField(blank=True, related_name='nutrition_product_note', to='base.annotation')),
                ('characteristic', models.ManyToManyField(blank=True, related_name='nutrition_product_characteristic', to='nutritionproducts.nutritionproductcharacteristic')),
                ('ingredient', models.ManyToManyField(blank=True, related_name='nutrition_product_ingredient', to='nutritionproducts.nutritionproductingredient')),
                ('instance', models.ManyToManyField(blank=True, related_name='nutrition_product_instance', to='nutritionproducts.nutritionproductinstance')),
                ('nutrient', models.ManyToManyField(blank=True, related_name='nutrition_product_nutrient', to='nutritionproducts.nutritionproductnutrients')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='NutritionProductReference',
            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)),
                ('reference', models.CharField(max_length=255, null=True)),
                ('type', models.CharField(max_length=255, null=True)),
                ('display', models.CharField(max_length=255, null=True)),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_product_reference_identifier', to='base.identifier')),
                ('nutrition_product', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_product_reference_product', to='nutritionproducts.nutritionproduct')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='nutritionproductcodeablereference',
            name='reference',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_product_codeable_reference_reference', to='nutritionproducts.nutritionproductreference'),
        ),
    ]
