# Generated by Django 5.2.13 on 2026-05-05 10:00

import apps.core.storage.paths
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("rims_finance", "0006_budgetline_funding_source_and_payment_batch"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AddField(
            model_name="disbursementexecution",
            name="proof_channel",
            field=models.CharField(
                blank=True,
                choices=[
                    ("bank", "Bank transfer receipt"),
                    ("mobile_money", "Mobile money confirmation"),
                    ("cheque", "Cheque scan"),
                    ("cash_voucher", "Cash voucher"),
                    ("other", "Other"),
                ],
                help_text="Origin of the proof-of-payment file (bank, mobile money, cheque, cash voucher).",
                max_length=20,
            ),
        ),
        migrations.AddField(
            model_name="disbursementexecution",
            name="proof_of_payment",
            field=models.FileField(
                blank=True,
                help_text="Receipt or confirmation file from the bank or mobile money platform.",
                null=True,
                upload_to=apps.core.storage.paths.upload_to_finance,
            ),
        ),
        migrations.AddField(
            model_name="disbursementexecution",
            name="proof_received_at",
            field=models.DateTimeField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name="disbursementexecution",
            name="proof_uploaded_by",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="disbursement_proofs_uploaded",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AddField(
            model_name="disbursementreconciliation",
            name="discrepancy_amount",
            field=models.DecimalField(
                blank=True,
                decimal_places=2,
                help_text="Signed amount difference when status=DISCREPANCY (positive = overpaid).",
                max_digits=14,
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="disbursementreconciliation",
            name="statement_excerpt",
            field=models.FileField(
                blank=True,
                help_text="Bank statement page or mobile-money statement screenshot evidencing the payment.",
                null=True,
                upload_to=apps.core.storage.paths.upload_to_finance,
            ),
        ),
        migrations.AddField(
            model_name="disbursementreconciliation",
            name="statement_period_end",
            field=models.DateField(
                blank=True,
                help_text="Inclusive end of the period covered by the statement excerpt.",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="disbursementreconciliation",
            name="statement_period_start",
            field=models.DateField(
                blank=True,
                help_text="Inclusive start of the period covered by the statement excerpt.",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="disbursementreconciliation",
            name="statement_source",
            field=models.CharField(
                blank=True,
                choices=[
                    ("bank", "Bank statement"),
                    ("mobile_money", "Mobile money statement"),
                    ("cash_ledger", "Cash ledger"),
                    ("other", "Other"),
                ],
                help_text="Where the statement excerpt came from.",
                max_length=20,
            ),
        ),
        migrations.AlterField(
            model_name="disbursementexecution",
            name="execution_reference",
            field=models.CharField(
                blank=True,
                help_text="PRD §5.4 / SRS use-case step 4 — transaction reference returned by the payment platform (bank reference, mobile-money transaction ID).",
                max_length=96,
            ),
        ),
    ]
