{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/calculate-co-nz/json-schema/calculate-co-nz-rate-record-schema.json",
  "title": "RateRecord",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/calculate-co-nz-reference-data-api-openapi.yml#/components/schemas/RateRecord",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id",
      "description": "Stable identifier. Safe to store and to key on."
    },
    "label": {
      "type": "string",
      "title": "Label",
      "description": "What the figure is, in words."
    },
    "value": {
      "type": "string",
      "title": "Value",
      "description": "The current value, as published. A string so 1.75 and 0.0175 are never confused by a float."
    },
    "effective_from": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Effective From",
      "description": "ISO date the value took effect, where the source states one."
    },
    "source": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Source",
      "description": "Where it was read from. A URL for anything verified against an issuing body."
    },
    "verified_on": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Verified On",
      "description": "ISO date this figure was last checked against the issuing body. NULL means recorded but not yet verified, and is deliberately visible rather than hidden."
    },
    "review_cycle": {
      "type": "string",
      "title": "Review Cycle",
      "description": "When it next changes: annual-1-april, budget-may, periodic, or on-legislative-change. This is the field to filter on if you want to know what to re-check and when."
    },
    "previous_values": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Previous Values",
      "description": "Prior values, most recent first. Undated for now."
    },
    "history_note": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "History Note",
      "description": "The limits of previous_values."
    },
    "note": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Note",
      "description": "Anything a consumer needs to know about this figure."
    }
  },
  "type": "object",
  "required": [
    "id",
    "label",
    "value",
    "review_cycle"
  ]
}