<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
           attributeFormDefault="unqualified">
    <xs:element name="itemMaster">
        <xs:annotation>
            <xs:documentation>GSI UK item master feed</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element name="clientId">
                    <xs:annotation>
                        <xs:documentation>Client identifier. Unique value provided to you at the time of integration.</xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                        <xs:restriction base="xs:string">
                            <xs:maxLength value="10"/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:element>
                <xs:element name="date" type="xs:dateTime">
                    <xs:annotation>
                        <xs:documentation>Date and timestamp when the export is generated.Date format as per W3C ISO 8601. Sample: 2009-11-05T13:15:30Z</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="catalogId" minOccurs="0">
                    <xs:annotation>
                        <xs:documentation>Catalogue identifier or brand code if the case. All items listed below will inherit this value. Maximum 10 characters length.</xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                        <xs:restriction base="xs:string">
                            <xs:maxLength value="10"/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:element>
                <xs:element name="item" minOccurs="0" maxOccurs="unbounded">
                    <xs:complexType>
                        <xs:all>
                            <xs:element name="sku">
                                <xs:annotation>
                                    <xs:documentation>Unique product identifier that will be used by GSI to communicate with the web-store on all feeds. It is not necessarily  imported into WMS.</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                    <xs:restriction base="xs:string">
                                        <xs:minLength value="1"/>
                                        <xs:maxLength value="50"/>
                                    </xs:restriction>
                                </xs:simpleType>
                            </xs:element>
                            <xs:element name="altSku" minOccurs="0">
                                <xs:annotation>
                                    <xs:documentation>Alternative SKU. Unique SKU identifier (preferable the one is on the products label) that will be imported into warehouse management system.
                                        The best scenario would be that this code will be a barcode (either EAN or UPC code). This is limited to maximum 32 characters long.
                                        I can contain just alphanumeric, dashes and underscores characters. If provided and valid it could be printed on advice note.</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                    <xs:restriction base="xs:string">
                                        <xs:pattern value="[a-zA-Z0-9\-_]{1,32}"/>
                                    </xs:restriction>
                                </xs:simpleType>
                            </xs:element>
                            <xs:element name="eanCode" minOccurs="0">
                                <xs:simpleType>
                                    <xs:restriction base="xs:string">
                                        <xs:pattern value="[\d]{13}"/>
                                    </xs:restriction>
                                </xs:simpleType>
                            </xs:element>
                            <xs:element name="upcCode" minOccurs="0">
                                <xs:simpleType>
                                    <xs:restriction base="xs:string">
                                        <xs:pattern value="[\d]{12}"/>
                                    </xs:restriction>
                                </xs:simpleType>
                            </xs:element>
                            <xs:element name="name">
                                <xs:annotation>
                                    <xs:documentation>Human readable description of the product. Please avoid providing html entities.</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                    <xs:restriction base="xs:string">
                                        <xs:maxLength value="255"/>
                                    </xs:restriction>
                                </xs:simpleType>
                            </xs:element>
                            <xs:element name="weight" type="xs:float">
                                <xs:annotation>
                                    <xs:documentation>Product weight in Kg</xs:documentation>
                                </xs:annotation>
                            </xs:element>
                            <xs:element name="height" type="xs:float">
                                <xs:annotation>
                                    <xs:documentation>Product height in cm</xs:documentation>
                                </xs:annotation>
                            </xs:element>
                            <xs:element name="length" type="xs:float">
                                <xs:annotation>
                                    <xs:documentation>Product length in cm</xs:documentation>
                                </xs:annotation>
                            </xs:element>
                            <xs:element name="width" type="xs:float">
                                <xs:annotation>
                                    <xs:documentation>Product width in cm</xs:documentation>
                                </xs:annotation>
                            </xs:element>
                            <xs:element name="cost" type="xs:decimal" minOccurs="0">
                                <xs:annotation>
                                    <xs:documentation>Product cost. VAT exclusive if WMS is PRIAM</xs:documentation>
                                </xs:annotation>
                            </xs:element>
                            <xs:element name="price" type="xs:float" minOccurs="0">
                                <xs:annotation>
                                    <xs:documentation>Recommended retail price.VAT inclusive if WMS is PRIAM. It's not intended to replace the product price that the customer pay for it.</xs:documentation>
                                </xs:annotation>
                            </xs:element>
                            <xs:element name="customsNumber" type="xs:string" minOccurs="0">
                                <xs:annotation>
                                    <xs:documentation>Harmonized commodity product code. Needed only for shipments outside of EU countries.</xs:documentation>
                                </xs:annotation>
                            </xs:element>
                            <xs:element name="countryOfOrigin" minOccurs="0">
                                <xs:annotation>
                                    <xs:documentation>Two letter country codes as per ISO 3166-1 alpha-2</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                    <xs:restriction base="xs:string">
                                        <xs:minLength value="2"/>
                                        <xs:maxLength value="2"/>
                                    </xs:restriction>
                                </xs:simpleType>
                            </xs:element>
                            <xs:element name="productType" type="xs:string" default="P"
                                        minOccurs="0">
                                <xs:annotation>
                                    <xs:documentation>It could have the following values: P - norma; product; S - set (bundle type);  Most implementations will be using value P. If not provided the default value will be used: P (normal product)</xs:documentation>
                                </xs:annotation>
                            </xs:element>
                            <xs:element name="backorderable" minOccurs="0">
                                <xs:annotation>
                                    <xs:documentation>Legacy, no longer in use!</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                    <xs:restriction base="xs:string">
                                        <xs:pattern value="(Y|N){1}"/>
                                        <xs:enumeration value="Y"/>
                                        <xs:enumeration value="N"/>
                                    </xs:restriction>
                                </xs:simpleType>
                            </xs:element>
                            <xs:element name="componentOf" minOccurs="0">
                                <xs:annotation>
                                    <xs:documentation>If productType is defined as "S" (SET) this information must be provided.</xs:documentation>
                                </xs:annotation>
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="component" maxOccurs="unbounded">
                                            <xs:complexType>
                                                <xs:all>
                                                    <xs:element name="sku" type="xs:string">
                                                        <xs:annotation>
                                                            <xs:documentation>The SKUs this product will be a component of. These SKUs needs to be defined (exist) already in the catalogue having the "productType" = P (normal product)</xs:documentation>
                                                        </xs:annotation>
                                                    </xs:element>
                                                    <xs:element name="quantity"
                                                                type="xs:positiveInteger">
                                                        <xs:annotation>
                                                            <xs:documentation>The component quantity within the SET</xs:documentation>
                                                        </xs:annotation>
                                                    </xs:element>
                                                </xs:all>
                                            </xs:complexType>
                                        </xs:element>
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>
                            <xs:element name="contents" minOccurs="0">
                                <xs:annotation>
                                    <xs:documentation>Item contents. One item could have infinite contents.</xs:documentation>
                                </xs:annotation>
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="content" maxOccurs="unbounded">
                                            <xs:annotation>
                                                <xs:documentation>Content node. Each content could have distinct trasnalations.</xs:documentation>
                                            </xs:annotation>
                                            <xs:complexType>
                                                <xs:sequence>
                                                    <xs:element name="propertyName">
                                                        <xs:annotation>
                                                            <xs:documentation>Content name. It has restrictions against it. There is allow just alphanumeric, dashes and underscores between 1 and 50 characters length.</xs:documentation>
                                                        </xs:annotation>
                                                        <xs:simpleType>
                                                            <xs:restriction base="xs:string">
                                                                <xs:pattern value="[a-zA-Z0-9\-_]{1,50}"/>
                                                            </xs:restriction>
                                                        </xs:simpleType>
                                                    </xs:element>
                                                    <xs:element name="value" maxOccurs="unbounded">
                                                        <xs:complexType>
                                                            <xs:all>
                                                                <xs:element name="langId">
                                                                    <xs:annotation>
                                                                        <xs:documentation>Language identifier. Two characters length as per ISO 639-1.</xs:documentation>
                                                                    </xs:annotation>
                                                                </xs:element>
                                                                <xs:element name="valueContent">
                                                                    <xs:annotation>
                                                                        <xs:documentation>Human readable description of the item content property defined on property name. it should have the content translated as per language identifier. Not allowed blank values.</xs:documentation>
                                                                    </xs:annotation>
                                                                    <xs:simpleType>
                                                                        <xs:restriction base="xs:string">
                                                                            <xs:pattern value="(.*)+"/>
                                                                        </xs:restriction>
                                                                    </xs:simpleType>
                                                                </xs:element>
                                                            </xs:all>
                                                        </xs:complexType>
                                                    </xs:element>
                                                </xs:sequence>
                                            </xs:complexType>
                                        </xs:element>
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>
                            <xs:element name="fabric" minOccurs="0">
                                <xs:annotation>
                                    <xs:documentation>Product fabric. I.e. 85% Cotton 15% Merinos Wool </xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                    <xs:restriction base="xs:string">
                                        <xs:maxLength value="50"/>
                                    </xs:restriction>
                                </xs:simpleType>
                            </xs:element>
                            <xs:element name="productTypeDescription" minOccurs="0">
                                <xs:annotation>
                                    <xs:documentation>Product type description</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                    <xs:restriction base="xs:string">
                                        <xs:maxLength value="50"/>
                                    </xs:restriction>
                                </xs:simpleType>
                            </xs:element>
                            <xs:element name="imageUrl" minOccurs="0">
                                <xs:annotation>
                                    <xs:documentation>Product Image URL of the item. This field must be a valid URL</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                    <xs:restriction base="xs:anyURI">
                                        <xs:maxLength value="250"/>
                                    </xs:restriction>
                                </xs:simpleType>
                            </xs:element>
                            <xs:element name="captureExpireDate" type="xs:boolean" minOccurs="0">
                                <xs:annotation>
                                    <xs:documentation>Whether or not Radial's operation should capture the product expiry date.
                                        Accepted values are: true / false.
                                        Currently supported only for German operation.</xs:documentation>
                                </xs:annotation>
                            </xs:element>
                            <xs:element name="minExpireDays" type="xs:nonNegativeInteger"
                                        minOccurs="0">
                                <xs:annotation>
                                    <xs:documentation>Minimum number of days the product can be held in the warehouse before it expires. Used during receiving validations. Radial operation won't receive the stock if the expire date is less than this given number.
                                        It works in conjunction with captureExpireDate flag.
                                        Default value is 0.</xs:documentation>
                                </xs:annotation>
                            </xs:element>
                            <xs:element name="captureBatchRef" type="xs:boolean" minOccurs="0">
                                <xs:annotation>
                                    <xs:documentation>Defines if Warehouse Management System prompts the user for batch number during the receiving process.
                                        Accepted values: true / false
                                        Default value: false</xs:documentation>
                                </xs:annotation>
                            </xs:element>
                            <xs:element name="catalogId" minOccurs="0">
                                <xs:annotation>
                                    <xs:documentation>Catalogue identifier or brand code.
                                        If this is set, it will take precedence if the header catalogue ID is provided.

                                        Maximum 10 characters length.
                                        Default value: [blank]</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                    <xs:restriction base="xs:string">
                                        <xs:maxLength value="10"/>
                                    </xs:restriction>
                                </xs:simpleType>
                            </xs:element>
                            <xs:element name="extendedAttributes" type="extendedAttributes"
                                        minOccurs="0">
                                <xs:annotation>
                                    <xs:documentation>Encapsulates item specific  customizable section of the message.
                                        It enables additional details to be added to the given product.</xs:documentation>
                                </xs:annotation>
                            </xs:element>
                            <xs:element minOccurs="0" name="gtinBarcodes" type="gtinBarcodes"/>
                            <xs:element default="0" minOccurs="0" name="captureSerialNumber">
                                <xs:annotation>
                                    <xs:documentation>If serial number tracking is enabled for the warehouse, this flag defines how serial number should be tracked for the given product.

                                        0 ~ Default value / do not track
                                        1 ~ Only track the serial numbers during Outbound (packing and shipping only)
                                        3 ~ Only track serial numbers during Inbound (receiving and create LPN only)
                                        4 ~ Complete tracking of the serial numbers (throughout the entire warehouse)
                                    </xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                    <xs:restriction base="xs:integer">
                                        <xs:pattern value="[0,1,3,4]{1}"/>
                                    </xs:restriction>
                                </xs:simpleType>
                            </xs:element>
                            <xs:element default="kg" minOccurs="0" name="weightUomCode">
                                <xs:annotation>
                                    <xs:documentation>Weight unit of measure
                                        Default code: kilogram / kg
                                        Accepted codes: kg, g, t, ton_uk, ton_us, lb, oz</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                    <xs:restriction base="xs:string">
                                        <xs:enumeration value="kg"/>
                                        <xs:enumeration value="g"/>
                                        <xs:enumeration value="t"/>
                                        <xs:enumeration value="ton_uk"/>
                                        <xs:enumeration value="ton_us"/>
                                        <xs:enumeration value="lb"/>
                                        <xs:enumeration value="oz"/>
                                    </xs:restriction>
                                </xs:simpleType>
                            </xs:element>
                            <xs:element default="cm" minOccurs="0" name="dimensionsUomCode">
                                <xs:annotation>
                                    <xs:documentation>Dimensions unit of measure
                                        Default value: centimeters / cm
                                        Accepted values: cm, mm, m, in, ft, yd</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                    <xs:restriction base="xs:string">
                                        <xs:enumeration value="cm"/>
                                        <xs:enumeration value="mm"/>
                                        <xs:enumeration value="m"/>
                                        <xs:enumeration value="in"/>
                                        <xs:enumeration value="ft"/>
                                        <xs:enumeration value="yd"/>
                                    </xs:restriction>
                                </xs:simpleType>
                            </xs:element>
                        </xs:all>
                    </xs:complexType>
                </xs:element>
                <xs:element name="extendedAttributes" type="extendedAttributes" minOccurs="0">
                    <xs:annotation>
                        <xs:documentation>Encapsulates item master customizable section of the message.
                            It enables additional details to be added to the given message.</xs:documentation>
                    </xs:annotation>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:complexType name="extendedAttributes">
        <xs:annotation>
            <xs:documentation>Encapsulates the customizable section of the message.
                It enables additional details to be added to the given message.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="attribute" maxOccurs="unbounded">
                <xs:annotation>
                    <xs:documentation>It holds the actual attribute value.

                        Allowable Values: Text string
                        Required: Yes
                        Max length: 200
                        Default Value: blank
                        Restrictions: N/A</xs:documentation>
                </xs:annotation>
                <xs:complexType>
                    <xs:simpleContent>
                        <xs:extension base="xs:string">
                            <xs:attribute name="name" use="required">
                                <xs:annotation>
                                    <xs:documentation>Attribute title

                                        Allowable Values: Text string
                                        Required: Yes
                                        Max length: 30
                                        Default Value: blank
                                        Restrictions: Yes</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                    <xs:restriction base="xs:string">
                                        <xs:maxLength value="30"/>
                                    </xs:restriction>
                                </xs:simpleType>
                            </xs:attribute>
                        </xs:extension>
                    </xs:simpleContent>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="gtinBarcodes">
        <xs:annotation>
            <xs:documentation>Encapsulates dynamically item barcode management for a given item/product.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="barcode" maxOccurs="unbounded">
                <xs:annotation>
                    <xs:documentation>In the event the product has more than one barcode, this is the place to add them.
                        RUC executes business logic validation and SKU update is rejected if the same GTIN barcode is used against different SKUs or is duplicated within the same SKU.
                        Allowable Values: AlphaNumeric, hypen and underscore only
                        Required: Yes
                        Max length: 32
                        Default Value: Cannot be blank</xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:pattern value="[a-zA-Z0-9\-_]{1,32}"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
</xs:schema>
