<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="ProgrammersReference.xslt"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://ePocket.no/Handyman62/Api" targetNamespace="http://ePocket.no/Handyman62/Api" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:element name="CategoryList">
		<xs:annotation>
			<xs:documentation>Handyman Import: Categories</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="Category" maxOccurs="unbounded">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="CategoryType">
								<xs:simpleType>
									<xs:annotation>
										<xs:appinfo>Order related category types:
                    &#160;&#160;&#160;1: Order category
                    &#160;&#160;&#160;0: Free category used on order
                    &#160;10: Priority
                    999: Free category used on order
					
					Other category types:
					&#160;&#160;2: Customer
					&#160;&#160;3: Checklist
					&#160;&#160;4: Salary code
					&#160;&#160;5: Wholesaler
					11: Reason for order rejection
					12: Repair cause
                    14: Discrepancy 
                    15: Equipment
                    18: Service form/task
                    20: Replacement cause
                    21: Reason for event rejection
                    22: Material
                    </xs:appinfo>
										<xs:documentation>Used together with CategoryID to identify record </xs:documentation>
									</xs:annotation>
									<xs:restriction base="xs:integer">
										<xs:enumeration value="0"/>
										<xs:enumeration value="1"/>
										<xs:enumeration value="2"/>
										<xs:enumeration value="3"/>
										<xs:enumeration value="4"/>
										<xs:enumeration value="5"/>
										<xs:enumeration value="10"/>
										<xs:enumeration value="12"/>
										<xs:enumeration value="14"/>
										<xs:enumeration value="15"/>
										<xs:enumeration value="18"/>
										<xs:enumeration value="20"/>
										<xs:enumeration value="21"/>
										<xs:enumeration value="22"/>
										<xs:enumeration value="999"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
							<xs:element name="CategoryID">
								<xs:annotation>
									<xs:documentation>Must be >0 and unique within CategoryType </xs:documentation>
								</xs:annotation>
								<xs:simpleType>
									<xs:restriction base="xs:string">
										<xs:maxLength value="20"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
							<xs:element name="Name">
								<xs:simpleType>
									<xs:restriction base="xs:string">
										<xs:maxLength value="255"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
							<xs:element name="Label" minOccurs="0">
								<xs:annotation>
									<xs:appinfo>For CategoryType 0 and 999</xs:appinfo>
									<xs:documentation>Label to be used in interface in Handyman</xs:documentation>
								</xs:annotation>
								<xs:simpleType>
									<xs:restriction base="xs:string">
										<xs:maxLength value="255"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
							<xs:element name="Settings" minOccurs="0">
								<xs:simpleType>
									<xs:annotation>
										<xs:appinfo>
                      For CategoryType 0,1 and 999:
                      0 = Visible for new orders
                      1 = Not visible for new orders

                      For CategoryType 10:
                      How will priority be displayed
                      0 = Low prioity icon + Name
                      1 = No icon + Name
                      2 = High priority icon + Name
                      3 = ID + Name
                    </xs:appinfo>
										<xs:documentation>Various settings depending on category type </xs:documentation>
									</xs:annotation>
									<xs:restriction base="xs:integer">
										<xs:enumeration value="0"/>
										<xs:enumeration value="1"/>
										<xs:enumeration value="2"/>
										<xs:enumeration value="3"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
							<xs:element name="Deleted" minOccurs="0">
								<xs:simpleType>
									<xs:annotation>
										<xs:appinfo>1=Delete category </xs:appinfo>
										<xs:documentation>All connections to the category will also be deleted </xs:documentation>
									</xs:annotation>
									<xs:restriction base="xs:integer">
										<xs:enumeration value="0"/>
										<xs:enumeration value="1"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
							<xs:element name="DepartmentID" minOccurs="0">
								<xs:annotation>
									<xs:appinfo>
                    For CategoryType 0,1 and 999:
                    Specify department id to restrict category to the department.
                  </xs:appinfo>
									<xs:documentation>If empty or not provided, the category will be available for all departments</xs:documentation>
								</xs:annotation>
								<xs:simpleType>
									<xs:restriction base="xs:string">
										<xs:maxLength value="255"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
							<xs:element name="CustomerSignatureMandatory" minOccurs="0">
								<xs:simpleType>
									<xs:annotation>
										<xs:appinfo>1=Customer signature is required for orders having this category</xs:appinfo>
										<xs:documentation/>
									</xs:annotation>
									<xs:restriction base="xs:integer">
										<xs:enumeration value="0"/>
										<xs:enumeration value="1"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
							<xs:element name="DefaultChecklistList" minOccurs="0">
								<xs:annotation>
									<xs:appinfo>List of default checklists for category.</xs:appinfo>
									<xs:documentation>NB! This structure will only be handeled if CategoryType=1</xs:documentation>
								</xs:annotation>
								<xs:complexType>
									<xs:sequence>
										<xs:element name="DefaultChecklist" minOccurs="0" maxOccurs="unbounded">
											<xs:complexType>
												<xs:sequence>
													<xs:element name="HSChecklistTypeID" type="xs:integer"/>
													<xs:element name="ChecklistTypeID">
														<xs:simpleType>
															<xs:restriction base="xs:string">
																<xs:maxLength value="20"/>
															</xs:restriction>
														</xs:simpleType>
													</xs:element>
													<xs:element name="ChecklistName">
														<xs:annotation>
															<xs:documentation>Name given by user for this checklist. If there are several checklists of the same type on an order they must have unique names.</xs:documentation>
														</xs:annotation>
														<xs:simpleType>
															<xs:restriction base="xs:string">
																<xs:maxLength value="20"/>
															</xs:restriction>
														</xs:simpleType>
													</xs:element>
													<xs:element name="DeleteOnClientNotAllowed">
														<xs:simpleType>
															<xs:annotation>
																<xs:appinfo>1=Not allowed to delete this checklist on the client. This means that the backoffice system can decide wich checklists that are mandatory on an ordercategory.</xs:appinfo>
															</xs:annotation>
															<xs:restriction base="xs:integer">
																<xs:enumeration value="0"/>
																<xs:enumeration value="1"/>
															</xs:restriction>
														</xs:simpleType>
													</xs:element>
													<xs:element name="Deleted" minOccurs="0">
														<xs:simpleType>
															<xs:annotation>
																<xs:appinfo>1=delete from list of default checklists for category</xs:appinfo>
															</xs:annotation>
															<xs:restriction base="xs:integer">
																<xs:enumeration value="0"/>
																<xs:enumeration value="1"/>
															</xs:restriction>
														</xs:simpleType>
													</xs:element>
													<xs:element name="CustomerSignatureMandatory" minOccurs="0">
														<xs:simpleType>
															<xs:annotation>
																<xs:appinfo>1=Customer signature is required for checklist used with this order category</xs:appinfo>
																<xs:documentation/>
															</xs:annotation>
															<xs:restriction base="xs:integer">
																<xs:enumeration value="0"/>
																<xs:enumeration value="1"/>
															</xs:restriction>
														</xs:simpleType>
													</xs:element>
												</xs:sequence>
											</xs:complexType>
										</xs:element>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>
