# Generated by Django 6.0.1 on 2026-05-21 21:22

from django.db import migrations, models


def backfill_manager_review_status(apps, schema_editor):
    ComplaintInvolvedDepartment = apps.get_model("complaints", "ComplaintInvolvedDepartment")
    ComplaintInvolvedDepartment.objects.filter(
        manager_review_status__isnull=True,
        response_submitted=True,
    ).update(manager_review_status="pending")


class Migration(migrations.Migration):

    dependencies = [
        ("complaints", "0008_manager_review_workflow"),
    ]

    operations = [
        migrations.AlterField(
            model_name="complaintinvolveddepartment",
            name="manager_review_status",
            field=models.CharField(
                blank=True,
                choices=[
                    ("pending", "Pending Manager Review"),
                    ("approved", "Manager Approved"),
                    ("rejected", "Manager Rejected"),
                ],
                default="pending",
                help_text="Department manager review status of the champion response",
                max_length=20,
                null=True,
            ),
        ),
        migrations.RunPython(
            backfill_manager_review_status,
            reverse_code=migrations.RunPython.noop,
        ),
    ]
