{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nopaque-co-uk/json-schema/nopaque-co-uk-support-ticket-detail-schema.json",
  "title": "SupportTicketDetail",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nopaque-co-uk-support-api-openapi.yml#/components/schemas/SupportTicketDetail",
  "allOf": [
    {
      "$ref": "#/$defs/SupportTicketSummary"
    },
    {
      "type": "object",
      "required": [
        "createdBy"
      ],
      "properties": {
        "createdBy": {
          "type": "string",
          "description": "The user id of the person who raised it. Always present."
        },
        "createdByEmail": {
          "type": "string",
          "description": "The email address of the person who raised it. OMITTED when nopaque does not\nhold one, which is the common case today — never an empty string. Use\n`createdBy` as the identifier.\n"
        }
      }
    }
  ],
  "$defs": {
    "SupportTicketSummary": {
      "type": "object",
      "description": "A ticket as it appears in a list. DELIBERATELY carries no due date, no countdown and\nno breach flag: service-level state is internal to nopaque (design D-5). What the\nplan promises is published with the plan.\n",
      "required": [
        "ticketId",
        "subject",
        "status",
        "severity",
        "createdAt",
        "updatedAt",
        "messageCount"
      ],
      "properties": {
        "ticketId": {
          "type": "string",
          "description": "Opaque id. Use it on the detail and reply operations."
        },
        "subject": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "open",
            "awaiting_customer",
            "resolved"
          ],
          "description": "`awaiting_customer` means nopaque is waiting on you. Replying moves it back to\n`open`, and so does replying to a `resolved` one.\n"
        },
        "severity": {
          "type": "string",
          "enum": [
            "p1",
            "p2",
            "p3"
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "lastMessageAt": {
          "type": "string",
          "format": "date-time",
          "description": "When the newest message on the thread was posted. Absent until there is one."
        },
        "messageCount": {
          "type": "integer",
          "description": "Messages on the thread. The ticket's own opening text is not one of them."
        }
      }
    }
  }
}