# Generated by Django 3.0.5 on 2020-12-27 08:52

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('catalogapp', '0012_auto_20201227_1152'),
    ]

    operations = [
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('customer', models.CharField(max_length=25, verbose_name='Комментарий')),
                ('date', models.DateTimeField(auto_now_add=True, verbose_name='Дата')),
                ('total', models.DecimalField(decimal_places=2, default=0, max_digits=15, verbose_name='Сумма заказа')),
                ('сook_by', models.DateTimeField(auto_now_add=True, verbose_name='Приготовить к')),
                ('comment', models.CharField(blank=True, max_length=1024, null=True, verbose_name='Комментарий')),
                ('weight', models.DecimalField(decimal_places=3, default=0, max_digits=15, verbose_name='Вес, кг')),
                ('volume', models.DecimalField(decimal_places=5, default=0, max_digits=15, verbose_name='Объем, м3')),
                ('is_sale', models.BooleanField(default=False, verbose_name='Подтвержден')),
            ],
            options={
                'verbose_name': 'Заказ',
                'verbose_name_plural': 'Заказы',
            },
        ),
        migrations.CreateModel(
            name='OrderItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quant', models.DecimalField(decimal_places=0, default=1, max_digits=15, verbose_name='Количество')),
                ('price', models.DecimalField(decimal_places=2, default=0, max_digits=15, verbose_name='Цена')),
                ('discount', models.DecimalField(decimal_places=2, default=0, max_digits=15, verbose_name='Скидка, %')),
                ('total', models.DecimalField(decimal_places=2, default=0, max_digits=15, verbose_name='Сумма')),
                ('weight', models.DecimalField(decimal_places=3, default=0, max_digits=15, verbose_name='Вес, кг')),
                ('volume', models.DecimalField(decimal_places=5, default=0, max_digits=15, verbose_name='Объем, м3')),
                ('offer', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='catalogapp.Offer', verbose_name='Предложение')),
                ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='orderapp.Order', verbose_name='Корзина')),
            ],
            options={
                'verbose_name': 'Строка заказа',
                'verbose_name_plural': 'Строки заказа',
            },
        ),
    ]
