# Generated by Django 4.2.16 on 2024-12-04 11:56

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Delay',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('destination', models.EmailField(max_length=254)),
                ('delay_type', models.CharField(blank=True, max_length=50, null=True)),
                ('delay', models.JSONField()),
                ('mail', models.JSONField()),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Date updated')),
                ('created', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Date created')),
                ('count', models.IntegerField(default=1)),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='email_delays', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-created',),
            },
        ),
        migrations.CreateModel(
            name='Complaint',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('destination', models.EmailField(max_length=254)),
                ('complaint_type', models.CharField(blank=True, max_length=50, null=True)),
                ('complaint', models.JSONField()),
                ('mail', models.JSONField()),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Date updated')),
                ('created', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Date created')),
                ('count', models.IntegerField(default=1)),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='email_complaints', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-created',),
            },
        ),
        migrations.CreateModel(
            name='Bounce',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('destination', models.EmailField(max_length=254)),
                ('bounce_type', models.CharField(blank=True, max_length=50, null=True)),
                ('bounce_sub_type', models.CharField(blank=True, max_length=50, null=True)),
                ('bounce', models.JSONField()),
                ('mail', models.JSONField()),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Date updated')),
                ('created', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Date created')),
                ('count', models.IntegerField(default=1)),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='email_bounces', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-created',),
            },
        ),
        migrations.AddConstraint(
            model_name='delay',
            constraint=models.UniqueConstraint(fields=('destination', 'delay_type'), name='unique_delay'),
        ),
        migrations.AddConstraint(
            model_name='complaint',
            constraint=models.UniqueConstraint(fields=('destination', 'complaint_type'), name='unique_complaint'),
        ),
        migrations.AddConstraint(
            model_name='bounce',
            constraint=models.UniqueConstraint(fields=('destination', 'bounce_type', 'bounce_sub_type'), name='unique_bounce'),
        ),
    ]
