{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://abcs.sirvisetti.com/schemas/objects/service/customer-case.schema.json",
  "title": "ABCS Customer Case",
  "type": "object",
  "additionalProperties": false,
  "required": ["number", "provider", "summary", "status"],
  "properties": {
    "number": {"type": "string", "minLength": 1},
    "provider": {"$ref": "../../common/party-reference.schema.json"},
    "customer": {"$ref": "../../common/business-object-reference.schema.json"},
    "requester": {"$ref": "../../common/party-reference.schema.json"},
    "summary": {"type": "string", "minLength": 1},
    "description": {"type": "string"},
    "priority": {"type": "string", "enum": ["low", "normal", "high", "critical"]},
    "assignedTo": {"$ref": "../../common/party-reference.schema.json"},
    "resolution": {"type": "string"},
    "openedAt": {"type": "string", "format": "date-time"},
    "resolvedAt": {"type": "string", "format": "date-time"},
    "closedAt": {"type": "string", "format": "date-time"},
    "status": {
      "type": "object",
      "additionalProperties": false,
      "required": ["lifecycle", "assignment"],
      "properties": {
        "lifecycle": {"type": "string", "enum": ["open", "in-progress", "resolved", "closed", "cancelled"]},
        "assignment": {"type": "string", "enum": ["unassigned", "assigned"]}
      }
    }
  }
}
