# Generated by Django 4.2.15 on 2025-07-14 10:31

from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import uuid


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('core', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Newsletter',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, help_text='Date and time when the record was created', verbose_name='Created At')),
                ('updated_at', models.DateTimeField(auto_now=True, help_text='Date and time when the record was last updated', verbose_name='Updated At')),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, help_text='Unique identifier for this record', primary_key=True, serialize=False)),
                ('email', models.EmailField(help_text='Email address for newsletter subscription', max_length=254, unique=True, validators=[django.core.validators.EmailValidator()])),
                ('first_name', models.CharField(blank=True, max_length=100)),
                ('last_name', models.CharField(blank=True, max_length=100)),
                ('is_subscribed', models.BooleanField(default=True)),
                ('subscribed_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('unsubscribed_at', models.DateTimeField(blank=True, null=True)),
                ('ip_address', models.GenericIPAddressField(blank=True, null=True)),
                ('user_agent', models.TextField(blank=True)),
                ('source', models.CharField(default='website', help_text='Source of subscription (website, api, etc.)', max_length=50)),
            ],
            options={
                'db_table': 'newsletter_subscriptions',
                'ordering': ['-subscribed_at'],
                'indexes': [models.Index(fields=['email'], name='newsletter__email_71b1f8_idx'), models.Index(fields=['is_subscribed'], name='newsletter__is_subs_b52e2d_idx'), models.Index(fields=['subscribed_at'], name='newsletter__subscri_497fe4_idx')],
            },
        ),
        migrations.CreateModel(
            name='ContactMessage',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, help_text='Date and time when the record was created', verbose_name='Created At')),
                ('updated_at', models.DateTimeField(auto_now=True, help_text='Date and time when the record was last updated', verbose_name='Updated At')),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, help_text='Unique identifier for this record', primary_key=True, serialize=False)),
                ('name', models.CharField(help_text='Full name of the person', max_length=100)),
                ('email', models.EmailField(max_length=254, validators=[django.core.validators.EmailValidator()])),
                ('phone', models.CharField(blank=True, max_length=20)),
                ('company', models.CharField(blank=True, max_length=100)),
                ('subject', models.CharField(max_length=200)),
                ('message', models.TextField()),
                ('status', models.CharField(choices=[('NEW', 'New'), ('READ', 'Read'), ('REPLIED', 'Replied'), ('CLOSED', 'Closed'), ('SPAM', 'Spam')], default='NEW', max_length=20)),
                ('priority', models.CharField(choices=[('LOW', 'Low'), ('MEDIUM', 'Medium'), ('HIGH', 'High'), ('URGENT', 'Urgent')], default='MEDIUM', max_length=20)),
                ('responded_at', models.DateTimeField(blank=True, null=True)),
                ('response_message', models.TextField(blank=True)),
                ('ip_address', models.GenericIPAddressField(blank=True, null=True)),
                ('user_agent', models.TextField(blank=True)),
                ('source', models.CharField(default='website', help_text='Source of contact (website, api, etc.)', max_length=50)),
                ('is_newsletter_signup', models.BooleanField(default=False, help_text='Whether the user also wants to subscribe to newsletter')),
                ('responded_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='responded_messages', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'contact_messages',
                'ordering': ['-created_at'],
                'indexes': [models.Index(fields=['email'], name='contact_mes_email_a7fb56_idx'), models.Index(fields=['status'], name='contact_mes_status_31d23b_idx'), models.Index(fields=['priority'], name='contact_mes_priorit_684e65_idx'), models.Index(fields=['created_at'], name='contact_mes_created_eb3e69_idx')],
            },
        ),
    ]
