# Generated by Django 6.0.1 on 2026-01-22 19:01

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='ClientType',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('update_at', models.DateTimeField(auto_now=True)),
                ('code', models.CharField(help_text="Code type client (ex: 'PP', 'PM').", max_length=10, unique=True)),
                ('name', models.CharField(help_text="Nom lisible du type (ex: 'Personne physique').", max_length=100)),
                ('description', models.TextField(blank=True, help_text='Description optionnelle.')),
                ('is_active', models.BooleanField(default=True, help_text='Permet de désactiver un type sans le supprimer.')),
            ],
            options={
                'verbose_name': 'Type de client',
                'verbose_name_plural': 'Types de client',
                'ordering': ['code'],
            },
        ),
        migrations.CreateModel(
            name='ItemType',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('update_at', models.DateTimeField(auto_now=True)),
                ('code', models.CharField(help_text="Code type article (ex: 'GOODS', 'SERVICE').", max_length=20, unique=True)),
                ('name', models.CharField(help_text="Nom lisible (ex: 'Bien', 'Service').", max_length=100)),
                ('description', models.TextField(blank=True, help_text='Description optionnelle.')),
                ('is_active', models.BooleanField(default=True, help_text='Permet de désactiver un type sans le supprimer.')),
            ],
            options={
                'verbose_name': "Type d'article",
                'verbose_name_plural': "Types d'article",
                'ordering': ['code'],
            },
        ),
        migrations.CreateModel(
            name='TaxGroup',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('update_at', models.DateTimeField(auto_now=True)),
                ('code', models.CharField(help_text="Code du groupe de taxation (ex: 'A', 'B').", max_length=10, unique=True)),
                ('name', models.CharField(help_text="Nom du groupe (ex: 'TVA 16%').", max_length=100)),
                ('description', models.TextField(blank=True, help_text='Description optionnelle.')),
                ('tax', models.DecimalField(decimal_places=2, default=0.0, max_digits=5)),
                ('is_active', models.BooleanField(default=True, help_text='Permet de désactiver un groupe sans le supprimer.')),
            ],
            options={
                'verbose_name': 'Groupe de taxation',
                'verbose_name_plural': 'Groupes de taxation',
                'ordering': ['code'],
            },
        ),
        migrations.CreateModel(
            name='Client',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('update_at', models.DateTimeField(auto_now=True)),
                ('username', models.CharField(blank=True, max_length=255, null=True)),
                ('password', models.CharField(blank=True, max_length=20, null=True)),
                ('nif', models.CharField(blank=True, help_text='NIF du client (peut être vide si non renseigné).', max_length=20, null=True)),
                ('name', models.CharField(help_text='Nom / Raison sociale du client.', max_length=255)),
                ('contact', models.CharField(blank=True, help_text='Téléphone ou autre contact.', max_length=50)),
                ('email', models.EmailField(blank=True, help_text='Adresse email du client (facultatif).', max_length=254, null=True)),
                ('address', models.CharField(blank=True, help_text='Adresse postale du client.', max_length=255)),
                ('is_active', models.BooleanField(default=True, help_text='Permet de désactiver un client sans le supprimer.')),
                ('client_type', models.ForeignKey(blank=True, help_text='Type de client (PP, PM, etc.).', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='clients', to='dgi.clienttype')),
            ],
            options={
                'verbose_name': 'Client',
                'verbose_name_plural': 'Clients',
                'ordering': ['name'],
            },
        ),
    ]
