Commit 40caf52c by Amelin Konstantin

Complete all templates with identifier dictionary.

parent 8dbcd1c2
...@@ -7,12 +7,14 @@ class BondBasketOptionTemplate(source: Node) extends TradeTemplate(source) { ...@@ -7,12 +7,14 @@ class BondBasketOptionTemplate(source: Node) extends TradeTemplate(source) {
<rtsrep:bondBasketOption> <rtsrep:bondBasketOption>
<fpml:productType>{ get(source \\ "trade" \ "bondBasketOption" \ "productType") }</fpml:productType> <fpml:productType>{ get(source \\ "trade" \ "bondBasketOption" \ "productType") }</fpml:productType>
<fpml:productId productIdScheme={ get(source \\ "trade" \ "bondBasketOption" \ "productId", "productIdScheme") }>{ get(source \\ "trade" \ "bondBasketOption" \ "productId") }</fpml:productId> <fpml:productId productIdScheme={ get(source \\ "trade" \ "bondBasketOption" \ "productId", "productIdScheme") }>{ get(source \\ "trade" \ "bondBasketOption" \ "productId") }</fpml:productId>
<fpml:buyerPartyReference href={ get(source \\ "trade" \ "bondBasketOption" \ "buyerPartyReference", "href") }/> { /* Uses dictionary from PartyTemplate for identifier */ }
<fpml:sellerPartyReference href={ get(source \\ "trade" \ "bondBasketOption" \ "sellerPartyReference", "href") }/> <fpml:buyerPartyReference href={ parties(get(source \\ "trade" \ "bondBasketOption" \ "buyerPartyReference", "href").mkString)._1 }/>
<fpml:sellerPartyReference href={ parties(get(source \\ "trade" \ "bondBasketOption" \ "sellerPartyReference", "href").mkString)._1 }/>
<fpml:optionType>{ get(source \\ "trade" \ "bondBasketOption" \ "optionType") }</fpml:optionType> <fpml:optionType>{ get(source \\ "trade" \ "bondBasketOption" \ "optionType") }</fpml:optionType>
<fpml:premium> <fpml:premium>
<fpml:payerPartyReference href={ get(source \\ "trade" \ "bondBasketOption" \ "premium" \"payerPartyReference", "href") }/> { /* Uses dictionary from PartyTemplate for identifier */ }
<fpml:receiverPartyReference href={ get(source \\ "trade" \ "bondBasketOption" \ "premium" \"receiverPartyReference", "href") }/> <fpml:payerPartyReference href={ parties(get(source \\ "trade" \ "bondBasketOption" \ "premium" \"payerPartyReference", "href").mkString)._1 }/>
<fpml:receiverPartyReference href={ parties(get(source \\ "trade" \ "bondBasketOption" \ "premium" \"receiverPartyReference", "href").mkString)._1 }/>
<fpml:paymentAmount> <fpml:paymentAmount>
<fpml:currency>{ get(source \\ "trade" \ "bondBasketOption" \ "premium" \\ "currency") }</fpml:currency> <fpml:currency>{ get(source \\ "trade" \ "bondBasketOption" \ "premium" \\ "currency") }</fpml:currency>
<fpml:amount>{ get(source \\ "trade" \ "bondBasketOption" \ "premium" \\ "amount") }</fpml:amount> <fpml:amount>{ get(source \\ "trade" \ "bondBasketOption" \ "premium" \\ "amount") }</fpml:amount>
......
...@@ -7,12 +7,14 @@ class BondOptionTemplate(source: Node) extends TradeTemplate(source) { ...@@ -7,12 +7,14 @@ class BondOptionTemplate(source: Node) extends TradeTemplate(source) {
<fpml:bondOption> <fpml:bondOption>
<fpml:productType>{ get(source \\ "trade" \ "bondOption" \ "productType") }</fpml:productType> <fpml:productType>{ get(source \\ "trade" \ "bondOption" \ "productType") }</fpml:productType>
<fpml:productId productIdScheme={ get(source \\ "trade" \ "bondOption" \ "productId", "productIdScheme") }>{ get(source \\ "trade" \ "bondOption" \ "productId") }</fpml:productId> <fpml:productId productIdScheme={ get(source \\ "trade" \ "bondOption" \ "productId", "productIdScheme") }>{ get(source \\ "trade" \ "bondOption" \ "productId") }</fpml:productId>
<fpml:buyerPartyReference href={ get(source \\ "trade" \ "bondOption" \ "buyerPartyReference", "href") }/> { /* Uses dictionary from PartyTemplate for identifier */ }
<fpml:sellerPartyReference href={ get(source \\ "trade" \ "bondOption" \ "sellerPartyReference", "href") }/> <fpml:buyerPartyReference href={ parties(get(source \\ "trade" \ "bondOption" \ "buyerPartyReference", "href").mkString)._1 }/>
<fpml:sellerPartyReference href={ parties(get(source \\ "trade" \ "bondOption" \ "sellerPartyReference", "href").mkString)._1 }/>
<fpml:optionType>{ get(source \\ "trade" \ "bondOption" \ "optionType") }</fpml:optionType> <fpml:optionType>{ get(source \\ "trade" \ "bondOption" \ "optionType") }</fpml:optionType>
<fpml:premium> <fpml:premium>
<fpml:payerPartyReference href={ get(source \\ "trade" \ "bondOption" \ "premium" \"payerPartyReference", "href") }/> { /* Uses dictionary from PartyTemplate for identifier */ }
<fpml:receiverPartyReference href={ get(source \\ "trade" \ "bondOption" \ "premium" \"receiverPartyReference", "href") }/> <fpml:payerPartyReference href={ parties(get(source \\ "trade" \ "bondOption" \ "premium" \"payerPartyReference", "href").mkString)._1 }/>
<fpml:receiverPartyReference href={ parties(get(source \\ "trade" \ "bondOption" \ "premium" \"receiverPartyReference", "href").mkString)._1 }/>
<fpml:paymentAmount> <fpml:paymentAmount>
<fpml:currency>{ get(source \\ "trade" \ "bondOption" \ "premium" \\ "currency") }</fpml:currency> <fpml:currency>{ get(source \\ "trade" \ "bondOption" \ "premium" \\ "currency") }</fpml:currency>
<fpml:amount>{ get(source \\ "trade" \ "bondOption" \ "premium" \\ "amount") }</fpml:amount> <fpml:amount>{ get(source \\ "trade" \ "bondOption" \ "premium" \\ "amount") }</fpml:amount>
......
...@@ -14,8 +14,9 @@ class CommodityForwardTemplate(source: Node) extends TradeTemplate(source) { ...@@ -14,8 +14,9 @@ class CommodityForwardTemplate(source: Node) extends TradeTemplate(source) {
</fpml:adjustableDate> </fpml:adjustableDate>
</fpml:valueDate> </fpml:valueDate>
<fpml:fixedLeg> <fpml:fixedLeg>
<fpml:payerPartyReference href={ get(source \\ "trade" \ "commodityForward" \ "fixedLeg" \ "payerPartyReference", "href") }/> { /* Uses dictionary from PartyTemplate for identifier */ }
<fpml:receiverPartyReference href={ get(source \\ "trade" \ "commodityForward" \ "fixedLeg" \ "receiverPartyReference", "href") }/> <fpml:payerPartyReference href={ parties(get(source \\ "trade" \ "commodityForward" \ "fixedLeg" \ "payerPartyReference", "href").mkString)._1 }/>
<fpml:receiverPartyReference href={ parties(get(source \\ "trade" \ "commodityForward" \ "fixedLeg" \ "receiverPartyReference", "href").mkString)._1 }/>
<fpml:fixedPrice> <fpml:fixedPrice>
<fpml:price>{ get(source \\ "trade" \ "commodityForward" \ "fixedLeg" \ "fixedPrice" \ "price") }</fpml:price> <fpml:price>{ get(source \\ "trade" \ "commodityForward" \ "fixedLeg" \ "fixedPrice" \ "price") }</fpml:price>
<fpml:priceCurrency>{ get(source \\ "trade" \ "commodityForward" \ "fixedLeg" \ "fixedPrice" \ "priceCurrency") }</fpml:priceCurrency> <fpml:priceCurrency>{ get(source \\ "trade" \ "commodityForward" \ "fixedLeg" \ "fixedPrice" \ "priceCurrency") }</fpml:priceCurrency>
...@@ -32,8 +33,9 @@ class CommodityForwardTemplate(source: Node) extends TradeTemplate(source) { ...@@ -32,8 +33,9 @@ class CommodityForwardTemplate(source: Node) extends TradeTemplate(source) {
</fpml:paymentDates> </fpml:paymentDates>
</fpml:fixedLeg> </fpml:fixedLeg>
<rtsrep:commodityPhysicalLeg> <rtsrep:commodityPhysicalLeg>
<fpml:payerPartyReference href={ get(source \\ "trade" \ "commodityForward" \ "commodityForwardPhysicalLeg" \ "payerPartyReference", "href") }/> { /* Uses dictionary from PartyTemplate for identifier */ }
<fpml:receiverPartyReference href={ get(source \\ "trade" \ "commodityForward" \ "commodityForwardPhysicalLeg" \ "receiverPartyReference", "href") }/> <fpml:payerPartyReference href={ parties(get(source \\ "trade" \ "commodityForward" \ "commodityForwardPhysicalLeg" \ "payerPartyReference", "href").mkString)._1 }/>
<fpml:receiverPartyReference href={ parties(get(source \\ "trade" \ "commodityForward" \ "commodityForwardPhysicalLeg" \ "receiverPartyReference", "href").mkString)._1 }/>
<rtsrep:commodity id={ get(source \\ "trade" \ "commodityForward" \ "commodityForwardPhysicalLeg" \ "commodity", "id") }> <rtsrep:commodity id={ get(source \\ "trade" \ "commodityForward" \ "commodityForwardPhysicalLeg" \ "commodity", "id") }>
<fpml:instrumentId instrumentIdScheme={ get(source \\ "trade" \ "commodityForward" \ "commodityForwardPhysicalLeg" \ "commodity" \ "instrumentId", "instrumentIdScheme") }>{ get(source \\ "trade" \ "commodityForward" \ "commodityForwardPhysicalLeg" \ "commodity" \ "instrumentId") }</fpml:instrumentId> <fpml:instrumentId instrumentIdScheme={ get(source \\ "trade" \ "commodityForward" \ "commodityForwardPhysicalLeg" \ "commodity" \ "instrumentId", "instrumentIdScheme") }>{ get(source \\ "trade" \ "commodityForward" \ "commodityForwardPhysicalLeg" \ "commodity" \ "instrumentId") }</fpml:instrumentId>
<fpml:unit>{ get(source \\ "trade" \ "commodityForward" \ "commodityForwardPhysicalLeg" \ "commodity" \ "unit") }</fpml:unit> <fpml:unit>{ get(source \\ "trade" \ "commodityForward" \ "commodityForwardPhysicalLeg" \ "commodity" \ "unit") }</fpml:unit>
...@@ -51,8 +53,9 @@ class CommodityForwardTemplate(source: Node) extends TradeTemplate(source) { ...@@ -51,8 +53,9 @@ class CommodityForwardTemplate(source: Node) extends TradeTemplate(source) {
</rtsrep:deliveryQuantity> </rtsrep:deliveryQuantity>
</rtsrep:commodityPhysicalLeg> </rtsrep:commodityPhysicalLeg>
<rtsrep:floatingForwardLeg> <rtsrep:floatingForwardLeg>
<fpml:payerPartyReference href={ get(source \\ "trade" \ "commodityForward" \ "floatingForwardLeg" \ "payerPartyReference", "href") }/> { /* Uses dictionary from PartyTemplate for identifier */ }
<fpml:receiverPartyReference href={ get(source \\ "trade" \ "commodityForward" \ "floatingForwardLeg" \ "receiverPartyReference", "href") }/> <fpml:payerPartyReference href={ parties(get(source \\ "trade" \ "commodityForward" \ "floatingForwardLeg" \ "payerPartyReference", "href").mkString)._1 }/>
<fpml:receiverPartyReference href={ parties(get(source \\ "trade" \ "commodityForward" \ "floatingForwardLeg" \ "receiverPartyReference", "href").mkString)._1 }/>
<rtsrep:commodity id={ get(source \\ "trade" \ "commodityForward" \ "floatingForwardLeg" \ "commodity", "id") }> <rtsrep:commodity id={ get(source \\ "trade" \ "commodityForward" \ "floatingForwardLeg" \ "commodity", "id") }>
<fpml:instrumentId instrumentIdScheme={ get(source \\ "trade" \ "commodityForward" \ "floatingForwardLeg" \ "commodity" \ "instrumentId", "instrumentIdScheme") }>{ get(source \\ "trade" \ "commodityForward" \ "floatingForwardLeg" \ "commodity" \ "instrumentId") }</fpml:instrumentId> <fpml:instrumentId instrumentIdScheme={ get(source \\ "trade" \ "commodityForward" \ "floatingForwardLeg" \ "commodity" \ "instrumentId", "instrumentIdScheme") }>{ get(source \\ "trade" \ "commodityForward" \ "floatingForwardLeg" \ "commodity" \ "instrumentId") }</fpml:instrumentId>
<fpml:unit>{ get(source \\ "trade" \ "commodityForward" \ "floatingForwardLeg" \ "commodity" \ "unit") }</fpml:unit> <fpml:unit>{ get(source \\ "trade" \ "commodityForward" \ "floatingForwardLeg" \ "commodity" \ "unit") }</fpml:unit>
......
...@@ -8,8 +8,9 @@ class CommodityOptionTemplate(source: Node) extends TradeTemplate(source) { ...@@ -8,8 +8,9 @@ class CommodityOptionTemplate(source: Node) extends TradeTemplate(source) {
{ /* productType is unknown for RTS */ } { /* productType is unknown for RTS */ }
{ /*<fpml:productType>{ get(source \\ "trade" \ "commodityOption" \ "productType") }</fpml:productType> */ } { /*<fpml:productType>{ get(source \\ "trade" \ "commodityOption" \ "productType") }</fpml:productType> */ }
<fpml:productId productIdScheme={ get(source \\ "trade" \ "commodityOption" \ "productId", "productIdScheme") }>{ get(source \\ "trade" \ "commodityOption" \ "productId") }</fpml:productId> <fpml:productId productIdScheme={ get(source \\ "trade" \ "commodityOption" \ "productId", "productIdScheme") }>{ get(source \\ "trade" \ "commodityOption" \ "productId") }</fpml:productId>
<fpml:buyerPartyReference href={ get(source \\ "trade" \ "commodityOption" \ "buyerPartyReference", "href") }/> { /* Uses dictionary from PartyTemplate for identifier */ }
<fpml:sellerPartyReference href={ get(source \\ "trade" \ "commodityOption" \ "sellerPartyReference", "href") }/> <fpml:buyerPartyReference href={ parties(get(source \\ "trade" \ "commodityOption" \ "buyerPartyReference", "href").mkString)._1 }/>
<fpml:sellerPartyReference href={ parties(get(source \\ "trade" \ "commodityOption" \ "sellerPartyReference", "href").mkString)._1 }/>
{ /* optionType isn`t present in source!!!*/ } { /* optionType isn`t present in source!!!*/ }
{ /* { <fpml:optionType>{ get(source \\ "trade" \ "commodityOption" \ "optionType") }</fpml:optionType> } */ } { /* { <fpml:optionType>{ get(source \\ "trade" \ "commodityOption" \ "optionType") }</fpml:optionType> } */ }
<fpml:optionType>{ if (get(source \\ "trade" \ "commodityOption" \ "buyerPartyReference", "href").mkString == "Party1") "Call" else "Put" }</fpml:optionType> <fpml:optionType>{ if (get(source \\ "trade" \ "commodityOption" \ "buyerPartyReference", "href").mkString == "Party1") "Call" else "Put" }</fpml:optionType>
...@@ -72,8 +73,9 @@ class CommodityOptionTemplate(source: Node) extends TradeTemplate(source) { ...@@ -72,8 +73,9 @@ class CommodityOptionTemplate(source: Node) extends TradeTemplate(source) {
<fpml:spreadPercentage>{ get(source \\ "trade" \ "commodityOption" \ "floatingStrikePricePerUnit" \ "spreadPercentage") }</fpml:spreadPercentage> <fpml:spreadPercentage>{ get(source \\ "trade" \ "commodityOption" \ "floatingStrikePricePerUnit" \ "spreadPercentage") }</fpml:spreadPercentage>
</fpml:floatingStrikePricePerUnit> </fpml:floatingStrikePricePerUnit>
<fpml:premium> <fpml:premium>
<fpml:payerPartyReference href={ get(source \\ "trade" \ "commodityOption" \ "premium" \"payerPartyReference", "href") }/> { /* Uses dictionary from PartyTemplate for identifier */ }
<fpml:receiverPartyReference href={ get(source \\ "trade" \ "commodityOption" \ "premium" \"receiverPartyReference", "href") }/> <fpml:payerPartyReference href={ parties(get(source \\ "trade" \ "commodityOption" \ "premium" \"payerPartyReference", "href").mkString)._1 }/>
<fpml:receiverPartyReference href={ parties(get(source \\ "trade" \ "commodityOption" \ "premium" \"receiverPartyReference", "href").mkString)._1 }/>
<fpml:paymentAmount> <fpml:paymentAmount>
<fpml:currency>{ get(source \\ "trade" \ "commodityOption" \ "premium" \\ "currency") }</fpml:currency> <fpml:currency>{ get(source \\ "trade" \ "commodityOption" \ "premium" \\ "currency") }</fpml:currency>
<fpml:amount>{ get(source \\ "trade" \ "commodityOption" \ "premium" \\ "amount") }</fpml:amount> <fpml:amount>{ get(source \\ "trade" \ "commodityOption" \ "premium" \\ "amount") }</fpml:amount>
......
...@@ -20,8 +20,9 @@ class CommoditySwapTemplate(source: Node) extends TradeTemplate(source) { ...@@ -20,8 +20,9 @@ class CommoditySwapTemplate(source: Node) extends TradeTemplate(source) {
<fpml:settlementCurrency>{ get(source \\ "trade" \ "commoditySwap" \ "settlementCurrency") }</fpml:settlementCurrency> <fpml:settlementCurrency>{ get(source \\ "trade" \ "commoditySwap" \ "settlementCurrency") }</fpml:settlementCurrency>
{ for (s <- source \\ "trade" \ "commoditySwap" \ "fixedLeg") yield { { for (s <- source \\ "trade" \ "commoditySwap" \ "fixedLeg") yield {
<fpml:fixedLeg> <fpml:fixedLeg>
<fpml:payerPartyReference href={get(s \ "payerPartyReference", "href")}/> { /* Uses dictionary from PartyTemplate for identifier */ }
<fpml:receiverPartyReference href={get(s \ "receiverPartyReference", "href")}/> <fpml:payerPartyReference href={ parties(get(s \ "payerPartyReference", "href").mkString)._1 }/>
<fpml:receiverPartyReference href={ parties(get(s \ "receiverPartyReference", "href").mkString)._1 }/>
<fpml:calculationDates> <fpml:calculationDates>
<fpml:unadjustedDate>{ get(s \ "calculationDates" \ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(s \ "calculationDates" \ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:calculationDates> </fpml:calculationDates>
......
...@@ -7,8 +7,9 @@ class EquityForwardTemplate(source: Node) extends TradeTemplate(source) { ...@@ -7,8 +7,9 @@ class EquityForwardTemplate(source: Node) extends TradeTemplate(source) {
<fpml:equityForward> <fpml:equityForward>
<fpml:productType>{ get(source \\ "trade" \ "equityForward" \ "productType") }</fpml:productType> <fpml:productType>{ get(source \\ "trade" \ "equityForward" \ "productType") }</fpml:productType>
<fpml:productId productIdScheme={ get(source \\ "trade" \ "equityForward" \ "productId", "productIdScheme") }>{ get(source \\ "trade" \ "equityForward" \ "productId") }</fpml:productId> <fpml:productId productIdScheme={ get(source \\ "trade" \ "equityForward" \ "productId", "productIdScheme") }>{ get(source \\ "trade" \ "equityForward" \ "productId") }</fpml:productId>
<fpml:buyerPartyReference href={ get(source \\ "trade" \ "equityForward" \ "buyerPartyReference", "href") }/> { /* Uses dictionary from PartyTemplate for identifier */ }
<fpml:sellerPartyReference href={ get(source \\ "trade" \ "equityForward" \ "sellerPartyReference", "href") }/> <fpml:buyerPartyReference href={ parties(get(source \\ "trade" \ "equityForward" \ "buyerPartyReference", "href").mkString)._1 }/>
<fpml:sellerPartyReference href={ parties(get(source \\ "trade" \ "equityForward" \ "sellerPartyReference", "href").mkString)._1 }/>
<fpml:optionType>{ "Forward" }</fpml:optionType> <fpml:optionType>{ "Forward" }</fpml:optionType>
<fpml:underlyer> <fpml:underlyer>
<fpml:basket> <fpml:basket>
......
...@@ -7,8 +7,9 @@ class EquityOptionTemplate(source: Node) extends TradeTemplate(source) { ...@@ -7,8 +7,9 @@ class EquityOptionTemplate(source: Node) extends TradeTemplate(source) {
<fpml:equityOption> <fpml:equityOption>
<fpml:productType>{ get(source \\ "trade" \ "equityOption" \ "productType") }</fpml:productType> <fpml:productType>{ get(source \\ "trade" \ "equityOption" \ "productType") }</fpml:productType>
<fpml:productId productIdScheme={ get(source \\ "trade" \ "equityOption" \ "productId", "productIdScheme") }>{ get(source \\ "trade" \ "equityOption" \ "productId") }</fpml:productId> <fpml:productId productIdScheme={ get(source \\ "trade" \ "equityOption" \ "productId", "productIdScheme") }>{ get(source \\ "trade" \ "equityOption" \ "productId") }</fpml:productId>
<fpml:buyerPartyReference href={ get(source \\ "trade" \ "equityOption" \ "buyerPartyReference", "href") }/> { /* Uses dictionary from PartyTemplate for identifier */ }
<fpml:sellerPartyReference href={ get(source \\ "trade" \ "equityOption" \ "sellerPartyReference", "href") }/> <fpml:buyerPartyReference href={ parties(get(source \\ "trade" \ "equityOption" \ "buyerPartyReference", "href").mkString)._1 }/>
<fpml:sellerPartyReference href={ parties(get(source \\ "trade" \ "equityOption" \ "sellerPartyReference", "href").mkString)._1 }/>
<fpml:optionType>{ get(source \\ "trade" \ "equityOption" \ "optionType") }</fpml:optionType> <fpml:optionType>{ get(source \\ "trade" \ "equityOption" \ "optionType") }</fpml:optionType>
<fpml:underlyer> <fpml:underlyer>
<fpml:singleUnderlyer> <fpml:singleUnderlyer>
...@@ -62,8 +63,9 @@ class EquityOptionTemplate(source: Node) extends TradeTemplate(source) { ...@@ -62,8 +63,9 @@ class EquityOptionTemplate(source: Node) extends TradeTemplate(source) {
<fpml:numberOfOptions>{ get(source \\ "trade" \ "equityOption" \ "numberOfOptions") }</fpml:numberOfOptions> <fpml:numberOfOptions>{ get(source \\ "trade" \ "equityOption" \ "numberOfOptions") }</fpml:numberOfOptions>
<fpml:optionEntitlement>{ get(source \\ "trade" \ "equityOption" \ "optionEntitlement") }</fpml:optionEntitlement> <fpml:optionEntitlement>{ get(source \\ "trade" \ "equityOption" \ "optionEntitlement") }</fpml:optionEntitlement>
<fpml:equityPremium> <fpml:equityPremium>
<fpml:payerPartyReference href={ get(source \\ "trade" \ "equityOption" \ "equityPremium" \"payerPartyReference", "href") }/> { /* Uses dictionary from PartyTemplate for identifier */ }
<fpml:receiverPartyReference href={ get(source \\ "trade" \ "equityOption" \ "equityPremium" \"receiverPartyReference", "href") }/> <fpml:payerPartyReference href={ parties(get(source \\ "trade" \ "equityOption" \ "equityPremium" \"payerPartyReference", "href").mkString)._1 }/>
<fpml:receiverPartyReference href={ parties(get(source \\ "trade" \ "equityOption" \ "equityPremium" \"receiverPartyReference", "href").mkString)._1 }/>
<fpml:paymentAmount> <fpml:paymentAmount>
<fpml:currency>{ get(source \\ "trade" \ "equityOption" \ "equityPremium" \\ "currency") }</fpml:currency> <fpml:currency>{ get(source \\ "trade" \ "equityOption" \ "equityPremium" \\ "currency") }</fpml:currency>
<fpml:amount>{ get(source \\ "trade" \ "equityOption" \ "equityPremium" \\ "amount") }</fpml:amount> <fpml:amount>{ get(source \\ "trade" \ "equityOption" \ "equityPremium" \\ "amount") }</fpml:amount>
......
...@@ -29,11 +29,12 @@ class FairValueReportTemplate(source: Node) extends PartyTemplate(source) { ...@@ -29,11 +29,12 @@ class FairValueReportTemplate(source: Node) extends PartyTemplate(source) {
</rtsrep:fairValue> </rtsrep:fairValue>
<rtsrep:valuationDate>{ get(source \ "markToMarketValuation" \ "markToMarketDetails" \ "valuationDateTime") }</rtsrep:valuationDate> <rtsrep:valuationDate>{ get(source \ "markToMarketValuation" \ "markToMarketDetails" \ "valuationDateTime") }</rtsrep:valuationDate>
</rtsrep:fairValueReport> </rtsrep:fairValueReport>
{ /* Uses dictionary from PartyTemplate for identifier */ }
{ for { s <- source \ "party" { for { s <- source \ "party"
id = get(s, "id").mkString id = get(s, "id").mkString
if id != "Sender" && id != "UTIGeneratingParty" } yield { if id != "Sender" && id != "UTIGeneratingParty" } yield {
<fpml:party id={ id }> <fpml:party id={ parties(id)._1 }>
<fpml:partyId partyIdScheme={ get(s \ "partyId", "partyIdScheme") }>{ get(s \ "partyId") }</fpml:partyId> <fpml:partyId partyIdScheme={ parties(id)._2 }>{ parties(id)._1 }</fpml:partyId>
<fpml:partyName>{ get(s \ "partyName") }</fpml:partyName> <fpml:partyName>{ get(s \ "partyName") }</fpml:partyName>
<fpml:country>{ get(s \ "country") }</fpml:country> <fpml:country>{ get(s \ "country") }</fpml:country>
<fpml:organizationType>{ get(s \ "classification") }</fpml:organizationType> <fpml:organizationType>{ get(s \ "classification") }</fpml:organizationType>
......
...@@ -23,16 +23,19 @@ class MasterAgreementTemplate(source: Node) extends RegiAmendTermMasterAgreement ...@@ -23,16 +23,19 @@ class MasterAgreementTemplate(source: Node) extends RegiAmendTermMasterAgreement
<rtsrep:masterAgreementDate>{ get(source \\ "trade" \ "tradeHeader" \ "tradeDate") }</rtsrep:masterAgreementDate> <rtsrep:masterAgreementDate>{ get(source \\ "trade" \ "tradeHeader" \ "tradeDate") }</rtsrep:masterAgreementDate>
</rtsrep:masterAgreement> </rtsrep:masterAgreement>
<rtsrep:masterAgreementParty> <rtsrep:masterAgreementParty>
<rtsrep:masterAgreementPartyReference href={ get(rp \ "partyReference", "href") }/> { /* Uses dictionary from PartyTemplate for identifier */ }
<rtsrep:masterAgreementPartyReference href={ parties(get(rp \ "partyReference", "href").mkString)._1 }/>
<rtsrep:masterAgreementId>{ get(utip \ "tradeId") }</rtsrep:masterAgreementId> <rtsrep:masterAgreementId>{ get(utip \ "tradeId") }</rtsrep:masterAgreementId>
<rtsrep:reportingParty> <rtsrep:reportingParty>
<rtsrep:reportingPartyReference href={ get(rp \ "partyReference", "href") }/> { /* Uses dictionary from PartyTemplate for identifier */ }
<rtsrep:reportingPartyReference href={ parties(get(rp \ "partyReference", "href").mkString)._1 }/>
{/* productType isn`t present in the source */} {/* productType isn`t present in the source */}
<rtsrep:productType>{ "All" }</rtsrep:productType> <rtsrep:productType>{ "All" }</rtsrep:productType>
</rtsrep:reportingParty> </rtsrep:reportingParty>
</rtsrep:masterAgreementParty> </rtsrep:masterAgreementParty>
<rtsrep:nonreportingParty> <rtsrep:nonreportingParty>
<rtsrep:partyReference href={ get(nrp \ "partyReference", "href") }/> { /* Uses dictionary from PartyTemplate for identifier */ }
<rtsrep:partyReference href={ parties(get(nrp \ "partyReference", "href").mkString)._1 }/>
</rtsrep:nonreportingParty> </rtsrep:nonreportingParty>
<rtsrep:partyRelatedType>{ get(source \\ "trade" \ "masterAgreementTerms" \ "partiesAreAffiliated") }</rtsrep:partyRelatedType> <rtsrep:partyRelatedType>{ get(source \\ "trade" \ "masterAgreementTerms" \ "partiesAreAffiliated") }</rtsrep:partyRelatedType>
<rtsrep:attachment> <rtsrep:attachment>
......
package templates package templates
import scala.util.{Failure, Success, Try}
import scala.xml.Node import scala.xml.Node
abstract class PartyTemplate(source: Node) extends Template(source) { abstract class PartyTemplate(source: Node) extends Template(source) {
var c = 0
protected[this] val parties = { protected[this] val parties = {
val p1 = val p1 =
for { s <- source \ "party" for { s <- source \ "party"
...@@ -13,7 +15,7 @@ abstract class PartyTemplate(source: Node) extends Template(source) { ...@@ -13,7 +15,7 @@ abstract class PartyTemplate(source: Node) extends Template(source) {
if (partyId0 != "NONREF") if (partyId0 != "NONREF")
id -> (partyId0, msgNotFound) id -> (partyId0, msgNotFound)
else { else {
val partyId1 = get(s \ "partyId", null, 1).mkString.filterNot(_.isWhitespace) val partyId1 = get(s \ "partyId", null, 1).mkString.filterNot(_.isWhitespace).replace("INN", "ITN")
id -> (partyId1, partyId1.split('_').head) id -> (partyId1, partyId1.split('_').head)
} }
...@@ -23,12 +25,11 @@ abstract class PartyTemplate(source: Node) extends Template(source) { ...@@ -23,12 +25,11 @@ abstract class PartyTemplate(source: Node) extends Template(source) {
for { s <- source \\ "trade" \ "nsdSpecificTradeFields" \ "clientDetails" for { s <- source \\ "trade" \ "nsdSpecificTradeFields" \ "clientDetails"
id = get(s \ "id").mkString id = get(s \ "id").mkString
if id != msgNotFound } yield { if id != msgNotFound } yield {
val partyId = id.filterNot(_.isWhitespace) val partyId = id.filterNot(_.isWhitespace).replace("INN", "ITN")
id -> (partyId, partyId.split('_').head) id -> (partyId, partyId.split('_').head)
} }
(p1 ++ p2).toMap (p1 ++ p2).toMap.withDefaultValue((msgNotFound, msgNotFound))
} }
println(parties)
} }
...@@ -37,11 +37,12 @@ abstract class RegiAmendTermMasterAgreementTemplate(source: Node) extends PartyT ...@@ -37,11 +37,12 @@ abstract class RegiAmendTermMasterAgreementTemplate(source: Node) extends PartyT
<fpml:effectiveDate>{ get(source \ "amendment" \ "effectiveDate") }</fpml:effectiveDate> <fpml:effectiveDate>{ get(source \ "amendment" \ "effectiveDate") }</fpml:effectiveDate>
</rtsrep:amendmentMasterAgreement> </rtsrep:amendmentMasterAgreement>
} }
{ /* Uses dictionary from PartyTemplate for identifier */ }
{ for { s <- source \ "party" { for { s <- source \ "party"
id = get(s, "id").mkString id = get(s, "id").mkString
if id != "Sender" && id != "UTIGeneratingParty" } yield { if id != "Sender" && id != "UTIGeneratingParty" } yield {
<fpml:party id={ id }> <fpml:party id={ parties(id)._1 }>
<fpml:partyId partyIdScheme={ get(s \ "partyId", "partyIdScheme") }>{ get(s \ "partyId") }</fpml:partyId> <fpml:partyId partyIdScheme={ parties(id)._2 }>{ parties(id)._1 }</fpml:partyId>
<fpml:partyName>{ get(s \ "partyName") }</fpml:partyName> <fpml:partyName>{ get(s \ "partyName") }</fpml:partyName>
<fpml:country>{ get(s \ "country") }</fpml:country> <fpml:country>{ get(s \ "country") }</fpml:country>
<fpml:organizationType>{ get(s \ "classification") }</fpml:organizationType> <fpml:organizationType>{ get(s \ "classification") }</fpml:organizationType>
......
...@@ -27,8 +27,9 @@ class RepoTemplate(source: Node) extends TradeTemplate(source) { ...@@ -27,8 +27,9 @@ class RepoTemplate(source: Node) extends TradeTemplate(source) {
</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") } /> { /* Uses dictionary from PartyTemplate for identifier */ }
<fpml:sellerPartyReference href={ get(source \\ "trade" \ "repo" \ "spotLeg" \ "sellerPartyReference", "href") } /> <fpml:buyerPartyReference href={ parties(get(source \\ "trade" \ "repo" \ "spotLeg" \ "buyerPartyReference", "href").mkString)._1 } />
<fpml:sellerPartyReference href={ parties(get(source \\ "trade" \ "repo" \ "spotLeg" \ "sellerPartyReference", "href").mkString)._1 } />
<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>
...@@ -57,8 +58,9 @@ class RepoTemplate(source: Node) extends TradeTemplate(source) { ...@@ -57,8 +58,9 @@ class RepoTemplate(source: Node) extends TradeTemplate(source) {
</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") } /> { /* Uses dictionary from PartyTemplate for identifier */ }
<fpml:sellerPartyReference href={ get(source \\ "trade" \ "repo" \ "forwardLeg" \ "sellerPartyReference", "href") } /> <fpml:buyerPartyReference href={ parties(get(source \\ "trade" \ "repo" \ "forwardLeg" \ "buyerPartyReference", "href").mkString)._1 } />
<fpml:sellerPartyReference href={ parties(get(source \\ "trade" \ "repo" \ "forwardLeg" \ "sellerPartyReference", "href").mkString)._1 } />
<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>
......
...@@ -19,8 +19,10 @@ abstract class TradeTemplate(source: Node) extends RegiAmendTradeTemplate(source ...@@ -19,8 +19,10 @@ abstract class TradeTemplate(source: Node) extends RegiAmendTradeTemplate(source
} }
} }
<fpml:partyTradeInformation> <fpml:partyTradeInformation>
{ /* Uses dictionary from PartyTemplate for identifier */ }
<fpml:partyReference href={ parties(get(source \\ "trade" \ "tradeHeader" \ "partyTradeInformation" \ "partyReference", "href").mkString)._1 }/> <fpml:partyReference href={ parties(get(source \\ "trade" \ "tradeHeader" \ "partyTradeInformation" \ "partyReference", "href").mkString)._1 }/>
<fpml:relatedParty> <fpml:relatedParty>
{ /* Uses dictionary from PartyTemplate for identifier */ }
<fpml:partyReference href={ parties(get(source \\ "trade" \ "tradeHeader" \ "partyTradeInformation" \ "partyReference", "href").mkString)._1 } /> <fpml:partyReference href={ parties(get(source \\ "trade" \ "tradeHeader" \ "partyTradeInformation" \ "partyReference", "href").mkString)._1 } />
<fpml:role>ClearingOrganization</fpml:role> <fpml:role>ClearingOrganization</fpml:role>
</fpml:relatedParty> </fpml:relatedParty>
...@@ -35,6 +37,7 @@ abstract class TradeTemplate(source: Node) extends RegiAmendTradeTemplate(source ...@@ -35,6 +37,7 @@ abstract class TradeTemplate(source: Node) extends RegiAmendTradeTemplate(source
</fpml:partyTradeInformation> </fpml:partyTradeInformation>
{ for (s <- source \\ "trade" \ "nsdSpecificTradeFields" \ "clientDetails") yield { { for (s <- source \\ "trade" \ "nsdSpecificTradeFields" \ "clientDetails") yield {
<fpml:partyTradeInformation> <fpml:partyTradeInformation>
{ /* Uses dictionary from PartyTemplate for identifier */ }
<fpml:partyReference href={ parties(get(s \ "servicingParty", "href").mkString)._1 } /> <fpml:partyReference href={ parties(get(s \ "servicingParty", "href").mkString)._1 } />
{ val id = get(s \ "id").mkString { val id = get(s \ "id").mkString
if (id != msgNotFound) if (id != msgNotFound)
......
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