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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('admissions', '0002_remove_application_religion_and_more'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Payment',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.DecimalField(decimal_places=2, max_digits=12)),
                ('payment_type', models.CharField(
                    choices=[
                        ('tuition', 'Tuition Fee'),
                        ('practical', 'Practical / Project Fee'),
                        ('assessment', 'Assessment Fee'),
                        ('admission', 'Admission Fee'),
                        ('other', 'Other'),
                    ],
                    max_length=20,
                )),
                ('term', models.CharField(
                    choices=[('term_1', 'Term 1'), ('term_2', 'Term 2'), ('term_3', 'Term 3')],
                    max_length=10,
                )),
                ('academic_year', models.CharField(help_text='e.g. 2024/2025', max_length=9)),
                ('payment_method', models.CharField(
                    choices=[
                        ('mobile_money', 'Mobile Money'),
                        ('bank', 'Bank Transfer'),
                        ('cash', 'Cash'),
                        ('other', 'Other'),
                    ],
                    default='mobile_money',
                    max_length=20,
                )),
                ('reference', models.CharField(
                    blank=True,
                    help_text='Transaction ID, bank slip no., receipt no., etc.',
                    max_length=100,
                )),
                ('payment_date', models.DateField()),
                ('notes', models.TextField(blank=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('enrollment', models.ForeignKey(
                    on_delete=django.db.models.deletion.CASCADE,
                    related_name='payments',
                    to='admissions.enrollment',
                )),
                ('recorded_by', models.ForeignKey(
                    blank=True,
                    null=True,
                    on_delete=django.db.models.deletion.SET_NULL,
                    related_name='recorded_payments',
                    to=settings.AUTH_USER_MODEL,
                )),
            ],
            options={
                'ordering': ['-payment_date', '-created_at'],
            },
        ),
    ]
