# Generated by Django 5.2.19 on 2026-12-01 07:27

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


class Migration(migrations.Migration):

    dependencies = [
        ('accounting', '0010_voucherregisterviewconfig_and_more'),
        ('banking', '0002_alter_bankaccount_unique_together_and_more'),
        ('projects', '0002_dailysitereport_projectactivity_projectadvance_and_more'),
        ('tenancy', '0003_taxconfig_calculation_rule_taxconfig_category_and_more'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AddField(
            model_name='chequebook',
            name='bank_book_number',
            field=models.CharField(blank=True, max_length=64),
        ),
        migrations.AddField(
            model_name='chequebook',
            name='handover_notes',
            field=models.TextField(blank=True),
        ),
        migrations.AddField(
            model_name='chequebook',
            name='last_handed_over_at',
            field=models.DateTimeField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='chequebook',
            name='updated_at',
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AddField(
            model_name='chequeleaf',
            name='normalized_cheque_number',
            field=models.CharField(blank=True, db_index=True, max_length=40),
        ),
        migrations.AlterField(
            model_name='chequebook',
            name='status',
            field=models.CharField(choices=[('ACTIVE', 'Active'), ('EXHAUSTED', 'Exhausted'), ('SUSPENDED', 'Suspended'), ('CANCELLED', 'Cancelled')], default='ACTIVE', max_length=16),
        ),
        migrations.AlterField(
            model_name='chequeleaf',
            name='status',
            field=models.CharField(choices=[('AVAILABLE', 'Available'), ('RESERVED', 'Reserved'), ('PREPARED', 'Prepared'), ('APPROVED', 'Approved'), ('ISSUED', 'Issued'), ('PRESENTED', 'Presented at Bank'), ('RECEIVED', 'Received'), ('VERIFIED', 'Verified'), ('DEPOSITED', 'Deposited'), ('UNDER_CLEARING', 'Under Clearing'), ('IN_HAND', 'Cheque in Hand'), ('CLEARED', 'Cleared'), ('BOUNCED', 'Bounced'), ('STOP_PAYMENT', 'Stop Payment'), ('CANCELLED', 'Cancelled'), ('SKIPPED', 'Skipped'), ('LOST_DAMAGED', 'Lost / Damaged'), ('STALE', 'Stale / Expired')], db_index=True, default='AVAILABLE', max_length=20),
        ),
        migrations.AddConstraint(
            model_name='chequeleaf',
            constraint=models.UniqueConstraint(condition=models.Q(('direction', 'ISSUED'), models.Q(('normalized_cheque_number', ''), _negated=True)), fields=('company', 'bank_account', 'normalized_cheque_number'), name='uniq_issued_cheque_per_company_account'),
        ),
    ]
