{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agonna-com/json-schema/agonna-com-locale-in-schema.json",
  "title": "LocaleIn",
  "description": "What a person tells Agonna about where they are. Every field is optional.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agonna-com-cockpit-api-openapi.yml#/components/schemas/LocaleIn",
  "properties": {
    "country": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Country",
      "description": "ISO 3166-1 alpha-2, e.g. CN, JP, US"
    },
    "region": {
      "type": "string",
      "maxLength": 120,
      "title": "Region",
      "default": ""
    },
    "city": {
      "type": "string",
      "maxLength": 120,
      "title": "City",
      "default": ""
    },
    "lat": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 90.0,
          "minimum": -90.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Lat"
    },
    "lon": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 180.0,
          "minimum": -180.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Lon"
    },
    "timezone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Timezone",
      "description": "IANA, e.g. Asia/Shanghai"
    },
    "currency": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Currency",
      "description": "ISO 4217, e.g. CNY"
    },
    "languages": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "maxItems": 12,
      "title": "Languages"
    },
    "work_hours": {
      "anyOf": [
        {
          "$ref": "#/$defs/WorkHours"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "additionalProperties": false,
  "type": "object",
  "$defs": {
    "WorkHours": {
      "properties": {
        "start": {
          "type": "string",
          "title": "Start",
          "description": "HH:MM, e.g. 09:00"
        },
        "end": {
          "type": "string",
          "title": "End",
          "description": "HH:MM, e.g. 18:00"
        },
        "days": {
          "items": {
            "type": "integer"
          },
          "type": "array",
          "title": "Days",
          "description": "ISO weekdays: 1 = Monday ... 7 = Sunday"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "start",
        "end"
      ],
      "title": "WorkHours",
      "description": "Usual working hours in the person's own time zone. ``end`` before ``start`` = past midnight."
    }
  }
}