from django.utils.translation import gettext_lazy as _
from drf_spectacular.utils import OpenApiParameter

from engine.vibes_auth.messaging.serializers import (
    StaffInboxEventSerializer,
    ThreadOkResponseSerializer,
    ThreadReplyRequestSerializer,
    UserMessageRequestSerializer,
    UserMessageResponseSerializer,
)

USER_MESSAGE_CONSUMER_SCHEMA = {
    "tags": [
        "messaging",
    ],
    "type": "send",
    "summary": _("User messages entrypoint"),
    "description": _(
        "Anonymous or authenticated non-staff users send messages. Also supports action=ping."
    ),
    "request": UserMessageRequestSerializer,
    "responses": UserMessageResponseSerializer,
}

STAFF_INBOX_CONSUMER_SCHEMA = {
    "tags": [
        "messaging",
    ],
    "type": "send",
    "summary": _("Staff inbox control"),
    "description": _(
        "Staff-only actions: list_open, assign, reply, close, ping. Unified event payloads are emitted."
    ),
    "request": StaffInboxEventSerializer,
    "responses": StaffInboxEventSerializer,
}

THREAD_CONSUMER_SCHEMA = {
    "tags": [
        "messaging",
    ],
    "type": "send",
    "summary": _("Per-thread staff channel"),
    "description": _("Reply, close, and ping within a specific thread."),
    "parameters": [OpenApiParameter(name="thread_id")],
    "request": ThreadReplyRequestSerializer,
    "responses": ThreadOkResponseSerializer,
}
