{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://compo.kluchna24.ru/poster_engine/hermes_content_plan_adapter.schema.json",
  "title": "COMPO Hermes Content Plan Adapter",
  "type": "object",
  "additionalProperties": false,
  "required": ["adapter_id", "source", "snapshot_ref", "items", "mutation_allowed", "publication_allowed"],
  "properties": {
    "adapter_id": {"type": "string", "pattern": "^hermes-adapter-[a-z0-9-]+$"},
    "source": {"const": "hermes_content_plan_snapshot"},
    "snapshot_ref": {"type": "string", "pattern": "^snapshot://"},
    "items": {"type": "array", "items": {"$ref": "#/$defs/item"}},
    "unresolved_questions": {"type": "array", "items": {"type": "string"}},
    "mutation_allowed": {"const": false},
    "publication_allowed": {"const": false}
  },
  "$defs": {
    "item": {
      "type": "object",
      "additionalProperties": false,
      "required": ["item_id", "brief", "channel", "status"],
      "properties": {
        "item_id": {"type": "string"},
        "brief": {"type": "string"},
        "channel": {"type": "string", "enum": ["web", "instagram", "telegram", "youtube", "other"]},
        "due_at": {"type": "string"},
        "reference_assets": {"type": "array", "items": {"type": "string", "pattern": "^asset://"}},
        "status": {"type": "string", "enum": ["imported", "needs_clarification", "skipped"]}
      }
    }
  }
}
