{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Draw",
  "description": "One draw result. Unique key: market + draw_date + session + draw_type.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "market",
    "draw_type",
    "draw_date",
    "session",
    "session_timezone",
    "result"
  ],
  "properties": {
    "market": {
      "type": "string",
      "enum": [
        "SG",
        "HK",
        "SDY",
        "MC",
        "CAM"
      ],
      "description": "Market code."
    },
    "draw_type": {
      "const": "4D",
      "description": "Draw format. Always 4D in this release."
    },
    "draw_date": {
      "type": "string",
      "format": "date",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "Calendar date (YYYY-MM-DD) under which the compiled archives list the draw."
    },
    "session": {
      "type": "string",
      "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
      "description": "Draw time label HH:MM as published by the compiled archives, in WIB (Asia/Jakarta). A label, not a verified timestamp."
    },
    "session_timezone": {
      "const": "Asia/Jakarta",
      "description": "Time zone of the session label. Not the local time zone of the market."
    },
    "result": {
      "type": "string",
      "pattern": "^\\d{4}$",
      "description": "Four-digit result as a string. Leading zeros are significant (\"0678\")."
    }
  }
}
