# Generated by Django 6.0.5 on 2026-05-11 11:47

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('name_en', models.CharField(max_length=100)),
                ('name_ar', models.CharField(max_length=100)),
                ('icon', models.ImageField(blank=True, null=True, upload_to='categories/')),
            ],
            options={
                'verbose_name_plural': 'categories',
                'db_table': 'categories',
            },
        ),
        migrations.CreateModel(
            name='PaymentMethod',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True)),
                ('icon', models.ImageField(blank=True, null=True, upload_to='payment_methods/')),
            ],
            options={
                'db_table': 'payment_methods',
            },
        ),
        migrations.CreateModel(
            name='Store',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('name_en', models.CharField(max_length=200)),
                ('name_ar', models.CharField(blank=True, max_length=200)),
                ('logo', models.ImageField(blank=True, null=True, upload_to='stores/logos/')),
                ('cover', models.ImageField(blank=True, null=True, upload_to='stores/covers/')),
                ('description_en', models.TextField(blank=True)),
                ('description_ar', models.TextField(blank=True)),
                ('rating', models.DecimalField(decimal_places=2, default=0, max_digits=3)),
                ('rating_count', models.PositiveIntegerField(default=0)),
                ('views', models.PositiveIntegerField(default=0)),
                ('local_delivery_days', models.PositiveSmallIntegerField(blank=True, null=True)),
                ('intl_delivery_days', models.PositiveSmallIntegerField(blank=True, null=True)),
                ('is_online', models.BooleanField(default=True)),
                ('is_in_store', models.BooleanField(default=False)),
                ('is_top', models.BooleanField(db_index=True, default=False)),
                ('is_recommended', models.BooleanField(db_index=True, default=False)),
                ('is_recently_added', models.BooleanField(db_index=True, default=False)),
                ('is_trending', models.BooleanField(default=False)),
                ('has_deals', models.BooleanField(default=False)),
                ('supports_installments', models.BooleanField(default=False)),
                ('categories', models.ManyToManyField(blank=True, related_name='stores', to='stores.category')),
                ('payment_methods', models.ManyToManyField(blank=True, related_name='stores', to='stores.paymentmethod')),
            ],
            options={
                'db_table': 'stores',
            },
        ),
        migrations.CreateModel(
            name='StoreBranch',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('address', models.TextField()),
                ('latitude', models.DecimalField(blank=True, decimal_places=6, max_digits=9, null=True)),
                ('longitude', models.DecimalField(blank=True, decimal_places=6, max_digits=9, null=True)),
                ('is_open', models.BooleanField(default=True)),
                ('open_hours', models.CharField(blank=True, max_length=100)),
                ('store', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='branches', to='stores.store')),
            ],
            options={
                'verbose_name_plural': 'store branches',
                'db_table': 'store_branches',
            },
        ),
        migrations.CreateModel(
            name='StoreReview',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('rating', models.PositiveSmallIntegerField()),
                ('title', models.CharField(blank=True, max_length=200)),
                ('comment', models.TextField(blank=True)),
                ('store', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reviews', to='stores.store')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='store_reviews', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'store_reviews',
                'unique_together': {('user', 'store')},
            },
        ),
    ]
