# Generated by Django 4.2.30 on 2026-04-08 12:53

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('core', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='SMSCampaign',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='Internal name for this campaign', max_length=150)),
                ('message_body', models.TextField()),
                ('scheduled_at', models.DateTimeField(blank=True, null=True)),
                ('status', models.CharField(choices=[('DRAFT', 'Draft'), ('QUEUED', 'Queued'), ('SENDING', 'Sending'), ('SENT', 'Sent'), ('FAILED', 'Failed')], default='DRAFT', max_length=15)),
                ('total_cost', models.DecimalField(decimal_places=2, default=0.0, max_digits=10)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('recipient_groups', models.ManyToManyField(blank=True, to='core.contactgroup')),
                ('recipients', models.ManyToManyField(blank=True, to='core.contact')),
            ],
        ),
        migrations.CreateModel(
            name='SMSMessage',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('message_body', models.TextField()),
                ('at_message_id', models.CharField(blank=True, help_text="Africa's Talking Message ID", max_length=100, null=True)),
                ('status', models.CharField(choices=[('PENDING', 'Pending'), ('SENT', 'Sent'), ('DELIVERED', 'Delivered'), ('FAILED', 'Failed')], default='PENDING', max_length=15)),
                ('cost', models.DecimalField(decimal_places=2, default=0.0, max_digits=10)),
                ('sent_at', models.DateTimeField(auto_now_add=True)),
                ('delivered_at', models.DateTimeField(blank=True, null=True)),
                ('campaign', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='messages', to='sms.smscampaign')),
                ('contact', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sms_messages', to='core.contact')),
            ],
        ),
    ]
