# Generated by Django 5.2.15 on 2026-06-19 17:32

import chatapp.models
import django.contrib.auth.models
import django.contrib.auth.validators
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='HeroSlide',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(help_text='Image for the hero slider', upload_to='hero_slides/')),
                ('alt_text', models.CharField(blank=True, help_text='Alt text for the image', max_length=255, null=True)),
                ('order', models.IntegerField(default=0, help_text='Order in the slider')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'ordering': ['order', '-created_at'],
            },
        ),
        migrations.CreateModel(
            name='Lead',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('phone', models.CharField(max_length=50)),
                ('page_url', models.URLField(blank=True, max_length=1000, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='Package',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('is_unlimited', models.BooleanField(default=False, help_text='Unlimited message subscription')),
                ('message_limit', models.IntegerField(default=0, help_text='Message limit (used if not unlimited)')),
                ('days_valid', models.IntegerField(default=30, help_text='Validity duration in days')),
                ('price', models.DecimalField(decimal_places=2, default=0.0, help_text='Price of package', max_digits=10)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='SiteSettings',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fb_app_verify_token', models.CharField(blank=True, help_text='Global Meta Webhook Verification Token', max_length=255, null=True)),
                ('privacy_policy', models.TextField(blank=True, help_text='Global Platform Privacy Policy', null=True)),
                ('webhook_logging_enabled', models.BooleanField(default=True, help_text='Enable logging of incoming webhooks to the database (Monitor page)')),
                ('hero_badge_text', models.CharField(default='ChatLab AI Sales Agent', max_length=255)),
                ('hero_title', models.TextField(default='Increase Engagement with Your Customers')),
                ('hero_subtitle', models.TextField(default='Help businesses scale their operations and boost sales via intelligent WhatsApp, Messenger, and web chatbots.')),
                ('home_feature_1_title', models.CharField(default='Omnichannel Integration', max_length=255)),
                ('home_feature_1_desc', models.TextField(default='Seamlessly connect with customers across WhatsApp, Facebook Messenger, and web chatbots from a single platform.')),
                ('home_feature_2_title', models.CharField(default='AI Sales Agent', max_length=255)),
                ('home_feature_2_desc', models.TextField(default='Deploy intelligent AI agents that instantly reply to queries, capture leads, and close sales 24/7 automatically.')),
                ('home_feature_3_title', models.CharField(default='Live Handoff & Monitor', max_length=255)),
                ('home_feature_3_desc', models.TextField(default='Monitor AI conversations in real-time and effortlessly take over control when human intervention is needed.')),
                ('contact_email', models.EmailField(default='info@chat-lab.labxit.com', max_length=254)),
                ('contact_phone', models.CharField(default='+880 1XXX-XXXXXX', max_length=50)),
                ('contact_address', models.TextField(default='123 AI Boulevard, Tech City')),
                ('pricing_basic_name', models.CharField(default='Starter', max_length=100)),
                ('pricing_basic_price', models.CharField(default='৳4900/mo', max_length=100)),
                ('pricing_basic_features', models.TextField(default='1 Agent\n1000 Messages/mo\nStandard Support')),
                ('pricing_pro_name', models.CharField(default='Professional', max_length=100)),
                ('pricing_pro_price', models.CharField(default='৳9900/mo', max_length=100)),
                ('pricing_pro_features', models.TextField(default='5 Agents\nUnlimited Messages\nPriority Support')),
                ('pricing_ent_name', models.CharField(default='Enterprise', max_length=100)),
                ('pricing_ent_price', models.CharField(default='Custom', max_length=100)),
                ('pricing_ent_features', models.TextField(default='Unlimited Agents\nDedicated Account Manager\nCustom Integration')),
                ('logo', models.ImageField(blank=True, help_text='Upload platform logo', null=True, upload_to='site_logos/')),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Topic',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='WebhookTestLog',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('source', models.CharField(choices=[('facebook', 'Facebook'), ('whatsapp', 'WhatsApp')], default='facebook', max_length=20)),
                ('raw_payload', models.TextField()),
                ('remote_ip', models.GenericIPAddressField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('reply_status', models.CharField(choices=[('pending', 'Pending AI Reply'), ('replied', 'Replied by AI'), ('escalated', 'Escalated to Human'), ('failed', 'Failed'), ('ignored', 'Ignored/Not Applicable')], default='pending', max_length=20)),
                ('reply_time_seconds', models.FloatField(blank=True, null=True)),
                ('processing_attempts', models.PositiveIntegerField(default=0)),
            ],
            options={
                'ordering': ('-created_at',),
            },
        ),
        migrations.CreateModel(
            name='AIModel',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('provider', models.CharField(choices=[('gemini', 'Google Gemini'), ('openai', 'OpenAI')], max_length=20)),
                ('model_name', models.CharField(help_text='Model identifier (e.g., gpt-4o, gemini-2.0-flash)', max_length=150)),
                ('display_name', models.CharField(help_text='Human-readable name for dropdown display', max_length=150)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'ordering': ('provider', '-created_at'),
                'unique_together': {('provider', 'model_name')},
            },
        ),
        migrations.CreateModel(
            name='Company',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('chatbot_name', models.CharField(default='Assistant', max_length=255)),
                ('welcome_message', models.TextField(default='Hi! Welcome to our site. I am your virtual assistant. Feel free to ask me anything!', help_text='Welcome message shown when visitor opens the chat')),
                ('ai_provider', models.CharField(choices=[('gemini', 'Google Gemini'), ('openai', 'OpenAI')], default='gemini', max_length=20)),
                ('api_key', models.CharField(blank=True, max_length=255, null=True)),
                ('system_prompt', models.TextField(blank=True, null=True)),
                ('google_sheet_url', models.URLField(blank=True, help_text='Public Google Sheet URL (View Only) for live knowledge (Items, Pricing, Stock)', max_length=1000, null=True)),
                ('model_name', models.CharField(default='gemini-3.5-flash', max_length=100)),
                ('allowed_domain', models.CharField(blank=True, help_text='Authorized domain for widget embedding, e.g. example.com (without https://)', max_length=255, null=True)),
                ('icon', models.ImageField(blank=True, null=True, upload_to='chatbot_icons/')),
                ('chatbot_icon', models.ImageField(blank=True, help_text='Icon used for the floating chat button', null=True, upload_to='chatbot_button_icons/')),
                ('widget_position', models.CharField(choices=[('right', 'Bottom Right'), ('left', 'Bottom Left')], default='right', max_length=10)),
                ('widget_bottom_offset', models.PositiveIntegerField(default=24, help_text='Pixels from bottom edge')),
                ('widget_side_offset', models.PositiveIntegerField(default=24, help_text='Pixels from left/right edge')),
                ('widget_button_size', models.PositiveIntegerField(default=60, help_text='Floating button size in pixels')),
                ('widget_panel_width', models.PositiveIntegerField(default=360, help_text='Chat panel width in pixels')),
                ('widget_panel_height', models.PositiveIntegerField(default=480, help_text='Chat panel height in pixels')),
                ('widget_sound_enabled', models.BooleanField(default=True, help_text='Play notification sound on new messages')),
                ('widget_positions', models.CharField(blank=True, help_text="Comma-separated enabled positions for the widget (e.g. 'bottom-right,left-center')", max_length=255, null=True)),
                ('auto_escalate_via_sms', models.BooleanField(default=False, help_text='When enabled, new escalations will trigger SMS notifications to agents')),
                ('auto_escalate_every_message', models.BooleanField(default=False, help_text='When enabled, every incoming visitor message will create an escalation for agents to pick up')),
                ('show_watermark', models.BooleanField(default=True, help_text="Show 'Powered by ChatLab' watermark footer in chat widget")),
                ('image_limit', models.IntegerField(default=50, help_text='Maximum total media images the company can upload (0 for unlimited)')),
                ('fb_messenger_enabled', models.BooleanField(default=False, help_text='Enable Facebook Messenger integration')),
                ('fb_verify_token', models.CharField(blank=True, help_text='Facebook Webhook Verification Token', max_length=255, null=True)),
                ('fb_page_id', models.CharField(blank=True, help_text='Facebook Page ID', max_length=255, null=True)),
                ('fb_page_access_token', models.TextField(blank=True, help_text='Facebook Page Access Token', null=True)),
                ('fb_typing_indicator_enabled', models.BooleanField(default=True, help_text="Show typing '...' animation before bot reply in Messenger")),
                ('fb_mark_seen_enabled', models.BooleanField(default=True, help_text="Send 'Seen' checkmark when message is received in Messenger")),
                ('fb_comment_ai_reply', models.BooleanField(default=True, help_text='Automatically reply to Facebook page comments using AI')),
                ('agent_fb_comments_access', models.BooleanField(default=True, help_text='Show Facebook Comments menu to agents')),
                ('whatsapp_enabled', models.BooleanField(default=False, help_text='Enable WhatsApp integration')),
                ('wa_phone_number_id', models.CharField(blank=True, help_text='WhatsApp Phone Number ID', max_length=255, null=True)),
                ('wa_business_account_id', models.CharField(blank=True, help_text='WhatsApp Business Account ID', max_length=255, null=True)),
                ('wa_access_token', models.TextField(blank=True, help_text='WhatsApp Permanent Access Token', null=True)),
                ('sitemap_url', models.URLField(blank=True, help_text='Sitemap XML link for product scraping', max_length=1000, null=True)),
                ('ecom_api_url', models.URLField(blank=True, help_text='Base URL for E-commerce API', max_length=1000, null=True)),
                ('ecom_api_key', models.CharField(blank=True, help_text='Generated API Key for E-commerce', max_length=255, null=True)),
                ('subscription_valid_until', models.DateField(blank=True, help_text='Subscription valid until this date', null=True)),
                ('message_limit', models.IntegerField(default=0, help_text='Message limit (0 for unlimited)')),
                ('message_count', models.IntegerField(default=0, help_text='Total bot messages processed')),
                ('ai_agent_active', models.BooleanField(default=True, help_text='AI agent active for this company')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('ai_model', models.ForeignKey(blank=True, help_text='Select a predefined AI model', null=True, on_delete=django.db.models.deletion.SET_NULL, to='chatapp.aimodel')),
                ('package', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='companies', to='chatapp.package')),
                ('topics', models.ManyToManyField(blank=True, related_name='companies', to='chatapp.topic')),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
                ('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
                ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('role', models.CharField(choices=[('SUPERUSER', 'Superuser'), ('ADMIN', 'Company Admin'), ('AGENT', 'Agent')], default='AGENT', max_length=20)),
                ('agent_name', models.CharField(blank=True, help_text='Display name for agents - appears in chat header', max_length=255, null=True)),
                ('agent_photo', models.ImageField(blank=True, null=True, upload_to='agent_photos/')),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.permission', verbose_name='user permissions')),
                ('company', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='users', to='chatapp.company')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='CompanyMedia',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to=chatapp.models.company_media_path)),
                ('tags', models.TextField(help_text="Comma-separated keywords or taglines (e.g., 'summer menu, drinks')")),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='media_items', to='chatapp.company')),
            ],
        ),
        migrations.CreateModel(
            name='CompanyMediaFile',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to=chatapp.models.company_media_path)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('company_media', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='extra_files', to='chatapp.companymedia')),
            ],
        ),
        migrations.CreateModel(
            name='CustomParameter',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('keyword', models.CharField(help_text='The keyword or phrase to match', max_length=255)),
                ('response', models.TextField(help_text='The fixed response to give when keyword matches')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='custom_parameters', to='chatapp.company')),
            ],
        ),
        migrations.CreateModel(
            name='Escalation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('message', models.TextField()),
                ('visitor_id', models.CharField(blank=True, help_text='Optional ephemeral visitor identifier', max_length=255, null=True)),
                ('is_handled', models.BooleanField(default=False)),
                ('claimed_at', models.DateTimeField(blank=True, null=True)),
                ('agent_last_typing_at', models.DateTimeField(blank=True, help_text='Timestamp when agent was last typing (for UI indicator)', null=True)),
                ('ai_mode_active', models.BooleanField(default=False, help_text='AI mode active for this claimed conversation')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('claimed_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='claimed_escalations', to=settings.AUTH_USER_MODEL)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='escalations', to='chatapp.company')),
            ],
        ),
        migrations.CreateModel(
            name='ChatMessage',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sender', models.CharField(choices=[('visitor', 'Visitor'), ('bot', 'Bot'), ('agent', 'Agent'), ('system', 'System')], max_length=20)),
                ('content', models.TextField(blank=True, null=True)),
                ('visitor_id', models.CharField(blank=True, max_length=255, null=True)),
                ('message_type', models.CharField(choices=[('text', 'Text'), ('image', 'Image'), ('voice', 'Voice'), ('file', 'File')], default='text', max_length=20)),
                ('attachment', models.FileField(blank=True, null=True, upload_to='chat_attachments/%Y/%m/%d/')),
                ('attachment_url', models.URLField(blank=True, max_length=500, null=True)),
                ('meta_message_id', models.CharField(blank=True, help_text='Unique Meta message ID (mid or wamid) for deduplication', max_length=255, null=True, unique=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('delivery_status', models.CharField(choices=[('pending', 'Pending'), ('sent', 'Sent'), ('failed', 'Failed'), ('not_applicable', 'Not Applicable')], default='not_applicable', max_length=20)),
                ('delivery_attempts', models.PositiveIntegerField(default=0)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='messages', to='chatapp.company')),
                ('escalation', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='messages', to='chatapp.escalation')),
            ],
        ),
        migrations.CreateModel(
            name='FacebookComment',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('comment_id', models.CharField(max_length=255, unique=True)),
                ('post_id', models.CharField(max_length=255)),
                ('sender_id', models.CharField(max_length=255)),
                ('sender_name', models.CharField(blank=True, max_length=255, null=True)),
                ('profile_pic', models.URLField(blank=True, max_length=1000, null=True)),
                ('message', models.TextField()),
                ('is_handled', models.BooleanField(default=False)),
                ('ai_reply', models.TextField(blank=True, help_text='AI generated reply text', null=True)),
                ('replied_at', models.DateTimeField(blank=True, help_text='Timestamp when reply was sent', null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='facebook_comments', to='chatapp.company')),
            ],
            options={
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='FAQ',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('question', models.CharField(max_length=255)),
                ('answer', models.TextField()),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='faqs', to='chatapp.company')),
            ],
        ),
        migrations.CreateModel(
            name='Form',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=255)),
                ('keyword', models.CharField(help_text='The keyword or phrase that triggers this form in chat', max_length=255)),
                ('is_shared', models.BooleanField(default=False, help_text='Share form submissions with agents')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='forms', to='chatapp.company')),
            ],
        ),
        migrations.CreateModel(
            name='FormField',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='Label of the field', max_length=255)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('form', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='fields', to='chatapp.form')),
            ],
        ),
        migrations.CreateModel(
            name='FormSession',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('visitor_id', models.CharField(max_length=255)),
                ('current_field_index', models.PositiveIntegerField(default=0)),
                ('answers', models.JSONField(default=dict)),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='chatapp.company')),
                ('form', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='chatapp.form')),
            ],
        ),
        migrations.CreateModel(
            name='FormSubmission',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('visitor_id', models.CharField(blank=True, max_length=255, null=True)),
                ('answers', models.JSONField(default=dict)),
                ('status', models.CharField(choices=[('pending', 'Pending'), ('in_progress', 'In Progress'), ('resolved', 'Resolved'), ('closed', 'Closed')], default='pending', max_length=32)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('form', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='submissions', to='chatapp.form')),
            ],
        ),
        migrations.CreateModel(
            name='IntegrationErrorLog',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('platform', models.CharField(choices=[('facebook', 'Facebook Messenger'), ('whatsapp', 'WhatsApp Business'), ('ai', 'AI Engine (Gemini/OpenAI)')], max_length=20)),
                ('error_type', models.CharField(default='API_ERROR', max_length=100)),
                ('error_message', models.TextField()),
                ('details', models.TextField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='error_logs', to='chatapp.company')),
            ],
            options={
                'ordering': ('-created_at',),
            },
        ),
        migrations.CreateModel(
            name='QuickType',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label', models.CharField(help_text='Short label shown on the button', max_length=150)),
                ('content', models.TextField(help_text='Text to insert/send when the quick type is used')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='quick_types', to='chatapp.company')),
            ],
            options={
                'ordering': ('-created_at',),
            },
        ),
        migrations.CreateModel(
            name='StoreComplaint',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=255)),
                ('description', models.TextField(blank=True)),
                ('customer_name', models.CharField(blank=True, max_length=255, null=True)),
                ('status', models.CharField(choices=[('open', 'Open'), ('in_progress', 'In Progress'), ('resolved', 'Resolved'), ('closed', 'Closed')], default='open', max_length=32)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='store_complaints', to='chatapp.company')),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='created_complaints', to=settings.AUTH_USER_MODEL)),
                ('updated_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='updated_complaints', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Theme',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('preset', models.CharField(choices=[('dark', 'Dark Theme'), ('light', 'Light Theme'), ('custom', 'Custom')], default='dark', max_length=20)),
                ('primary_color', models.CharField(default='#6366f1', help_text='Primary accent color (hex)', max_length=7)),
                ('secondary_color', models.CharField(default='#10b981', help_text='Secondary accent color (hex)', max_length=7)),
                ('background_color', models.CharField(default='#0b0f19', help_text='Main background color (hex)', max_length=7)),
                ('text_primary', models.CharField(default='#f5f5f5', help_text='Primary text color (hex)', max_length=7)),
                ('text_muted', models.CharField(default='#9ca3af', help_text='Muted text color (hex)', max_length=7)),
                ('border_color', models.CharField(default='#374151', help_text='Border color (hex)', max_length=7)),
                ('bot_bubble_bg', models.CharField(default='#1f2937', help_text='Bot message bubble background (hex)', max_length=7)),
                ('user_bubble_bg', models.CharField(default='#6366f1', help_text='User message bubble background (hex)', max_length=7)),
                ('send_button_bg', models.CharField(default='#6366f1', help_text='Send button background color (hex)', max_length=7)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('company', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='theme', to='chatapp.company')),
            ],
            options={
                'ordering': ('-updated_at',),
            },
        ),
        migrations.CreateModel(
            name='VoiceReply',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('keyword', models.CharField(help_text='Keyword or phrase to match (comma-separated keywords supported)', max_length=255)),
                ('audio_file', models.FileField(help_text='Audio file for the voice reply', upload_to='voice_replies/%Y/%m/%d/')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='voice_replies', to='chatapp.company')),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('url', models.URLField(max_length=1000)),
                ('title', models.CharField(blank=True, max_length=500, null=True)),
                ('price', models.CharField(blank=True, max_length=100, null=True)),
                ('brand', models.CharField(blank=True, max_length=255, null=True)),
                ('image_url', models.URLField(blank=True, max_length=1000, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='products', to='chatapp.company')),
            ],
            options={
                'unique_together': {('company', 'url')},
            },
        ),
        migrations.CreateModel(
            name='VisitorSessionTopic',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('visitor_id', models.CharField(max_length=255)),
                ('current_topic', models.CharField(blank=True, max_length=255, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='chatapp.company')),
            ],
            options={
                'unique_together': {('company', 'visitor_id')},
            },
        ),
    ]
