# Generated by Django 2.1 on 2018-12-22 20:14

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='Course',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='Название блюда')),
                ('price', models.DecimalField(decimal_places=2, max_digits=8, verbose_name='Цена')),
                ('photo', models.ImageField(upload_to='', verbose_name='Фотография')),
            ],
        ),
        migrations.CreateModel(
            name='CourseOrder',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantity', models.IntegerField(verbose_name='Количество')),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='ordered', to='webapp.Course', verbose_name='Блюдо')),
            ],
        ),
        migrations.CreateModel(
            name='Employee',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('phone', models.CharField(max_length=50, verbose_name='Телефон')),
                ('user', models.ForeignKey(on_delete=True, related_name='employee', to=settings.AUTH_USER_MODEL, verbose_name='Сотрудник')),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('client_name', models.CharField(max_length=50, verbose_name='Имя клиента')),
                ('client_phone', models.CharField(max_length=50, verbose_name='Телефон')),
                ('client_address', models.CharField(max_length=50, verbose_name='Адрес')),
                ('status', models.CharField(choices=[('new', 'новый'), ('in progress', 'в процессе'), ('beeing delivered', 'доставляется'), ('done', 'выполненный'), ('cancelled', 'отменен')], default='new', max_length=50, verbose_name='Статус')),
                ('courier', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='courier_orders', to=settings.AUTH_USER_MODEL, verbose_name='Курьер')),
                ('operator', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='operator_orders', to=settings.AUTH_USER_MODEL, verbose_name='Оператор')),
            ],
        ),
        migrations.AddField(
            model_name='courseorder',
            name='order',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='courses', to='webapp.Order', verbose_name='Заказ'),
        ),
    ]
