# Generated by Django 5.1.1 on 2024-09-19 13:35

import apps.common.fields.month_year
import apps.transactions.validators
import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("accounts", "0001_initial"),
        ("transactions", "0001_initial"),
    ]

    operations = [
        migrations.AddField(
            model_name="transaction",
            name="account",
            field=models.ForeignKey(
                default=0,
                on_delete=django.db.models.deletion.PROTECT,
                to="accounts.account",
                verbose_name="Account",
            ),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name="transaction",
            name="amount",
            field=models.DecimalField(
                decimal_places=18,
                default=0,
                max_digits=30,
                validators=[
                    apps.transactions.validators.validate_non_negative,
                    apps.transactions.validators.validate_decimal_places,
                ],
                verbose_name="Amount",
            ),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name="transaction",
            name="date",
            field=models.DateField(verbose_name="Date"),
        ),
        migrations.AlterField(
            model_name="transaction",
            name="description",
            field=models.CharField(max_length=500, verbose_name="Description"),
        ),
        migrations.AlterField(
            model_name="transaction",
            name="is_paid",
            field=models.BooleanField(default=True, verbose_name="Paid"),
        ),
        migrations.AlterField(
            model_name="transaction",
            name="notes",
            field=models.TextField(blank=True, verbose_name="Notes"),
        ),
        migrations.AlterField(
            model_name="transaction",
            name="reference_date",
            field=apps.common.fields.month_year.MonthYearModelField(
                verbose_name="Reference Date"
            ),
        ),
    ]
