<?xml version="1.0"?>
<xs:schema xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">

    <xs:element name="AssessmentOrderAcknowledgement">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="ClientId" minOccurs="0" maxOccurs="1">
                    <xs:complexType>
                        <xs:sequence>
                            <!-- OrgId - this is the HR Avatar Org Id  for this customer, encrypted. -->
                            <xs:element name="IdValue" type="IdValue" minOccurs="0"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>

                <xs:element name="ClientOrderId" minOccurs="0" maxOccurs="1">
                    <xs:complexType>
                        <xs:sequence>
                            <!-- OrderId - this is a unique identifier for this assessment event (order). Must be unique for the third party organization. -->
                            <xs:element name="IdValue" type="IdValue" minOccurs="0"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>

                <xs:element name="PackageId" minOccurs="0" maxOccurs="1">
                    <xs:complexType>
                        <xs:sequence>
                            <!-- AssessmentId - this is the HR Avatar Product Id  for this assessment -->
                            <xs:element name="IdValue" type="IdValue" minOccurs="0"/>

                        </xs:sequence>

                        <!-- date format is yyyy-mm-dd -->
                        <xs:attribute name="validFrom" type="xs:date"/>
                        <xs:attribute name="validTo" type="xs:date"/>

                    </xs:complexType>
                </xs:element>

                <xs:element name="AccessPoint" minOccurs="0" maxOccurs="1">
                    <xs:complexType>
                        <xs:sequence>
                            <!-- Assessment Start URL - redirect test-taker here to begin this assessment. This is always included unless the result XML is provided. -->
                            <xs:element name="InternetWebAddress" type="xs:string" minOccurs="0" maxOccurs="1"/>
                        </xs:sequence>
                        <!-- date format is yyyy-mm-dd -->
                        <xs:attribute name="validFrom" type="xs:date"/>
                        <xs:attribute name="validTo" type="xs:date"/>
                    </xs:complexType>
                </xs:element>
          
                <!-- Used only for Reference Checks only. -->
                <xs:element name="Raters" minOccurs="0" maxOccurs="1">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="Rater" minOccurs="0" maxOccurs="unbounded">
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="Identifier" type="xs:string" minOccurs="0" maxOccurs="1"/>
                                        <xs:element name="GivenName" type="xs:string" minOccurs="0"/>
                                        <xs:element name="FamilyName" type="xs:string" minOccurs="0"/>
                                        <xs:element name="InternetEmailAddress" type="xs:string" minOccurs="0"/>
                                        <xs:element name="MobilePhoneNumber" type="xs:string" minOccurs="0"/>
                                        <xs:element name="InternetWebAddress" type="xs:string" minOccurs="0" maxOccurs="1"/>
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
          

                <xs:element name="AssessmentStatus" minOccurs="0" maxOccurs="1">
                    <xs:complexType>
                        <xs:sequence>
                            <!-- Acknowledged or Error -->
                            <xs:element name="Status" type="xs:string" minOccurs="1" maxOccurs="1"/>

                            <!-- If Error this contains the error message -->
                            <xs:element name="Details" type="xs:string" minOccurs="0" maxOccurs="1"/>

                            <!-- Date that the assessment order was processed. yyyy-mm-dd -->
                            <xs:element name="StatusDate" type="xs:date" minOccurs="0" maxOccurs="1"/>

                            <!-- errorCode:  0=No Error (success), 1=Insufficient or erroneous request information, 2= Unknown system error. -->
                            <xs:element name="ErrorCode" type="xs:int" minOccurs="0"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>

                <!-- These are proprietary fields used by the HR Avatar System. Only included if order request succeeded -->
                <xs:element name="UserArea" minOccurs="0">
                    <xs:complexType>
                        <xs:sequence>
                            <!-- For single event authorizations, the Test Key id is a permenant unique identifier for this testing event on the the HR Avatar system.
                               In general, you can reference a Test Key either by including this value or by using the ClientOrderId.IdValue (name=orderId)
      
                               For multiple event authorizations when FileExportId=1 in the request, this is a set of Test Key Ids that can be used with the exported zip file.
                            -->
                            <xs:element name="TestKey" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>


                            <!-- This is the HR Avatar Access Code that can be used by a test taker to uniquely reference the test during the time before it is finished on test.hravatar.com.
                                This value is only valid while the test key is unfinished and valid. It is rarely used in integration situations.
        
                                 For multiple event authorizations when FileExportId=1 in the request, this is a set of Access codes that can be used.
                            -->
                            <xs:element name="AccessCode" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>

                            <!-- ZipFile Export Url URL - This is the download URL for a single-event-only zip file created as a part of the request (PackageId - FileExportTypeId=1).
                            Note that this file is only avilable for a short time around 12 hours and IS NOT AVAILABLE for approximately 10 minutes after the request is made.
                            The Sim contained in the Zip file will only operate with the provided testkey provided to the IMO as its 'eventId.' Also, the test must be completed within 48 hours.
                            Users should wait at least 10 minutes and then download this file after the response is received. -->
                            <xs:element name="FileExportUrl" type="xs:string" minOccurs="0" maxOccurs="1"/>

                            <!-- AssessmentStatusTypeId - this is an HR Avatar status identifier. Unstarted tests use a status identifer of 0. Completed tests used a status identifier of 100.
                            For a full list of status codes, please contact support@hravatar.com -->
                            <!-- ThirdPartyCookiesRequired - 0=Not Required, 1=Required -->                  
                            <!-- AssessmentStatusDescription - text explanation of the status -->                  
                            <!-- HRATestEventId - If resultXml is posted in the request, this is the HR Avatar Test Event Identifier. It's an long integer value. -->                  
                            <xs:element name="IdValue" type="IdValue" minOccurs="0" maxOccurs="unbounded"/>

                            <!-- If the AssessmentOrderRequest contains the value for ClientUniqueCustomerOrganizatonId, this value will appear in
                            the response with the id of the acocunt on the HR Avatar system.  -->
                            <xs:element name="ClientCustomerAccountId" type="xs:string" minOccurs="0" maxOccurs="1"/>

                            <!-- If the AssessmentOrderRequest contains the value for ClientUniqueCustomerOrganizatonId, this value will appear in
                            the response with the name of the acocunt on the HR Avatar system.  -->
                            <xs:element name="ClientCustomerAccountName" type="xs:string" minOccurs="0" maxOccurs="1"/>


                        </xs:sequence>
                    </xs:complexType>
                </xs:element>


            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:complexType name="IdValue">
        <xs:simpleContent msdata:ColumnName="idvalue_text" msdata:Ordinal="1">
            <xs:extension base="xs:string">
                <xs:attribute name="name" type="xs:string" />
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>


</xs:schema>