{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "EmployeesRoot",
  "type": "object",
  "properties": {
    "Employees": {
      "type": "object",
      "properties": {
        "generated": {
          "type": "string",
          "format": "date-time"
        },
        "Employee": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "EmployeeId": { "type": "string" },
              "SalesPersonId": { "type": "string" },
              "EmployeeCardId": { "type": "string" },
              "FirstName": { "type": "string" },
              "LastName": { "type": "string" },
              "ShortName": { "type": "string" },
              "HomeStoreId": { "type": "string" },
              "Language": {
                "type": "string",
                "pattern": "([a-z]{2})(-[A-Z]{2})?"
              },
              "FunctionId": { "type": "string" },
              "DeviatingRoleId": { "type": "string" },
              "StartOfEmployment": {
                "type": "string",
                "format": "date"
              },
              "EndOfEmployment": {
                "type": "string",
                "format": "date"
              },
              "AdditionalInformation": {
                "type": "object",
                "properties": {
                  "PreferredHand": {
                    "type": "string",
                    "enum": ["Left", "Right"]
                  },
                  "PaymentPreSelectionType": {
                    "type": "string",
                    "enum": ["Blocked", "Cash", "OnAccount"]
                  }
                },
                "additionalProperties": false
              },
              "AccessStores": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "StoreId": { "type": "string" },
                    "AccessStartDate": {
                      "type": "string",
                      "format": "date"
                    },
                    "AccessEndDate": {
                      "type": "string",
                      "format": "date"
                    }
                  },
                  "required": ["StoreId"],
                  "additionalProperties": false
                }
              },
              "ContractHours": {
                "type": ["integer", "null"]
              },
              "DiscountBalanceStartDate": {
                "type": "string",
                "format": "date"
              }
            },
            "required": [
              "EmployeeId",
              "FirstName",
              "LastName",
              "HomeStoreId",
              "Language",
              "FunctionId",
              "AccessStores"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": ["Employee"],
      "additionalProperties": false
    }
  },
  "required": ["Employees"],
  "additionalProperties": false
}
