# Generated by Django 5.2.8 on 2025-12-01 20:29

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('platform_admin', '0006_subscriptionplan_is_most_popular_and_more'),
    ]

    operations = [
        migrations.CreateModel(
            name='PlatformEmailAddress',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('display_name', models.CharField(help_text="Display name (e.g., 'Support', 'Billing', 'Sales')", max_length=100)),
                ('local_part', models.CharField(help_text='Local part of email address (before @)', max_length=64)),
                ('domain', models.CharField(choices=[('smoothschedule.com', 'smoothschedule.com'), ('talova.net', 'talova.net')], default='smoothschedule.com', help_text='Email domain', max_length=50)),
                ('color', models.CharField(default='#3b82f6', help_text='Hex color code for visual identification', max_length=7)),
                ('password', models.CharField(help_text='Password for the email account (stored encrypted, synced to mail server)', max_length=255)),
                ('is_active', models.BooleanField(default=True, help_text='Whether this email address is active')),
                ('is_default', models.BooleanField(default=False, help_text='Default email for platform support')),
                ('mail_server_synced', models.BooleanField(default=False, help_text='Whether the account exists on the mail server')),
                ('last_sync_error', models.TextField(blank=True, default='', help_text='Last sync error message, if any')),
                ('last_synced_at', models.DateTimeField(blank=True, help_text='When this account was last synced to the mail server', null=True)),
                ('emails_processed_count', models.IntegerField(default=0, help_text='Total number of emails processed for this address')),
                ('last_check_at', models.DateTimeField(blank=True, help_text='When emails were last checked for this address', null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'Platform Email Address',
                'verbose_name_plural': 'Platform Email Addresses',
                'ordering': ['-is_default', 'display_name'],
                'unique_together': {('local_part', 'domain')},
            },
        ),
    ]
