# Generated by Django 2.2.11 on 2020-03-20 19:05

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


class Migration(migrations.Migration):

    dependencies = [
        ('logistica', '0005_auto_20200320_1751'),
    ]

    operations = [
        migrations.CreateModel(
            name='Intermediary',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_date', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('last_updated_date', models.DateTimeField(auto_now=True, db_index=True)),
                ('notes', models.TextField(blank=True, null=True, verbose_name='Notas')),
                ('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')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.RemoveField(
            model_name='shipping',
            name='status',
        ),
        migrations.AddField(
            model_name='consumer',
            name='notes',
            field=models.TextField(blank=True, null=True, verbose_name='Notas'),
        ),
        migrations.AddField(
            model_name='inventory',
            name='notes',
            field=models.TextField(blank=True, null=True, verbose_name='Notas'),
        ),
        migrations.AddField(
            model_name='producer',
            name='notes',
            field=models.TextField(blank=True, null=True, verbose_name='Notas'),
        ),
        migrations.AddField(
            model_name='region',
            name='notes',
            field=models.TextField(blank=True, null=True, verbose_name='Notas'),
        ),
        migrations.AddField(
            model_name='resource',
            name='notes',
            field=models.TextField(blank=True, null=True, verbose_name='Notas'),
        ),
        migrations.AddField(
            model_name='shipping',
            name='notes',
            field=models.TextField(blank=True, null=True, verbose_name='Notas'),
        ),
        migrations.CreateModel(
            name='Tracking',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_date', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('last_updated_date', models.DateTimeField(auto_now=True, db_index=True)),
                ('notes', models.TextField(blank=True, null=True, verbose_name='Notas')),
                ('status', models.IntegerField(choices=[(0, 'Esperando'), (1, 'Enviado'), (2, 'Recibido'), (3, 'Programado')], default=0, verbose_name='Authorization status')),
                ('scheduled_date', models.DateTimeField(blank=True, db_index=True, default=None, null=True, verbose_name='Programado')),
                ('consumer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='tracking', to='logistica.Consumer')),
                ('intermediary', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='tracking', to='logistica.Intermediary')),
                ('producer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='tracking', to='logistica.Producer')),
                ('shipping', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tracking', to='logistica.Shipping')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='intermediary',
            name='region',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='intermediary_points', to='logistica.Region'),
        ),
    ]
