{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/taktovka-com/json-schema/taktovka-com-location-schema.json",
  "title": "Location",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/taktovka-com-openapi.json#/components/schemas/Location",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string"
    },
    "tz": {
      "type": "string",
      "description": "IANA time zone the location plans and counts in"
    },
    "address": {
      "type": [
        "string",
        "null"
      ]
    },
    "active": {
      "type": "boolean"
    },
    "attendance_enabled": {
      "type": "boolean",
      "description": "The QR door scan is on here"
    },
    "work_time": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "distribution": {
              "type": "string",
              "enum": [
                "even",
                "uneven"
              ]
            },
            "weekly_norm_minutes": {
              "type": "integer",
              "description": "The standard week the average is held to, e.g. 2400 = 40 h"
            },
            "averaging_start": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date",
                  "description": "Local date of the location, YYYY-MM-DD"
                },
                {
                  "type": "null"
                }
              ],
              "description": "First day of the first averaging period"
            },
            "averaging_length": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Length of one averaging period: months in SK, weeks in CZ"
            }
          },
          "required": [
            "distribution",
            "weekly_norm_minutes",
            "averaging_start",
            "averaging_length"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ],
      "description": "Uneven distribution of working time with an averaging period; null when the week is even"
    }
  },
  "required": [
    "id",
    "name",
    "tz",
    "address",
    "active",
    "attendance_enabled",
    "work_time"
  ],
  "additionalProperties": false
}