# Generated by Django 5.0.7 on 2024-07-23 17:00

import django.db.models.deletion
import django_jsonform.models.fields
import sage_mailbox.validators
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("sage_mailbox", "0007_alter_mailbox_folder_type"),
    ]

    operations = [
        migrations.DeleteModel(
            name="Inbox",
        ),
        migrations.AlterModelOptions(
            name="archive",
            options={"verbose_name": "Archive", "verbose_name_plural": "Archive"},
        ),
        migrations.AlterModelOptions(
            name="draft",
            options={"verbose_name": "Draft", "verbose_name_plural": "Draft"},
        ),
        migrations.AlterModelOptions(
            name="emailmessage",
            options={
                "default_manager_name": "objects",
                "ordering": ["-date"],
                "permissions": [
                    ("mark_read", "Can mark email as read"),
                    ("mark_unread", "Can mark email as unread"),
                    ("flag_email", "Can flag email"),
                    ("unflag_email", "Can unflag email"),
                    ("forward_email", "Can forward email"),
                    ("reply_email", "Can reply to email"),
                    ("export_email", "Can export email data"),
                    ("download_eml", "Can download email data"),
                ],
                "verbose_name": "Inbox",
                "verbose_name_plural": "Inbox",
            },
        ),
        migrations.AlterModelOptions(
            name="junk",
            options={"verbose_name": "Junk", "verbose_name_plural": "Junk"},
        ),
        migrations.AlterModelOptions(
            name="sent",
            options={"verbose_name": "Sent", "verbose_name_plural": "Sent"},
        ),
        migrations.AlterModelOptions(
            name="trash",
            options={"verbose_name": "Trash", "verbose_name_plural": "Trash"},
        ),
        migrations.AlterField(
            model_name="emailmessage",
            name="bcc_address",
            field=models.TextField(
                blank=True,
                db_comment="List of BCC recipient email addresses, separated by commas.",
                help_text="BCC recipient email addresses (comma-separated).",
                validators=[sage_mailbox.validators.CommaSeparatedEmailValidator()],
                verbose_name="BCC Address",
            ),
        ),
        migrations.AlterField(
            model_name="emailmessage",
            name="cc_address",
            field=models.TextField(
                blank=True,
                db_comment="List of CC recipient email addresses, separated by commas.",
                help_text="CC recipient email addresses (comma-separated).",
                validators=[sage_mailbox.validators.CommaSeparatedEmailValidator()],
                verbose_name="CC Address",
            ),
        ),
        migrations.AlterField(
            model_name="emailmessage",
            name="date",
            field=models.DateTimeField(
                blank=True,
                db_comment="The date the email was sent, in ISO format.",
                help_text="Date the email was sent (ISO format).",
                null=True,
                verbose_name="Date",
            ),
        ),
        migrations.AlterField(
            model_name="emailmessage",
            name="flags",
            field=models.ManyToManyField(
                blank=True,
                db_comment="Flags associated with the email.",
                help_text="Flags associated with the email.",
                to="sage_mailbox.flag",
                verbose_name="Flags",
            ),
        ),
        migrations.AlterField(
            model_name="emailmessage",
            name="from_address",
            field=models.EmailField(
                db_comment="The sender's email address.",
                help_text="Sender's email address.",
                max_length=254,
                verbose_name="From Address",
            ),
        ),
        migrations.AlterField(
            model_name="emailmessage",
            name="headers",
            field=django_jsonform.models.fields.JSONField(
                blank=True,
                db_comment="The email headers in JSON format.",
                help_text="Email headers in JSON format.",
                null=True,
                verbose_name="Headers",
            ),
        ),
        migrations.AlterField(
            model_name="emailmessage",
            name="html_body",
            field=models.TextField(
                db_comment="The HTML body content of the email.",
                help_text="HTML body of the email.",
                verbose_name="HTML Body",
            ),
        ),
        migrations.AlterField(
            model_name="emailmessage",
            name="is_flagged",
            field=models.BooleanField(
                db_comment="Indicates whether the email has been flagged.",
                default=False,
                help_text="Indicates if the email has been flagged.",
                verbose_name="Is Flagged",
            ),
        ),
        migrations.AlterField(
            model_name="emailmessage",
            name="is_read",
            field=models.BooleanField(
                db_comment="Indicates whether the email has been read.",
                default=False,
                help_text="Indicates if the email has been read.",
                verbose_name="Is Read",
            ),
        ),
        migrations.AlterField(
            model_name="emailmessage",
            name="mailbox",
            field=models.ForeignKey(
                db_comment="The mailbox to which this email belongs.",
                help_text="Mailbox to which this email belongs.",
                on_delete=django.db.models.deletion.CASCADE,
                related_name="emails",
                to="sage_mailbox.mailbox",
                verbose_name="Mailbox",
            ),
        ),
        migrations.AlterField(
            model_name="emailmessage",
            name="message_id",
            field=models.CharField(
                blank=True,
                db_comment="Message ID from the email client's header.",
                editable=False,
                help_text="Message ID from the email client's header.",
                max_length=255,
                null=True,
                verbose_name="Message-ID Header",
            ),
        ),
        migrations.AlterField(
            model_name="emailmessage",
            name="plain_body",
            field=models.TextField(
                db_comment="The plain text body content of the email.",
                help_text="Plain text body of the email.",
                verbose_name="Plain Body",
            ),
        ),
        migrations.AlterField(
            model_name="emailmessage",
            name="raw",
            field=models.BinaryField(
                blank=True,
                db_comment="The raw binary data of the email.",
                help_text="Raw binary data of the email.",
                null=True,
                verbose_name="Raw Email Data",
            ),
        ),
        migrations.AlterField(
            model_name="emailmessage",
            name="subject",
            field=models.CharField(
                db_comment="The subject of the email.",
                help_text="Subject of the email.",
                max_length=255,
                verbose_name="Subject",
            ),
        ),
        migrations.AlterField(
            model_name="emailmessage",
            name="to_address",
            field=models.TextField(
                db_comment="List of recipient email addresses, separated by commas.",
                help_text="Recipient email addresses (comma-separated).",
                validators=[sage_mailbox.validators.CommaSeparatedEmailValidator()],
                verbose_name="To Address",
            ),
        ),
        migrations.AlterField(
            model_name="emailmessage",
            name="uid",
            field=models.IntegerField(
                blank=True,
                db_comment="IMAP Server Unique Identifier (UID).",
                help_text="Unique identifier of the IMAP server.",
                null=True,
                verbose_name="IMAP UID",
            ),
        ),
    ]
