{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://dpone.dev/schemas/schema-migration/recovery-point.schema.json",
  "title": "dpone schema migration recovery point",
  "type": "object",
  "required": [
    "schema_version",
    "restore_point_id",
    "pack_id",
    "backup_certificate_id",
    "target",
    "environment",
    "kind",
    "status",
    "destination",
    "chain_id",
    "chain_depth",
    "created_at",
    "restore_rehearsal",
    "blockers",
    "warnings"
  ],
  "additionalProperties": true,
  "properties": {
    "schema_version": {"const": "dpone.schema_migration_recovery_point.v1"},
    "restore_point_id": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
    "pack_id": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
    "backup_certificate_id": {"type": "string"},
    "target": {"type": "object", "required": ["sink_type", "table"], "additionalProperties": true},
    "environment": {"type": "string"},
    "kind": {"enum": ["full", "incremental", "manual", "external"]},
    "status": {"enum": ["usable", "warning", "blocked", "expired"]},
    "destination": {"type": ["string", "null"]},
    "base_restore_point_id": {"type": ["string", "null"]},
    "chain_id": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
    "chain_depth": {"type": "integer", "minimum": 0},
    "created_at": {"type": "string"},
    "valid_until": {"type": ["string", "null"]},
    "rpo_seconds": {"type": "integer", "minimum": 0},
    "restore_rehearsal": {"type": "object"},
    "blockers": {"type": "array", "items": {"type": "string"}},
    "warnings": {"type": "array", "items": {"type": "string"}}
  }
}
