# Generated by Django 3.2.12 on 2023-02-04 09:52

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('subscriptions', '0014_subscription_created_date'),
    ]

    operations = [
        migrations.CreateModel(
            name='Coupon',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=15)),
                ('discount', models.DecimalField(decimal_places=2, max_digits=10)),
                ('start_date', models.DateField()),
                ('end_date', models.DateField()),
                ('usage_limit', models.PositiveIntegerField()),
                ('is_active', models.BooleanField(default=True)),
                ('minimum_order_amount', models.DecimalField(decimal_places=2, max_digits=10)),
                ('redeem_by', models.DateField()),
                ('usage_count', models.PositiveIntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_created', models.DateField(auto_now_add=True)),
                ('order_number', models.CharField(max_length=100)),
                ('amount', models.DecimalField(decimal_places=2, max_digits=10)),
                ('status', models.CharField(choices=[('completed', 'Completed'), ('failed', 'Failed')], max_length=10)),
                ('payment_method', models.CharField(max_length=50)),
                ('shipping_address', models.TextField()),
                ('billing_address', models.TextField()),
                ('notes', models.TextField(blank=True)),
                ('coupon', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='order.coupon')),
                ('subscription', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='subscriptions.subscription')),
            ],
        ),
    ]
