# Generated by Django 5.2.8 on 2025-12-06 15:03

from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("chats", "0002_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="WhatsAppChatBridge",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_seed_data", models.BooleanField(default=False, editable=False)),
                ("is_user_data", models.BooleanField(default=False, editable=False)),
                ("is_deleted", models.BooleanField(default=False, editable=False)),
                (
                    "is_enabled",
                    models.BooleanField(
                        default=True,
                        help_text="Disable to stop forwarding chat messages to this bridge.",
                    ),
                ),
                (
                    "is_default",
                    models.BooleanField(
                        default=False,
                        help_text="Use as the fallback bridge when no site-specific configuration is defined.",
                    ),
                ),
                (
                    "api_base_url",
                    models.URLField(
                        default="https://graph.facebook.com/v18.0",
                        help_text="Base URL for the Meta Graph API.",
                    ),
                ),
                (
                    "phone_number_id",
                    models.CharField(
                        help_text="Identifier of the WhatsApp phone number used for delivery.",
                        max_length=64,
                        verbose_name="Phone Number ID",
                    ),
                ),
                (
                    "access_token",
                    models.TextField(
                        help_text="Meta access token used to authenticate Graph API requests."
                    ),
                ),
                (
                    "avatars",
                    models.ManyToManyField(
                        blank=True,
                        help_text="Avatars allowed to use this bridge.",
                        related_name="%(app_label)s_%(class)s_bridges",
                        to="chats.chatavatar",
                    ),
                ),
            ],
            options={
                "verbose_name": "WhatsApp Chat Bridge",
                "verbose_name_plural": "WhatsApp Chat Bridges",
                "db_table": "pages_whatsappchatbridge",
                "ordering": ["site__domain", "pk"],
            },
        ),
    ]
