<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns="http://entp.hud.gov/binderList"
        targetNamespace="http://entp.hud.gov/binderList"
        elementFormDefault="qualified">

<!-- elements -->
<xsd:element name="process" type="inputType"/>
<xsd:element name="listResults" type="listOutputType"/>

<!-- complex types -->

<xsd:complexType name="inputType">
	<xsd:sequence>
		<!-- root element -->
		<xsd:element name="MULTICASEDATA" type="MCInputType"/>
	</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="listOutputType">
	<xsd:sequence>
		<!-- root element -->
		<xsd:element name="MULTICASEDATA" type="MCOutputType"/>
	</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="MCInputType">
	<xsd:sequence>
		<xsd:element name="PROCESSSTATUS" type="ProcessStatusInputType"/>
		<xsd:element name="CASEDATA" type="caseDataInputType" minOccurs="1" maxOccurs="unbounded"/>
	</xsd:sequence>
	<xsd:attribute name="MISMOVersionID" type="xsd:string"/>
</xsd:complexType>

<xsd:complexType name="MCOutputType">
	<xsd:sequence>
		<xsd:element name="PROCESSSTATUS" type="ProcessStatusOutputType"/>
		<xsd:element name="CASEDATA" type="caseDataOutputType" minOccurs="1" maxOccurs="unbounded"/>
	</xsd:sequence>
	<xsd:attribute name="MISMOVersionID" type="xsd:string"/>
</xsd:complexType>

<xsd:complexType name="caseDataInputType">
	<xsd:sequence>
		<xsd:element name="APPLICATION" type="applicationType"/>
	</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="caseDataOutputType">
	<xsd:sequence>
		<xsd:element name="APPLICATION" type="applicationType"/>
		<xsd:element name="AUDIT_TRAIL" type="trailType"/>
	</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="trailType">
	<xsd:sequence>
		<xsd:element name="AUDIT_ENTRY" type="aeType"/>
	</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="aeType">
<!--
The value of "_Status" indicates while fields to search for
DocumentUploaded	_DateTime (when file was uploaded)
UploadedFileName	_Value (name of file)
Error			_AuditNumber (code for audit reason) and _Message (text describing audit)
-->
	<xsd:attribute name="_Status" type="atStatType"/>
	<xsd:attribute name="_DateTime" type="xsd:integer"/><!-- yyyymmdd -->
	<xsd:attribute name="_Value" type="xsd:string"/>
	<xsd:attribute name="_AuditNumber" type="xsd:string"/>
	<xsd:attribute name="_Message" type="xsd:string"/>
</xsd:complexType>

<xsd:complexType name="applicationType">
	<xsd:sequence>
		<xsd:element name="AgencyCaseIdentifier" type="xsd:string"/>
	</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="ProcessStatusInputType">
 <xsd:sequence>
  <xsd:element name="ProcessStatusRequestor" type="xsd:string"/>
  <xsd:element name="ProcessStatusCode" type="ProcessStatusCodeInputType"/>
  <xsd:element name="KEY" type="KeyDType"/>
  <xsd:element name="KEY" type="KeySeaType"/>
  <xsd:element name="KEY" type="KeySubType"/>
 </xsd:sequence>
</xsd:complexType>
 
<xsd:complexType name="ProcessStatusOutputType">
 <xsd:sequence>
  <xsd:element name="ProcessStatusCode" type="ProcessStatusCodeOutputType"/>
  <xsd:element name="ProcessStatusMessage" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="KeyDType">
 <xsd:sequence>
  <xsd:element name="_Name" type="nameDType"/>
  <xsd:element name="_Value" type="xsd:integer"/><!-- yyyymmdd -->
 </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="KeySeaType">
 <xsd:sequence>
  <xsd:element name="_Name" type="nameSeaType"/>
  <xsd:element name="_Value" type="valueSeaType"/>
 </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="KeySubType">
 <xsd:sequence>
  <xsd:element name="_Name" type="nameSubType"/>
  <xsd:element name="_Value" type="valueSubType"/>
 </xsd:sequence>
</xsd:complexType>

<!-- simple types -->

<xsd:simpleType name="ProcessStatusCodeInputType">
 <xsd:restriction base="xsd:string">
  <xsd:enumeration value="BindersRequired"/>
  <xsd:enumeration value="BindersAccepted"/>
  <xsd:enumeration value="BindersNotAccepted"/>
  <!-- note currently implemented
  <xsd:enumeration value="AwaitingEndorsement"/>
  <xsd:enumeration value="RequestedAdditionalDocuments"/>
  <xsd:enumeration value="ReceivedAdditionalDocuments"/>
  -->
 </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="ProcessStatusCodeOutputType">
 <xsd:restriction base="xsd:string">
  <xsd:enumeration value="Error"/>
  <xsd:enumeration value="SuccessUpdatesAllowed"/>
  <xsd:enumeration value="UNAVAILABLE"/>
 </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="nameDType">
 <xsd:restriction base="xsd:string">
    <xsd:enumeration value="InitialBinderSearchDate"/>
    <xsd:enumeration value="TerminalBinderSearchDate"/>
 </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="nameSubType">
 <xsd:restriction base="xsd:string">
    <xsd:enumeration value="BinderSubmissionType"/>
 </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="nameSeaType">
 <xsd:restriction base="xsd:string">
    <xsd:enumeration value="BinderSearchScope"/>
 </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="valueSubType">
 <xsd:restriction base="xsd:string">
  <xsd:enumeration value="Electronic"/>
  <xsd:enumeration value="Paper"/>
 </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="valueSeaType">
 <xsd:restriction base="xsd:string">
  <xsd:enumeration value="Originator"/>
  <xsd:enumeration value="Sponsor"/>
 </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="atStatType">
 <xsd:restriction base="xsd:string">
  <xsd:enumeration value="DocumentUploaded"/>
  <xsd:enumeration value="UploadedFileName"/>
  <xsd:enumeration value="Error"/>
 </xsd:restriction>
</xsd:simpleType>

</xsd:schema>