{
    "title": "chat_conversations",
    "type": "object",
    "properties": {
        "id": {
            "type": "integer",
            "description": "Primary key, auto-increment"
        },
        "user_id": {
            "type": "string",
            "description": "Atoms user id of visitor when logged in"
        },
        "whmcs_client_id": {
            "type": "integer",
            "description": "WHMCS client id when linked"
        },
        "visitor_name": {
            "type": "string",
            "description": "Visitor display name"
        },
        "visitor_email": {
            "type": "string",
            "description": "Visitor email"
        },
        "department_id": {
            "type": "integer",
            "description": "FK to support_departments.id"
        },
        "assigned_seat_id": {
            "type": "integer",
            "description": "FK to support_seats.id"
        },
        "status": {
            "type": "string",
            "description": "ai|queued|assigned|resolved|closed"
        },
        "priority": {
            "type": "string",
            "description": "low|normal|high|urgent"
        },
        "sla_due_at": {
            "type": "string",
            "format": "date-time",
            "description": "SLA deadline"
        },
        "linked_whmcs_service_id": {
            "type": "integer",
            "description": "WHMCS service id"
        },
        "linked_whmcs_invoice_id": {
            "type": "integer",
            "description": "WHMCS invoice id"
        },
        "linked_whmcs_domain_id": {
            "type": "integer",
            "description": "WHMCS domain id"
        },
        "linked_ticket_id": {
            "type": "integer",
            "description": "WHMCS ticket id after conversion"
        },
        "ai_summary": {
            "type": "string",
            "description": "AI-generated conversation summary"
        },
        "last_message_at": {
            "type": "string",
            "format": "date-time",
            "description": "Last message timestamp"
        },
        "subject": {
            "type": "string",
            "description": "Conversation subject/topic"
        }
    },
    "required": [
        "id",
        "status",
        "priority"
    ]
}