﻿<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
  <entity name="llp_incident" >
    <attribute name="llp_incidentcode" />
    <attribute name="createdon" />
    <attribute name='statuscode' />
    <order attribute="createdon" descending="true" />
    <link-entity name="account" from="accountid" to="llp_providerid" link-type="outer" alias="provider" >
      <filter type="and" >
        <condition attribute="llp_providercode" operator="eq" value="${partnerID}" />
      </filter>
    </link-entity>
    <link-entity name="incident" from="incidentid" to="llp_claimid" link-type="outer" alias="incident" >
      <attribute name="llp_claimnumber" />
    </link-entity>
    <link-entity name="llp_insurancepolicy" from="llp_insurancepolicyid" to="llp_insurancepolicyid" link-type="outer" alias="policy" >
      <link-entity name="llp_insuredobjectanimal" from="llp_insurancepolicyid" to="llp_insurancepolicyid" link-type="outer" alias="animal" >
        <attribute name="llp_dateofbirth" />
        <attribute name="llp_name" />
        <attribute name="llp_animalkind" />
        <link-entity name="llp_breed" from="llp_breedid" to="llp_breedid" link-type="outer" alias="breed" >
          <attribute name="llp_name" />
        </link-entity>
      </link-entity>
      <link-entity name="contact" from="contactid" to="llp_customerid" link-type="outer" alias="owner" >
        <attribute name="fullname" />
        <attribute name="emailaddress1" />
        <attribute name="address1_city" />
        <attribute name="address1_line1" />
        <attribute name="address1_postalcode" />
        <attribute name="telephone1" />
      </link-entity>
    </link-entity>
    <link-entity name="llp_settlement" from="llp_settlementid" to="llp_settlementid" link-type="outer" alias="settlement" >
      <attribute name="llp_amountpayable" />
      <attribute name="llp_amountrequested" />
      <attribute name="statuscode" />
    </link-entity>
  </entity>
</fetch>