{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.demiton.io/registers/protection/v1.json",
  "title": "protection contract v1",
  "type": "object",
  "required": [
    "disease",
    "obligation_key",
    "protection_type",
    "ready_state",
    "severity"
  ],
  "properties": {
    "disease": {
      "type": "string",
      "description": "which of the five diseases this protection guards against",
      "enum": [
        "rework",
        "overrun",
        "forfeited_entitlements",
        "disputes",
        "non_compliance"
      ],
      "x-demiton-requiredness": "required"
    },
    "severity": {
      "type": "integer",
      "description": "the contract-risk tier (1-4)",
      "x-demiton-requiredness": "required"
    },
    "ready_state": {
      "type": "string",
      "description": "whether this protection can run today: built_in/record_in_demiton/not_collected are static, from the obligation's own evidence kind; filled/connected_no_data/vendor_gap/needs_type come from readiness_service when the evidence kind is a register",
      "enum": [
        "built_in",
        "record_in_demiton",
        "not_collected",
        "filled",
        "connected_no_data",
        "vendor_gap",
        "needs_type"
      ],
      "x-demiton-requiredness": "required"
    },
    "window_unit": {
      "type": "string",
      "description": "unit of window_value",
      "enum": [
        "hours",
        "days",
        "business_days",
        "working_days",
        "months"
      ],
      "x-demiton-requiredness": "optional"
    },
    "window_value": {
      "type": "number",
      "description": "the resolved window length in window_unit, after decision 5's strictest-wins rule",
      "x-demiton-requiredness": "optional"
    },
    "window_source": {
      "type": "string",
      "description": "which side the resolved window came from",
      "enum": [
        "library",
        "contract"
      ],
      "x-demiton-requiredness": "optional"
    },
    "obligation_key": {
      "type": "string",
      "description": "the obligation this protection runs for",
      "x-demiton-requiredness": "required"
    },
    "protection_type": {
      "type": "string",
      "description": "the engine that runs this protection",
      "enum": [
        "watch",
        "countdown",
        "check",
        "threshold"
      ],
      "x-demiton-requiredness": "required"
    }
  },
  "x-demiton-register-type": "protection",
  "x-demiton-contract-version": "1.0.0",
  "x-demiton-store": "tenant",
  "x-demiton-axes": [],
  "x-demiton-measures": [],
  "x-demiton-provenance": {
    "standards": []
  },
  "description": "The Protection register contract, version 1. JSON Schema (draft 2020-12); x-demiton-* keywords carry Demiton's own meaning and standard validators ignore them.",
  "x-demiton-contract-url": "https://docs.demiton.io/registers/protection/",
  "x-demiton-register-catalog": "https://docs.demiton.io/concepts/register-catalog"
}