# Generated by Django 6.0.3 on 2026-03-10 08:06

import django.db.models.deletion
import uuid
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Notification',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('is_active', models.BooleanField(db_index=True, default=True)),
                ('channel', models.CharField(choices=[('email', 'Email'), ('sms', 'SMS'), ('push', 'Push'), ('whatsapp', 'WhatsApp')], max_length=20)),
                ('recipient', models.CharField(max_length=255)),
                ('subject', models.CharField(blank=True, max_length=512)),
                ('message', models.TextField(blank=True)),
                ('status', models.CharField(choices=[('pending', 'Pending'), ('sent', 'Sent'), ('failed', 'Failed')], db_index=True, default='pending', max_length=20)),
                ('provider', models.CharField(blank=True, max_length=100)),
                ('sent_at', models.DateTimeField(blank=True, null=True)),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='notifications', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='NotificationTemplate',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('channel', models.CharField(max_length=20)),
                ('code', models.CharField(db_index=True, max_length=100, unique=True)),
                ('subject_template', models.CharField(blank=True, max_length=512)),
                ('body_template', models.TextField(blank=True)),
                ('is_active', models.BooleanField(db_index=True, default=True)),
            ],
            options={
                'indexes': [models.Index(fields=['code'], name='notificatio_code_ffac41_idx'), models.Index(fields=['channel'], name='notificatio_channel_ba807a_idx')],
            },
        ),
    ]
