# Generated by Django 2.2 on 2023-05-03 13:14

import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import wcd_envoyer.const
import wcd_envoyer.utils.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='ChannelConfig',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Updated at')),
                ('channel', wcd_envoyer.utils.models.DynamicChoicesField(choices=[], max_length=512, unique=True, verbose_name='Channel')),
                ('data', django.contrib.postgres.fields.jsonb.JSONField(default=dict, verbose_name='Data')),
            ],
            options={
                'verbose_name': 'Channel config',
                'verbose_name_plural': 'Channel configs',
            },
        ),
        migrations.CreateModel(
            name='Message',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Updated at')),
                ('status', models.CharField(choices=[('010-new', 'New'), ('030-pending', 'Pending'), ('060-sent', 'Sent'), ('080-failed', 'Failed')], default=wcd_envoyer.const.MessageStatus('010-new'), max_length=512, verbose_name='Status')),
                ('channel', wcd_envoyer.utils.models.DynamicChoicesField(choices=[], max_length=512, verbose_name='Channel')),
                ('event', wcd_envoyer.utils.models.DynamicChoicesField(choices=[], max_length=512, verbose_name='Event')),
                ('recipients', django.contrib.postgres.fields.jsonb.JSONField(default=list, verbose_name='Recipients')),
                ('data', django.contrib.postgres.fields.jsonb.JSONField(default=dict, verbose_name='Data')),
            ],
            options={
                'verbose_name': 'Message',
                'verbose_name_plural': 'Messages',
            },
        ),
        migrations.CreateModel(
            name='Template',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Updated at')),
                ('channel', wcd_envoyer.utils.models.DynamicChoicesField(choices=[], max_length=512, verbose_name='Channel')),
                ('event', wcd_envoyer.utils.models.DynamicChoicesField(choices=[], max_length=512, verbose_name='Event')),
                ('data', django.contrib.postgres.fields.jsonb.JSONField(default=dict, verbose_name='Data')),
                ('is_active', models.BooleanField(default=False, verbose_name='Is active')),
            ],
            options={
                'verbose_name': 'Template',
                'verbose_name_plural': 'Templates',
                'unique_together': {('channel', 'event')},
            },
        ),
    ]
