# Generated by Django 5.2.4 on 2025-07-21 13:30

import django.core.validators
import django.db.models.deletion
import django.utils.timezone
import uuid
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='Configuration',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, help_text='Timestamp when this object was created', verbose_name='Created At')),
                ('updated_at', models.DateTimeField(auto_now=True, help_text='Timestamp when this object was last modified', verbose_name='Updated At')),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, help_text='Unique identifier for this object', primary_key=True, serialize=False)),
                ('is_deleted', models.BooleanField(default=False, help_text='Whether this object has been soft-deleted', verbose_name='Is Deleted')),
                ('deleted_at', models.DateTimeField(blank=True, help_text='Timestamp when this object was soft-deleted', null=True, verbose_name='Deleted At')),
                ('key', models.CharField(help_text='Unique configuration key', max_length=100, unique=True, validators=[django.core.validators.RegexValidator(message='Key must be uppercase with underscores only', regex='^[A-Z_][A-Z0-9_]*$')], verbose_name='Key')),
                ('value', models.TextField(help_text='Configuration value', verbose_name='Value')),
                ('description', models.TextField(blank=True, help_text='Description of this configuration setting', verbose_name='Description')),
                ('is_sensitive', models.BooleanField(default=False, help_text='Whether this configuration contains sensitive data', verbose_name='Is Sensitive')),
                ('config_type', models.CharField(choices=[('string', 'String'), ('integer', 'Integer'), ('float', 'Float'), ('boolean', 'Boolean'), ('json', 'JSON'), ('list', 'List')], default='string', help_text='Type of configuration value', max_length=20, verbose_name='Type')),
                ('created_by', models.ForeignKey(blank=True, help_text='User who created this object', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)s_created', to=settings.AUTH_USER_MODEL, verbose_name='Created By')),
                ('deleted_by', models.ForeignKey(blank=True, help_text='User who soft-deleted this object', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)s_deleted', to=settings.AUTH_USER_MODEL, verbose_name='Deleted By')),
                ('updated_by', models.ForeignKey(blank=True, help_text='User who last modified this object', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)s_updated', to=settings.AUTH_USER_MODEL, verbose_name='Updated By')),
            ],
            options={
                'verbose_name': 'Configuration',
                'verbose_name_plural': 'Configurations',
                'ordering': ['key'],
            },
        ),
        migrations.CreateModel(
            name='Newsletter',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, help_text='Timestamp when this object was created', verbose_name='Created At')),
                ('updated_at', models.DateTimeField(auto_now=True, help_text='Timestamp when this object was last modified', verbose_name='Updated At')),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, help_text='Unique identifier for this object', primary_key=True, serialize=False)),
                ('email', models.EmailField(help_text='Email address of the subscriber', max_length=254, unique=True, verbose_name='Email')),
                ('is_subscribed', models.BooleanField(default=True, help_text='Whether the subscriber is currently subscribed', verbose_name='Is Subscribed')),
                ('subscribed_at', models.DateTimeField(default=django.utils.timezone.now, help_text='Date and time when the subscriber subscribed', verbose_name='Subscribed At')),
                ('unsubscribed_at', models.DateTimeField(blank=True, help_text='Date and time when the subscriber unsubscribed', null=True, verbose_name='Unsubscribed At')),
                ('ip_address', models.GenericIPAddressField(blank=True, help_text='IP address of the subscriber', null=True, verbose_name='IP Address')),
                ('user_agent', models.TextField(blank=True, help_text='User agent of the subscriber', verbose_name='User Agent')),
                ('source', models.CharField(default='website', help_text='Source of subscription (website, api, etc.)', max_length=50, verbose_name='Source')),
            ],
            options={
                'verbose_name': 'Newsletter Subscription',
                'verbose_name_plural': 'Newsletter Subscriptions',
                'ordering': ['-subscribed_at'],
                'indexes': [models.Index(fields=['email'], name='core_newsle_email_13575a_idx'), models.Index(fields=['is_subscribed'], name='core_newsle_is_subs_2cd8ed_idx'), models.Index(fields=['subscribed_at'], name='core_newsle_subscri_77cd11_idx')],
            },
        ),
        migrations.CreateModel(
            name='ContactMessage',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, help_text='Timestamp when this object was created', verbose_name='Created At')),
                ('updated_at', models.DateTimeField(auto_now=True, help_text='Timestamp when this object was last modified', verbose_name='Updated At')),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, help_text='Unique identifier for this object', 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')],
            },
        ),
    ]
