<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  <xs:element name="Employees">
    <xs:complexType>
      <xs:sequence maxOccurs="1">
        <xs:element maxOccurs="unbounded" ref="Employee"/>
      </xs:sequence>
      <xs:attribute name="generated" type="xs:dateTime" use="optional"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="Employee">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="EmployeeId" type="xs:string"/>
        <xs:element minOccurs="0" name="SalesPersonId" type="xs:string"/>
        <xs:element name="EmployeeCardId" type="xs:string" minOccurs="0" maxOccurs="1"/>
        <xs:element name="FirstName" type="xs:string"/>
        <xs:element name="LastName" type="xs:string"/>
        <xs:element minOccurs="0" name="ShortName" type="xs:string"/>
        <xs:element name="HomeStoreId" type="xs:string"/>
        <xs:element name="Language">
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:pattern value="([a-z]{2})(-[A-Z]{2})?"/>
            </xs:restriction>
          </xs:simpleType>
        </xs:element>
        <xs:element name="FunctionId" type="xs:string" minOccurs="1"/>
        <xs:element name="DeviatingRoleId" type="xs:string" minOccurs="0"/>
        <xs:element name="StartOfEmployment" type="xs:date" minOccurs="0"/>
        <xs:element name="EndOfEmployment" type="xs:date" minOccurs="0"/>
        <xs:element minOccurs="0" ref="AdditionalInformation"/>
        <xs:element name="AccessStores">
          <xs:complexType>
            <xs:sequence maxOccurs="1">
              <xs:element maxOccurs="unbounded" ref="AccessStore"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="ContractHours" type="xs:int" nillable="true" minOccurs="0" />
        <xs:element name="DiscountBalanceStartDate" type="xs:date" nillable="true" minOccurs="0" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="AdditionalInformation">
    <xs:complexType>
      <xs:sequence>

        <xs:element minOccurs="0" name="PreferredHand">
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:enumeration value="Left"/>
              <xs:enumeration value="Right"/>
            </xs:restriction>
          </xs:simpleType>
        </xs:element>
        <xs:element minOccurs="0" name="PaymentPreSelectionType">
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:enumeration value="Blocked"/>
              <xs:enumeration value="Cash"/>
              <xs:enumeration value="OnAccount"/>
            </xs:restriction>
          </xs:simpleType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="AccessStore">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="StoreId" type="xs:string"/>
        <xs:element name="AccessStartDate" type="xs:date" minOccurs="0" />
        <xs:element name="AccessEndDate" type="xs:date" minOccurs="0" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

</xs:schema>
