# Generated by Django 5.1 on 2026-05-02 17:34

import django.db.models.deletion
import django.utils.timezone
import uuid
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('email', models.EmailField(max_length=255, unique=True, verbose_name='Email')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='Prénom')),
                ('last_name', models.CharField(blank=True, max_length=30, verbose_name='Nom')),
                ('speciality', models.CharField(blank=True, max_length=50, verbose_name='Spécialité')),
                ('phone_number', models.CharField(blank=True, max_length=20, verbose_name='Téléphone')),
                ('document', models.FileField(blank=True, null=True, upload_to='documents/', verbose_name='Document justificatif')),
                ('profile_image', models.ImageField(blank=True, null=True, upload_to='profiles/', verbose_name='Photo de profil')),
                ('membership_id', models.UUIDField(default=uuid.uuid4, editable=False, help_text="Identifiant unique pour le QR code d'inscription", unique=True, verbose_name="Numéro d'adhérent")),
                ('qr_code', models.ImageField(blank=True, null=True, upload_to='qrcodes/', verbose_name='QR Code')),
                ('is_active', models.BooleanField(default=False, help_text="Activé par l'agent après réception du paiement", verbose_name='Compte actif')),
                ('is_staff', models.BooleanField(default=False, verbose_name='Staff')),
                ('is_email_verified', models.BooleanField(default=False, help_text="Étape 1 : l'utilisateur a confirmé son email", verbose_name='Email vérifié')),
                ('is_validated_by_staff', models.BooleanField(default=False, help_text="Étape 2 : l'agent a validé le paiement", verbose_name="Validé par l'administration")),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name="Date d'inscription")),
                ('membership_start_date', models.DateField(blank=True, null=True, verbose_name="Début de l'adhésion")),
                ('membership_end_date', models.DateField(blank=True, null=True, verbose_name="Fin de l'adhésion")),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.permission', verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'Compte Utilisateur',
                'verbose_name_plural': 'Comptes Utilisateurs',
                'ordering': ['-date_joined'],
            },
        ),
        migrations.CreateModel(
            name='PaymentReceipt',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('receipt_file', models.FileField(upload_to='receipts/', verbose_name='Fichier du reçu (Image/PDF)')),
                ('payment_date', models.DateField(default=django.utils.timezone.now, verbose_name='Date de paiement')),
                ('amount', models.DecimalField(decimal_places=2, default=0.0, max_digits=10, verbose_name='Montant payé')),
                ('is_validated', models.BooleanField(default=False, verbose_name="Validé par l'administration")),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payment_receipts', to=settings.AUTH_USER_MODEL, verbose_name='Adhérent')),
            ],
            options={
                'verbose_name': 'Reçu de paiement',
                'verbose_name_plural': 'Reçus de paiement',
                'ordering': ['-payment_date', '-created_at'],
            },
        ),
    ]
