<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.ismobile.com/coordinator/2006/operations/cwi/create_asgt/" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:coord="http://www.ismobile.com/coordinator/2006/operations/cwi/create_asgt/" xmlns:ty="http://www.ismobile.com/coordinator/2017/types/">
    <!-- Created with com.ismobile.xsdfix:xsdfix:1.1 at 2018-01-19 14:40:41 -->
    <xs:import namespace="http://www.ismobile.com/coordinator/2017/types/" schemaLocation="http://coord.ismobile.com/coordinator/cwi/ws/hard/types.xsd"/>
    <xs:attribute name="target" type="ty:string100"/>
    <xs:attribute name="type" type="ty:string100"/>
    <xs:element name="instruction" type="ty:string100">
        <xs:annotation>
            <xs:documentation>Assignment instructions</xs:documentation>
        </xs:annotation>
    </xs:element>
    <xs:element name="messageid" type="ty:string100">
        <xs:annotation>
            <xs:documentation>ID of the message from backend system, if this element is set in the XML, an ack/nack will be sent back</xs:documentation>
        </xs:annotation>
    </xs:element>
    <xs:element name="woid" type="ty:string100" nillable="false">
        <xs:annotation>
            <xs:documentation>External workorder ID</xs:documentation>
        </xs:annotation>
    </xs:element>
    <xs:element name="companyid" type="ty:string100" nillable="false">
        <xs:annotation>
            <xs:documentation>Team name where the workorder exists</xs:documentation>
        </xs:annotation>
    </xs:element>
    <xs:element name="workitemid" type="ty:string100" nillable="false">
        <xs:annotation>
            <xs:documentation>Workitem Id, the workitem to create the assignment from</xs:documentation>
        </xs:annotation>
    </xs:element>
    <xs:element name="resid" type="ty:string100" nillable="false">
        <xs:annotation>
            <xs:documentation>External Id of assigned resource</xs:documentation>
        </xs:annotation>
    </xs:element>
    <xs:element name="starttime" nillable="false">
        <xs:annotation>
            <xs:documentation>Start time for the assignment (ISO-8601)</xs:documentation>
        </xs:annotation>
        <xs:complexType> 
            <xs:simpleContent>
                <xs:extension base="ty:baseDatetime">
                    <xs:attribute ref="coord:type" use="required" fixed="datetime"/>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>
    <xs:element name="stoptime" nillable="false">
        <xs:annotation>
            <xs:documentation>Stop time for the assignment (ISO-8601)</xs:documentation>
        </xs:annotation>
        <xs:complexType> 
            <xs:simpleContent>
                <xs:extension base="ty:baseDatetime">
                    <xs:attribute ref="coord:type" use="required" fixed="datetime"/>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>
    <xs:element name="useglobalid" nillable="false">
        <xs:annotation>
            <xs:documentation>Use global search over all teams for resource id</xs:documentation>
        </xs:annotation>
        <xs:complexType> 
            <xs:simpleContent>
                <xs:extension base="ty:baseBool">
                    <xs:attribute ref="coord:type" use="required" fixed="bool"/>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>
    <xs:element name="assignmentpart">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="coord:starttime"/>
                <xs:element ref="coord:stoptime"/>
                <xs:element ref="coord:effort"/>
                <xs:element ref="coord:percentcomplete"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="percentcomplete">
        <xs:annotation>
            <xs:documentation>How much of the work is done on the part of the assignment</xs:documentation>
        </xs:annotation>
        <xs:complexType> 
            <xs:simpleContent>
                <xs:extension base="ty:baseInt">
                    <xs:attribute ref="coord:type" use="required" fixed="int"/>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>
    <xs:element name="effort">
        <xs:annotation>
            <xs:documentation>Effort for this assignment part in minutes</xs:documentation>
        </xs:annotation>
        <xs:complexType> 
            <xs:simpleContent>
                <xs:extension base="ty:baseInt">
                    <xs:attribute ref="coord:type" use="required" fixed="int"/>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>
    <xs:element name="dispatched">
        <xs:annotation>
            <xs:documentation>True/false flag saying if the assignment should be dispatched immediately</xs:documentation>
        </xs:annotation>
        <xs:complexType> 
            <xs:simpleContent>
                <xs:extension base="ty:baseBool">
                    <xs:attribute ref="coord:type" use="required" fixed="bool"/>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>
    <xs:element name="create">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="coord:useglobalid" minOccurs="0"/>
                <xs:element ref="coord:companyid"/>
                <xs:element ref="coord:resid"/>
                <xs:element ref="coord:workitemid"/>
                <xs:element ref="coord:starttime"/>
                <xs:element ref="coord:stoptime"/>
                <xs:element ref="coord:assignmentpart" minOccurs="0" maxOccurs="100"/>
                <xs:element ref="coord:instruction" minOccurs="0"/>
                <xs:element ref="coord:dispatched" minOccurs="0"/>
            </xs:sequence>
            <xs:attribute ref="coord:target" use="required" fixed="assignment"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="header">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="coord:messageid"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="operation">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="coord:header" minOccurs="0"/>
                <xs:element ref="coord:create"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>
