# Generated by Django 6.0.5 on 2026-05-21 12:18

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='PromotionPlan',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('name_en', models.CharField(max_length=100, verbose_name='Plan Name (English)')),
                ('name_ar', models.CharField(blank=True, max_length=100, verbose_name='Plan Name (Arabic)')),
                ('type', models.CharField(choices=[('store', 'Store Promotion'), ('product', 'Product Promotion')], max_length=10, verbose_name='Promotion Type')),
                ('duration_months', models.PositiveSmallIntegerField(choices=[(6, '6 Months'), (12, '1 Year'), (36, '3 Years')], verbose_name='Duration (Months)')),
                ('price', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Price (AED)')),
                ('is_active', models.BooleanField(default=True, verbose_name='Active')),
            ],
            options={
                'db_table': 'promotion_plans',
                'ordering': ['type', 'duration_months'],
                'unique_together': {('type', 'duration_months')},
            },
        ),
        migrations.CreateModel(
            name='Promotion',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('status', models.CharField(choices=[('pending', 'Pending Payment'), ('active', 'Active'), ('expired', 'Expired'), ('cancelled', 'Cancelled')], default='pending', max_length=10, verbose_name='Status')),
                ('start_date', models.DateTimeField(blank=True, null=True, verbose_name='Start Date')),
                ('end_date', models.DateTimeField(blank=True, null=True, verbose_name='End Date')),
                ('amount_paid', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='Amount Paid (AED)')),
                ('payment_reference', models.CharField(blank=True, max_length=200, verbose_name='Payment Reference')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='promotions', to=settings.AUTH_USER_MODEL)),
                ('product', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='promotions', to='products.product')),
                ('store', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='promotions', to='stores.store')),
                ('plan', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='promotions', to='promotions.promotionplan')),
            ],
            options={
                'db_table': 'promotions',
                'ordering': ['-created_at'],
            },
        ),
    ]
