# Generated by Django 2.2.11 on 2020-03-19 12:44

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('facility', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Building',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_date', models.DateTimeField(auto_now_add=True)),
                ('modified_date', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=1000)),
                ('num_rooms', models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(0)])),
                ('num_floors', models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(0)])),
                ('building_type', models.IntegerField(choices=[(1, 'Educational Inst'), (2, 'Hospital'), (3, 'Other')])),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Inventory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_date', models.DateTimeField(auto_now_add=True)),
                ('modified_date', models.DateTimeField(auto_now=True)),
                ('quantitiy', models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(0)])),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='InventoryItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_date', models.DateTimeField(auto_now_add=True)),
                ('modified_date', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=1000)),
                ('description', models.TextField()),
                ('minimum_stock', models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(0)])),
                ('unit', models.CharField(max_length=20)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Room',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_date', models.DateTimeField(auto_now_add=True)),
                ('modified_date', models.DateTimeField(auto_now=True)),
                ('num', models.CharField(max_length=1000)),
                ('floor', models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(0)])),
                ('beds_capacity', models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(0)])),
                ('occupied_beds', models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(0)])),
                ('room_type', models.IntegerField(choices=[(1, 'Normal'), (10, 'ICU'), (20, 'ICCU')])),
                ('building', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='facility.Building')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AlterModelOptions(
            name='facility',
            options={'verbose_name_plural': 'Facilities'},
        ),
        migrations.CreateModel(
            name='StaffRoomAllocation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_date', models.DateTimeField(auto_now_add=True)),
                ('modified_date', models.DateTimeField(auto_now=True)),
                ('room', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='facility.Room')),
                ('staff', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='InventoryLog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_date', models.DateTimeField(auto_now_add=True)),
                ('modified_date', models.DateTimeField(auto_now=True)),
                ('prev_count', models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(0)])),
                ('new_count', models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(0)])),
                ('inventory', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='facility.Inventory')),
                ('updated_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='inventory',
            name='facility',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='facility.Facility'),
        ),
        migrations.AddField(
            model_name='inventory',
            name='item',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='facility.InventoryItem'),
        ),
        migrations.AddField(
            model_name='building',
            name='facility',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='facility.Facility'),
        ),
    ]
