{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dataquoll-io/json-schema/dataquoll-io-calendar-verdict-schema.json",
  "title": "CalendarVerdict",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dataquoll-io-calendars-api-openapi.yml#/components/schemas/CalendarVerdict",
  "type": "object",
  "properties": {
    "jurisdiction": {
      "type": "string"
    },
    "date": {
      "type": "string",
      "format": "date"
    },
    "weekday": {
      "type": "string",
      "enum": [
        "Mon",
        "Tue",
        "Wed",
        "Thu",
        "Fri",
        "Sat",
        "Sun"
      ]
    },
    "timezone": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "public_holiday",
        "weekend",
        "industry_shutdown",
        "rdo",
        "part_day_public_holiday",
        "annual_leave",
        "industry_event",
        "working"
      ]
    },
    "working_day": {
      "type": "boolean"
    },
    "applies_to": {
      "type": "string"
    },
    "entries": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CalendarDay"
      },
      "description": "Every row on the date, including the ones that do not decide the verdict"
    },
    "restricted": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CalendarDay"
      },
      "description": "Official holidays that apply only to the area or sector in their scope"
    },
    "edition": {
      "$ref": "#/$defs/CalendarEdition"
    }
  },
  "$defs": {
    "CalendarDay": {
      "type": "object",
      "description": "One row of an industry calendar. Null-valued fields are omitted from this description but always present in the JSON.",
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "weekday": {
          "type": "string",
          "enum": [
            "Mon",
            "Tue",
            "Wed",
            "Thu",
            "Fri",
            "Sat",
            "Sun"
          ]
        },
        "category": {
          "type": "string",
          "enum": [
            "public_holiday",
            "part_day_public_holiday",
            "restricted_public_holiday",
            "poster_holiday",
            "rdo",
            "industry_shutdown",
            "annual_leave",
            "industry_event",
            "union_event",
            "school_holiday",
            "school_term"
          ],
          "description": "public_holiday is official and jurisdiction-wide. restricted_public_holiday is official but only for the area or sector in scope. poster_holiday is a day the source calendar colours as a holiday that is not one, kept for audit."
        },
        "subtype": {
          "type": [
            "string",
            "null"
          ],
          "description": "The calendar's own split where it has one (scheduled, flexible, 36_hour_week, 38_hour_week, industry, eba, contracting, award, construction); null otherwise"
        },
        "scope": {
          "type": [
            "string",
            "null"
          ],
          "description": "For restricted_public_holiday, the area or sector the day applies to; null otherwise"
        },
        "name": {
          "type": "string"
        },
        "poster_marking": {
          "type": [
            "string",
            "null"
          ],
          "description": "What the source calendar shows for the day; null where it has no cell"
        },
        "official_match": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "For official holidays, whether the source calendar agrees; null where the question does not apply"
        },
        "part_day_from": {
          "type": [
            "string",
            "null"
          ],
          "description": "Local start time of a part-day holiday; null otherwise"
        },
        "range_end": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "description": "Last day of the range this row belongs to (a shutdown, a school break, a term); null otherwise"
        },
        "note": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "CalendarEdition": {
      "type": "object",
      "properties": {
        "jurisdiction": {
          "type": "string"
        },
        "year": {
          "type": "integer"
        },
        "title": {
          "type": "string"
        },
        "publisher": {
          "type": "string"
        },
        "source_url": {
          "type": "string",
          "format": "uri"
        },
        "applies_to": {
          "type": "string"
        },
        "covers": {
          "type": "object",
          "properties": {
            "from": {
              "type": "string",
              "format": "date"
            },
            "to": {
              "type": "string",
              "format": "date"
            }
          }
        },
        "timezone": {
          "type": "string"
        }
      }
    }
  }
}