{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://uwmd.org/schemas/tax-abatement.schema.json",
  "title": "tax-abatement",
  "description": "RFC 0053 / format 4.5. Shape validation only; period ordering, granularity and the TAX-06/TAX-07 rules are semantic checks.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "kind",
    "schedule"
  ],
  "properties": {
    "kind": {
      "enum": [
        "exemption",
        "freeze",
        "pilot",
        "phase_in",
        "credit"
      ]
    },
    "program": {
      "type": [
        "string",
        "null"
      ]
    },
    "stabilized_period": {
      "description": "An RFC 0041 selector naming one schedule period.",
      "type": [
        "string",
        "null"
      ],
      "pattern": "^(Y[1-9][0-9]*|[0-9]{4}-(Q[1-4]|0[1-9]|1[0-2])|[0-9]{4}-[0-9]{2}-[0-9]{2})$"
    },
    "schedule": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "period",
          "full_tax",
          "abated_tax"
        ],
        "properties": {
          "period": {
            "description": "An RFC 0041 selector: Y1+, YYYY-Qn, YYYY-MM, or YYYY-MM-DD.",
            "type": "string",
            "pattern": "^(Y[1-9][0-9]*|[0-9]{4}-(Q[1-4]|0[1-9]|1[0-2])|[0-9]{4}-[0-9]{2}-[0-9]{2})$"
          },
          "full_tax": {
            "type": "number",
            "minimum": 0
          },
          "abated_tax": {
            "type": "number",
            "minimum": 0
          }
        }
      }
    }
  }
}
