# Generated by Django 4.2.28 on 2026-03-03 13:40

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


class Migration(migrations.Migration):
    dependencies = [
        ("loans", "0022_remove_loan_amount_paid_loan__amount_paid_cache"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("reports", "0003_merge_20251213_1451"),
    ]

    operations = [
        migrations.AddField(
            model_name="generatedreport",
            name="generated_by",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AddField(
            model_name="loanscoring",
            name="user",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="credit_scores",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AddField(
            model_name="notification",
            name="related_application",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="notifications_as_application",
                to="loans.loanapplication",
            ),
        ),
        migrations.AddField(
            model_name="notification",
            name="related_loan",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="report_notifications",
                to="loans.loan",
            ),
        ),
        migrations.AddField(
            model_name="notification",
            name="user",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="report_notifications",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AddIndex(
            model_name="customerrequest",
            index=models.Index(
                fields=["status", "priority"], name="customer_re_status_439ecb_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="customerrequest",
            index=models.Index(
                fields=["request_type", "created_at"],
                name="customer_re_request_4873b2_idx",
            ),
        ),
        migrations.AddIndex(
            model_name="customerrequest",
            index=models.Index(
                fields=["assigned_to", "status"], name="customer_re_assigne_f07632_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="customerrequest",
            index=models.Index(
                fields=["customer", "status"], name="customer_re_custome_3375f8_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="customerrequest",
            index=models.Index(
                fields=["created_at", "status"], name="customer_re_created_733cdb_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="customerrequest",
            index=models.Index(
                fields=["priority", "created_at"], name="customer_re_priorit_f21719_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="registrationfee",
            index=models.Index(
                fields=["product_type", "is_active"],
                name="registratio_product_cda7fe_idx",
            ),
        ),
        migrations.AddIndex(
            model_name="registrationfee",
            index=models.Index(
                fields=["is_active", "effective_from"],
                name="registratio_is_acti_72f2f4_idx",
            ),
        ),
        migrations.AddIndex(
            model_name="registrationfee",
            index=models.Index(
                fields=["effective_from", "effective_to"],
                name="registratio_effecti_100c50_idx",
            ),
        ),
        migrations.AddIndex(
            model_name="registrationfeepayment",
            index=models.Index(
                fields=["customer", "payment_date"],
                name="registratio_custome_fc0a0d_idx",
            ),
        ),
        migrations.AddIndex(
            model_name="registrationfeepayment",
            index=models.Index(
                fields=["payment_method", "payment_date"],
                name="registratio_payment_96d5c6_idx",
            ),
        ),
        migrations.AddIndex(
            model_name="registrationfeepayment",
            index=models.Index(
                fields=["registration_fee", "payment_date"],
                name="registratio_registr_97a45a_idx",
            ),
        ),
        migrations.AddIndex(
            model_name="registrationfeepayment",
            index=models.Index(
                fields=["payment_date", "amount_paid"],
                name="registratio_payment_f34ff4_idx",
            ),
        ),
        migrations.AddIndex(
            model_name="registrationfeepayment",
            index=models.Index(
                fields=["transaction_reference"], name="registratio_transac_14dccc_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="reportexecution",
            index=models.Index(
                fields=["status", "started_at"], name="report_exec_status_0a8740_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="reportexecution",
            index=models.Index(
                fields=["report_type", "started_at"],
                name="report_exec_report__af4b86_idx",
            ),
        ),
        migrations.AddIndex(
            model_name="reportexecution",
            index=models.Index(
                fields=["schedule", "status"], name="report_exec_schedul_7ea710_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="reportschedule",
            index=models.Index(
                fields=["is_active", "next_run"], name="report_sche_is_acti_dd723c_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="reportschedule",
            index=models.Index(
                fields=["report_type", "frequency"],
                name="report_sche_report__ddf4e0_idx",
            ),
        ),
        migrations.AddIndex(
            model_name="reportschedule",
            index=models.Index(
                fields=["frequency", "is_active"], name="report_sche_frequen_ab7ca0_idx"
            ),
        ),
    ]
