Commit 26fae532 by Amelin Konstantin

change "" on messageNotFound in TradeTemplate

parent f92fbd09
...@@ -5,7 +5,7 @@ import templates._ ...@@ -5,7 +5,7 @@ import templates._
object Main extends App { object Main extends App {
implicit def templateFactory(source: Node): Template with Logger= { implicit def templateFactory(source: Node): Template with Logger = {
(source \ "trade").head.child (source \ "trade").head.child
.filter { .filter {
case v: Elem => true case v: Elem => true
......
...@@ -4,83 +4,83 @@ import scala.xml.Node ...@@ -4,83 +4,83 @@ import scala.xml.Node
class RepoTemplate(source: Node) extends TradeTemplate(source) { class RepoTemplate(source: Node) extends TradeTemplate(source) {
protected[this] def templateTradeBody: Node = { protected[this] def templateTradeBody: Node = {
<fpmlext:repo xsi:type="rtsrep:Repo"> <fpmlext:repo xsi:type="rtsrep:Repo">
<fpml:productId>{ get(source \ "trade" \ "repo" \ "productType") }</fpml:productId> <fpml:productId>{ get(source \ "trade" \ "repo" \ "productType") }</fpml:productId>
<fpml:productId productIdScheme={ get(source \ "trade" \ "repo" \ "productId", "productIdScheme") }>{ get(source \ "trade" \ "repo" \ "productId") }</fpml:productId> <fpml:productId productIdScheme={ get(source \ "trade" \ "repo" \ "productId", "productIdScheme") }>{ get(source \ "trade" \ "repo" \ "productId") }</fpml:productId>
<fpmlext:fixedRateSchedule> <fpmlext:fixedRateSchedule>
<fpml:initialValue>{ get(source \ "trade" \ "repo" \ "fixedRateSchedule" \ "initialValue") }</fpml:initialValue> <fpml:initialValue>{ get(source \ "trade" \ "repo" \ "fixedRateSchedule" \ "initialValue") }</fpml:initialValue>
<fpml:step> <fpml:step>
<fpml:stepDate>{ get(source \ "trade" \ "repo" \ "fixedRateSchedule" \\ "stepDate") }</fpml:stepDate> <fpml:stepDate>{ get(source \ "trade" \ "repo" \ "fixedRateSchedule" \\ "stepDate") }</fpml:stepDate>
<fpml:stepValue>{ get(source \ "trade" \ "repo" \ "fixedRateSchedule" \\ "stepValue") }</fpml:stepValue> <fpml:stepValue>{ get(source \ "trade" \ "repo" \ "fixedRateSchedule" \\ "stepValue") }</fpml:stepValue>
</fpml:step> </fpml:step>
</fpmlext:fixedRateSchedule> </fpmlext:fixedRateSchedule>
<fpmlext:floatingRateCalculation> <fpmlext:floatingRateCalculation>
<fpml:floatingRateIndex>{ get(source \ "trade" \ "repo" \ "floatingRateCalculation" \ "floatingRateIndex") }</fpml:floatingRateIndex> <fpml:floatingRateIndex>{ get(source \ "trade" \ "repo" \ "floatingRateCalculation" \ "floatingRateIndex") }</fpml:floatingRateIndex>
<fpml:indexTenor> <fpml:indexTenor>
<fpml:periodMultiplier>{ get(source \ "trade" \ "repo" \ "floatingRateCalculation" \\ "periodMultiplier") }</fpml:periodMultiplier> <fpml:periodMultiplier>{ get(source \ "trade" \ "repo" \ "floatingRateCalculation" \\ "periodMultiplier") }</fpml:periodMultiplier>
<fpml:period>{ get(source \ "trade" \ "repo" \ "floatingRateCalculation" \\ "period") }</fpml:period> <fpml:period>{ get(source \ "trade" \ "repo" \ "floatingRateCalculation" \\ "period") }</fpml:period>
</fpml:indexTenor> </fpml:indexTenor>
<fpml:spreadSchedule> <fpml:spreadSchedule>
<fpml:initialValue>{ get(source \ "trade" \ "repo" \ "floatingRateCalculation" \\ "initialValue") }</fpml:initialValue> <fpml:initialValue>{ get(source \ "trade" \ "repo" \ "floatingRateCalculation" \\ "initialValue") }</fpml:initialValue>
</fpml:spreadSchedule> </fpml:spreadSchedule>
<fpml:initialRate>{ get(source \ "trade" \ "repo" \ "floatingRateCalculation" \\ "initialRate") }</fpml:initialRate> <fpml:initialRate>{ get(source \ "trade" \ "repo" \ "floatingRateCalculation" \\ "initialRate") }</fpml:initialRate>
</fpmlext:floatingRateCalculation> </fpmlext:floatingRateCalculation>
<fpmlext:dayCountFraction>{ get(source \ "trade" \ "repo" \ "dayCountFraction") }</fpmlext:dayCountFraction> <fpmlext:dayCountFraction>{ get(source \ "trade" \ "repo" \ "dayCountFraction") }</fpmlext:dayCountFraction>
<fpmlext:spotLeg xsi:type="rtsrep:RepoTransactionLeg"> <fpmlext:spotLeg xsi:type="rtsrep:RepoTransactionLeg">
<fpml:buyerPartyReference href={ get(source \ "trade" \ "repo" \ "spotLeg" \ "buyerPartyReference", "href") } /> <fpml:buyerPartyReference href={ get(source \ "trade" \ "repo" \ "spotLeg" \ "buyerPartyReference", "href") } />
<fpml:sellerPartyReference href={ get(source \ "trade" \ "repo" \ "spotLeg" \ "sellerPartyReference", "href") } /> <fpml:sellerPartyReference href={ get(source \ "trade" \ "repo" \ "spotLeg" \ "sellerPartyReference", "href") } />
<fpmlext:settlementDate> <fpmlext:settlementDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "repo" \ "spotLeg" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \ "trade" \ "repo" \ "spotLeg" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</fpmlext:settlementDate> </fpmlext:settlementDate>
<fpml:settlementAmount> <fpml:settlementAmount>
<fpml:currency>{ get(source \ "trade" \ "repo" \ "spotLeg" \\ "currency") }</fpml:currency> <fpml:currency>{ get(source \ "trade" \ "repo" \ "spotLeg" \\ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "repo" \ "spotLeg" \\ "amount") }</fpml:amount> <fpml:amount>{ get(source \ "trade" \ "repo" \ "spotLeg" \\ "amount") }</fpml:amount>
</fpml:settlementAmount> </fpml:settlementAmount>
{ /* <fpmlext:collateral xsi:type="rtsrep:CollateralValuation"> */ } { /* <fpmlext:collateral xsi:type="rtsrep:CollateralValuation"> */ }
<fpmlext:collateral> <fpmlext:collateral>
<fpmlext:numberOfUnits>{ get(source \ "trade" \ "repo" \ "spotLeg" \ "collateral" \ "numberOfUnits") }</fpmlext:numberOfUnits> <fpmlext:numberOfUnits>{ get(source \ "trade" \ "repo" \ "spotLeg" \ "collateral" \ "numberOfUnits") }</fpmlext:numberOfUnits>
<fpmlext:unitPrice> <fpmlext:unitPrice>
<fpml:currency>{ get(source \ "trade" \ "repo" \ "spotLeg" \ "collateral" \ "unitPrice" \ "currency") }</fpml:currency> <fpml:currency>{ get(source \ "trade" \ "repo" \ "spotLeg" \ "collateral" \ "unitPrice" \ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "repo" \ "spotLeg" \ "collateral" \ "unitPrice" \ "amount") }</fpml:amount> <fpml:amount>{ get(source \ "trade" \ "repo" \ "spotLeg" \ "collateral" \ "unitPrice" \ "amount") }</fpml:amount>
</fpmlext:unitPrice> </fpmlext:unitPrice>
<fpmlext:nominalAmount> <fpmlext:nominalAmount>
<fpml:currency>{ get(source \ "trade" \ "repo" \ "spotLeg" \ "collateral" \ "nominalAmount" \ "currency") }</fpml:currency> <fpml:currency>{ get(source \ "trade" \ "repo" \ "spotLeg" \ "collateral" \ "nominalAmount" \ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "repo" \ "spotLeg" \ "collateral" \ "nominalAmount" \ "amount") }</fpml:amount> <fpml:amount>{ get(source \ "trade" \ "repo" \ "spotLeg" \ "collateral" \ "nominalAmount" \ "amount") }</fpml:amount>
</fpmlext:nominalAmount> </fpmlext:nominalAmount>
<fpmlext:assetReference href={ get(source \ "trade" \ "repo" \ "spotLeg" \ "collateral" \ "assetReference", "href") }/> <fpmlext:assetReference href={ get(source \ "trade" \ "repo" \ "spotLeg" \ "collateral" \ "assetReference", "href") }/>
</fpmlext:collateral> </fpmlext:collateral>
<rtsrep:deliveryDate> <rtsrep:deliveryDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "repo" \ "spotLeg" \ "deliveryDate" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \ "trade" \ "repo" \ "spotLeg" \ "deliveryDate" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</rtsrep:deliveryDate> </rtsrep:deliveryDate>
</fpmlext:spotLeg> </fpmlext:spotLeg>
<fpmlext:forwardLeg xsi:type="rtsrep:ForwardRepoTransactionLeg"> <fpmlext:forwardLeg xsi:type="rtsrep:ForwardRepoTransactionLeg">
<fpml:buyerPartyReference href={ get(source \ "trade" \ "repo" \ "forwardLeg" \ "buyerPartyReference", "href") } /> <fpml:buyerPartyReference href={ get(source \ "trade" \ "repo" \ "forwardLeg" \ "buyerPartyReference", "href") } />
<fpml:sellerPartyReference href={ get(source \ "trade" \ "repo" \ "forwardLeg" \ "sellerPartyReference", "href") } /> <fpml:sellerPartyReference href={ get(source \ "trade" \ "repo" \ "forwardLeg" \ "sellerPartyReference", "href") } />
<fpmlext:settlementDate> <fpmlext:settlementDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "repo" \ "forwardLeg" \ "settlementDate" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \ "trade" \ "repo" \ "forwardLeg" \ "settlementDate" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</fpmlext:settlementDate> </fpmlext:settlementDate>
<fpml:settlementAmount> <fpml:settlementAmount>
<fpml:currency>{ get(source \ "trade" \ "repo" \ "forwardLeg" \\ "currency") }</fpml:currency> <fpml:currency>{ get(source \ "trade" \ "repo" \ "forwardLeg" \\ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "repo" \ "forwardLeg" \\ "amount") }</fpml:amount> <fpml:amount>{ get(source \ "trade" \ "repo" \ "forwardLeg" \\ "amount") }</fpml:amount>
</fpml:settlementAmount> </fpml:settlementAmount>
<rtsrep:deliveryDate> <rtsrep:deliveryDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "repo" \ "forwardLeg" \ "deliveryDate" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \ "trade" \ "repo" \ "forwardLeg" \ "deliveryDate" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</rtsrep:deliveryDate> </rtsrep:deliveryDate>
</fpmlext:forwardLeg> </fpmlext:forwardLeg>
<fpml:equity id={ get(source \ "trade" \ "repo" \ "equity", "id") }> <fpml:equity id={ get(source \ "trade" \ "repo" \ "equity", "id") }>
<fpml:instrumentId instrumentIdScheme={ get(source \ "trade" \ "repo" \ "equity" \ "instrumentId", "instrumentIdScheme") }>{ get(source \ "trade" \ "repo" \ "equity" \ "instrumentId") }</fpml:instrumentId> <fpml:instrumentId instrumentIdScheme={ get(source \ "trade" \ "repo" \ "equity" \ "instrumentId", "instrumentIdScheme") }>{ get(source \ "trade" \ "repo" \ "equity" \ "instrumentId") }</fpml:instrumentId>
</fpml:equity> </fpml:equity>
<fpml:bond id={ get(source \ "trade" \ "repo" \ "bond", "id") }> <fpml:bond id={ get(source \ "trade" \ "repo" \ "bond", "id") }>
<fpml:instrumentId instrumentIdScheme={ get(source \ "trade" \ "repo" \ "bond" \ "instrumentId", "instrumentIdScheme") }>{ get(source \ "trade" \ "repo" \ "bond" \ "instrumentId") }</fpml:instrumentId> <fpml:instrumentId instrumentIdScheme={ get(source \ "trade" \ "repo" \ "bond" \ "instrumentId", "instrumentIdScheme") }>{ get(source \ "trade" \ "repo" \ "bond" \ "instrumentId") }</fpml:instrumentId>
</fpml:bond> </fpml:bond>
</fpmlext:repo> </fpmlext:repo>
} }
} }
\ No newline at end of file
...@@ -52,29 +52,29 @@ abstract class TradeTemplate(source: Node) extends Template(source) { ...@@ -52,29 +52,29 @@ abstract class TradeTemplate(source: Node) extends Template(source) {
<fpml:partyReference href={ get(s \ "servicingParty", "href") } /> <fpml:partyReference href={ get(s \ "servicingParty", "href") } />
<fpml:relatedParty> <fpml:relatedParty>
<fpml:partyReference href={ get(s \ "id") } /> <fpml:partyReference href={ get(s \ "id") } />
<fpml:role>{ if (get(s \ "id").mkString != msgNotFound) "Client" else ""}</fpml:role> <fpml:role>{ if (get(s \ "id").mkString != msgNotFound) "Client" else msgNotFound}</fpml:role>
<fpml:type>{ get(s \ "type") }</fpml:type> <fpml:type>{ get(s \ "type") }</fpml:type>
</fpml:relatedParty> </fpml:relatedParty>
<fpml:timestamps> <fpml:timestamps>
<fpml:timestamp> <fpml:timestamp>
<fpml:type>{ if (get(source \ "trade" \ "nsdSpecificTradeFields" \ "clearedDate").mkString != msgNotFound) "InClearingPool" else ""}</fpml:type> <fpml:type>{ if (get(source \ "trade" \ "nsdSpecificTradeFields" \ "clearedDate").mkString != msgNotFound) "InClearingPool" else msgNotFound}</fpml:type>
<fpml:value>{ <fpml:value>{
val d = get(source \ "trade" \ "nsdSpecificTradeFields" \ "clearedDate") val d = get(source \ "trade" \ "nsdSpecificTradeFields" \ "clearedDate")
if (d.mkString != msgNotFound) d + "T00:00:00" else "" if (d.mkString != msgNotFound) d + "T00:00:00" else msgNotFound
}</fpml:value> }</fpml:value>
</fpml:timestamp> </fpml:timestamp>
<fpml:timestamp> <fpml:timestamp>
<fpml:type>{ if (get(source \ "trade" \ "nsdSpecificTradeFields" \ "startAgreementDate").mkString != msgNotFound) "InPortfolio" else ""}</fpml:type> <fpml:type>{ if (get(source \ "trade" \ "nsdSpecificTradeFields" \ "startAgreementDate").mkString != msgNotFound) "InPortfolio" else msgNotFound}</fpml:type>
<fpml:value>{ <fpml:value>{
val d = get(source \ "trade" \ "nsdSpecificTradeFields" \ "startAgreementDate") val d = get(source \ "trade" \ "nsdSpecificTradeFields" \ "startAgreementDate")
if (d.mkString != msgNotFound) d + "T00:00:00" else "" if (d.mkString != msgNotFound) d + "T00:00:00" else msgNotFound
}</fpml:value> }</fpml:value>
</fpml:timestamp> </fpml:timestamp>
<fpml:timestamp> <fpml:timestamp>
<fpml:type>{ if (get(source \ "trade" \ "nsdSpecificTradeFields" \ "endAgreementDate").mkString != msgNotFound) "OutPortfolio" else ""}</fpml:type> <fpml:type>{ if (get(source \ "trade" \ "nsdSpecificTradeFields" \ "endAgreementDate").mkString != msgNotFound) "OutPortfolio" else msgNotFound}</fpml:type>
<fpml:value>{ <fpml:value>{
val d = get(source \ "trade" \ "nsdSpecificTradeFields" \ "endAgreementDate") val d = get(source \ "trade" \ "nsdSpecificTradeFields" \ "endAgreementDate")
if (d.mkString != msgNotFound) d + "T00:00:00" else "" if (d.mkString != msgNotFound) d + "T00:00:00" else msgNotFound
}</fpml:value> }</fpml:value>
</fpml:timestamp> </fpml:timestamp>
</fpml:timestamps> </fpml:timestamps>
...@@ -84,7 +84,7 @@ abstract class TradeTemplate(source: Node) extends Template(source) { ...@@ -84,7 +84,7 @@ abstract class TradeTemplate(source: Node) extends Template(source) {
case v if v == "PC" => "Partially" case v if v == "PC" => "Partially"
case v if v == "OC" => "OneWay" case v if v == "OC" => "OneWay"
case v if v == "U" => "Uncollateralized" case v if v == "U" => "Uncollateralized"
case _ => "" case _ => msgNotFound
} }
}</fpml:collateralizationType> }</fpml:collateralizationType>
<fpml:collateralPortfolio>{ get(source \ "trade" \ "collateral" \ "collateralForm") }</fpml:collateralPortfolio> <fpml:collateralPortfolio>{ get(source \ "trade" \ "collateral" \ "collateralForm") }</fpml:collateralPortfolio>
...@@ -123,5 +123,4 @@ abstract class TradeTemplate(source: Node) extends Template(source) { ...@@ -123,5 +123,4 @@ abstract class TradeTemplate(source: Node) extends Template(source) {
</document> </document>
</signedDocument> </signedDocument>
} }
} }
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