{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://venuemind.dev/schemas/event-brief.schema.json",
  "title": "VenueMind Event Brief",
  "type": "object",
  "required": [
    "id",
    "eventName",
    "date",
    "timezone",
    "venueId",
    "roomId",
    "attendeeTarget",
    "occupancyMode",
    "requirements"
  ],
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1
    },
    "eventName": {
      "type": "string",
      "minLength": 1
    },
    "date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "timezone": {
      "type": "string",
      "minLength": 1
    },
    "venueId": {
      "type": [
        "string",
        "null"
      ]
    },
    "roomId": {
      "type": [
        "string",
        "null"
      ]
    },
    "attendeeTarget": {
      "type": "integer",
      "minimum": 0
    },
    "occupancyMode": {
      "enum": [
        "theater",
        "classroom",
        "banquet",
        "standing",
        "mixed",
        "custom"
      ]
    },
    "schedule": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "object",
          "required": [
            "startAt",
            "endAt",
            "timezone"
          ],
          "properties": {
            "startAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{3})?(?:Z|(?!-00:00)[+-]\\d{2}:\\d{2})$"
            },
            "endAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{3})?(?:Z|(?!-00:00)[+-]\\d{2}:\\d{2})$"
            },
            "timezone": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "planningEffectBindings": {
      "type": "object",
      "properties": {
        "set_attendance_target": {
          "type": "object",
          "required": [
            "targetRequirementId",
            "category",
            "affectedConstraintIds"
          ],
          "properties": {
            "targetRequirementId": {
              "type": "string",
              "minLength": 1
            },
            "category": {
              "const": "seating"
            },
            "affectedConstraintIds": {
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          "additionalProperties": false
        },
        "set_event_schedule": {
          "type": "object",
          "required": [
            "targetRequirementId",
            "category",
            "affectedConstraintIds"
          ],
          "properties": {
            "targetRequirementId": {
              "type": "string",
              "minLength": 1
            },
            "category": {
              "const": "staffing"
            },
            "affectedConstraintIds": {
              "type": "array",
              "maxItems": 0
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "requirements": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "category",
          "label",
          "priority",
          "owner",
          "status",
          "measurable",
          "constraintIds",
          "evidenceRefs"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "category": {
            "enum": [
              "accessibility",
              "seating",
              "production",
              "catering",
              "staffing",
              "security",
              "emergency",
              "circulation"
            ]
          },
          "label": {
            "type": "string",
            "minLength": 1
          },
          "priority": {
            "enum": [
              "critical",
              "high",
              "medium",
              "low"
            ]
          },
          "owner": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "enum": [
              "open",
              "confirmed",
              "satisfied",
              "waived"
            ]
          },
          "measurable": {
            "type": "boolean"
          },
          "constraintIds": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "evidenceRefs": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}
