<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="ProgrammersReference.xslt"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://ePocket.no/Handyman62/Api" targetNamespace="http://ePocket.no/Handyman62/Api">
  <xs:element name="EventList">
		<xs:annotation>
			<xs:documentation>Handyman Export: Events from mobile device (timers)</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="Event" minOccurs="0" maxOccurs="unbounded">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="HSEventID" type="xs:integer">
								<xs:annotation>
									<xs:appinfo>0,>0</xs:appinfo>
									<xs:documentation>Unique database id for event from Handyman</xs:documentation>
								</xs:annotation>
                </xs:element>
							<xs:element name="Type">
								<xs:simpleType>
									<xs:annotation>
										<xs:appinfo>
                    1 = Start Day
                    2 = Start Travel
                    3 = Stop Travel
                    4 = Start Work
                    5 = Stop Work
                    6 = Start Break
                    7 = Stop Break
                    8 = End Day
                  </xs:appinfo>
										<xs:documentation/>
									</xs:annotation>
									<xs:restriction base="xs:integer">
										<xs:enumeration value="1"/>
										<xs:enumeration value="2"/>
										<xs:enumeration value="3"/>
										<xs:enumeration value="4"/>
										<xs:enumeration value="5"/>
										<xs:enumeration value="6"/>
										<xs:enumeration value="7"/>
										<xs:enumeration value="8"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
							<xs:element name="EmployeeNo">
							<xs:simpleType>
								<xs:restriction base="xs:string">
								<xs:maxLength value="20"/>
								</xs:restriction>
							</xs:simpleType>
							</xs:element>
							<xs:element name="HSOrderNumber" type="xs:integer">
								<xs:annotation>
									<xs:appinfo>0,>0</xs:appinfo>
									<xs:documentation>Handymans internal order number. 0 if message is not connected to an order.</xs:documentation>
								</xs:annotation>
							</xs:element>
							<xs:element name="OrderNo">
								<xs:annotation>
									<xs:documentation>Backoffice order number. Empty string if no number is avaialable or event not is connected to order.</xs:documentation>
								</xs:annotation>
							<xs:simpleType>
								<xs:restriction base="xs:string">
								<xs:maxLength value="20"/>
								</xs:restriction>
							</xs:simpleType>
							</xs:element>
							<xs:element name="SalaryCode">
								<xs:annotation>
									<xs:documentation>Mandatory for event type 2 to 7. Empty for type 1 and 8.</xs:documentation>
								</xs:annotation>
								<xs:simpleType>
								<xs:restriction base="xs:string">
								<xs:maxLength value="20"/>
								</xs:restriction>
							</xs:simpleType>
							</xs:element>
							<xs:element name="Date" type="xs:dateTime">
								<xs:annotation>
									<xs:documentation>Date and time for the event.</xs:documentation>
								</xs:annotation>
								
							</xs:element>
							<xs:element name="Duration" type="xs:float">
								<xs:annotation>
									<xs:appinfo>0,>0</xs:appinfo>
									<xs:documentation>
                    Only for event type 3,5,7 and 8. Not mandatory.
                    Represented in minutes. If seconds, decimal value is in 100's. 45 seconds = 0,75.
                  </xs:documentation>
								</xs:annotation>
							</xs:element>
							<xs:element name="Odometer" type="xs:integer">
								<xs:annotation>
									<xs:appinfo>0,>0</xs:appinfo>
									<xs:documentation>Only for event type 1 and 8. Not mandatory.</xs:documentation>
								</xs:annotation>
							</xs:element>
							<xs:element name="Longitude" type="xs:integer">
								<xs:annotation>
									<xs:appinfo>0,>0</xs:appinfo>
									<xs:documentation>WGS84 format (in millionths of degree). 0 if no position defined</xs:documentation>
								</xs:annotation>
							</xs:element>
							<xs:element name="Latitude" type="xs:integer">
								<xs:annotation>
									<xs:appinfo>0,>0</xs:appinfo>
									<xs:documentation>WGS84 format (in millionths of degree). 0 if no position defined.</xs:documentation>
								</xs:annotation>
							</xs:element>
              <xs:element name="GPSTimeStamp" type="nillableDate">
                <xs:annotation>
                  <xs:documentation>Timestamp for GPS position data. This is a "nillable" dateTime.</xs:documentation>
                </xs:annotation>
              </xs:element>
            </xs:sequence>
		</xs:complexType>
	</xs:element>
	</xs:sequence>
	</xs:complexType>
	</xs:element>

  <xs:simpleType name="nillableDate">
    <xs:union memberTypes="xs:dateTime emptyString"/>
  </xs:simpleType>

  <xs:simpleType name="emptyString">
    <xs:restriction base="xs:string">
      <xs:length value="0"/>
    </xs:restriction>
  </xs:simpleType>

</xs:schema>
