# 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', '0003_initial'),
        ('biologicallyderivedproducts', '0001_initial'),
        ('devices', '0001_initial'),
        ('inventoryitems', '0001_initial'),
        ('locations', '0001_initial'),
        ('medications', '0001_initial'),
        ('nutritionproducts', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='InventoryReportInventoryListing',
            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)),
                ('counting_date_time', models.DateTimeField(null=True)),
                ('item_status', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='inventory_report_inventory_listing_item_status', to='base.codeableconcept')),
                ('location', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='inventory_report_inventory_listing', to='locations.locationreference')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='InventoryReport',
            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=[('draft', 'Draft'), ('requested', 'Requested'), ('active', 'Active'), ('entered-in-error', 'Entered In Error')], max_length=255, null=True)),
                ('count_type', models.CharField(choices=[('snapshot', 'Snapshot'), ('difference', 'Difference')], max_length=255, null=True)),
                ('reported_date_time', models.DateTimeField(null=True)),
                ('identifier', models.ManyToManyField(blank=True, related_name='inventory_report', to='base.identifier')),
                ('note', models.ManyToManyField(blank=True, related_name='inventory_report', to='base.annotation')),
                ('operation_type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='inventory_report_operational_type', to='base.codeableconcept')),
                ('operation_type_reason', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='inventory_report_operational_reason', to='base.codeableconcept')),
                ('reporting_period', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='inventory_report', to='base.period')),
                ('inventory_listing', models.ManyToManyField(blank=True, related_name='inventory_report', to='inventoryreports.inventoryreportinventorylisting')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='InventoryReportInventoryListingItemItemCodeableReference',
            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='inventory_report_inventory_listing_item_item_codeable_reference_concept', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='inventoryreportinventorylisting',
            name='item',
            field=models.ManyToManyField(blank=True, related_name='inventory_report_inventory_listing', to='inventoryreports.inventoryreportinventorylistingitemitemcodeablereference'),
        ),
        migrations.CreateModel(
            name='InventoryReportInventoryListingItemItemReference',
            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)),
                ('biologically_derived_product', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='inventory_report_inventory_listing_item_biologically_derived_product', to='biologicallyderivedproducts.biologicallyderivedproduct')),
                ('device', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='inventory_report_inventory_listing_item_device', to='devices.device')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='inventory_report_inventory_listing_item_reference_identifier', to='base.identifier')),
                ('inventory_item', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='inventory_report_inventory_listing_item_inventory_item', to='inventoryitems.inventoryitem')),
                ('medication', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='inventory_report_inventory_listing_item_medication', to='medications.medication')),
                ('nutrition_product', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='inventory_report_inventory_listing_item_nutrition_product', to='nutritionproducts.nutritionproduct')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='inventoryreportinventorylistingitemitemcodeablereference',
            name='reference',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='inventory_report_inventory_listing_item_item_codeable_reference_reference', to='inventoryreports.inventoryreportinventorylistingitemitemreference'),
        ),
        migrations.CreateModel(
            name='InventoryReportInventoryListingItem',
            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)),
                ('category', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='inventory_report_inventory_listing_item_category', to='base.codeableconcept')),
                ('quality', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='inventory_report_inventory_listing_item_quality', to='base.quantity')),
                ('item', models.ManyToManyField(blank=True, related_name='inventory_report_inventory_listing_item', to='inventoryreports.inventoryreportinventorylistingitemitemreference')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='InventoryReportReporterReference',
            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)),
                ('device', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='inventory_report_reporter_reference_device', to='devices.device')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='inventory_report_reporter_reference_identifier', to='base.identifier')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
