# Generated migration for PenaltyCharge model

from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    dependencies = [
        ('loans', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='PenaltyCharge',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('amount', models.DecimalField(decimal_places=2, max_digits=12)),
                ('penalty_rate', models.DecimalField(decimal_places=2, help_text='Daily penalty rate used', max_digits=5)),
                ('days_overdue', models.PositiveIntegerField(help_text='Number of days overdue when penalty was applied')),
                ('outstanding_amount', models.DecimalField(decimal_places=2, help_text='Outstanding amount when penalty was calculated', max_digits=12)),
                ('applied_date', models.DateTimeField(auto_now_add=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('loan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='penalty_charges', to='loans.Loan')),
            ],
            options={
                'db_table': 'penalty_charges',
                'ordering': ['-applied_date'],
            },
        ),
    ]
