{
  "$id": "https://hoba.work/schemas/era.schema.json",
  "$ref": "#/definitions/Era",
  "definitions": {
    "Era": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string",
          "minLength": 3
        },
        "status": {
          "default": "active",
          "type": "string",
          "enum": [
            "active",
            "deprecated"
          ]
        },
        "evidence_ids": {
          "default": [],
          "type": "array",
          "items": {
            "$ref": "#/definitions/__schema0"
          }
        },
        "content": {
          "type": "string"
        },
        "aliases": {
          "default": [],
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "id": {
          "type": "string",
          "pattern": "^(E-\\d{3}|era\\.[a-z0-9_]+)$"
        },
        "type": {
          "type": "string",
          "const": "era"
        },
        "summary": {
          "type": "string",
          "minLength": 10
        },
        "from": {
          "type": "integer",
          "minimum": 1900,
          "maximum": 2100
        },
        "to": {
          "type": "integer",
          "minimum": 1900,
          "maximum": 2100
        },
        "capital": {
          "type": "string",
          "minLength": 20
        },
        "hiring": {
          "type": "string",
          "minLength": 20
        },
        "entry": {
          "type": "string",
          "minLength": 20
        },
        "ended_by": {
          "default": "",
          "type": "string"
        },
        "indicators": {
          "default": [],
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string",
                "minLength": 3
              },
              "figure": {
                "type": "string",
                "minLength": 1
              },
              "period": {
                "type": "string",
                "minLength": 4
              },
              "evidence": {
                "$ref": "#/definitions/__schema0"
              }
            },
            "required": [
              "label",
              "figure",
              "period",
              "evidence"
            ],
            "additionalProperties": false
          }
        },
        "entities": {
          "default": [],
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "specimens": {
          "default": [],
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "email",
                  "chat",
                  "ats",
                  "transcript",
                  "posting",
                  "note"
                ]
              },
              "label": {
                "type": "string",
                "minLength": 3
              },
              "subject": {
                "type": "string"
              },
              "context": {
                "type": "string"
              },
              "lines": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "$ref": "#/definitions/__schema1"
                }
              },
              "reading": {
                "type": "string",
                "minLength": 10
              }
            },
            "required": [
              "kind",
              "label",
              "lines"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "title",
        "id",
        "type",
        "summary",
        "from",
        "to",
        "capital",
        "hiring",
        "entry"
      ],
      "additionalProperties": false
    },
    "__schema0": {
      "type": "string",
      "pattern": "^(EVD-\\d{3}|evidence\\.[a-z0-9_]+)$"
    },
    "__schema1": {
      "type": "object",
      "properties": {
        "speaker": {
          "type": "string"
        },
        "at": {
          "type": "string"
        },
        "text": {
          "type": "string",
          "minLength": 1
        },
        "tell": {
          "default": false,
          "type": "boolean"
        }
      },
      "required": [
        "text"
      ],
      "additionalProperties": false
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#"
}
