Commit 51cbf3d6 by Amelin Konstantin

Fix TradeTemplate. partyTradeInformation -> Clients (one to many)

parent c5d4c356
...@@ -41,58 +41,60 @@ abstract class TradeTemplate(source: Node) extends RegiAmendTradeTemplate(source ...@@ -41,58 +41,60 @@ abstract class TradeTemplate(source: Node) extends RegiAmendTradeTemplate(source
<fpml:mandatorilyClearable>{ if (get(source \\ "trade" \ "nsdSpecificTradeFields" \ "cleared").mkString.contains("Y")) "true" else msgNotFound }</fpml:mandatorilyClearable> <fpml:mandatorilyClearable>{ if (get(source \\ "trade" \ "nsdSpecificTradeFields" \ "cleared").mkString.contains("Y")) "true" else msgNotFound }</fpml:mandatorilyClearable>
</fpml:reportingRegime> </fpml:reportingRegime>
</fpml:partyTradeInformation> </fpml:partyTradeInformation>
{ for (s <- source \\ "trade" \ "nsdSpecificTradeFields" \ "clientDetails") yield { { /* Uses dictionary from PartyTemplate for identifier */
for (p <- parties.filterKeys(_.startsWith("Party"))) yield
<fpml:partyTradeInformation> <fpml:partyTradeInformation>
{ /* Uses dictionary from PartyTemplate for identifier */ } <fpml:partyReference href={ p._2._1 } />
<fpml:partyReference href={ parties(get(s \ "servicingParty", "href").mkString)._1 } /> { for { s <- source \\ "trade" \ "nsdSpecificTradeFields" \ "clientDetails"
{ val id = get(s \ "id").mkString if parties(get(s \ "servicingParty", "href").mkString)._1 == p._2._1
if (id != msgNotFound) id = get(s \ "id").mkString
<fpml:relatedParty> if id != msgNotFound } yield {
<fpml:partyReference href={ parties(id)._1 } /> <fpml:relatedParty>
<fpml:role>{ "Client" }</fpml:role> <fpml:partyReference href={ parties(id)._1 } />
<fpml:type>{ get(s \ "type") }</fpml:type> <fpml:role>{ "Client" }</fpml:role>
</fpml:relatedParty> <fpml:type>{ get(s \ "type") }</fpml:type>
} </fpml:relatedParty>
<fpml:timestamps> }
<fpml:timestamp>
<fpml:type>{ if (get(source \\ "trade" \ "nsdSpecificTradeFields" \ "clearedDate").mkString != msgNotFound) "InClearingPool" else msgNotFound}</fpml:type>
{/* value isn`t present in the source */}
<fpml:value>{
val d = get(source \\ "trade" \ "nsdSpecificTradeFields" \ "clearedDate")
if (d.mkString != msgNotFound) d + "T00:00:00" else msgNotFound
}</fpml:value>
</fpml:timestamp>
<fpml:timestamp>
<fpml:type>{ if (get(source \\ "trade" \ "nsdSpecificTradeFields" \ "startAgreementDate").mkString != msgNotFound) "InPortfolio" else msgNotFound}</fpml:type>
{/* value isn`t present in the source */}
<fpml:value>{
val d = get(source \\ "trade" \ "nsdSpecificTradeFields" \ "startAgreementDate")
if (d.mkString != msgNotFound) d + "T00:00:00" else msgNotFound
}</fpml:value>
</fpml:timestamp>
<fpml:timestamp>
<fpml:type>{ if (get(source \\ "trade" \ "nsdSpecificTradeFields" \ "endAgreementDate").mkString != msgNotFound) "OutPortfolio" else msgNotFound}</fpml:type>
{/* value isn`t present in the source */}
<fpml:value>{
val d = get(source \\ "trade" \ "nsdSpecificTradeFields" \ "endAgreementDate")
if (d.mkString != msgNotFound) d + "T00:00:00" else msgNotFound
}</fpml:value>
</fpml:timestamp>
</fpml:timestamps>
{/* value isn`t present in the source */}
<fpml:collateralizationType>{
get(source \\ "trade" \ "collateral" \ "marginType").mkString match {
case "FC" => "Fully"
case "PC" => "Partially"
case "OC" => "OneWay"
case "U" => "Uncollateralized"
case _ => msgNotFound
} }
}</fpml:collateralizationType> <fpml:timestamps>
{/* value isn`t present in the source */} <fpml:timestamp>
<fpml:collateralPortfolio>{ get(source \\ "trade" \ "collateral" \ "collateralForm") }</fpml:collateralPortfolio> <fpml:type>{ if (get(source \\ "trade" \ "nsdSpecificTradeFields" \ "clearedDate").mkString != msgNotFound) "InClearingPool" else msgNotFound}</fpml:type>
{/* value isn`t present in the source */}
<fpml:value>{
val d = get(source \\ "trade" \ "nsdSpecificTradeFields" \ "clearedDate")
if (d.mkString != msgNotFound) d + "T00:00:00" else msgNotFound
}</fpml:value>
</fpml:timestamp>
<fpml:timestamp>
<fpml:type>{ if (get(source \\ "trade" \ "nsdSpecificTradeFields" \ "startAgreementDate").mkString != msgNotFound) "InPortfolio" else msgNotFound}</fpml:type>
{/* value isn`t present in the source */}
<fpml:value>{
val d = get(source \\ "trade" \ "nsdSpecificTradeFields" \ "startAgreementDate")
if (d.mkString != msgNotFound) d + "T00:00:00" else msgNotFound
}</fpml:value>
</fpml:timestamp>
<fpml:timestamp>
<fpml:type>{ if (get(source \\ "trade" \ "nsdSpecificTradeFields" \ "endAgreementDate").mkString != msgNotFound) "OutPortfolio" else msgNotFound}</fpml:type>
{/* value isn`t present in the source */}
<fpml:value>{
val d = get(source \\ "trade" \ "nsdSpecificTradeFields" \ "endAgreementDate")
if (d.mkString != msgNotFound) d + "T00:00:00" else msgNotFound
}</fpml:value>
</fpml:timestamp>
</fpml:timestamps>
{/* value isn`t present in the source */}
<fpml:collateralizationType>{
get(source \\ "trade" \ "collateral" \ "marginType").mkString match {
case "FC" => "Fully"
case "PC" => "Partially"
case "OC" => "OneWay"
case "U" => "Uncollateralized"
case _ => msgNotFound
}
}</fpml:collateralizationType>
{/* value isn`t present in the source */}
<fpml:collateralPortfolio>{ get(source \\ "trade" \ "collateral" \ "collateralForm") }</fpml:collateralPortfolio>
</fpml:partyTradeInformation> </fpml:partyTradeInformation>
}
} }
</fpml:tradeHeader> </fpml:tradeHeader>
{ templateTradeBody } { templateTradeBody }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment