{
  "$defs": {
    "BackupCadence": {
      "description": "Backup cadence.",
      "enum": [
        "continuous",
        "every_fifteen_minutes",
        "hourly",
        "daily",
        "weekly",
        "monthly"
      ],
      "type": "string"
    },
    "DrStatus": {
      "description": "Plan lifecycle.",
      "enum": [
        "draft",
        "approved",
        "in_revision",
        "retired"
      ],
      "type": "string"
    },
    "DrTest": {
      "description": "DR test record.",
      "properties": {
        "conducted_on": {
          "$ref": "#/$defs/IsoDate"
        },
        "findings": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "measured_rpo_minutes": {
          "description": "Measured RPO (minutes) during the test.",
          "format": "double",
          "type": "number"
        },
        "measured_rto_hours": {
          "description": "Measured RTO (hours) during the test.",
          "format": "double",
          "type": "number"
        },
        "outcome": {
          "$ref": "#/$defs/DrTestOutcome"
        },
        "report_ref": {
          "anyOf": [
            {
              "$ref": "#/$defs/PathRef"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "conducted_on",
        "measured_rto_hours",
        "measured_rpo_minutes",
        "outcome",
        "findings"
      ],
      "type": "object"
    },
    "DrTestOutcome": {
      "description": "DR test outcome.",
      "enum": [
        "passed",
        "passed_with_observations",
        "failed"
      ],
      "type": "string"
    },
    "IsoDate": {
      "description": "ISO 8601 date (YYYY-MM-DD).",
      "format": "date",
      "type": "string"
    },
    "PathRef": {
      "description": "Path-based cross-reference relative to .corpospec/ root.\nPattern: `^[a-z0-9_-]+(/[a-z0-9_.-]+)+$`",
      "pattern": "^[a-z0-9_-]+(/[a-z0-9_.-]+)+$",
      "type": "string"
    },
    "StandbyStrategy": {
      "description": "Standby strategy.",
      "oneOf": [
        {
          "const": "active_active",
          "description": "Active-active across regions.",
          "type": "string"
        },
        {
          "const": "active_passive_auto",
          "description": "Active-passive with automated failover.",
          "type": "string"
        },
        {
          "const": "active_passive_manual",
          "description": "Active-passive with manual failover.",
          "type": "string"
        },
        {
          "const": "warm_standby",
          "description": "Warm standby (data current, capacity needs scale-up).",
          "type": "string"
        },
        {
          "const": "cold_standby",
          "description": "Cold standby (backups only).",
          "type": "string"
        },
        {
          "const": "backup_only",
          "description": "Backup-only (no standby infrastructure).",
          "type": "string"
        }
      ]
    }
  },
  "$id": "https://corpospec.com/schemas/v0.16.0/disaster-recovery-plan.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Disaster-recovery plan.",
  "properties": {
    "backup_cadence": {
      "$ref": "#/$defs/BackupCadence"
    },
    "bcp_ref": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "PathRef to the parent BCP."
    },
    "control_basis": {
      "type": "string"
    },
    "effective_from": {
      "$ref": "#/$defs/IsoDate"
    },
    "entity": {
      "$ref": "#/$defs/PathRef"
    },
    "failover_runbook": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "PathRef to failover runbook."
    },
    "id": {
      "$ref": "#/$defs/PathRef"
    },
    "next_review_due": {
      "$ref": "#/$defs/IsoDate"
    },
    "owner": {
      "$ref": "#/$defs/PathRef"
    },
    "rpo_target_minutes": {
      "description": "Target RPO (minutes).",
      "format": "double",
      "type": "number"
    },
    "rto_target_hours": {
      "description": "Target RTO (hours).",
      "format": "double",
      "type": "number"
    },
    "standby_locations": {
      "description": "Standby site / region (e.g. \"AWS eu-central-1\" + \"eu-west-1\").",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "standby_strategy": {
      "$ref": "#/$defs/StandbyStrategy"
    },
    "status": {
      "$ref": "#/$defs/DrStatus"
    },
    "system": {
      "$ref": "#/$defs/PathRef",
      "description": "PathRef to the system covered."
    },
    "tests": {
      "items": {
        "$ref": "#/$defs/DrTest"
      },
      "type": "array"
    }
  },
  "required": [
    "id",
    "entity",
    "system",
    "rto_target_hours",
    "rpo_target_minutes",
    "standby_strategy",
    "backup_cadence",
    "standby_locations",
    "owner",
    "tests",
    "status",
    "effective_from",
    "next_review_due",
    "control_basis"
  ],
  "title": "DisasterRecoveryPlan",
  "type": "object",
  "x-corpospec-pillar": "operations"
}