# Generated by Django 5.2.14 on 2026-08-19 17:39

import apps.base.utils.images
import django.db.models.deletion
import simple_history.models
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('product', '0007_historicalproduct_product_video_and_more'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalProductAngleImage',
            fields=[
                ('id', models.IntegerField(blank=True, db_index=True)),
                ('is_deleted', models.BooleanField(default=False, verbose_name='Eliminado')),
                ('created_at', models.DateField(blank=True, editable=False, verbose_name='Fecha de Creación')),
                ('updated_at', models.DateField(blank=True, editable=False, verbose_name='Fecha de Modificación')),
                ('deleted_at', models.DateField(blank=True, null=True, verbose_name='Fecha de Eliminación')),
                ('image', models.TextField(blank=True, max_length=100, null=True, verbose_name='Imagen del Ángulo')),
                ('angle', models.CharField(blank=True, help_text='Nombre o tipo de ángulo (ej. Frente, Lateral, Posterior, Detalle)', max_length=100, null=True, verbose_name='Ángulo / Vista')),
                ('order', models.PositiveIntegerField(default=0, help_text='Orden en que aparecerá la imagen en la galería', verbose_name='Orden de visualización')),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField(db_index=True)),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('product', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='product.product', verbose_name='Producto')),
            ],
            options={
                'verbose_name': 'historical Ángulo de Producto',
                'verbose_name_plural': 'historical Ángulos de Productos',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': ('history_date', 'history_id'),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='ProductAngleImage',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('is_deleted', models.BooleanField(default=False, verbose_name='Eliminado')),
                ('created_at', models.DateField(auto_now_add=True, verbose_name='Fecha de Creación')),
                ('updated_at', models.DateField(auto_now=True, verbose_name='Fecha de Modificación')),
                ('deleted_at', models.DateField(blank=True, null=True, verbose_name='Fecha de Eliminación')),
                ('image', models.ImageField(blank=True, null=True, upload_to=apps.base.utils.images.rename_image_upload_to, verbose_name='Imagen del Ángulo')),
                ('angle', models.CharField(blank=True, help_text='Nombre o tipo de ángulo (ej. Frente, Lateral, Posterior, Detalle)', max_length=100, null=True, verbose_name='Ángulo / Vista')),
                ('order', models.PositiveIntegerField(default=0, help_text='Orden en que aparecerá la imagen en la galería', verbose_name='Orden de visualización')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='angle_images', to='product.product', verbose_name='Producto')),
            ],
            options={
                'verbose_name': 'Ángulo de Producto',
                'verbose_name_plural': 'Ángulos de Productos',
                'ordering': ['order', 'id'],
            },
        ),
    ]
