# Generated by Django 5.2.3 on 2025-11-19 15:17

import django.db.models.deletion
import django.utils.timezone
import functools
import ichec_django_core.models.utils
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("ichec_django_core", "0003_alter_formfieldvalue_value"),
        ("marinerg_test_access", "0001_initial"),
    ]

    operations = [
        migrations.AddField(
            model_name="accessapplicationboardreview",
            name="application",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="marinerg_test_access.accessapplication",
            ),
        ),
        migrations.AlterField(
            model_name="accessapplication",
            name="call",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="applications",
                to="marinerg_test_access.accesscall",
            ),
        ),
        migrations.AlterField(
            model_name="accessapplication",
            name="status",
            field=models.CharField(
                choices=[
                    ("CREATED", "Created"),
                    ("SUBMITTED", "Submitted"),
                    ("FACILITY", "Awaiting Facility Review"),
                    ("BOARD", "Awaiting Board Review"),
                    ("DECISION", "Awaiting Decision"),
                    ("ACCEPTED", "Accepted"),
                    ("REJECTED", "Rejected"),
                ],
                default="CREATED",
                max_length=10,
            ),
        ),
        migrations.AlterField(
            model_name="accessapplication",
            name="summary",
            field=models.FileField(
                null=True,
                upload_to=functools.partial(
                    ichec_django_core.models.utils.content_file_name,
                    *("application_summary",),
                    **{},
                ),
            ),
        ),
        migrations.CreateModel(
            name="AccessApplicationBoardDecision",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created_at",
                    models.DateTimeField(
                        default=django.utils.timezone.now, editable=False
                    ),
                ),
                ("updated_at", models.DateTimeField(default=django.utils.timezone.now)),
                (
                    "decision",
                    models.CharField(
                        choices=[("1", "ACCEPT"), ("2", "REJECT")], max_length=10
                    ),
                ),
                ("comments", models.TextField(blank=True)),
                (
                    "application",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="marinerg_test_access.accessapplication",
                    ),
                ),
                (
                    "call",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="marinerg_test_access.accesscall",
                    ),
                ),
                (
                    "creator",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="ichec_django_core.member",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
    ]
