{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openteesheet.com/schemas/bay.schema.json",
  "title": "OpenTeeSheet bay (open format v1)",
  "description": "One bookable simulator bay (or tee sheet) at a venue.",
  "type": "object",
  "properties": {
    "object": {
      "const": "bay"
    },
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "venue_id": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string",
      "minLength": 1
    },
    "simulator": {
      "type": [
        "string",
        "null"
      ],
      "description": "Free text the owner typed, e.g. 'Trackman iO'"
    },
    "launch_monitor": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "trackman",
        "foresight",
        "uneekor",
        "full_swing",
        "aboutgolf",
        "golfzon",
        "flightscope",
        "skytrak",
        "garmin",
        "other",
        null
      ]
    },
    "session_control": {
      "type": "string",
      "enum": [
        "off",
        "bay_agent"
      ],
      "description": "bay_agent = the OpenTeeSheet bay agent on the sim PC starts/stops each paid session"
    },
    "session_start": {
      "type": "string",
      "enum": [
        "booking_start",
        "door_open"
      ],
      "description": "When the bay agent starts the sim: booking_start = on the booking's clock; door_open = when the door lets the golfer in (a no-show never runs the sim)"
    },
    "rate_cents": {
      "type": "integer",
      "minimum": 0,
      "description": "Hourly rate in cents (whole dollars on every OpenTeeSheet price)"
    },
    "max_players": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1
    },
    "sort_order": {
      "type": [
        "integer",
        "null"
      ]
    },
    "buffer_minutes": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 120,
      "description": "Cleanup gap kept free after each booking"
    },
    "active": {
      "type": "boolean"
    }
  },
  "required": [
    "object",
    "id",
    "venue_id",
    "name",
    "rate_cents"
  ],
  "additionalProperties": false
}
