# Generated by Django 3.1.7 on 2021-05-07 13:54

import app.core.validators
from django.conf import settings
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0003_auto_20210420_0845'),
    ]

    operations = [
        migrations.CreateModel(
            name='CountryCoordinates',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('iso', models.CharField(max_length=2)),
                ('latitude', models.DecimalField(decimal_places=6, max_digits=9)),
                ('longitude', models.DecimalField(decimal_places=6, max_digits=9)),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.PositiveSmallIntegerField(choices=[(1, 'Created'), (2, 'Accepted'), (3, 'Finished')], default=1)),
                ('from_to_points', django.contrib.gis.db.models.fields.MultiPointField(srid=4326)),
                ('price', models.DecimalField(decimal_places=2, max_digits=9)),
                ('start_datetime', models.DateTimeField(auto_now_add=True)),
                ('accept_datetime', models.DateTimeField(blank=True, null=True)),
                ('finish_datetime', models.DateTimeField(blank=True, null=True)),
                ('mass', models.PositiveSmallIntegerField()),
                ('car', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='orders', to='core.car')),
                ('cargo_features', models.ManyToManyField(related_name='orders', to='core.CargoFeature')),
            ],
        ),
        migrations.AlterField(
            model_name='customuser',
            name='first_name',
            field=models.CharField(max_length=150),
        ),
        migrations.AlterField(
            model_name='customuser',
            name='last_name',
            field=models.CharField(max_length=150),
        ),
        migrations.AlterField(
            model_name='customuser',
            name='phone_number',
            field=models.CharField(max_length=16, unique=True, validators=[app.core.validators.PhoneNumberValidator]),
        ),
        migrations.DeleteModel(
            name='Shipping',
        ),
        migrations.AddField(
            model_name='order',
            name='employee',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='orders', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='order',
            name='recipient',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='parcels', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='order',
            name='sender',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='packages', to=settings.AUTH_USER_MODEL),
        ),
    ]
