<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" 
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns="http://www.posti.com/wms/postiwmsxml/UpdateBatch/2018/1"
    targetNamespace="http://www.posti.com/wms/postiwmsxml/UpdateBatch/2018/1">

	<xs:element name="UpdateBatch">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="MetaData" type="ctMetaDataType" minOccurs="1" maxOccurs="1"/>
				<xs:element name="Item" type="ctItemType" minOccurs="1" maxOccurs="1"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	
	<xs:element name="UpdateBatchResponse">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="Result" type="stResponseResultType" minOccurs="1" maxOccurs="1"/>
				<xs:element name="Message" type="xs:string" minOccurs="0" maxOccurs="1"/>
				<xs:element name="ProcessId" type="xs:string" minOccurs="0" maxOccurs="1"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>

	<xs:complexType name="ctMetaDataType">
		<xs:annotation>
			<xs:documentation>Contains information about message.</xs:documentation>
		</xs:annotation>
		<xs:attribute name="SourceOrganizationId" type="stStringMaxLength40Type" use="required">
			<xs:annotation>
				<xs:documentation>Code for the organization that sends the item master message, provided by Posti (principal identifier).</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="Language" type="stStringMaxLength2Type" use="optional">
			<xs:annotation>
				<xs:documentation>Language code of the item master in two-letter ISO 639-1 format, e.g. FI.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ExternalUserId" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Identifier of the principal in external system (OVT code, EDI sender ID).</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="DocumentType" type="stStringMaxLength40Type" use="required">
			<xs:annotation>
				<xs:documentation>Name of the document. This should be InItemMaster.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="CreationDateTime" type="xs:dateTime" use="optional">
			<xs:annotation>
				<xs:documentation>Date and time of item master creation.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="MessageIdentifier" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Identifier of the message which is unique at least in the scope of message sender.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>

	<xs:complexType name="ctItemType">
		<xs:annotation>
			<xs:documentation>Contains information about item.</xs:documentation>
		</xs:annotation>
		<xs:all>
			<xs:element name="TagDetail" type="ctItemTagDetailType" minOccurs="1" maxOccurs="1"/>
		</xs:all>
		<xs:attribute name="UnitOfMeasure" type="stStringMaxLength40Type" use="required">
			<xs:annotation>
				<xs:documentation>Unit of measure for item quantity.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ItemID" type="stStringMaxLength40Type" use="required">
			<xs:annotation>
				<xs:documentation>Unique identifier for an item that belongs to a principal's catalog organization.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="InventoryStatus" type="stStringMaxLength40Type" use="required">
			<xs:annotation>
				<xs:documentation>Unique identifier for an item that belongs to a principal's catalog organization.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ProductClass" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Product class. This field is used as an inventory identifier.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	
	<xs:complexType name="ctItemTagDetailType">
		<xs:attribute name="LotNumber" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Lot number.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ManufacturingDate" type="xs:date" use="optional">
			<xs:annotation>
				<xs:documentation>Lot manufacturing date.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="LotAttribute1" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Lot attribute 1.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="LotAttribute2" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Lot attribute 2.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="LotAttribute3" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Lot attribute 3.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="RevisionNo" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Revision number.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="BestBeforeDate" type="xs:date" use="optional">
			<xs:annotation>
				<xs:documentation>Best before date.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="IncubationDate" type="xs:date" use="optional">
			<xs:annotation>
				<xs:documentation>Incubation date.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="AvailabilityDate" type="xs:date" use="optional">
			<xs:annotation>
				<xs:documentation>Material availability date.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	
	<xs:simpleType name="stStringMaxLength2Type">
		<xs:annotation>
			<xs:documentation>String with maximum length of 2 characters.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="2"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="stStringMaxLength40Type">
		<xs:annotation>
			<xs:documentation>String with maximum length of 40 characters.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="40"/>
		</xs:restriction>
	</xs:simpleType>
	
	<xs:simpleType name="stResponseResultType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="SUCCESS"/>
			<xs:enumeration value="FAILURE"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>