{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Номера горячих линий по регионам. verified: true только после звонка куратора в РФ. hidden: true - строку не показываем на карточке (правка человека или только темы other и staff)",
  "type": "object",
  "properties": {
    "dataset": { "const": "region-lines" },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "region_id", "agency", "agency_name", "number_raw", "number_display", "tel", "ext_text", "kind",
                     "topic_text", "hours_text", "is_24x7", "topics", "topics_checked", "audience", "roles", "shared_with",
                     "foreign_number", "hidden", "origin", "source_row", "source_text", "assured_date", "source_ref",
                     "verified", "verified_at"],
        "properties": {
          "id": { "type": "string", "pattern": "^ru-[a-z]{2,3}-(rzn|minzdrav|tfoms)-\\d{3,11}(-\\d+)?$" },
          "region_id": { "type": "string", "pattern": "^RU-[A-Z]{2,3}$" },
          "agency": { "enum": ["rzn", "minzdrav", "tfoms"] },
          "agency_name": { "type": "string", "minLength": 1 },
          "number_raw": { "type": "string", "minLength": 3 },
          "number_display": { "type": "string", "pattern": "^(8 \\(\\d{3,5}\\) [\\d-]{5,9}|\\d{3})$" },
          "tel": { "type": "string", "pattern": "^(\\+7\\d{10}|\\d{3})$",
                   "x-message-ru": "номер должен быть в виде +7 и 10 цифр или коротким из 3 цифр" },
          "ext_text": { "type": "string" },
          "kind": { "enum": ["landline", "mobile", "tollfree", "short"] },
          "topic_text": { "type": "string" },
          "hours_text": { "type": "string" },
          "is_24x7": { "type": "boolean" },
          "topics": { "type": "array", "minItems": 1, "uniqueItems": true,
                      "items": { "enum": ["pain", "pmp", "drugs", "complaints", "general", "other", "staff"] } },
          "topics_checked": { "type": "boolean" },
          "audience": { "enum": ["adults", "children", "all"] },
          "roles": { "type": "array", "uniqueItems": true,
                     "items": { "enum": ["pmp", "pain", "general", "rzn", "minzdrav", "tfoms"] } },
          "shared_with": { "type": "array", "items": { "type": "string", "pattern": "^RU-[A-Z]{2,3}$" } },
          "foreign_number": { "type": "boolean" },
          "hidden": { "type": "boolean" },
          "origin": { "enum": ["rzn", "curator", "order", "synthetic"] },
          "source_row": { "type": "integer", "minimum": 0 },
          "source_text": { "type": "string", "minLength": 3 },
          "assured_date": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
          "source_ref": { "type": "string", "minLength": 1 },
          "verified": { "type": "boolean" },
          "verified_at": { "type": ["string", "null"], "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }
        }
      }
    }
  }
}
