# Generated by Django 5.2.17 on 2026-11-04 10:06

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('exams', '0146_daily_code_visibility'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='DayAttemptPolicy',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField(db_index=True, help_text='Calendar date this policy applies to', unique=True)),
                ('status', models.CharField(choices=[('LOCKED', 'Locked - No attempts'), ('PAST_REATTEMPT', 'Past Day Re-attempts'), ('FUTURE_PRACTICE', 'Future Day Practice (no score)')], default='LOCKED', max_length=20)),
                ('max_attempts', models.PositiveSmallIntegerField(default=2, help_text='Max attempts per question')),
                ('late_penalty_pct', models.DecimalField(decimal_places=2, default=10.0, help_text='Score reduction per re-attempt (%)', max_digits=5)),
                ('opened_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('notes', models.TextField(blank=True, default='')),
                ('opened_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'Day attempt policies',
                'ordering': ['-date'],
            },
        ),
    ]
