{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://kit.tenhaw.com/schemas/opmodel.schema.json",
  "type": "object",
  "properties": {
    "teams": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "type": {
            "type": "string",
            "enum": [
              "stream-aligned",
              "platform",
              "enabling",
              "complicated-subsystem"
            ]
          },
          "size": {
            "type": "integer",
            "minimum": 1
          },
          "cognitiveLoad": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "platformDependencies": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "required": [
          "id",
          "name",
          "type",
          "size"
        ],
        "additionalProperties": false
      }
    },
    "okrs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "objective": {
            "type": "string",
            "minLength": 1
          },
          "teamId": {
            "type": "string",
            "minLength": 1
          },
          "keyResults": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "description": {
                  "type": "string",
                  "minLength": 1
                },
                "baseline": {
                  "type": "number"
                },
                "target": {
                  "type": "number"
                },
                "current": {
                  "type": "number"
                },
                "confidence": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                }
              },
              "required": [
                "id",
                "description",
                "baseline",
                "target",
                "current",
                "confidence"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "objective",
          "keyResults"
        ],
        "additionalProperties": false
      }
    },
    "roadmap": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "title": {
            "type": "string",
            "minLength": 1
          },
          "horizon": {
            "type": "string",
            "enum": [
              "now",
              "next",
              "later"
            ]
          },
          "outcome": {
            "type": "string"
          },
          "teamId": {
            "type": "string",
            "minLength": 1
          },
          "okrId": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "id",
          "title",
          "horizon"
        ],
        "additionalProperties": false
      }
    },
    "interactions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "minLength": 1
          },
          "to": {
            "type": "string",
            "minLength": 1
          },
          "mode": {
            "type": "string",
            "enum": [
              "collaboration",
              "X-as-a-Service",
              "facilitating"
            ]
          }
        },
        "required": [
          "from",
          "to",
          "mode"
        ],
        "additionalProperties": false
      }
    },
    "products": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "teams"
  ],
  "additionalProperties": false
}
