{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "tg4.today.v1.schema.json",
  "title": "TG4 Today (tg4.today.v1)",
  "description": "Snapshot of all 11 Malaysian 4D operator results for a single draw date.",
  "type": "object",
  "required": [
    "schema",
    "license",
    "source",
    "generated_at",
    "draw_date",
    "operators"
  ],
  "properties": {
    "schema": {
      "const": "tg4.today.v1"
    },
    "license": {
      "const": "CC0-1.0"
    },
    "source": {
      "type": "string",
      "format": "uri"
    },
    "generated_at": {
      "type": "string",
      "format": "date-time"
    },
    "draw_date": {
      "type": "string"
    },
    "status": {
      "type": [
        "string",
        "null"
      ]
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "operators": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "slug",
          "name",
          "state"
        ],
        "properties": {
          "slug": {
            "type": "string",
            "pattern": "^[a-z0-9-]+$"
          },
          "name": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "Final",
              "Live",
              "Updating",
              "Waiting",
              "Corrected"
            ]
          },
          "first": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9]{4}$|^$"
          },
          "second": {
            "type": [
              "string",
              "null"
            ]
          },
          "third": {
            "type": [
              "string",
              "null"
            ]
          },
          "special": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "consolation": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "draw_days": {
            "type": [
              "string",
              "null"
            ]
          },
          "est_jackpot": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "next_special_draw": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date-time"
        },
        "label": {
          "type": "string"
        },
        "operator": {
          "type": "string"
        }
      }
    },
    "lunar": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string"
        },
        "lunar_short": {
          "type": "string"
        },
        "lunar_long": {
          "type": "string"
        },
        "zodiac": {
          "type": "string"
        },
        "zodiac_emoji": {
          "type": "string"
        },
        "lucky_digits": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}