# Generated by Django 2.2.2 on 2020-04-10 12:27

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('rompas', '0027_auto_20200406_0932'),
    ]

    operations = [
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='Name')),
                ('email', models.EmailField(max_length=254, verbose_name='Email')),
                ('phone_number', models.CharField(max_length=17, validators=[django.core.validators.RegexValidator(message="Phone number must be entered in the format: '+999999999'. Up to 15 digits allowed.", regex='^\\+?1?\\d{9,15}$')])),
                ('address', models.CharField(blank=True, max_length=250, verbose_name='Adress')),
                ('postal_code', models.CharField(blank=True, max_length=20, verbose_name='ZIP Code')),
                ('city', models.CharField(blank=True, max_length=100, verbose_name='City')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Create')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Update')),
                ('paid', models.BooleanField(default=False, verbose_name='Paid')),
                ('paid_status', models.CharField(blank=True, max_length=50, verbose_name='paid_status')),
                ('message', models.CharField(blank=True, max_length=250, verbose_name='Message')),
                ('declaration', models.CharField(blank=True, max_length=250, verbose_name='Declaration')),
                ('call_back', models.BooleanField(default=False, verbose_name='No Call Back')),
            ],
            options={
                'verbose_name': 'Order',
                'verbose_name_plural': 'Orders',
                'ordering': ('-created',),
            },
        ),
        migrations.CreateModel(
            name='OrderStatus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name_ru', models.CharField(max_length=64, unique=True, verbose_name='Order Status In Russian')),
                ('name_en', models.CharField(blank=True, max_length=64, verbose_name='Order Status In English')),
                ('name_ua', models.CharField(blank=True, max_length=64, verbose_name='Order Status In Ukraine')),
            ],
        ),
        migrations.CreateModel(
            name='PaymentMethod',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name_ru', models.CharField(max_length=64, unique=True, verbose_name='Payment Method In Russian')),
                ('name_en', models.CharField(blank=True, max_length=64, verbose_name='Payment Method In English')),
                ('name_ua', models.CharField(blank=True, max_length=64, verbose_name='Payment Method In Ukraine')),
            ],
        ),
        migrations.CreateModel(
            name='OrderItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('price', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Price')),
                ('quantity', models.PositiveIntegerField(default=1, verbose_name='Amount')),
                ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to='orders.Order')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='order_items', to='rompas.Product')),
            ],
        ),
        migrations.AddField(
            model_name='order',
            name='order_status',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='orders.OrderStatus', verbose_name='Order Status'),
        ),
        migrations.AddField(
            model_name='order',
            name='payment_method',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='orders.PaymentMethod', verbose_name='Payment Method'),
        ),
    ]
