# Generated by Django 6.0 on 2026-02-05 12:52

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


class Migration(migrations.Migration):

    dependencies = [
        ('collections_management', '0003_alter_collectionemail_options_and_more'),
        ('tenancy', '0003_tenant_address_line1_tenant_address_line2_and_more'),
        ('treasury_management', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AddField(
            model_name='payment',
            name='received_by',
            field=models.CharField(choices=[('acx', 'Encaissement ACX'), ('customer_direct', 'Paiement direct chez le client')], db_index=True, default='acx', max_length=20),
        ),
        migrations.AddField(
            model_name='payment',
            name='treasury_account',
            field=models.ForeignKey(blank=True, help_text='Compte de trésorerie ACX utilisé si received_by=acx.', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='collection_payments', to='treasury_management.treasuryaccount'),
        ),
        migrations.AddIndex(
            model_name='payment',
            index=models.Index(fields=['tenant', 'received_by'], name='collections_tenant__809d4e_idx'),
        ),
        migrations.AddIndex(
            model_name='payment',
            index=models.Index(fields=['tenant', 'treasury_account'], name='collections_tenant__f03a1a_idx'),
        ),
    ]
