{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hantamonitor.com/schemas/map-hotzones.schema.json",
  "title": "Hanta Monitor Country-Level Map Overlay Artifact",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "schema_version",
    "generated_at",
    "generator",
    "status",
    "precision",
    "status_semantics",
    "sources",
    "items"
  ],
  "properties": {
    "schema_version": { "const": 1 },
    "generated_at": { "type": "string", "format": "date-time" },
    "generator": { "type": "string", "minLength": 1 },
    "status": { "type": "string", "minLength": 1 },
    "precision": { "const": "country-level" },
    "status_semantics": {
      "type": "object",
      "required": ["baseline", "reported", "confirmed", "monitored-event", "context"],
      "additionalProperties": { "type": "string" }
    },
    "summary": { "type": "object" },
    "sources": {
      "type": "array",
      "minItems": 1,
      "items": { "$ref": "#/$defs/mapSource" }
    },
    "items": {
      "type": "array",
      "minItems": 1,
      "items": { "$ref": "#/$defs/mapItem" }
    }
  },
  "$defs": {
    "mapSource": {
      "type": "object",
      "additionalProperties": true,
      "required": ["id", "name", "rank", "url", "retrieved_at"],
      "properties": {
        "id": { "type": "string", "minLength": 1 },
        "name": { "type": "string", "minLength": 1 },
        "rank": { "type": "string", "minLength": 1 },
        "url": { "type": "string", "format": "uri" },
        "retrieved_at": { "type": "string", "format": "date-time" }
      }
    },
    "mapItem": {
      "type": "object",
      "additionalProperties": true,
      "required": [
        "id",
        "label",
        "scope",
        "geometry_id",
        "status",
        "last_seen_at",
        "source_ids",
        "summary",
        "precision_note"
      ],
      "properties": {
        "id": { "type": "string", "minLength": 1 },
        "label": { "type": "string", "minLength": 1 },
        "scope": { "const": "country" },
        "geometry_id": { "type": "string", "minLength": 1 },
        "status": {
          "enum": ["baseline", "reported", "confirmed", "monitored-event", "context"]
        },
        "last_seen_at": { "type": "string", "format": "date-time" },
        "source_ids": {
          "type": "array",
          "minItems": 1,
          "items": { "type": "string", "minLength": 1 }
        },
        "feed_item_ids": {
          "type": "array",
          "items": { "type": "string", "minLength": 1 }
        },
        "summary": { "type": "string", "minLength": 1 },
        "precision_note": { "type": "string", "minLength": 1 }
      }
    }
  }
}
