<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl"?>
<xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified"
  targetNamespace="urn:com:adcubum:syrius:api:finanzwesen:rechtlichesinkasso:v520:types"
  xmlns="urn:com:adcubum:syrius:api:finanzwesen:rechtlichesinkasso:v520:types"
  xmlns:eCH-0010="http://www.ech.ch/xmlns/eCH-0010/6"
  xmlns:eCH-0007="http://www.ech.ch/xmlns/eCH-0007/6"
  xmlns:eSchKG="http://www.eschkg.ch/schema/2.0"
  xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:import namespace="http://www.ech.ch/xmlns/eCH-0007/6" schemaLocation="eCH-0007-6-0.xsd" />
  <xs:import namespace="http://www.ech.ch/xmlns/eCH-0010/6" schemaLocation="eCH-0010-6-0.xsd" />
  <xs:import namespace="http://www.eschkg.ch/schema/2.0" schemaLocation="eSchKG_2.0.013.xsd" />

  <xs:element name="legalCollectionRequest">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="header" type="metaType" />
        <xs:element name="messages" type="legalCollectionRequestType"  minOccurs="0" maxOccurs="unbounded" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="processDebtReduction">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="header" type="metaType" />
        <xs:element name="messages" type="debtReductionType" minOccurs="0" maxOccurs="unbounded" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="processPartnerdata">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="header" type="metaType" />
        <xs:element name="messages" type="partnerDataChangeType" minOccurs="0" maxOccurs="unbounded" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="processClaimCancellation">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="header" type="metaType" />
        <xs:element name="messages" type="claimCancellationType" minOccurs="0" maxOccurs="unbounded" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="processClaimReturn">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="header" type="metaType" />
        <xs:element name="messages" type="claimReturnRequestType" minOccurs="0" maxOccurs="unbounded" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="processDeletionApproval">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="header" type="metaType" />
        <xs:element name="messages" type="deletionApprovalRequestType" minOccurs="0" maxOccurs="100" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="processConnectionCheck">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="header" type="metaType" />
        <xs:element name="messages" type="connectionCheckRequestType" minOccurs="0" maxOccurs="1" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="processPayerdata">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="header" type="metaType" />
        <xs:element name="payerDataChange" type="payerDataChangeType" minOccurs="1" maxOccurs="1" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>


  <xs:element name="response">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="messages" type="importResponse" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="deletionApprovalResponse">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="message" type="deletionApprovalResponseType" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:simpleType name="messageIdType">
    <xs:annotation>
      <xs:documentation>Unique message-ID</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:minLength value="1" />
      <xs:maxLength value="128" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="originType">
    <xs:annotation>
      <xs:documentation>
        Name of the receiving SYRIUS-Instance.
        The Legal Collection System has to fill this field with the Instance-Name of SYRIUS
        (see the legal collection configuration). If the origin does not match the defined origin,
        SYRIUS will not process the message but throw an Error back.
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:minLength value="1" />
      <xs:maxLength value="128" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="productType">
    <xs:annotation>
      <xs:documentation>Name of the Product which is sending the message.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:minLength value="1" />
      <xs:maxLength value="50" />
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="emigrationType">
    <xs:annotation>
      <xs:documentation>Information of emigration for the person</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="date" type="xs:date" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Date of emigration</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="reason" type="string100" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Reason of emigration in german locale</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="reasonInternalName" type="string100" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>internalName of the reason of emigration</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:simpleType name="versionType">
    <xs:annotation>
      <xs:documentation>
        Version of the sending Product in the form 'A.B.C.D-E-F' where the positions A-D must be numbers and
        the positions E and F can be alpha numeric.
        Example: 1.2.3.4-01-A, 1.2-SD, 1.2.3-666
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:pattern value="(\d+)?(\.\d+)?(\.\d+)?(\.\d+)?(\-[a-zA-Z0-9]+)?(\-[a-zA-Z0-9]+)?" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="string8">
    <xs:restriction base="xs:token">
      <xs:minLength value="0" />
      <xs:maxLength value="8" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="string40">
    <xs:restriction base="xs:token">
      <xs:minLength value="0" />
      <xs:maxLength value="40" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="string43">
    <xs:restriction base="xs:token">
      <xs:minLength value="0" />
      <xs:maxLength value="43" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="string50">
    <xs:restriction base="xs:token">
      <xs:minLength value="0" />
      <xs:maxLength value="50" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="string100">
    <xs:restriction base="xs:token">
      <xs:minLength value="0" />
      <xs:maxLength value="100" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="string255">
    <xs:restriction base="xs:token">
      <xs:minLength value="0" />
      <xs:maxLength value="255" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="string500">
    <xs:restriction base="xs:token">
      <xs:minLength value="0" />
      <xs:maxLength value="500" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="businessUnitType">
    <xs:annotation>
      <xs:documentation>Defines the main business unit for the item (claim, payment, amortization, fee, ...)</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:minLength value="0" />
      <xs:maxLength value="40" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="genderType">
    <xs:annotation>
      <xs:documentation>Gender of a natural person</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:enumeration value="MALE">
        <xs:annotation>
          <xs:documentation>Male</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="FEMALE">
        <xs:annotation>
          <xs:documentation>Female</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="UNKNOWN">
        <xs:annotation>
          <xs:documentation>Unknown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="maritalStatusType">
    <xs:annotation>
      <xs:documentation>Civil status</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:enumeration value="SINGLE">
        <xs:annotation>
          <xs:documentation>Person is in no relationship</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MARRIED">
        <xs:annotation>
          <xs:documentation>Person is married</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="WIDOWED">
        <xs:annotation>
          <xs:documentation>Person is widowed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DIVORCED">
        <xs:annotation>
          <xs:documentation>Person is divorced</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SEPARATED">
        <xs:annotation>
          <xs:documentation>Person is separated</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="LEGAL_PARTNERSHIP">
        <xs:annotation>
          <xs:documentation>Person is in a legal partnership</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DISSOLVED_PARTNERSHIP">
        <xs:annotation>
          <xs:documentation>Person is in a dissolved partnership</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="UNKNOWN">
        <xs:annotation>
          <xs:documentation>Person is in an unknown civil state</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="reasonTypeType">
    <xs:annotation>
      <xs:documentation>Defines a set of default values configured in both system for Claims, Payments, Amortizations, ...</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:minLength value="0" />
      <xs:maxLength value="100" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="esrNumberType">
    <xs:annotation>
      <xs:documentation>The ESR-/QESR-Number which defines the number of a payment slip in Switzerland</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:minLength value="0" />
      <xs:maxLength value="27" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="accountNumberType">
    <xs:annotation>
      <xs:documentation>Defines the ESR-Participant used on a payment slip in Switzerland</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:minLength value="0" />
      <xs:maxLength value="34" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="ibanNumberType">
    <xs:annotation>
      <xs:documentation>The international Bank Account Number (IBAN)</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:minLength value="0" />
      <xs:maxLength value="34" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="amountType">
    <xs:annotation>
      <xs:documentation>Amount of the Item</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:decimal">
      <xs:fractionDigits value="2" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="positiveAmountType">
    <xs:restriction base="xs:decimal">
      <xs:fractionDigits value="2" />
      <xs:minExclusive value="0" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="nameType">
    <xs:restriction base="xs:token">
      <xs:minLength value="1" />
      <xs:maxLength value="100" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="typeOfClaimType">
    <xs:annotation>
      <xs:documentation>
        A predefined value to define a mapping which defines the type of this claim, fee, interest, ...
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:minLength value="1" />
      <xs:maxLength value="500" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="payLockTypeType">
    <xs:annotation>
      <xs:documentation>Locking a payer for a given reason.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:enumeration value="MORATORY_INTEREST_LOCK">
        <xs:annotation>
          <xs:documentation>Lock Default Interest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="COLLECTION_LOCK">
        <xs:annotation>
          <xs:documentation>Lock Dunning</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PAYOUT_LOCK">
        <xs:annotation>
          <xs:documentation>Lock payout</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PAYMENT_LOCK">
        <xs:annotation>
          <xs:documentation>Lock payment</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SETTLEMENT_LOCK">
        <xs:annotation>
          <xs:documentation>Lock Settlements</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="INVOICE_LOCK">
        <xs:annotation>
          <xs:documentation>Lock Invoicing</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="WRITE_OFF_LOCK">
        <xs:annotation>
          <xs:documentation>Lock Write-Offs</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PAYMENT_ALLOCATION_LOCK">
        <xs:annotation>
          <xs:documentation>Lock payment allocations</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CLAIM_LOCK">
        <xs:annotation>
          <xs:documentation>Lock claims</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="currencyType">
    <xs:annotation>
      <xs:documentation>Currency in ISO-4217</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:enumeration value="AED" />
      <xs:enumeration value="AFN" />
      <xs:enumeration value="ALL" />
      <xs:enumeration value="AMD" />
      <xs:enumeration value="ANG" />
      <xs:enumeration value="AOA" />
      <xs:enumeration value="ARS" />
      <xs:enumeration value="AUD" />
      <xs:enumeration value="AWG" />
      <xs:enumeration value="AZN" />
      <xs:enumeration value="BAM" />
      <xs:enumeration value="BBD" />
      <xs:enumeration value="BDT" />
      <xs:enumeration value="BGN" />
      <xs:enumeration value="BHD" />
      <xs:enumeration value="BIF" />
      <xs:enumeration value="BMD" />
      <xs:enumeration value="BND" />
      <xs:enumeration value="BOB" />
      <xs:enumeration value="BOV" />
      <xs:enumeration value="BRL" />
      <xs:enumeration value="BSD" />
      <xs:enumeration value="BTN" />
      <xs:enumeration value="BWP" />
      <xs:enumeration value="BYN" />
      <xs:enumeration value="BZD" />
      <xs:enumeration value="CAD" />
      <xs:enumeration value="CDF" />
      <xs:enumeration value="CHF" />
      <xs:enumeration value="CHW" />
      <xs:enumeration value="CLF" />
      <xs:enumeration value="CLP" />
      <xs:enumeration value="CNY" />
      <xs:enumeration value="COP" />
      <xs:enumeration value="COU" />
      <xs:enumeration value="CRC" />
      <xs:enumeration value="CUC" />
      <xs:enumeration value="CUP" />
      <xs:enumeration value="CVE" />
      <xs:enumeration value="CZK" />
      <xs:enumeration value="DJF" />
      <xs:enumeration value="DKK" />
      <xs:enumeration value="DOP" />
      <xs:enumeration value="DZD" />
      <xs:enumeration value="EGP" />
      <xs:enumeration value="ERN" />
      <xs:enumeration value="ETB" />
      <xs:enumeration value="EUR" />
      <xs:enumeration value="FJD" />
      <xs:enumeration value="FKP" />
      <xs:enumeration value="GBP" />
      <xs:enumeration value="GEL" />
      <xs:enumeration value="GHS" />
      <xs:enumeration value="GIP" />
      <xs:enumeration value="GMD" />
      <xs:enumeration value="GNF" />
      <xs:enumeration value="GTQ" />
      <xs:enumeration value="GYD" />
      <xs:enumeration value="HKD" />
      <xs:enumeration value="HNL" />
      <xs:enumeration value="HRK" />
      <xs:enumeration value="HTG" />
      <xs:enumeration value="HUF" />
      <xs:enumeration value="IDR" />
      <xs:enumeration value="ILS" />
      <xs:enumeration value="INR" />
      <xs:enumeration value="IQD" />
      <xs:enumeration value="IRR" />
      <xs:enumeration value="ISK" />
      <xs:enumeration value="JMD" />
      <xs:enumeration value="JOD" />
      <xs:enumeration value="JPY" />
      <xs:enumeration value="KES" />
      <xs:enumeration value="KGS" />
      <xs:enumeration value="KHR" />
      <xs:enumeration value="KMF" />
      <xs:enumeration value="KPW" />
      <xs:enumeration value="KRW" />
      <xs:enumeration value="KWD" />
      <xs:enumeration value="KYD" />
      <xs:enumeration value="KZT" />
      <xs:enumeration value="LAK" />
      <xs:enumeration value="LBP" />
      <xs:enumeration value="LKR" />
      <xs:enumeration value="LRD" />
      <xs:enumeration value="LSL" />
      <xs:enumeration value="LYD" />
      <xs:enumeration value="MAD" />
      <xs:enumeration value="MDL" />
      <xs:enumeration value="MGA" />
      <xs:enumeration value="MKD" />
      <xs:enumeration value="MMK" />
      <xs:enumeration value="MNT" />
      <xs:enumeration value="MOP" />
      <xs:enumeration value="MRU" />
      <xs:enumeration value="MUR" />
      <xs:enumeration value="MVR" />
      <xs:enumeration value="MWK" />
      <xs:enumeration value="MXN" />
      <xs:enumeration value="MXV" />
      <xs:enumeration value="MYR" />
      <xs:enumeration value="MZN" />
      <xs:enumeration value="NAD" />
      <xs:enumeration value="NGN" />
      <xs:enumeration value="NIO" />
      <xs:enumeration value="NOK" />
      <xs:enumeration value="NPR" />
      <xs:enumeration value="NZD" />
      <xs:enumeration value="OMR" />
      <xs:enumeration value="PAB" />
      <xs:enumeration value="PEN" />
      <xs:enumeration value="PGK" />
      <xs:enumeration value="PHP" />
      <xs:enumeration value="PKR" />
      <xs:enumeration value="PLN" />
      <xs:enumeration value="PYG" />
      <xs:enumeration value="QAR" />
      <xs:enumeration value="RON" />
      <xs:enumeration value="RSD" />
      <xs:enumeration value="RUB" />
      <xs:enumeration value="RWF" />
      <xs:enumeration value="SAR" />
      <xs:enumeration value="SBD" />
      <xs:enumeration value="SCR" />
      <xs:enumeration value="SDG" />
      <xs:enumeration value="SEK" />
      <xs:enumeration value="SGD" />
      <xs:enumeration value="SHP" />
      <xs:enumeration value="SLL" />
      <xs:enumeration value="SOS" />
      <xs:enumeration value="SRD" />
      <xs:enumeration value="SSP" />
      <xs:enumeration value="STN" />
      <xs:enumeration value="SVC" />
      <xs:enumeration value="SYP" />
      <xs:enumeration value="SZL" />
      <xs:enumeration value="THB" />
      <xs:enumeration value="TJS" />
      <xs:enumeration value="TMT" />
      <xs:enumeration value="TND" />
      <xs:enumeration value="TOP" />
      <xs:enumeration value="TRY" />
      <xs:enumeration value="TTD" />
      <xs:enumeration value="TWD" />
      <xs:enumeration value="TZS" />
      <xs:enumeration value="UAH" />
      <xs:enumeration value="UGX" />
      <xs:enumeration value="USD" />
      <xs:enumeration value="USN" />
      <xs:enumeration value="UYI" />
      <xs:enumeration value="UYU" />
      <xs:enumeration value="UZS" />
      <xs:enumeration value="VEF" />
      <xs:enumeration value="VND" />
      <xs:enumeration value="VUV" />
      <xs:enumeration value="WST" />
      <xs:enumeration value="XAF" />
      <xs:enumeration value="XAG" />
      <xs:enumeration value="XAU" />
      <xs:enumeration value="XBA" />
      <xs:enumeration value="XBB" />
      <xs:enumeration value="XBC" />
      <xs:enumeration value="XBD" />
      <xs:enumeration value="XCD" />
      <xs:enumeration value="XDR" />
      <xs:enumeration value="XOF" />
      <xs:enumeration value="XPD" />
      <xs:enumeration value="XPF" />
      <xs:enumeration value="XPT" />
      <xs:enumeration value="XSU" />
      <xs:enumeration value="XTS" />
      <xs:enumeration value="XUA" />
      <xs:enumeration value="XXX" />
      <xs:enumeration value="YER" />
      <xs:enumeration value="ZAR" />
      <xs:enumeration value="ZMW" />
      <xs:enumeration value="ZWL" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="languageType">
    <xs:annotation>
      <xs:documentation>Language in ISO-639-1 (limited to official swiss languages)</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:enumeration value="DE"/>
      <xs:enumeration value="FR"/>
      <xs:enumeration value="IT"/>
      <xs:enumeration value="RM"/>
      <xs:enumeration value="EN"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="typeOfReductionType">
    <xs:annotation>
      <xs:documentation>Type of a reduction</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:enumeration value="PAYMENT">
        <xs:annotation>
          <xs:documentation>Payment</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="WRITE_OFF">
        <xs:annotation>
          <xs:documentation>Write off</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CREDIT_CLEARING">
        <xs:annotation>
          <xs:documentation>Credit clearing</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CREDIT_CLEARING_FROM_PV_CREDIT">
        <xs:annotation>
          <xs:documentation>Premium-Credit (German: Praemien Verbilligung/PV)</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CREDIT_CLEARING_FROM_PREMIUM_CREDIT">
        <xs:annotation>
          <xs:documentation>Premium reduction</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="REBALANCING">
        <xs:annotation>
          <xs:documentation>Re-Balancing</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="treatAmortizationType">
    <xs:annotation>
      <xs:documentation>Type of the amortization</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:enumeration value="REGULAR">
        <xs:annotation>
          <xs:documentation>A regular amortization</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CANCELLATION">
        <xs:annotation>
          <xs:documentation>A cancellation</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="AMORTISATION_DISTRIBUTION_CHANGE">
        <xs:annotation>
          <xs:documentation>Do a Re-Balance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="treatAdditionalCostType">
    <xs:annotation>
      <xs:documentation>Type of the additional costs</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:enumeration value="REGULAR">
        <xs:annotation>
          <xs:documentation>A regular payment or claim</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CANCELLATION">
        <xs:annotation>
          <xs:documentation>A Cancellation</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="metaType">
    <xs:annotation>
      <xs:documentation>
        MetaData of the message, has to contain at least the unique message id and the origin.
        All the other parameters are optional and are there for a better tracing and logging.
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="messageId" type="messageIdType" />
      <xs:element name="origin" type="originType" />
      <xs:element name="time" type="xs:dateTime" minOccurs="0" maxOccurs="1" />
      <xs:element name="product" type="productType" minOccurs="0" maxOccurs="1" />
      <xs:element name="version" type="versionType" minOccurs="0" maxOccurs="1" />
    </xs:sequence>
  </xs:complexType>

  <xs:simpleType name="targetType">
    <xs:annotation>
      <xs:documentation>Type of the amortization</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:enumeration value="CLAIM">
        <xs:annotation>
          <xs:documentation>A Claim</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PAYMENT">
        <xs:annotation>
          <xs:documentation>Incoming Payment</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="amortizationDetailType">
    <xs:annotation>
      <xs:documentation>Detail position of an Amortization</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="targetId" type="string40">
        <xs:annotation>
          <xs:documentation>Reference to the claim where the amortization should be applied onto</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="targetType" type="targetType" />
      <xs:element name="connectorId" type="string40" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Optional reference to a connection to an already done payment</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="treat" type="treatAdditionalCostType" />
      <xs:element name="amount" type="amountType"/>
      <xs:element name="currency" type="currencyType" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="amortizationType">
    <xs:annotation>
      <xs:documentation>Main Body for an Amortization</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="id" type="string40">
        <xs:annotation>
          <xs:documentation>
            The main claim/payment/amortization ID for messages to the Legal-Collection system;
            For messages from the Legal Collection System to SYRIUS, only in case of a Cancellation.
          </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="treat" type="treatAmortizationType" />
      <xs:element name="amountTotal" type="amountType" />
      <xs:element name="currency" type="currencyType" />
      <xs:element name="datePayment" type="xs:date">
        <xs:annotation>
          <xs:documentation>Balance-Date for Credits, Interest-Date for Payments and Write-Offs</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="typeOfReduction" type="typeOfReductionType" />
      <xs:element name="reasonType" type="reasonTypeType" />
      <xs:element name="businessUnit" type="businessUnitType" />
      <xs:element name="paymentDebtor" type="paymentDebtorType" minOccurs="0" maxOccurs="1" />
      <xs:element name="reason" type="string500">
        <xs:annotation>
          <xs:documentation>A reason for this amortization</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="amortizationDetails" type="amortizationDetailType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="paymentDebtorType">
    <xs:annotation>
      <xs:documentation>Debtor of a payment</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="name" type="string500" minOccurs="0" maxOccurs="1" />
      <xs:element name="street" type="string100" minOccurs="0" maxOccurs="1" />
      <xs:element name="town" type="string100" minOccurs="0" maxOccurs="1" />
      <xs:element name="esrNumber" type="esrNumberType" minOccurs="0" maxOccurs="1" />
      <xs:element name="participantNumber" type="accountNumberType" minOccurs="0" maxOccurs="1" />
      <xs:element name="accountNumber" type="accountNumberType" minOccurs="0" maxOccurs="1" />
      <xs:element name="remittanceInformation" type="string500" minOccurs="0" maxOccurs="1" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="addressType">
    <xs:annotation>
      <xs:documentation>An Address</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="eCH-0010:addressInformationType">
        <xs:sequence>
          <xs:element name="id" type="string40">
            <xs:annotation>
              <xs:documentation>Identification number</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="stateFrom" type="xs:date">
            <xs:annotation>
              <xs:documentation>Start date of this state</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="stateUpTo" type="xs:date">
            <xs:annotation>
              <xs:documentation>End date of this state</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="provinzISOCode" type="string40" minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>ISO Code of the provinz</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="provinz" type="string40" minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>Provinz</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="municipalityName" type="string40" minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>Gemeindename</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="municipalityId" type="string8" minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>Gemeindenummer</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="claimCancellationType">
    <xs:annotation>
      <xs:documentation>A claim cancellation</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:choice>
        <xs:element name="dossierId" type="string40">
          <xs:annotation>
            <xs:documentation>ID of the Legal Collection where the claim is in</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="installmentPlanId" type="string40">
          <xs:annotation>
            <xs:documentation>ID of the Payment Plan where the claim is in</xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:choice>
      <xs:element name="claimTypes" type="claimType" minOccurs="1" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>Detailed information about the cancellation</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="claimType">
    <xs:annotation>
      <xs:documentation>Detailed information about a claim</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="claimDetailId" type="string40">
        <xs:annotation>
          <xs:documentation>ID of the Claim</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="treatType" type="treatAdditionalCostType"/>
      <xs:element name="amount" type="amountType" minOccurs="0" maxOccurs="1"/>
      <xs:element name="currencyType" type="currencyType" minOccurs="0" maxOccurs="1" />
      <xs:element name="dateCurrentExpiry" type="xs:date" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Expiration date</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="dateOriginalExpiry" type="xs:date">
        <xs:annotation>
          <xs:documentation>The original expiration date</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="dateCurrentInvoice" type="xs:date" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>The payment date</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="dateOriginalInvoice" type="xs:date">
        <xs:annotation>
          <xs:documentation>The original payment date</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="interestUpto" type="xs:date">
        <xs:annotation>
          <xs:documentation>Date up to which the interest is calculated to</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="lastReminder" type="xs:date" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Date when the last reminder was sent to the debtor</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="typeOfClaim" type="typeOfClaimType" />
      <xs:element name="reasonType" type="reasonTypeType" />
      <xs:element name="businessUnit" type="businessUnitType" />
      <xs:element name="reason" type="string500">
        <xs:annotation>
          <xs:documentation>Textual representation of the reason of this claim, fee, ...</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="interestRate" type="amountType">
        <xs:annotation>
          <xs:documentation>Used rate of interest</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="interestBearing" type="xs:boolean">
        <xs:annotation>
          <xs:documentation>This is a bearing interest</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="accountArea" type="string40">
        <xs:annotation>
          <xs:documentation>Defines the main accounting in the ledger</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="insuredPerson" type="personType" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>The insured person</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="invoiceNumber" type="string40">
        <xs:annotation>
          <xs:documentation>The invoice number (claim or open item collection number)</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="periodeFrom" type="xs:date" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Start of the period of this claim</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="periodeUpto" type="xs:date" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>End of the period of this claim</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="legalBase" type="string100">
        <xs:annotation>
          <xs:documentation>Legal basis of this claim</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="dunningLevel" type="string100">
        <xs:annotation>
          <xs:documentation>The dunning level of this claim</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="businessTransaction" type="string100">
        <xs:annotation>
          <xs:documentation>Business transaction of this claim</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="openItemCollectionType" type="string100" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Name of the open item collection type</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="claimNumber" type="string40">
        <xs:annotation>
          <xs:documentation>Contains the claim detail number (OPDetail-number or the Zahlung-number)</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="insuredProduct" type="insuredProductType" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Insured product information</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="insuredProductType">
    <xs:annotation>
      <xs:documentation>Information about the Insured product</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="internalName" type="string500" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>internal name</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="name" type="string255" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>name in german</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="contactType">
    <xs:annotation>
      <xs:documentation>Information to get in contact with a person</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="phone1" type="string43" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Telephone number</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="phone2" type="string43" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Second telephone number</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="mobile" type="string43" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Mobile number</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="fax" type="string43" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Fax number</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="email" type="string100" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Email address</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="physicalPersonType">
    <xs:annotation>
      <xs:documentation>Natural Person</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="gender" type="genderType"/>
      <xs:element name="title" type="string255">
        <xs:annotation>
          <xs:documentation>Title</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="lastName" type="nameType">
        <xs:annotation>
          <xs:documentation>Last name</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="firstNames" type="nameType">
        <xs:annotation>
          <xs:documentation>First name</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="language" type="languageType">
        <xs:annotation>
          <xs:documentation>Language for communicate</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="dateOfBirth" type="xs:date" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Date of birth</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="dateOfDeath" type="xs:date" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Date of death</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="emigration" type="emigrationType" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Emigration data</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="contacts" type="contactType" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>Contact data</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="socialSecurityNumber" type="string100" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Social Security Number</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="insurancePersonNumber" type="string40" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Insurance number</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="maritalStatus" type="maritalStatusType" minOccurs="0" maxOccurs="1" />
      <xs:element name="centralForeignerRegisterNumber" type="string100" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Central foreigner number (ZAR)</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="centralMigrationInformationSystemNumber" type="string100" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Central migration information system number (ZEMIS)</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="familyMemberRole" type="string40" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Role of the member in the family (Head of family, partner, child, ...)</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="companyType">
    <xs:annotation>
      <xs:documentation>Legal Person</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="eSchKG:companyType">
        <xs:sequence>
          <xs:element name="contacts" type="contactType" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Contact data</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="creditorType">
    <xs:annotation>
      <xs:documentation>Data from the creditor</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="creditor" type="personType">
        <xs:annotation>
          <xs:documentation>The creditor who owe the money</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="creditorRepresentative" type="personType">
        <xs:annotation>
          <xs:documentation>Person who officially represents the creditor</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="partnerDataChangeType">
    <xs:annotation>
      <xs:documentation>Information for sending changes from a person</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="person" type="personType" minOccurs="1" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>New data of the person</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="personType">
    <xs:annotation>
      <xs:documentation>Data from a person</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="personId" type="string40">
        <xs:annotation>
          <xs:documentation>The main identification ID of the person</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="personNumber" type="string40">
        <xs:annotation>
          <xs:documentation>The main identification number (not the ID) of the person</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="naturalPerson" type="physicalPersonType" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Data if it's a natural Person</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="legalPerson" type="companyType" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Data if it's a legal Person</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="addresses" type="addressType" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>Address data for a given time range</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="paymentAddresses" type="ibanNumberType" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="stateFrom" type="xs:date">
        <xs:annotation>
          <xs:documentation>Date as of when this person data are valid from</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="stateUpTo" type="xs:date">
        <xs:annotation>
          <xs:documentation>Date as of when this person data are valid up to</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="administrativeOffice" type="string40">
        <xs:annotation>
          <xs:documentation>Identification of the administrative department</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="contractOffice" type="string40">
        <xs:annotation>
          <xs:documentation>Identification of the contract department</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="careProviderOffice" type="string40">
        <xs:annotation>
          <xs:documentation>Identification of the claim/care providers department</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="financeOffice" type="string40">
        <xs:annotation>
          <xs:documentation>Identification of the financial department</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="isLegalRepresentative" type="xs:boolean" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>This person is a legal representative of the insured person</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="foreignState" type="string100" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Foreign state of the person</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="partnerProtDef" type="string100" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Partner Protection Definition of the person</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="payLockType">
    <xs:annotation>
      <xs:documentation>Defines a lock to prevent a payer doing a defined action</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="paylockType" type="payLockTypeType">
        <xs:annotation>
          <xs:documentation>Type of pay lock</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="dateFrom" type="xs:date">
        <xs:annotation>
          <xs:documentation>Date as of when the lock starts</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="dateUntil" type="xs:date">
        <xs:annotation>
          <xs:documentation>Date when the lock ends</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="legalCollectionRequestType">
    <xs:annotation>
      <xs:documentation>Structure to send a collection request</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="processId" type="string40">
        <xs:annotation>
          <xs:documentation>ID of the process which created this request</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="creditor" type="creditorType" />
      <xs:element name="debtor" type="debtorType" />
      <xs:element name="paymentProfile" type="paymentProfileType" />
      <xs:element name="payLocks" type="payLockType" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="claimId" type="string40">
        <xs:annotation>
          <xs:documentation>Identification of the claim to add to the collection request</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="claims" type="claimType" minOccurs="1" maxOccurs="unbounded" />
      <xs:element name="amortizations" type="amortizationType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="payerDataChangeType">
    <xs:annotation>
      <xs:documentation>Information for sending changes from a payer</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="personId" type="string40">
        <xs:annotation>
          <xs:documentation>The main identification ID of the person</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="personNumber" type="string40">
        <xs:annotation>
          <xs:documentation>The main identification number (not the ID) of the person</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="paymentProfile" type="paymentProfileType" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>New data of the payment profile</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="paymentProfileType">
    <xs:annotation>
      <xs:documentation>Data of a payment profile</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="paymentProfileId" type="string40">
        <xs:annotation>
          <xs:documentation>The main identification ID of the payment profile eeg. payer</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="payerNumber" type="string40">
        <xs:annotation>
          <xs:documentation>The main identification number (not the ID) of the payer</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="type" type="string100">
        <xs:annotation>
          <xs:documentation>Coding of the payment profile type: Values via individual assignment tables</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="solvency" type="solvencyType">
        <xs:annotation>
          <xs:documentation>Credit rating of a payment profile. This rating results from the payer’s payment behavior. The solvency is continuously assessed during the dunning processes. It increases based on the number of reminders that have been issued for this payment profile.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="solvencyType">
    <xs:annotation>
      <xs:documentation>Solvency eeg. credit rating  of a payer</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="solvencyId" type="string40">
        <xs:annotation>
          <xs:documentation>The main identification ID of solvency</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="creditRating" type="xs:int">
        <xs:annotation>
          <xs:documentation>Defines the solvency. The higher it is, the worse the payment behavior</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="internalName" type="string500">
        <xs:annotation>
          <xs:documentation>Internal name of solvency</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="description" type="string255">
        <xs:annotation>
          <xs:documentation>German description of solvency</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="debtReductionType">
    <xs:annotation>
      <xs:documentation>A debt reduction</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:choice>
        <xs:element name="dossierId" type="string40">
          <xs:annotation>
            <xs:documentation>Number of the legal collection where this debt reduction should be applied on</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="paymentPlanId" type="string40">
          <xs:annotation>
            <xs:documentation>Number of the payment plan where this debt reduction should be applied on</xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:choice>
      <xs:element name="amortizations" type="amortizationType" minOccurs="1" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>The debt reduction / amortization</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="debtorType">
    <xs:annotation>
      <xs:documentation>Data structure to define a debtor</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="debtor" type="personType">
        <xs:annotation>
          <xs:documentation>The debtor</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="debtorRepresentatives" type="personType" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>One or more representatives of the debtor</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="claimReturnRequestType">
    <xs:annotation>
      <xs:documentation>Request to remove a position from a legal collection</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="claimDetails" type="string40" minOccurs="1" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>Identification of the claim to remove from the legal collection</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="importResponse">
    <xs:annotation>
      <xs:documentation>The general response to all requests and messages</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="meta" type="metaType" />
      <xs:element name="state" type="importStatusType">
        <xs:annotation>
          <xs:documentation>The system was able to process the message without any errors</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="errorMessages" type="xs:token" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>Textual error message in case the message was not processed successfully</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="details" type="importDetailType" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>Status about an imported or processed detail.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="deletionApprovals" type="deletionApprovalType" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>Status about imported or processed deletion approvals.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:simpleType name="importStatusType">
    <xs:restriction base="xs:token">
      <xs:enumeration value="OK" />
      <xs:enumeration value="NOK" />
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="importDetailType">
    <xs:sequence>
      <xs:element name="claimDetail" type="string40">
        <xs:annotation>
          <xs:documentation>Identification of the claim detail</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="claimDetailAncestors" type="string40" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>In case of a certificate of loss message, this field can contain the ancestor of the claim for a correct assignemt</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="amortization" type="string40" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Identification of the amortization</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="status" type="importStatusType">
        <xs:annotation>
          <xs:documentation>This detail was processed without any errors</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="claimNumber" type="string40">
        <xs:annotation>
          <xs:documentation>Contains the claim detail number (OPDetail-number or the Zahlung-number) if a claim/payment is created</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="deletionApprovalRequestType">
    <xs:annotation>
      <xs:documentation>Structure to send a deletion approval request.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="id" type="string40">
        <xs:annotation>
          <xs:documentation>Business ID of the legal collection or payment plan.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="deletionApprovalCase" type="deletionApprovalCaseType">
        <xs:annotation>
          <xs:documentation>Cases: Legal collection or payment plan.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="deletionApprovalStatusChangeType">
    <xs:annotation>
      <xs:documentation>Structure to send a deletion approval request.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="id" type="string40">
        <xs:annotation>
          <xs:documentation>Business ID of the legal collection or payment plan.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="deletionApprovalCase" type="deletionApprovalCaseType">
        <xs:annotation>
          <xs:documentation>Cases: Legal collection or payment plan.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="deletionApprovalStatus" type="deletionApprovalStatusType">
        <xs:annotation>
          <xs:documentation>New status.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="message" type="string500" minOccurs="0">
        <xs:annotation>
          <xs:documentation>Additional message.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="deletionApprovalType">
    <xs:sequence>
      <xs:element name="id" type="string40">
        <xs:annotation>
          <xs:documentation>Business ID of the legal collection or payment plan.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="deletionApprovalCase" type="deletionApprovalCaseType">
        <xs:annotation>
          <xs:documentation>Cases: Legal collection or payment plan.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="importStatus" type="importStatusType">
        <xs:annotation>
          <xs:documentation>Request was processed without any technical errors.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="deletionApprovalStatus" type="deletionApprovalStatusType">
        <xs:annotation>
          <xs:documentation>Deletion approval status.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="message" type="string500" minOccurs="0">
        <xs:annotation>
          <xs:documentation>Additional message provided by third party system e.g. the reason for failed or rejected status or error message provided by SYRIUS.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="deletionApprovalResponseType">
    <xs:annotation>
      <xs:documentation>Deletion approval response.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="meta" type="metaType" />
      <xs:element name="deletionApproval" type="deletionApprovalType" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>Deletion approvals.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:simpleType name="deletionApprovalCaseType">
    <xs:restriction base="xs:token">
      <xs:enumeration value="LEGAL_COLLECTION" />
      <xs:enumeration value="PAYMENT_PLAN" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="deletionApprovalStatusType">
    <xs:restriction base="xs:token">
      <xs:enumeration value="IN_PROGRESS">
        <xs:annotation>
          <xs:documentation>The request was received successfully and will be processed asynchronously.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="REJECTED">
        <xs:annotation>
          <xs:documentation>The request was received but rejected. The request should be sent again at a later date.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="FAILED">
        <xs:annotation>
          <xs:documentation>The request was received but unexpected error occurred during processing e.g. unknown Dossier-ID. The request will not be resent without user interaction.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="APPROVED">
        <xs:annotation>
          <xs:documentation>From the perspective of the third party system, the object can be archived respectively deleted.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="NOT_APPROVED">
        <xs:annotation>
          <xs:documentation>From the perspective of the third party system, the object can NOT be archived respectively deleted yet.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="connectionCheckRequestType">
    <xs:annotation>
      <xs:documentation>Structure to send a connection check request.</xs:documentation>
    </xs:annotation>
  </xs:complexType>

</xs:schema>
