{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://lawwatch.rus.family/api/v1/events/schema.json",
  "title": "LawWatch Austria published event record",
  "description": "Schema for published LawWatch legislative-event records. The non-real /api/v1/sample object is intentionally outside this contract.",
  "type": "object",
  "additionalProperties": false,
  "required": ["id", "event_type", "jurisdiction", "level", "title", "publication", "effective_dates", "affected_laws", "sources", "verification", "public_url", "disclaimer"],
  "properties": {
    "$schema": {"type": "string", "format": "uri"},
    "id": {"type": "string", "pattern": "^at-bgbl-i-[0-9]{4}-[0-9]+$"},
    "event_type": {"const": "promulgation"},
    "jurisdiction": {"const": "AT"},
    "level": {"const": "federal"},
    "title": {"type": "string", "minLength": 1},
    "title_en": {"type": "string", "minLength": 1},
    "publication": {
      "type": "object",
      "additionalProperties": false,
      "required": ["series", "reference", "published_on"],
      "properties": {
        "series": {"const": "BGBl. I"},
        "reference": {"type": "string", "pattern": "^BGBl\\. I Nr\\. [0-9]+/[0-9]{4}$"},
        "published_on": {"type": "string", "format": "date"},
        "document_type": {"type": "string", "minLength": 1}
      }
    },
    "effective_dates": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["provisions", "effective_on"],
        "properties": {
          "provisions": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}},
          "effective_on": {"type": "string", "format": "date"},
          "official_basis": {"type": "string", "minLength": 1}
        }
      }
    },
    "affected_laws": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["name", "provision"],
        "properties": {
          "name": {"type": "string", "minLength": 1},
          "provision": {"type": "string", "minLength": 1},
          "change": {"type": "string", "minLength": 1},
          "act_instruction": {"type": "string", "minLength": 1},
          "effective_on": {"type": "string", "format": "date"},
          "confirmed_text": {"type": "string", "minLength": 1}
        },
        "anyOf": [{"required": ["change"]}, {"required": ["act_instruction"]}]
      }
    },
    "payroll_parameters": {
      "type": "object",
      "additionalProperties": false,
      "required": ["source_provision", "telework_allowance", "annual_day_cap", "payroll_reporting_condition"],
      "properties": {
        "source_provision": {"type": "string", "minLength": 1},
        "telework_allowance": {
          "type": "object",
          "additionalProperties": false,
          "required": ["currency", "maximum_amount_per_qualifying_day", "qualifying_day"],
          "properties": {
            "currency": {"const": "EUR"},
            "maximum_amount_per_qualifying_day": {"type": "number", "minimum": 0},
            "qualifying_day": {"type": "string", "minLength": 1}
          }
        },
        "annual_day_cap": {
          "type": "object",
          "additionalProperties": false,
          "required": ["maximum_days", "period"],
          "properties": {
            "maximum_days": {"type": "integer", "minimum": 0},
            "period": {"type": "string", "minLength": 1}
          }
        },
        "payroll_reporting_condition": {
          "type": "object",
          "additionalProperties": false,
          "required": ["required_for_the_stated_allowance", "official_text"],
          "properties": {
            "required_for_the_stated_allowance": {"type": "boolean"},
            "official_text": {"type": "string", "minLength": 1}
          }
        }
      }
    },
    "sources": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["type", "publisher", "eli", "html", "pdf"],
        "properties": {
          "type": {"const": "official_publication"},
          "publisher": {"type": "string", "minLength": 1},
          "eli": {"type": "string", "format": "uri"},
          "eli_version": {"type": "string", "format": "uri"},
          "html": {"type": "string", "format": "uri"},
          "pdf": {"type": "string", "format": "uri"},
          "evidence": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": ["article", "provision", "quote"],
              "properties": {
                "article": {"type": "string", "minLength": 1},
                "provision": {"type": "string", "minLength": 1},
                "quote": {"type": "string", "minLength": 1}
              }
            }
          }
        }
      }
    },
    "verification": {
      "type": "object",
      "additionalProperties": false,
      "required": ["status", "verified_on", "confirmed_facts", "not_asserted"],
      "properties": {
        "status": {"const": "verified_against_official_publication"},
        "verified_on": {"type": "string", "format": "date"},
        "method": {"type": "string", "minLength": 1},
        "confirmed_facts": {"type": "array", "items": {"type": "string", "minLength": 1}},
        "not_asserted": {"type": "array", "items": {"type": "string", "minLength": 1}},
        "editorial_summary": {
          "type": "object",
          "additionalProperties": false,
          "required": ["de", "en"],
          "properties": {"de": {"type": "string", "minLength": 1}, "en": {"type": "string", "minLength": 1}}
        },
        "inferences": {"type": "array", "items": {"type": "string", "minLength": 1}}
      }
    },
    "public_url": {"type": "string", "format": "uri"},
    "public_url_en": {"type": "string", "format": "uri"},
    "disclaimer": {"type": "string", "minLength": 1}
  }
}
