{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/thesignup-app/json-schema/thesignup-app-time-slot-schema.json",
  "title": "TimeSlot",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/thesignup-app-openapi.json#/components/schemas/TimeSlot",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "eventId": {
      "type": "string",
      "format": "uuid"
    },
    "startTime": {
      "type": "string",
      "format": "date-time"
    },
    "endTime": {
      "type": "string",
      "format": "date-time"
    },
    "startLocal": {
      "type": "string",
      "description": "The start time in the signup's timezone, with offset (e.g. `2026-11-20T15:00:00.000-06:00`). Present when the signup has a timezone; absent otherwise."
    },
    "endLocal": {
      "type": "string",
      "description": "The end time in the signup's timezone, with offset (e.g. `2026-11-20T16:00:00.000-06:00`). Present when the signup has a timezone; absent otherwise."
    },
    "maxParticipants": {
      "type": "integer",
      "minimum": 1
    },
    "maxPerPerson": {
      "type": "integer",
      "minimum": 0,
      "description": "The most spots one person may take on this slot. 1 (the default) is one spot per person; 0 is no per-person limit."
    },
    "title": {
      "type": [
        "string",
        "null"
      ]
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "location": {
      "type": [
        "string",
        "null"
      ]
    },
    "customField": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "placeholder": {
          "type": "string"
        },
        "required": {
          "type": "boolean"
        },
        "type": {
          "type": "string",
          "enum": [
            "short",
            "long"
          ]
        }
      },
      "required": [
        "name",
        "required",
        "type"
      ],
      "description": "The slot's own question, as stored. Read `question` for what the slot actually asks — a slot generated from a repeating shift may inherit the shift's question when this is null."
    },
    "question": {
      "allOf": [
        {
          "$ref": "#/$defs/Question"
        },
        {
          "type": [
            "object",
            "null"
          ],
          "description": "The question participants are asked when taking this slot: the slot's own, else the repeating shift's. Null when nothing is asked."
        }
      ]
    },
    "questionSource": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "own",
        "series",
        null
      ],
      "description": "\"own\" when `question` is the slot's own; \"series\" when inherited from its repeating shift; null when nothing is asked."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "eventId",
    "startTime",
    "endTime",
    "maxParticipants",
    "maxPerPerson",
    "title",
    "description",
    "location",
    "customField",
    "question",
    "questionSource",
    "createdAt"
  ],
  "$defs": {
    "Question": {
      "type": "object",
      "properties": {
        "label": {
          "type": "string"
        },
        "placeholder": {
          "type": "string",
          "description": "Example answer, shown as a hint in the answer box. Absent when none was given."
        },
        "required": {
          "type": "boolean"
        }
      },
      "required": [
        "label",
        "required"
      ]
    }
  }
}