# Generated by Django 4.2.26 on 2025-12-06 00:48

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


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0003_dynamicformdata_formdataentry'),
    ]

    operations = [
        migrations.CreateModel(
            name='SubscriptionPlan',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True)),
                ('code', models.CharField(help_text='Short code like FREE, BASIC, PRO', max_length=50, unique=True)),
                ('max_products', models.PositiveIntegerField(default=0, help_text='0 means unlimited products')),
                ('max_categories', models.PositiveIntegerField(default=0, help_text='0 means unlimited categories')),
                ('max_orders_per_day', models.PositiveIntegerField(default=0, help_text='0 means unlimited orders per day')),
                ('allow_credit_sales', models.BooleanField(default=True)),
                ('allow_dynamic_fields', models.BooleanField(default=True)),
            ],
        ),
        migrations.CreateModel(
            name='License',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('license_key', models.CharField(help_text='Secret key you control. Not shown to client.', max_length=100, unique=True)),
                ('is_active', models.BooleanField(default=True)),
                ('started_at', models.DateField(default=django.utils.timezone.now)),
                ('expires_at', models.DateField(blank=True, null=True)),
                ('notes', models.TextField(blank=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('plan', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='licenses', to='core.subscriptionplan')),
                ('system', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='license', to='core.systemsettings')),
            ],
        ),
    ]
