# Generated by Django 6.0.3 on 2026-03-30 06:05

import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('MASTERAPP', '0005_productreview_productreviewimage_returnrequest_and_more'),
    ]

    operations = [
        migrations.CreateModel(
            name='CMSPage',
            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)),
                ('is_active', models.BooleanField(default=True)),
                ('is_deleted', models.BooleanField(default=False)),
                ('extra_data', models.JSONField(blank=True, default=dict, null=True)),
                ('title', models.CharField(max_length=200)),
                ('slug', models.SlugField(blank=True, max_length=220, null=True, unique=True)),
                ('subtitle', models.CharField(blank=True, max_length=255, null=True)),
                ('content', models.TextField()),
                ('page_type', models.CharField(choices=[('about_us', 'About Us'), ('privacy_policy', 'Privacy Policy'), ('terms_conditions', 'Terms & Conditions'), ('refund_policy', 'Refund Policy'), ('shipping_policy', 'Shipping Policy'), ('contact_us', 'Contact Us'), ('support_info', 'Support Info')], max_length=50, unique=True)),
                ('last_updated_label', models.CharField(blank=True, max_length=120, null=True)),
            ],
            options={
                'db_table': 'cms_page',
                'ordering': ['title'],
            },
        ),
        migrations.CreateModel(
            name='Notification',
            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)),
                ('is_active', models.BooleanField(default=True)),
                ('is_deleted', models.BooleanField(default=False)),
                ('extra_data', models.JSONField(blank=True, default=dict, null=True)),
                ('title', models.CharField(max_length=200)),
                ('message', models.TextField()),
                ('notification_type', models.CharField(choices=[('order', 'Order'), ('payment', 'Payment'), ('offer', 'Offer'), ('support', 'Support'), ('return', 'Return'), ('service', 'Service'), ('general', 'General')], default='general', max_length=30)),
                ('is_read', models.BooleanField(default=False)),
                ('read_at', models.DateTimeField(blank=True, null=True)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notifications', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'notification',
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='RecentSearch',
            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)),
                ('is_active', models.BooleanField(default=True)),
                ('is_deleted', models.BooleanField(default=False)),
                ('extra_data', models.JSONField(blank=True, default=dict, null=True)),
                ('keyword', models.CharField(max_length=255)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='recent_searches', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'recent_search',
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='RecentlyViewed',
            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)),
                ('is_active', models.BooleanField(default=True)),
                ('is_deleted', models.BooleanField(default=False)),
                ('extra_data', models.JSONField(blank=True, default=dict, null=True)),
                ('viewed_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='recent_views', to='MASTERAPP.product')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='recently_viewed_products', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'recently_viewed',
                'ordering': ['-viewed_at'],
                'unique_together': {('user', 'product')},
            },
        ),
    ]
