# Generated by Django 2.1.5 on 2019-02-09 05:07

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import shop.helper


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('shop', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Cart',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('total_money', models.DecimalField(decimal_places=2, default=0, max_digits=11)),
            ],
        ),
        migrations.CreateModel(
            name='Payment_log',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(auto_now_add=True)),
                ('payment_code', models.CharField(max_length=200)),
                ('bank_tracking_code', models.CharField(blank=True, max_length=200)),
                ('Payment_status', models.IntegerField(choices=[(1, 'Initial'), (2, 'To Bank'), (3, 'From Bank'), (4, 'Error'), (5, 'Complete')], default=1)),
                ('message', models.CharField(blank=True, max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Product_selection',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('count', models.IntegerField()),
                ('price', models.DecimalField(decimal_places=2, default=0, max_digits=11)),
                ('cart', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='shop.Cart')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='shop.Product')),
            ],
        ),
        migrations.RemoveField(
            model_name='order',
            name='description',
        ),
        migrations.AddField(
            model_name='order',
            name='address',
            field=models.TextField(blank=True, max_length=300),
        ),
        migrations.AddField(
            model_name='order',
            name='company_name',
            field=models.CharField(blank=True, max_length=200),
        ),
        migrations.AddField(
            model_name='order',
            name='count_of_allow_download',
            field=models.IntegerField(default=100),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='order',
            name='date_of_expire_download',
            field=models.DateField(default=django.utils.timezone.now),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='order',
            name='extra_description',
            field=models.CharField(blank=True, max_length=200),
        ),
        migrations.AddField(
            model_name='order',
            name='is_accept_agreement',
            field=models.BooleanField(default=True),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='order',
            name='order_date',
            field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='order',
            name='order_status',
            field=models.IntegerField(blank=True, choices=[(1, 'Completed'), (2, 'Canceled'), (3, 'In progress'), (4, 'Checking'), (5, 'Paymentting')], default=4),
        ),
        migrations.AddField(
            model_name='order',
            name='payment_tool',
            field=models.CharField(blank=True, max_length=100),
        ),
        migrations.AddField(
            model_name='order',
            name='payment_type',
            field=models.IntegerField(choices=[(1, 'At place'), (2, 'Online')], default=2),
        ),
        migrations.AddField(
            model_name='order',
            name='random_order_id',
            field=models.IntegerField(default=shop.helper.random_int),
        ),
        migrations.AddField(
            model_name='order',
            name='total_price',
            field=models.DecimalField(decimal_places=2, default=0, max_digits=11),
        ),
        migrations.AddField(
            model_name='order',
            name='user',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='payment_log',
            name='order',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='shop.Order'),
        ),
        migrations.AddField(
            model_name='order',
            name='cart',
            field=models.OneToOneField(default=1, on_delete=django.db.models.deletion.CASCADE, to='shop.Cart'),
            preserve_default=False,
        ),
    ]
