# Generated by Django 3.0 on 2019-12-03 13:48

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('street_address', models.CharField(max_length=128, verbose_name='street address')),
                ('postal_code', models.CharField(max_length=16, verbose_name='postal code')),
                ('city', models.CharField(max_length=64, verbose_name='city')),
                ('country', models.CharField(max_length=64, verbose_name='country')),
                ('lat', models.DecimalField(decimal_places=6, max_digits=9)),
                ('lon', models.DecimalField(decimal_places=6, max_digits=9)),
            ],
            options={
                'verbose_name': 'address',
                'verbose_name_plural': 'addresses',
            },
        ),
        migrations.CreateModel(
            name='PhoneNumber',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('number', models.CharField(max_length=32, verbose_name='phone number')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='phone_numbers', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'phone number',
                'verbose_name_plural': 'phone numbers',
            },
        ),
        migrations.CreateModel(
            name='Package',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('height', models.PositiveIntegerField(help_text='in cm', verbose_name='height')),
                ('width', models.PositiveIntegerField(help_text='in cm', verbose_name='width')),
                ('depth', models.PositiveIntegerField(help_text='in cm', verbose_name='depth')),
                ('weight', models.DecimalField(decimal_places=2, help_text='in kg', max_digits=7, verbose_name='weight')),
                ('recipient', models.CharField(max_length=128, verbose_name='recipient')),
                ('recipient_phone', models.CharField(max_length=32, verbose_name='recipient phone number')),
                ('earliest_pickup_time', models.DateTimeField(verbose_name='earliest pickup time')),
                ('latest_pickup_time', models.DateTimeField(verbose_name='latest pickup time')),
                ('earliest_delivery_time', models.DateTimeField(verbose_name='earliest delivery time')),
                ('latest_delivery_time', models.DateTimeField(verbose_name='latest delivery time')),
                ('picked_up_time', models.DateTimeField(blank=True, null=True, verbose_name='picked up at')),
                ('delivered_time', models.DateTimeField(blank=True, null=True, verbose_name='delivered at')),
                ('courier', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='delivered_packages', to=settings.AUTH_USER_MODEL, verbose_name='courier')),
                ('deliver_to', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='inbound_packages', to='fvh_courier.Address', verbose_name='destination')),
                ('pickup_at', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='outbound_packages', to='fvh_courier.Address', verbose_name='pickup location')),
                ('sender', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='sent_packages', to=settings.AUTH_USER_MODEL, verbose_name='sender')),
            ],
            options={
                'verbose_name': 'package',
                'verbose_name_plural': 'packages',
                'ordering': ['-earliest_pickup_time'],
            },
        ),
    ]
