# Generated by Django 6.0.3 on 2026-04-20 14:37

import django.db.models.deletion
import uuid
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('rewards', '0003_rename_rewards_fra_user_id_8d8b53_idx_rewards_fra_user_id_da989d_idx_and_more'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Gift',
            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)),
                ('level', models.PositiveIntegerField(db_index=True, help_text='Available from this level')),
                ('gift_name', models.CharField(max_length=255)),
                ('gift_description', models.TextField(blank=True, default='')),
                ('gift_category', models.CharField(choices=[('product', 'Product'), ('experience', 'Experience'), ('voucher', 'Voucher'), ('other', 'Other')], db_index=True, default='product', max_length=50)),
                ('quota', models.PositiveIntegerField(default=0, help_text='Max claimants for this gift')),
                ('claimed_count', models.PositiveIntegerField(default=0)),
                ('value', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True)),
                ('is_active', models.BooleanField(db_index=True, default=True)),
            ],
            options={
                'ordering': ['level', 'gift_name'],
                'indexes': [models.Index(fields=['level', 'is_active'], name='rewards_gif_level_f5ba78_idx'), models.Index(fields=['gift_category'], name='rewards_gif_gift_ca_3d1d17_idx')],
            },
        ),
        migrations.CreateModel(
            name='Service',
            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)),
                ('level', models.PositiveIntegerField(db_index=True, help_text='Available from this level')),
                ('service_name', models.CharField(max_length=255)),
                ('service_description', models.TextField(blank=True, default='')),
                ('category', models.CharField(choices=[('trip', 'Trip/Travel'), ('service', 'Service'), ('experience', 'Experience'), ('other', 'Other')], db_index=True, default='service', max_length=50)),
                ('quota', models.PositiveIntegerField(default=0, help_text='Max claimants for this service')),
                ('claimed_count', models.PositiveIntegerField(default=0)),
                ('is_active', models.BooleanField(db_index=True, default=True)),
            ],
            options={
                'ordering': ['level', 'service_name'],
                'indexes': [models.Index(fields=['level', 'is_active'], name='rewards_ser_level_b8a0e1_idx'), models.Index(fields=['category'], name='rewards_ser_categor_5dd557_idx')],
            },
        ),
        migrations.CreateModel(
            name='GiftClaim',
            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)),
                ('status', models.CharField(choices=[('pending', 'Pending Approval'), ('approved', 'Approved'), ('completed', 'Completed'), ('rejected', 'Rejected'), ('cancelled', 'Cancelled')], db_index=True, default='pending', max_length=20)),
                ('approved_at', models.DateTimeField(blank=True, null=True)),
                ('completed_at', models.DateTimeField(blank=True, null=True)),
                ('notes', models.TextField(blank=True, default='')),
                ('admin_notes', models.TextField(blank=True, default='')),
                ('approved_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='approved_gift_claims', to=settings.AUTH_USER_MODEL)),
                ('gift', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='claims', to='rewards.gift')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='gift_claims', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-created_at'],
                'indexes': [models.Index(fields=['user', 'status'], name='rewards_gif_user_id_31850b_idx'), models.Index(fields=['gift', 'status'], name='rewards_gif_gift_id_802146_idx'), models.Index(fields=['created_at'], name='rewards_gif_created_6df449_idx')],
                'unique_together': {('user', 'gift')},
            },
        ),
        migrations.CreateModel(
            name='RewardAchievement',
            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', models.PositiveIntegerField(db_index=True, help_text='Level achieved')),
                ('reward_name', models.CharField(help_text='e.g., "Level 5 Reward"', max_length=255)),
                ('supercoin_amount', models.DecimalField(decimal_places=2, help_text='Supercoins to award', max_digits=12)),
                ('status', models.CharField(choices=[('earned', 'Earned'), ('claimed', 'Claimed'), ('expired', 'Expired')], db_index=True, default='earned', max_length=20)),
                ('claimed_at', models.DateTimeField(blank=True, null=True)),
                ('notes', models.TextField(blank=True, default='')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reward_achievements', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-created_at'],
                'indexes': [models.Index(fields=['user', 'status'], name='rewards_rew_user_id_3376c3_idx'), models.Index(fields=['level', 'status'], name='rewards_rew_level_8c99ac_idx'), models.Index(fields=['created_at'], name='rewards_rew_created_10d0fa_idx')],
            },
        ),
        migrations.CreateModel(
            name='ServiceClaim',
            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)),
                ('status', models.CharField(choices=[('pending', 'Pending Approval'), ('approved', 'Approved'), ('completed', 'Completed'), ('rejected', 'Rejected'), ('cancelled', 'Cancelled')], db_index=True, default='pending', max_length=20)),
                ('approved_at', models.DateTimeField(blank=True, null=True)),
                ('completed_at', models.DateTimeField(blank=True, null=True)),
                ('notes', models.TextField(blank=True, default='')),
                ('admin_notes', models.TextField(blank=True, default='')),
                ('approved_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='approved_service_claims', to=settings.AUTH_USER_MODEL)),
                ('service', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='claims', to='rewards.service')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='service_claims', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-created_at'],
                'indexes': [models.Index(fields=['user', 'status'], name='rewards_ser_user_id_67fd08_idx'), models.Index(fields=['service', 'status'], name='rewards_ser_service_530081_idx'), models.Index(fields=['created_at'], name='rewards_ser_created_989cc0_idx')],
                'unique_together': {('user', 'service')},
            },
        ),
    ]
