# Generated by Django 4.2.23 on 2026-04-21 23:01

import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('mastery', '0011_priority_fields'),
    ]

    operations = [
        migrations.CreateModel(
            name='MasteryDoctrineReadinessFilter',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=500, verbose_name='name')),
                ('description', models.CharField(max_length=500, verbose_name='description')),
                ('minimum_fittings', models.PositiveSmallIntegerField(default=1, help_text='Number of fittings in this doctrine the pilot must be able to fly.', validators=[django.core.validators.MinValueValidator(1)], verbose_name='minimum flyable fittings')),
                ('approved_only', models.BooleanField(default=False, help_text="If checked, only fittings with 'Approved' status are counted toward the minimum. Fittings in 'In progress' or 'Not approved' are skipped.", verbose_name='approved fittings only')),
            ],
            options={
                'verbose_name': 'Smart Filter: Mastery — Doctrine Readiness',
                'verbose_name_plural': 'Smart Filter: Mastery — Doctrine Readiness',
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MasteryFittingEliteFilter',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=500, verbose_name='name')),
                ('description', models.CharField(max_length=500, verbose_name='description')),
            ],
            options={
                'verbose_name': 'Smart Filter: Mastery — Fitting Elite',
                'verbose_name_plural': 'Smart Filter: Mastery — Fitting Elite',
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MasteryFittingProgressFilter',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=500, verbose_name='name')),
                ('description', models.CharField(max_length=500, verbose_name='description')),
                ('minimum_progress_pct', models.PositiveSmallIntegerField(default=80, help_text='Pilot must have completed at least this percentage of the skill plan.', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100)], verbose_name='minimum progress (%)')),
                ('use_required_plan', models.BooleanField(default=False, help_text='If checked, progress is measured against the required skills plan. By default, the recommended skills plan is used.', verbose_name='use required plan')),
            ],
            options={
                'verbose_name': 'Smart Filter: Mastery — Fitting Progress',
                'verbose_name_plural': 'Smart Filter: Mastery — Fitting Progress',
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MasteryFittingStatusFilter',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=500, verbose_name='name')),
                ('description', models.CharField(max_length=500, verbose_name='description')),
                ('minimum_status', models.CharField(choices=[('needs_training', 'Needs training'), ('almost_fit', 'Almost fit'), ('can_fly', 'Can fly'), ('almost_elite', 'Almost elite'), ('elite', 'Elite')], default='can_fly', help_text='Minimum status bucket a pilot must reach to pass this filter.', max_length=20, verbose_name='minimum status')),
                ('check_all_characters', models.BooleanField(default=False, help_text='If checked, every registered character must reach the minimum status. By default, any single qualifying character is sufficient.', verbose_name='require all characters')),
            ],
            options={
                'verbose_name': 'Smart Filter: Mastery — Fitting Status',
                'verbose_name_plural': 'Smart Filter: Mastery — Fitting Status',
                'abstract': False,
            },
        ),
        migrations.RenameIndex(
            model_name='summaryaudienceentity',
            new_name='mastery_sum_entity__457bd1_idx',
            old_name='mastery_sum_entity__266254_idx',
        ),
        migrations.AddField(
            model_name='masteryfittingstatusfilter',
            name='fitting_map',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='mastery.fittingskillsetmap', verbose_name='fitting skill plan'),
        ),
        migrations.AddField(
            model_name='masteryfittingprogressfilter',
            name='fitting_map',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='mastery.fittingskillsetmap', verbose_name='fitting skill plan'),
        ),
        migrations.AddField(
            model_name='masteryfittingelitefilter',
            name='fitting_map',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='mastery.fittingskillsetmap', verbose_name='fitting skill plan'),
        ),
        migrations.AddField(
            model_name='masterydoctrinereadinessfilter',
            name='doctrine_map',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='mastery.doctrineskillsetgroupmap', verbose_name='doctrine skill plan'),
        ),
    ]
