# Generated by Django 4.2.28 on 2026-07-27 22:20

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('businesses', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Product',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=300)),
                ('description', models.TextField(blank=True)),
                ('base_price', models.DecimalField(decimal_places=2, help_text='Reference price only. Each SaleItem sets its own actual price.', max_digits=10)),
                ('is_active', models.BooleanField(default=True, help_text='Soft-delete flag. Hides from sale picker without deleting sale history.')),
                ('business', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='products', to='businesses.business')),
            ],
            options={
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='ProductImage',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('image', models.ImageField(upload_to='products/originals/')),
                ('thumbnail', models.ImageField(blank=True, null=True, upload_to='products/thumbnails/')),
                ('medium', models.ImageField(blank=True, null=True, upload_to='products/medium/')),
                ('large', models.ImageField(blank=True, null=True, upload_to='products/large/')),
                ('webp', models.ImageField(blank=True, null=True, upload_to='products/webp/')),
                ('order', models.PositiveIntegerField(default=0)),
                ('processing_status', models.CharField(choices=[('pending', 'Pending'), ('processing', 'Processing'), ('done', 'Done'), ('failed', 'Failed')], default='pending', max_length=20)),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='images', to='products.product')),
            ],
            options={
                'ordering': ['order', 'created_at'],
            },
        ),
    ]
