# Generated by Django 4.0.10 on 2025-05-08 14:52

import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import tinymce.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('userapp', '0002_costumuser_address_alter_costumuser_type'),
    ]

    operations = [
        migrations.CreateModel(
            name='Bank',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, default='', max_length=255, verbose_name='Nom de la banque')),
            ],
        ),
        migrations.CreateModel(
            name='Contract',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(blank=True, max_length=200, null=True, unique=True)),
                ('startDate', models.DateField(blank=True, null=True, verbose_name="Date de d'effet")),
                ('dueDate', models.DateField(blank=True, null=True, verbose_name="Date d'echeance")),
                ('period', models.IntegerField(blank=True, default=0, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(10)], verbose_name='Durée de la période(en années)')),
                ('initPayment', models.FloatField(blank=True, default=0.0, validators=[django.core.validators.MinValueValidator(0)], verbose_name='Montant de la première cotisation')),
                ('periodicBonus', models.FloatField(blank=True, default=0.0, validators=[django.core.validators.MinValueValidator(0)], verbose_name='Montant de la cotisation périodique')),
                ('foresightBonus', models.FloatField(blank=True, default=0.0, validators=[django.core.validators.MinValueValidator(0)], verbose_name='Montant de la cotisation de prévoyance')),
                ('membershipFees', models.FloatField(blank=True, default=0.0, validators=[django.core.validators.MinValueValidator(0)], verbose_name="Frais d'adhésion")),
                ('createdAt', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Nationality',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, default='', max_length=255, verbose_name='Nom du pays')),
                ('slug', models.TextField(default='', max_length=200, unique=True)),
                ('createdAt', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Parameter',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, default='Ecolux BTP', max_length=255, unique=True, verbose_name='Nom de la société')),
                ('phone', models.CharField(blank=True, default='', max_length=45, verbose_name='Numéro de téléphone')),
                ('email', models.CharField(blank=True, default='', max_length=255)),
                ('contractFooter', tinymce.models.HTMLField(blank=True, default='', verbose_name='Pied de page du contrat')),
                ('logo', models.ImageField(blank=True, default='', upload_to='az-images/', verbose_name='Logo')),
                ('createdAt', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Place',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, default='', max_length=255, verbose_name='Nom de la ville')),
                ('slug', models.TextField(default='', max_length=200, unique=True)),
                ('createdAt', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Profession',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, default='', max_length=255)),
                ('slug', models.TextField(default='', max_length=200, unique=True)),
                ('createdAt', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Sector',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, default='', max_length=255, verbose_name='Nom du secteur')),
                ('slug', models.TextField(default='', max_length=200, unique=True)),
                ('createdAt', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Partner',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(blank=True, max_length=200, null=True, unique=True, verbose_name='Code partenaire')),
                ('name', models.CharField(blank=True, default='', max_length=255, verbose_name='Nom du partenaire')),
                ('phone', models.CharField(blank=True, default='', max_length=45, verbose_name='Numéro de téléphone')),
                ('email', models.CharField(blank=True, default='', max_length=255, verbose_name='Email')),
                ('address', models.CharField(blank=True, default='', max_length=255, verbose_name='Adresse')),
                ('createdAt', models.DateTimeField(auto_now_add=True)),
                ('cuser', models.OneToOneField(default=None, on_delete=django.db.models.deletion.CASCADE, to='userapp.costumuser')),
            ],
        ),
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(blank=True, max_length=200, null=True, unique=True, verbose_name='Code client')),
                ('sex', models.CharField(blank=True, choices=[('M', 'Homme'), ('F', 'Femme')], default='M', max_length=45, verbose_name='Sexe')),
                ('birthdate', models.DateField(blank=True, null=True, verbose_name='Date de naissance')),
                ('identityNumber', models.CharField(blank=True, default='', max_length=200, unique=True, verbose_name="Numéro d'identité")),
                ('dateOfIssue', models.DateField(blank=True, null=True, verbose_name="Date d'émission")),
                ('codeBank', models.CharField(blank=True, default='', max_length=200, verbose_name='Code banque')),
                ('rib', models.CharField(blank=True, default='', max_length=200, verbose_name='RIB')),
                ('numberBank', models.CharField(blank=True, default='', max_length=200, verbose_name='Numéro de compte')),
                ('identityType', models.CharField(blank=True, choices=[('CIN', 'CIN'), ('PASSPORT', 'PASSPORT'), ('PERMIS', 'PERMIS'), ('OTHER', 'OTHER')], default='CIN', max_length=45, verbose_name="Type d'identité")),
                ('is_active', models.BooleanField(default=False)),
                ('slug', models.TextField(default='', max_length=200, unique=True)),
                ('createdAt', models.DateTimeField(auto_now_add=True)),
                ('bank', models.ForeignKey(default=None, on_delete=django.db.models.deletion.DO_NOTHING, related_name='banque', to='app.bank', verbose_name='Banque')),
                ('birthplace', models.ForeignKey(default=None, on_delete=django.db.models.deletion.DO_NOTHING, related_name='birthplace', to='app.place', verbose_name='Lieu de naissance')),
                ('cuser', models.OneToOneField(default=None, on_delete=django.db.models.deletion.CASCADE, to='userapp.costumuser')),
                ('nationality', models.ForeignKey(default=None, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nationality', to='app.place', verbose_name='Nationalité')),
                ('profession', models.ForeignKey(default=None, on_delete=django.db.models.deletion.DO_NOTHING, related_name='profession', to='app.profession', verbose_name='Profession')),
                ('sector', models.ForeignKey(default=None, on_delete=django.db.models.deletion.DO_NOTHING, related_name='secteur', to='app.sector', verbose_name="Secteur d'activité")),
            ],
        ),
        migrations.CreateModel(
            name='ContractQuestion',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('question', models.CharField(blank=True, default='', max_length=255, verbose_name='Question')),
                ('code', models.CharField(blank=True, default='', max_length=255, verbose_name='Code')),
                ('isRequired', models.BooleanField(blank=True, default=False, verbose_name='Obligatoire')),
                ('createdAt', models.DateTimeField(auto_now_add=True)),
                ('parameter', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='contractQuestion', to='app.parameter', verbose_name='Paramètre')),
            ],
        ),
        migrations.CreateModel(
            name='ContractAnswer',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('answer', models.CharField(blank=True, default='', max_length=255, verbose_name='Réponse')),
                ('createdAt', models.DateTimeField(auto_now_add=True)),
                ('contract', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='contractAnswer', to='app.contract', verbose_name='Contrat')),
                ('question', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='contractAnswer', to='app.contractquestion', verbose_name='Question')),
            ],
        ),
        migrations.AddField(
            model_name='contract',
            name='customer',
            field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.DO_NOTHING, related_name='customer', to='app.customer', verbose_name='Client'),
        ),
        migrations.CreateModel(
            name='ContactOfContract',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, default='', max_length=255, verbose_name='Nom du contact')),
                ('phone', models.CharField(blank=True, default='', max_length=45, verbose_name='Numéro de téléphone')),
                ('address', models.CharField(blank=True, default='', max_length=255, verbose_name='Adresse')),
                ('contract', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='contactContract', to='app.contract', verbose_name='Contrat')),
            ],
        ),
        migrations.CreateModel(
            name='Beneficiary',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, default='', max_length=255, verbose_name='Nom du bénéficiaire')),
                ('sex', models.CharField(blank=True, choices=[('M', 'Homme'), ('F', 'Femme')], default='M', max_length=45, verbose_name='Sexe')),
                ('birthdate', models.DateField(blank=True, null=True, verbose_name='Date de naissance')),
                ('phone', models.CharField(blank=True, default='', max_length=45, verbose_name='Numéro de téléphone')),
                ('address', models.CharField(blank=True, default='', max_length=255, verbose_name='Adresse')),
                ('distribution', models.IntegerField(blank=True, default=0, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100)], verbose_name='Distribution')),
                ('createdAt', models.DateTimeField(auto_now_add=True)),
                ('contract', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='benefContract', to='app.contract', verbose_name='Contrat')),
                ('nationality', models.ForeignKey(default=None, on_delete=django.db.models.deletion.DO_NOTHING, related_name='benefNationality', to='app.nationality', verbose_name='Nationalité')),
            ],
        ),
    ]
