{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://abcs.sirvisetti.com/schemas/objects/service/service-request.schema.json",
  "title": "ABCS Service Request",
  "type": "object",
  "additionalProperties": false,
  "required": ["number", "provider", "requestedService", "status"],
  "properties": {
    "number": {"type": "string", "minLength": 1},
    "provider": {"$ref": "../../common/party-reference.schema.json"},
    "requester": {"$ref": "../../common/party-reference.schema.json"},
    "requestedService": {"type": "string", "minLength": 1},
    "description": {"type": "string"},
    "requestedAt": {"type": "string", "format": "date-time"},
    "requestedFor": {"type": "string", "format": "date-time"},
    "assignedTo": {"$ref": "../../common/party-reference.schema.json"},
    "completedAt": {"type": "string", "format": "date-time"},
    "status": {
      "type": "object",
      "additionalProperties": false,
      "required": ["lifecycle", "assignment"],
      "properties": {
        "lifecycle": {"type": "string", "enum": ["draft", "submitted", "accepted", "in-progress", "completed", "rejected", "cancelled"]},
        "assignment": {"type": "string", "enum": ["unassigned", "assigned"]}
      }
    }
  }
}
