# Generated by Django 3.1.5 on 2021-02-13 05:56

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import order.models


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='OrderProducts',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantity', models.IntegerField(default=0)),
                ('price', models.FloatField(default=0)),
                ('delivery_charge', models.IntegerField()),
                ('status', models.CharField(max_length=250)),
                ('shipping_address', models.TextField(blank=True, max_length=2000, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('buyer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='buyer_seller', to=settings.AUTH_USER_MODEL)),
                ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='relation_order', to='products.product')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='order_product', to='products.product')),
                ('seller', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='seller_user', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='OrderAddress',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('full_name', models.CharField(max_length=250)),
                ('mobile_number', models.CharField(max_length=250)),
                ('address', models.TextField(max_length=20000)),
                ('landmark', models.CharField(blank=True, max_length=250, null=True)),
                ('address_type', models.CharField(max_length=250)),
                ('is_default', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('State', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='order_address_state_name', to='location.state')),
                ('city', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='order_address_city_name', to='location.city')),
                ('country', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='order_address_country_name', to='location.country')),
                ('pin_code', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='order_address_pincode', to='location.pincode')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order_address_id', models.CharField(max_length=250)),
                ('order_id', models.CharField(max_length=20)),
                ('quantity', models.IntegerField(default=0)),
                ('price', models.FloatField(default=0)),
                ('coupon_code_id', models.CharField(max_length=250)),
                ('coupon_discount', models.FloatField(default=0)),
                ('total_price', models.FloatField(default=0)),
                ('status', models.CharField(max_length=250)),
                ('delivery_charge', models.IntegerField()),
                ('delivery_status', models.CharField(blank=True, max_length=250, null=True)),
                ('payment_method', models.CharField(max_length=20)),
                ('razorpay_payment_id', models.CharField(blank=True, max_length=250, null=True)),
                ('payment_status', models.CharField(max_length=250)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='CouponCode',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('coupon_code', models.CharField(max_length=250)),
                ('coupon_discount_max_amount', models.FloatField(default=0)),
                ('coupon_discount_percentage', models.FloatField(default=0)),
                ('coupon_image', models.FileField(upload_to=order.models.CouponCode.folder_path)),
                ('alt', models.TextField(blank=True, max_length=1000, null=True)),
                ('is_valid', models.BooleanField(default=True)),
                ('is_feature', models.BooleanField(default=False)),
                ('coupon_description', models.TextField(blank=True, max_length=20000, null=True)),
                ('valid_for', models.CharField(blank=True, max_length=250, null=True)),
                ('min_valid_amount', models.FloatField(default=0)),
                ('max_valid_amount', models.FloatField(default=0)),
                ('term_and_condition', models.TextField(blank=True, max_length=50000, null=True)),
                ('slug', models.CharField(blank=True, max_length=250, null=True)),
                ('meta_description', models.TextField(blank=True, max_length=10000, null=True)),
                ('meta_keyword', models.CharField(blank=True, max_length=250, null=True)),
                ('meta_title', models.CharField(blank=True, max_length=250, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
