{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openteesheet.com/schemas/venue.schema.json",
  "title": "OpenTeeSheet venue (open format v1)",
  "description": "A golf simulator studio or course on OpenTeeSheet. The full record is what GET /api/v1/venue and the venue export emit; the public GET /api/v1/venues/{slug} emits the public subset (no created_at, no active flag). Never carries payment-processor ids or secrets.",
  "type": "object",
  "properties": {
    "object": {
      "const": "venue"
    },
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "slug": {
      "type": [
        "string",
        "null"
      ],
      "description": "URL slug of the public booking page, https://openteesheet.com/book/<slug>"
    },
    "name": {
      "type": "string",
      "minLength": 1
    },
    "location": {
      "type": [
        "string",
        "null"
      ],
      "description": "Street address"
    },
    "city": {
      "type": [
        "string",
        "null"
      ]
    },
    "state": {
      "type": [
        "string",
        "null"
      ]
    },
    "phone": {
      "type": [
        "string",
        "null"
      ]
    },
    "email": {
      "type": [
        "string",
        "null"
      ]
    },
    "website": {
      "type": [
        "string",
        "null"
      ]
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "timezone": {
      "type": "string",
      "minLength": 1,
      "description": "IANA time zone of the venue, e.g. America/New_York"
    },
    "open_24_7": {
      "type": "boolean"
    },
    "operating_hours": {
      "type": [
        "object",
        "null"
      ],
      "description": "Weekly hours, one entry per day (sun..sat); null = never set (the default 08:00-21:00 applies). Ignored when open_24_7 is true.",
      "properties": {
        "sun": {
          "type": "object",
          "properties": {
            "open": {
              "type": "string",
              "pattern": "^([01][0-9]|2[0-4]):[0-5][0-9]$"
            },
            "close": {
              "type": "string",
              "pattern": "^([01][0-9]|2[0-4]):[0-5][0-9]$"
            },
            "closed": {
              "type": "boolean"
            }
          },
          "required": [
            "open",
            "close",
            "closed"
          ],
          "additionalProperties": false
        },
        "mon": {
          "type": "object",
          "properties": {
            "open": {
              "type": "string",
              "pattern": "^([01][0-9]|2[0-4]):[0-5][0-9]$"
            },
            "close": {
              "type": "string",
              "pattern": "^([01][0-9]|2[0-4]):[0-5][0-9]$"
            },
            "closed": {
              "type": "boolean"
            }
          },
          "required": [
            "open",
            "close",
            "closed"
          ],
          "additionalProperties": false
        },
        "tue": {
          "type": "object",
          "properties": {
            "open": {
              "type": "string",
              "pattern": "^([01][0-9]|2[0-4]):[0-5][0-9]$"
            },
            "close": {
              "type": "string",
              "pattern": "^([01][0-9]|2[0-4]):[0-5][0-9]$"
            },
            "closed": {
              "type": "boolean"
            }
          },
          "required": [
            "open",
            "close",
            "closed"
          ],
          "additionalProperties": false
        },
        "wed": {
          "type": "object",
          "properties": {
            "open": {
              "type": "string",
              "pattern": "^([01][0-9]|2[0-4]):[0-5][0-9]$"
            },
            "close": {
              "type": "string",
              "pattern": "^([01][0-9]|2[0-4]):[0-5][0-9]$"
            },
            "closed": {
              "type": "boolean"
            }
          },
          "required": [
            "open",
            "close",
            "closed"
          ],
          "additionalProperties": false
        },
        "thu": {
          "type": "object",
          "properties": {
            "open": {
              "type": "string",
              "pattern": "^([01][0-9]|2[0-4]):[0-5][0-9]$"
            },
            "close": {
              "type": "string",
              "pattern": "^([01][0-9]|2[0-4]):[0-5][0-9]$"
            },
            "closed": {
              "type": "boolean"
            }
          },
          "required": [
            "open",
            "close",
            "closed"
          ],
          "additionalProperties": false
        },
        "fri": {
          "type": "object",
          "properties": {
            "open": {
              "type": "string",
              "pattern": "^([01][0-9]|2[0-4]):[0-5][0-9]$"
            },
            "close": {
              "type": "string",
              "pattern": "^([01][0-9]|2[0-4]):[0-5][0-9]$"
            },
            "closed": {
              "type": "boolean"
            }
          },
          "required": [
            "open",
            "close",
            "closed"
          ],
          "additionalProperties": false
        },
        "sat": {
          "type": "object",
          "properties": {
            "open": {
              "type": "string",
              "pattern": "^([01][0-9]|2[0-4]):[0-5][0-9]$"
            },
            "close": {
              "type": "string",
              "pattern": "^([01][0-9]|2[0-4]):[0-5][0-9]$"
            },
            "closed": {
              "type": "boolean"
            }
          },
          "required": [
            "open",
            "close",
            "closed"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "sun",
        "mon",
        "tue",
        "wed",
        "thu",
        "fri",
        "sat"
      ],
      "additionalProperties": false
    },
    "payment_mode": {
      "type": "string",
      "enum": [
        "pay_at_venue",
        "prepay"
      ],
      "description": "prepay = card at booking (live only once the venue's own Stripe account can take charges)"
    },
    "prepay_enabled": {
      "type": "boolean",
      "description": "Public view only: card at booking is live for this venue right now"
    },
    "active": {
      "type": "boolean"
    },
    "created_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  },
  "required": [
    "object",
    "id",
    "name"
  ],
  "additionalProperties": false
}
