# Generated by Django 5.1.2 on 2025-02-06 17:55

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


class Migration(migrations.Migration):

    dependencies = [
        ('product', '0014_inpackitems_alter_productdetailmodel_product_and_more'),
    ]

    operations = [
        migrations.CreateModel(
            name='AttributeType',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='نام نوع اتربیوت')),
            ],
        ),
        migrations.CreateModel(
            name='ProductDetailCategory',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=40, verbose_name='عنوان')),
            ],
            options={
                'verbose_name': 'دسته بندی جزيات',
                'verbose_name_plural': 'دسته بندی های جزيیات',
            },
        ),
        migrations.CreateModel(
            name='AttributeValue',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.CharField(max_length=100, verbose_name='مقدار نوع اتربیوت')),
                ('color', models.CharField(blank=True, max_length=7, null=True, verbose_name='رنک')),
                ('attribute_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='product.attributetype')),
            ],
            options={
                'unique_together': {('attribute_type', 'value')},
            },
        ),
        migrations.AddField(
            model_name='productdetailmodel',
            name='detail_category',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='product.productdetailcategory', verbose_name='دسته بندی جزيات'),
        ),
        migrations.AlterUniqueTogether(
            name='productdetailmodel',
            unique_together={('product', 'detail_category')},
        ),
        migrations.CreateModel(
            name='ProductVariant',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('in_stock', models.PositiveIntegerField(default=0, verbose_name='تعداد موجود')),
                ('price', models.PositiveIntegerField(blank=True, null=True, verbose_name='قیمت (اختیاری)')),
                ('attributes', models.ManyToManyField(to='product.attributevalue', verbose_name='ویژگی\u200cها')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='variants', to='product.productmodel', verbose_name='محصول')),
            ],
            options={
                'verbose_name': 'تنوع محصول',
                'verbose_name_plural': 'تنوع\u200cهای محصول',
            },
        ),
        migrations.DeleteModel(
            name='InStuckColors',
        ),
    ]
