# Generated by Django 5.2.4 on 2025-07-20 04:14

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('loans', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AddField(
            model_name='loan',
            name='borrower',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='loans', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='loan',
            name='original_loan',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='loans.Loan'),
        ),
        migrations.AddField(
            model_name='loanapplication',
            name='borrower',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='loan_applications', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='loanapplication',
            name='reviewed_by',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='reviewed_applications', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='loan',
            name='application',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='loans.loanapplication'),
        ),
        migrations.AddField(
            model_name='loanapplication',
            name='loan_product',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='loans.loanproduct'),
        ),
        migrations.AddField(
            model_name='mpesatransaction',
            name='loan',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='loans.Loan'),
        ),
        migrations.AddField(
            model_name='repayment',
            name='loan',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='repayments', to='loans.Loan'),
        ),
        migrations.AddField(
            model_name='mpesatransaction',
            name='repayment',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='loans.repayment'),
        ),
        migrations.AddField(
            model_name='rolloverrequest',
            name='borrower',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='rolloverrequest',
            name='loan',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rollover_requests', to='loans.Loan'),
        ),
        migrations.AddField(
            model_name='rolloverrequest',
            name='reviewed_by',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='reviewed_rollovers', to=settings.AUTH_USER_MODEL),
        ),
    ]
