# Generated by Django 5.2.6 on 2026-01-23 16:25

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='MailAutomation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Created At')),
                ('is_active', models.BooleanField(default=True, verbose_name='Is Active')),
                ('title', models.CharField(max_length=256, unique=True)),
                ('method_title', models.CharField(editable=False, max_length=100)),
                ('model', models.CharField(choices=[], max_length=100)),
                ('mail_to', models.TextField(verbose_name='Mail to/Notify to')),
                ('mail_details', models.CharField(help_text='Fill mail template details(reciever/instance, `self` will be the person who trigger the automation)', max_length=250)),
                ('mail_detail_choice', models.TextField(default='', editable=False)),
                ('trigger', models.CharField(choices=[('on_create', 'On Create'), ('on_update', 'On Update'), ('on_delete', 'On Delete')], max_length=10)),
                ('delivery_channel', models.CharField(choices=[('email', 'Send as Email'), ('notification', 'Send as Notification'), ('both', 'Send as Email and Notification')], default='email', max_length=50, verbose_name='Choose Delivary Channel')),
                ('condition_html', models.TextField(editable=False, null=True)),
                ('condition_querystring', models.TextField(editable=False, null=True)),
                ('condition', models.TextField()),
                ('also_sent_to', models.ManyToManyField(blank=True, to='employee.employee', verbose_name='Also Send to')),
                ('created_by', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='Created By')),
                ('mail_template', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='base.horillamailtemplate')),
                ('modified_by', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)s_modified_by', to=settings.AUTH_USER_MODEL, verbose_name='Modified By')),
                ('template_attachments', models.ManyToManyField(blank=True, related_name='template_attachment', to='base.horillamailtemplate')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
