# Generated by Django 6.0.1 on 2026-11-24 19:04

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('dgi', '0006_reactivate_tax_groups_l_n_v2'),
    ]

    operations = [
        migrations.CreateModel(
            name='JournalFiscal',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('canal', models.CharField(default='EMCF', max_length=10)),
                ('numero', models.CharField(db_index=True, max_length=80)),
                ('type_facture', models.CharField(blank=True, default='', max_length=2)),
                ('commande_ref', models.PositiveIntegerField(blank=True, db_index=True, null=True)),
                ('uid', models.CharField(blank=True, db_index=True, default='', max_length=64)),
                ('statut', models.CharField(choices=[('EN_ATTENTE', 'En attente de finalisation'), ('CONFIRMEE', 'Normalisee (confirmee)'), ('ANNULEE', 'Annulee (CANCEL)'), ('ERREUR', 'Erreur')], db_index=True, default='EN_ATTENTE', max_length=12)),
                ('total_ttc_local', models.DecimalField(blank=True, decimal_places=2, max_digits=14, null=True)),
                ('total_tva_local', models.DecimalField(blank=True, decimal_places=2, max_digits=14, null=True)),
                ('total_ttc_dgi', models.DecimalField(blank=True, decimal_places=2, max_digits=14, null=True)),
                ('total_tva_dgi', models.DecimalField(blank=True, decimal_places=2, max_digits=14, null=True)),
                ('code_def_dgi', models.CharField(blank=True, db_index=True, default='', max_length=64)),
                ('nim', models.CharField(blank=True, default='', max_length=32)),
                ('counters', models.CharField(blank=True, default='', max_length=64)),
                ('date_fiscale', models.DateTimeField(blank=True, db_index=True, null=True)),
                ('demande', models.JSONField(blank=True, null=True)),
                ('reponse_demande', models.JSONField(blank=True, null=True)),
                ('reponse_finalisation', models.JSONField(blank=True, null=True)),
                ('message', models.TextField(blank=True, default='')),
            ],
            options={
                'verbose_name': 'Journal fiscal e-MCF',
                'verbose_name_plural': 'Journal fiscal e-MCF',
                'ordering': ['-created_at'],
            },
        ),
    ]
