35 lines
1.4 KiB
Python
35 lines
1.4 KiB
Python
# Generated by Django 5.2 on 2025-04-24 10:35
|
|
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('app', '0016_alter_slider_image'),
|
|
]
|
|
|
|
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=50, unique=True)),
|
|
('discount_type', models.CharField(choices=[('percentage', 'Percentage'), ('fixed', 'Fixed Amount')], default='percentage', max_length=10)),
|
|
('discount_value', models.DecimalField(decimal_places=2, max_digits=10)),
|
|
('min_purchase', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
|
|
('max_discount', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
|
|
('is_active', models.BooleanField(default=True)),
|
|
('start_date', models.DateTimeField()),
|
|
('end_date', models.DateTimeField()),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
],
|
|
options={
|
|
'verbose_name': 'Coupon',
|
|
'verbose_name_plural': 'Coupons',
|
|
'ordering': ['-created_at'],
|
|
},
|
|
),
|
|
]
|