{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://vinquery.com/schemas/decisioq/7.6.3/prepared-decision-request.schema.json",
  "title": "DecisioQ Prepared Decision Request",
  "type": "object",
  "additionalProperties": false,
  "required": ["decisionId", "options"],
  "properties": {
    "decisionId": { "type": "string", "minLength": 1 },
    "profileId": { "type": ["string", "null"] },
    "scenarioId": { "type": ["string", "null"] },
    "requestContext": { "type": ["object", "null"] },
    "options": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": ["name"],
        "properties": {
          "optionId": { "type": "string" },
          "name": { "type": "string", "minLength": 1 },
          "values": { "type": "object", "additionalProperties": { "type": "number" } },
          "scores": { "type": "object", "additionalProperties": { "type": "number" } }
        },
        "anyOf": [{ "required": ["values"] }, { "required": ["scores"] }]
      }
    },
    "runSensitivity": { "type": "boolean" },
    "algorithm": { "type": "string" },
    "weightStrategy": { "type": "string" },
    "constraintOverrides": { "type": "array" }
  }
}
