# Generated by Django 5.2.4 on 2026-02-12 13:51

import uuid
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("appointments", "0011_featureflag"),
    ]

    operations = [
        migrations.CreateModel(
            name="OutboundMessage",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("channel", models.CharField(max_length=10)),
                ("to", models.CharField(max_length=255)),
                ("subject", models.CharField(blank=True, max_length=255, null=True)),
                (
                    "template_name",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                ("context", models.JSONField(blank=True, null=True)),
                ("message_payload", models.JSONField(blank=True, null=True)),
                (
                    "provider_message_id",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                (
                    "twilio_call_sid",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                (
                    "retell_call_id",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                ("status", models.CharField(default="pending", max_length=20)),
                ("error_message", models.TextField(blank=True, null=True)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("sent_at", models.DateTimeField(blank=True, null=True)),
                ("delivered_at", models.DateTimeField(blank=True, null=True)),
            ],
            options={
                "indexes": [
                    models.Index(
                        fields=["channel", "status"],
                        name="appointment_channel_e40780_idx",
                    ),
                    models.Index(
                        fields=["provider_message_id"],
                        name="appointment_provide_3db1af_idx",
                    ),
                ],
            },
        ),
    ]
