# Generated by Django 5.0 on 2025-11-16 22:46

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


class Migration(migrations.Migration):

    dependencies = [
        ('app', '0070_testimonial'),
    ]

    operations = [
        migrations.CreateModel(
            name='ProductCategory',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=150, unique=True, verbose_name='Nom')),
                ('slug', models.SlugField(max_length=160, unique=True, verbose_name='Slug')),
                ('description', models.TextField(blank=True, verbose_name='Description')),
                ('icon', models.CharField(blank=True, max_length=50, verbose_name='Icône')),
                ('image', models.ImageField(blank=True, null=True, upload_to='shop/categories/', verbose_name='Image')),
                ('order', models.PositiveIntegerField(default=0, verbose_name='Ordre')),
                ('is_active', models.BooleanField(default=True, verbose_name='Active')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Créé le')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Mis à jour le')),
            ],
            options={
                'verbose_name': 'Catégorie de produit',
                'verbose_name_plural': 'Catégories de produits',
                'ordering': ['order', 'name'],
            },
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, verbose_name='Nom du produit')),
                ('slug', models.SlugField(max_length=220, unique=True, verbose_name='Slug')),
                ('short_description', models.CharField(blank=True, max_length=300, verbose_name='Description courte')),
                ('description', tinymce.models.HTMLField(blank=True, verbose_name='Description détaillée')),
                ('image', models.ImageField(blank=True, null=True, upload_to='shop/products/', verbose_name='Image principale')),
                ('gallery', models.JSONField(blank=True, default=list, verbose_name='Galerie (URLs)')),
                ('price', models.DecimalField(decimal_places=2, max_digits=12, validators=[django.core.validators.MinValueValidator(0)], verbose_name='Prix')),
                ('currency', models.CharField(default='FCFA', max_length=10, verbose_name='Devise')),
                ('stock', models.PositiveIntegerField(default=0, verbose_name='Stock disponible')),
                ('status', models.CharField(choices=[('ACTIVE', 'Actif'), ('HIDDEN', 'Caché'), ('ARCHIVED', 'Archivé')], default='ACTIVE', max_length=10, verbose_name='Statut')),
                ('is_featured', models.BooleanField(default=False, verbose_name='En vedette')),
                ('whatsapp_message_template', models.CharField(blank=True, help_text='Variables: {product} {price} {currency}', max_length=300, verbose_name='Template message WhatsApp')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Créé le')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Mis à jour le')),
                ('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='products', to='app.productcategory', verbose_name='Catégorie')),
            ],
            options={
                'verbose_name': 'Produit',
                'verbose_name_plural': 'Produits',
                'ordering': ['-created_at'],
            },
        ),
    ]
