# Generated migration for penalty mode

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('loans', '0015_alter_loanproduct_late_payment_penalty_and_more'),
    ]

    operations = [
        migrations.AddField(
            model_name='loanproduct',
            name='penalty_mode',
            field=models.CharField(
                max_length=10,
                choices=[('auto', 'Automatic'), ('manual', 'Manual')],
                default='auto',
                help_text='Auto: Penalties applied automatically daily. Manual: Admin must apply penalties manually.'
            ),
        ),
        migrations.AddField(
            model_name='loanproduct',
            name='penalty_frequency',
            field=models.CharField(
                max_length=10,
                choices=[('daily', 'Daily'), ('weekly', 'Weekly'), ('monthly', 'Monthly')],
                default='daily',
                help_text='How often penalties are calculated and applied'
            ),
        ),
        migrations.AlterField(
            model_name='loanproduct',
            name='late_payment_penalty',
            field=models.DecimalField(
                decimal_places=2,
                default=5.0,
                help_text='Penalty rate percentage (applied per frequency period)',
                max_digits=5
            ),
        ),
        migrations.AddField(
            model_name='penaltycharge',
            name='applied_by',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=models.SET_NULL,
                related_name='penalties_applied',
                to='users.customuser'
            ),
        ),
        migrations.AddField(
            model_name='penaltycharge',
            name='is_automatic',
            field=models.BooleanField(default=True, help_text='Whether penalty was applied automatically'),
        ),
        migrations.AddField(
            model_name='penaltycharge',
            name='reason',
            field=models.TextField(blank=True, help_text='Reason for manual penalty or additional notes'),
        ),
    ]
