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

import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('logistica', '0003_production_region'),
    ]

    operations = [
        migrations.CreateModel(
            name='Consumer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=250, verbose_name='Nombre')),
                ('address', models.CharField(max_length=250, verbose_name='Dirección')),
                ('phone', models.CharField(max_length=250, verbose_name='Teléfono')),
                ('point', django.contrib.gis.db.models.fields.PointField(srid=4326, verbose_name='Geospatial point')),
                ('region', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='consumer_points', to='logistica.Region')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Inventory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantity', models.IntegerField(default=0, verbose_name='Cantidad')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Producer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=250, verbose_name='Nombre')),
                ('point', django.contrib.gis.db.models.fields.PointField(srid=4326, verbose_name='Geospatial point')),
                ('production_capacity', models.IntegerField(default=1, verbose_name='Capacidad de producción')),
                ('logistics_need', models.BooleanField(default=False, verbose_name='Necesidad logística')),
                ('region', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='producer_points', to='logistica.Region')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Resource',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=250, verbose_name='Región')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Shipping',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.IntegerField(choices=[(0, 'Buscando productor'), (1, 'Enviado'), (2, 'Recibido')], default=0, verbose_name='Authorization status')),
                ('quantity', models.IntegerField(default=0, verbose_name='Cantidad')),
                ('consumer', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='shipping', to='logistica.Consumer')),
                ('producer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='shipping', to='logistica.Producer')),
                ('resource', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='shipping', to='logistica.Resource', verbose_name='Recurso')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.DeleteModel(
            name='Production',
        ),
        migrations.AddField(
            model_name='inventory',
            name='producer',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='Inventories', to='logistica.Producer', verbose_name='Punto de producción'),
        ),
        migrations.AddField(
            model_name='inventory',
            name='resource',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='Inventories', to='logistica.Resource', verbose_name='Recurso'),
        ),
    ]
