# Generated by Django 6.0.1 on 2026-05-18 21:00

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


class Migration(migrations.Migration):

    dependencies = [
        ('complaints', '0007_complaintinvolveddepartment_acceptance_notes_and_more'),
        ('organizations', '0003_alter_department_champion'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AddField(
            model_name='complaintinvolveddepartment',
            name='manager_review_status',
            field=models.CharField(blank=True, choices=[('pending', 'Pending Manager Review'), ('approved', 'Manager Approved'), ('rejected', 'Manager Rejected')], default=None, help_text='Department manager review status of the champion response', max_length=20, null=True),
        ),
        migrations.AddField(
            model_name='complaintinvolveddepartment',
            name='manager_reviewed_at',
            field=models.DateTimeField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='complaintinvolveddepartment',
            name='manager_reviewed_by',
            field=models.ForeignKey(blank=True, help_text='Department manager who reviewed the champion response', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='manager_reviewed_dept_responses', to=settings.AUTH_USER_MODEL),
        ),
        migrations.CreateModel(
            name='DepartmentManagerReview',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('status', models.CharField(choices=[('approved', 'Approved'), ('rejected', 'Rejected')], max_length=20)),
                ('reviewed_at', models.DateTimeField(auto_now_add=True)),
                ('rejection_reason', models.TextField(blank=True)),
                ('involved_department', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='manager_reviews', to='complaints.complaintinvolveddepartment')),
                ('reviewed_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='dept_manager_reviews', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Department Manager Review',
                'verbose_name_plural': 'Department Manager Reviews',
                'ordering': ['-reviewed_at'],
            },
        ),
        migrations.CreateModel(
            name='ManagerReviewQuestion',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('text_en', models.TextField(verbose_name='Question Text (English)')),
                ('text_ar', models.TextField(blank=True, verbose_name='Question Text (Arabic)')),
                ('question_type', models.CharField(choices=[('text', 'Short Text'), ('textarea', 'Long Text'), ('yes_no', 'Yes / No'), ('rating', 'Rating (1-5)'), ('multiple_choice', 'Multiple Choice')], default='textarea', max_length=20)),
                ('choices_json', models.JSONField(blank=True, default=list, help_text='List of choices for multiple_choice type, e.g. ["Option A","Option B"]')),
                ('order', models.PositiveIntegerField(default=0)),
                ('is_active', models.BooleanField(default=True)),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='created_manager_review_questions', to=settings.AUTH_USER_MODEL)),
                ('hospital', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='manager_review_questions', to='organizations.hospital')),
            ],
            options={
                'verbose_name': 'Manager Review Question',
                'verbose_name_plural': 'Manager Review Questions',
                'ordering': ['order', 'created_at'],
            },
        ),
        migrations.CreateModel(
            name='ManagerReviewAnswer',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('text_value', models.TextField(blank=True)),
                ('numeric_value', models.IntegerField(blank=True, null=True)),
                ('review', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='answers', to='complaints.departmentmanagerreview')),
                ('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='answers', to='complaints.managerreviewquestion')),
            ],
            options={
                'verbose_name': 'Manager Review Answer',
                'verbose_name_plural': 'Manager Review Answers',
            },
        ),
    ]
