{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://splitclubapp.com/schemas/v1/policy.json",
  "title": "Policy",
  "description": "The house rules: cancellation and refunds, age, dress code, arrival.",
  "x-doc": "schema-policy",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "cancellation": {
      "type": "array",
      "maxItems": 10,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "hours_before",
          "refund_pct"
        ],
        "properties": {
          "hours_before": {
            "type": "integer",
            "minimum": 0,
            "maximum": 8760,
            "examples": [
              48
            ]
          },
          "refund_pct": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "examples": [
              100
            ]
          }
        }
      },
      "description": "Refund tiers: cancelling at least hours_before the start refunds refund_pct.",
      "examples": [
        [
          {
            "hours_before": 48,
            "refund_pct": 100
          },
          {
            "hours_before": 24,
            "refund_pct": 50
          }
        ]
      ]
    },
    "min_age": {
      "type": "integer",
      "enum": [
        0,
        18,
        21
      ],
      "examples": [
        21
      ]
    },
    "dress_code": {
      "type": "string",
      "maxLength": 200,
      "examples": [
        "Collared shirts, soft spikes"
      ]
    },
    "arrival_window_minutes": {
      "type": "integer",
      "minimum": 0,
      "maximum": 240,
      "examples": [
        30
      ]
    },
    "notes": {
      "type": "string",
      "maxLength": 2000
    }
  },
  "examples": [
    {
      "cancellation": [
        {
          "hours_before": 48,
          "refund_pct": 100
        }
      ],
      "min_age": 0,
      "dress_code": "Collared shirts, soft spikes",
      "arrival_window_minutes": 30
    }
  ]
}
