{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ostrov-center/json-schema/ostrov-center-resource-schema.json",
  "title": "Resource",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ostrov-center-openapi.yml#/components/schemas/Resource",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "maxLength": 100
    },
    "name": {
      "type": "string",
      "maxLength": 300
    },
    "kind": {
      "enum": [
        "room",
        "venue",
        "food"
      ]
    },
    "unit": {
      "type": "string",
      "maxLength": 100
    },
    "quantity": {
      "type": "integer",
      "minimum": 0,
      "maximum": 10000
    },
    "capacity": {
      "type": "integer",
      "minimum": 0,
      "maximum": 10000
    },
    "rates": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "low": {
            "type": "number",
            "minimum": 0
          },
          "medium": {
            "type": "number",
            "minimum": 0
          },
          "high": {
            "type": "number",
            "minimum": 0
          }
        },
        "required": [
          "low",
          "medium",
          "high"
        ],
        "additionalProperties": false
      }
    },
    "prices": {
      "type": "object",
      "properties": {
        "low": {
          "type": "number",
          "minimum": 0
        },
        "medium": {
          "type": "number",
          "minimum": 0
        },
        "high": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": [
        "low",
        "medium",
        "high"
      ],
      "additionalProperties": false
    },
    "slots": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 100
          },
          "start": {
            "type": "string",
            "maxLength": 5
          },
          "end": {
            "type": "string",
            "maxLength": 5
          }
        },
        "required": [
          "id",
          "start",
          "end"
        ],
        "additionalProperties": false
      }
    },
    "gapMinutes": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1440
    },
    "options": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 100
          },
          "name": {
            "type": "string",
            "maxLength": 300
          },
          "prices": {
            "type": "object",
            "properties": {
              "low": {
                "type": "number",
                "minimum": 0
              },
              "medium": {
                "type": "number",
                "minimum": 0
              },
              "high": {
                "type": "number",
                "minimum": 0
              }
            },
            "required": [
              "low",
              "medium",
              "high"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "name",
          "prices"
        ],
        "additionalProperties": false
      }
    },
    "enabled": {
      "type": "boolean"
    },
    "availabilityRule": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "annualPeriod": {
              "type": "object",
              "properties": {
                "start": {
                  "type": "string",
                  "maxLength": 5
                },
                "end": {
                  "type": "string",
                  "maxLength": 5
                }
              },
              "required": [
                "start",
                "end"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "annualPeriod"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "months": {
              "type": "array",
              "items": {
                "type": "integer",
                "minimum": 1,
                "maximum": 12
              }
            }
          },
          "required": [
            "months"
          ],
          "additionalProperties": false
        }
      ]
    }
  },
  "required": [
    "id",
    "name",
    "kind",
    "unit",
    "enabled",
    "availabilityRule"
  ],
  "additionalProperties": false
}