{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ostrov-center/json-schema/ostrov-center-group-plan-schema.json",
  "title": "GroupPlan",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ostrov-center-openapi.yml#/components/schemas/GroupPlan",
  "type": "object",
  "properties": {
    "arrival": {
      "type": "string",
      "format": "date",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "departure": {
      "type": "string",
      "format": "date",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "adults": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100
    },
    "youngChildrenAges": {
      "type": "array",
      "maxItems": 30,
      "items": {
        "type": "integer",
        "minimum": 0,
        "maximum": 5
      },
      "description": "Information only; does not change any guest count, accommodation, food or price."
    },
    "policyVersion": {
      "type": "integer",
      "const": 4
    },
    "teens": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "description": "Children eligible for the child discount (currently 6–12). Despite the field name, full-rate children (currently 13+) belong in adults. Check the live catalogue."
    },
    "team": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "description": "Adult organizers and team, separate from participants. Ordinary tariff charges the team fully; all-inclusive benefits are calculated by the server."
    },
    "youngChildren": {
      "type": "integer",
      "const": 0,
      "description": "Legacy counter kept at zero; use youngChildrenAges for information."
    },
    "organizer": {
      "type": "string",
      "maxLength": 100,
      "description": "Display name; required and nonempty when saving."
    },
    "title": {
      "type": "string",
      "maxLength": 150,
      "description": "Retreat name; required and nonempty when saving."
    },
    "housing": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "resource": {
            "type": "string",
            "maxLength": 100
          },
          "occupancy": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          }
        },
        "required": [
          "resource",
          "occupancy",
          "quantity"
        ],
        "additionalProperties": false
      },
      "maxItems": 100
    },
    "activities": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "resource": {
            "type": "string",
            "maxLength": 100
          },
          "day": {
            "type": "integer",
            "minimum": 0,
            "maximum": 364
          },
          "slot": {
            "type": "string",
            "maxLength": 100
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 100
            },
            "maxItems": 20
          }
        },
        "required": [
          "resource",
          "day",
          "slot",
          "options"
        ],
        "additionalProperties": false
      },
      "maxItems": 2000
    },
    "food": {
      "type": "boolean"
    }
  },
  "required": [
    "policyVersion",
    "arrival",
    "departure",
    "adults",
    "teens",
    "team",
    "housing",
    "activities",
    "food"
  ],
  "additionalProperties": false
}