# Generated by Django 6.0.3 on 2026-03-22 21:24

import django.db.models.deletion
import uuid
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('products', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Scheme',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=255, unique=True)),
                ('is_active', models.BooleanField(default=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SchemeDistribution',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('is_active', models.BooleanField(db_index=True, default=True)),
                ('component_type', models.CharField(choices=[('DIRECT_INCENTIVE', 'Direct Incentive'), ('ENGAGEMENT_POOL', 'Engagement Pool'), ('POWER_STREAM', 'Power Stream'), ('PLATFORM_CHARGES', 'Platform Charges'), ('TAX', 'Tax')], max_length=32)),
                ('value_type', models.CharField(choices=[('FIXED', 'Fixed'), ('PERCENT', 'Percent')], max_length=16)),
                ('value', models.DecimalField(decimal_places=2, max_digits=12)),
                ('scheme', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='distributions', to='schemes.scheme')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SchemeLevel',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('is_active', models.BooleanField(db_index=True, default=True)),
                ('level_number', models.PositiveIntegerField(db_index=True)),
                ('display_order', models.PositiveIntegerField(default=1)),
                ('required_positions', models.PositiveIntegerField()),
                ('reward_amount', models.DecimalField(decimal_places=2, max_digits=12)),
                ('has_reward', models.BooleanField(default=False)),
                ('has_service', models.BooleanField(default=False)),
                ('has_gift', models.BooleanField(default=False)),
                ('auto_id_enabled', models.BooleanField(default=False)),
                ('auto_id_count', models.PositiveIntegerField(default=0)),
                ('requires_user_choice', models.BooleanField(default=False)),
                ('auto_id_product', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='products.product')),
                ('scheme', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='levels', to='schemes.scheme')),
            ],
            options={
                'ordering': ['display_order'],
                'indexes': [models.Index(fields=['scheme'], name='schemes_sch_scheme__8a2de0_idx'), models.Index(fields=['level_number'], name='schemes_sch_level_n_db0c60_idx'), models.Index(fields=['scheme', 'level_number'], name='schemes_sch_scheme__501bd5_idx'), models.Index(fields=['display_order'], name='schemes_sch_display_d38b77_idx')],
                'unique_together': {('scheme', 'level_number')},
            },
        ),
    ]
