{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://signupbetter.com/signupbetter.schema.json",
  "title": "SignupBetter draft",
  "description": "A reviewable signup draft. Importing a draft does not publish an event or charge a payment. Exclude contact lists, participant information, passwords, and payment data.",
  "type": "object",
  "additionalProperties": false,
  "required": ["title", "slots"],
  "properties": {
    "title": { "type": "string", "minLength": 1, "maxLength": 150 },
    "description": { "type": "string", "maxLength": 5000, "default": "" },
    "location": { "type": "string", "maxLength": 300, "default": "" },
    "date": {
      "type": "string",
      "pattern": "^(?:|[0-9]{4}-[0-9]{2}-[0-9]{2})$",
      "description": "A valid YYYY-MM-DD date, or empty when unknown.",
      "default": ""
    },
    "time": {
      "type": "string",
      "pattern": "^(?:|(?:[01][0-9]|2[0-3]):[0-5][0-9])$",
      "description": "24-hour HH:mm, or empty when unknown.",
      "default": ""
    },
    "timezone": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80,
      "description": "A valid IANA timezone.",
      "default": "UTC"
    },
    "type": {
      "type": "string",
      "enum": ["potluck", "volunteers", "timeslots", "custom"],
      "default": "custom"
    },
    "slots": {
      "type": "array",
      "minItems": 1,
      "maxItems": 40,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["title", "capacity"],
        "properties": {
          "title": { "type": "string", "minLength": 1, "maxLength": 150 },
          "capacity": { "type": "integer", "minimum": 1, "maximum": 100 }
        }
      }
    }
  },
  "examples": [
    {
      "title": "Neighborhood potluck",
      "description": "Bring something to share. Everyone is welcome.",
      "date": "",
      "time": "17:00",
      "timezone": "America/Los_Angeles",
      "type": "potluck",
      "slots": [
        { "title": "Main dish", "capacity": 4 },
        { "title": "Dessert", "capacity": 3 },
        { "title": "Drinks", "capacity": 2 }
      ]
    }
  ]
}
