{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "MINT cohort definition registry 0.1.0",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "catalogId",
    "version",
    "scope",
    "records"
  ],
  "properties": {
    "catalogId": {
      "const": "mint-shadow-cohorts"
    },
    "version": {
      "const": "0.1.0"
    },
    "scope": {
      "const": "definition-discovery"
    },
    "records": {
      "type": "array",
      "minItems": 12,
      "maxItems": 12,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "version",
          "name",
          "assetStructure",
          "definition",
          "aliases",
          "legacyIds",
          "evidenceToInspect",
          "decisionQuestion",
          "entryRule",
          "exclusionRule",
          "amountRule",
          "releaseRule",
          "referenceScenario",
          "sourceRefs",
          "assetStructureAliases"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z]+(?:-[a-z]+)*$"
          },
          "version": {
            "const": "0.1.0"
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "assetStructure": {
            "type": "string",
            "minLength": 1
          },
          "definition": {
            "type": "string",
            "minLength": 1
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "uniqueItems": true
          },
          "legacyIds": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "shadowDashboard"
            ],
            "properties": {
              "shadowDashboard": {
                "type": "string",
                "pattern": "^0[1-9]$|^1[0-2]$"
              }
            }
          },
          "evidenceToInspect": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "decisionQuestion": {
            "type": "string",
            "minLength": 1
          },
          "entryRule": {
            "type": "null"
          },
          "exclusionRule": {
            "type": "null"
          },
          "amountRule": {
            "type": "null"
          },
          "releaseRule": {
            "type": "null"
          },
          "referenceScenario": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "nextReleaseEvent",
              "sourceId"
            ],
            "properties": {
              "nextReleaseEvent": {
                "type": "string",
                "minLength": 1
              },
              "sourceId": {
                "const": "shadow-dashboard"
              }
            }
          },
          "sourceRefs": {
            "type": "array",
            "minItems": 2,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "sourceId",
                "sha256",
                "startLine",
                "endLine"
              ],
              "properties": {
                "sourceId": {
                  "type": "string",
                  "minLength": 1
                },
                "sha256": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                },
                "startLine": {
                  "type": "integer",
                  "minimum": 1
                },
                "endLine": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "assetStructureAliases": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "uniqueItems": true
          }
        }
      }
    }
  }
}
