{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "ORB Trading Lab Daily Levels Contract",
  "type": "object",
  "required": [
    "asOf",
    "timezone",
    "source",
    "symbols"
  ],
  "properties": {
    "asOf": {
      "type": "string",
      "format": "date-time"
    },
    "timezone": {
      "type": "string",
      "example": "GMT"
    },
    "source": {
      "type": "string",
      "const": "ORB Flow Engine"
    },
    "symbols": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "symbol",
          "displayName",
          "sessions"
        ],
        "properties": {
          "symbol": {
            "type": "string",
            "enum": [
              "XAUUSD",
              "XAGUSD",
              "US100"
            ]
          },
          "displayName": {
            "type": "string"
          },
          "sessions": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "name",
                "rangeStartGMT",
                "rangeEndGMT",
                "high",
                "low",
                "mid",
                "status"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "enum": [
                    "Sydney",
                    "Asia",
                    "London",
                    "New York"
                  ]
                },
                "rangeStartGMT": {
                  "type": "string",
                  "pattern": "^\\d{2}:\\d{2}$"
                },
                "rangeEndGMT": {
                  "type": "string",
                  "pattern": "^\\d{2}:\\d{2}$"
                },
                "high": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "low": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "mid": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "active",
                    "complete",
                    "invalidated"
                  ]
                },
                "bias": {
                  "type": "string",
                  "enum": [
                    "long",
                    "short",
                    "neutral",
                    "pending"
                  ]
                },
                "notes": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}
