# Generated by Django 5.2.11 on 2026-03-22 17:17

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0012_systemsettings_enable_camera_scanner'),
    ]

    operations = [
        migrations.CreateModel(
            name='PromoCode',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(help_text='The code a cashier enters at checkout', max_length=50, unique=True)),
                ('description', models.CharField(blank=True, max_length=200)),
                ('discount_type', models.CharField(choices=[('percentage', 'Percentage (%)'), ('fixed', 'Fixed Amount')], default='percentage', max_length=15)),
                ('discount_value', models.DecimalField(decimal_places=2, help_text='10 = 10% off (for percentage) or ₦10 off (for fixed)', max_digits=10)),
                ('max_uses', models.PositiveIntegerField(default=0, help_text='Maximum number of times this code can be used. 0 = unlimited.')),
                ('current_uses', models.PositiveIntegerField(default=0)),
                ('is_active', models.BooleanField(default=True)),
                ('expires_at', models.DateField(blank=True, help_text='Leave blank for no expiry', null=True)),
                ('minimum_order_amount', models.DecimalField(decimal_places=2, default=0, help_text='Minimum order total for this promo to apply. 0 = no minimum.', max_digits=10)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'Promo Code',
                'verbose_name_plural': 'Promo Codes',
                'ordering': ['-created_at'],
            },
        ),
    ]
