Commit cce0c27f by Amelin Konstantin

Fix path 'source \\ "trade"'

parent 4e0c2844
...@@ -14,7 +14,7 @@ object Main { ...@@ -14,7 +14,7 @@ object Main {
val logFileName: String = conf.getString("log") val logFileName: String = conf.getString("log")
implicit def templateFactory(source: Node): Template = { implicit def templateFactory(source: Node): Template = {
Try { (source \ "trade").head.child Try { (source \\ "trade").head.child
.filter { .filter {
case v: Elem => true case v: Elem => true
case _ => false case _ => false
......
...@@ -5,70 +5,70 @@ import scala.xml.Node ...@@ -5,70 +5,70 @@ import scala.xml.Node
class BondBasketOptionTemplate(source: Node) extends TradeTemplate(source) { class BondBasketOptionTemplate(source: Node) extends TradeTemplate(source) {
protected[this] def templateTradeBody: Node = { protected[this] def templateTradeBody: Node = {
<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") }/> <fpml:buyerPartyReference href={ get(source \\ "trade" \ "bondBasketOption" \ "buyerPartyReference", "href") }/>
<fpml:sellerPartyReference href={ get(source \ "trade" \ "bondBasketOption" \ "sellerPartyReference", "href") }/> <fpml:sellerPartyReference href={ get(source \\ "trade" \ "bondBasketOption" \ "sellerPartyReference", "href") }/>
<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") }/> <fpml:payerPartyReference href={ get(source \\ "trade" \ "bondBasketOption" \ "premium" \"payerPartyReference", "href") }/>
<fpml:receiverPartyReference href={ get(source \ "trade" \ "bondBasketOption" \ "premium" \"receiverPartyReference", "href") }/> <fpml:receiverPartyReference href={ get(source \\ "trade" \ "bondBasketOption" \ "premium" \"receiverPartyReference", "href") }/>
<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>
</fpml:paymentAmount> </fpml:paymentAmount>
{ /* paymentDate isn`t present in source!!!*/ } { /* paymentDate isn`t present in source!!!*/ }
<fpml:paymentDate> <fpml:paymentDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "bondBasketOption" \ "americanExercise" \ "expirationDate" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "bondBasketOption" \ "americanExercise" \ "expirationDate" \\ "unadjustedDate") }</fpml:unadjustedDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "bondBasketOption" \ "bermudaExercise" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "bondBasketOption" \ "bermudaExercise" \\ "unadjustedDate") }</fpml:unadjustedDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "bondBasketOption" \ "europeanExercise" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "bondBasketOption" \ "europeanExercise" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</fpml:paymentDate> </fpml:paymentDate>
</fpml:premium> </fpml:premium>
<fpml:americanExercise> <fpml:americanExercise>
<fpml:commencementDate> <fpml:commencementDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "bondBasketOption" \ "americanExercise" \ "commencementDate" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "bondBasketOption" \ "americanExercise" \ "commencementDate" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</fpml:commencementDate> </fpml:commencementDate>
<fpml:expirationDate> <fpml:expirationDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "bondBasketOption" \ "americanExercise" \ "expirationDate" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "bondBasketOption" \ "americanExercise" \ "expirationDate" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</fpml:expirationDate> </fpml:expirationDate>
</fpml:americanExercise> </fpml:americanExercise>
<fpml:bermudaExercise> <fpml:bermudaExercise>
<fpml:bermudaExerciseDates> <fpml:bermudaExerciseDates>
<fpml:adjustableDates> <fpml:adjustableDates>
<fpml:unadjustedDate>{ get(source \ "trade" \ "bondBasketOption" \ "bermudaExercise" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "bondBasketOption" \ "bermudaExercise" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDates> </fpml:adjustableDates>
</fpml:bermudaExerciseDates> </fpml:bermudaExerciseDates>
</fpml:bermudaExercise> </fpml:bermudaExercise>
<fpml:europeanExercise> <fpml:europeanExercise>
<fpml:expirationDate> <fpml:expirationDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "bondBasketOption" \ "europeanExercise" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "bondBasketOption" \ "europeanExercise" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</fpml:expirationDate> </fpml:expirationDate>
</fpml:europeanExercise> </fpml:europeanExercise>
<fpml:notionalAmount> <fpml:notionalAmount>
<fpml:currency>{ get(source \ "trade" \ "bondBasketOption" \ "notionalAmount" \ "currency") }</fpml:currency> <fpml:currency>{ get(source \\ "trade" \ "bondBasketOption" \ "notionalAmount" \ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "bondBasketOption" \ "notionalAmount" \ "amount") }</fpml:amount> <fpml:amount>{ get(source \\ "trade" \ "bondBasketOption" \ "notionalAmount" \ "amount") }</fpml:amount>
</fpml:notionalAmount> </fpml:notionalAmount>
<fpml:optionEntitlement>{ get(source \ "trade" \ "bondBasketOption" \ "optionEntitlement") }</fpml:optionEntitlement> <fpml:optionEntitlement>{ get(source \\ "trade" \ "bondBasketOption" \ "optionEntitlement") }</fpml:optionEntitlement>
<fpml:numberOfOptions>{ get(source \ "trade" \ "bondBasketOption" \ "numberOfOptions") }</fpml:numberOfOptions> <fpml:numberOfOptions>{ get(source \\ "trade" \ "bondBasketOption" \ "numberOfOptions") }</fpml:numberOfOptions>
<fpml:settlementType>{ get(source \ "trade" \ "bondBasketOption" \ "settlementType") }</fpml:settlementType> <fpml:settlementType>{ get(source \\ "trade" \ "bondBasketOption" \ "settlementType") }</fpml:settlementType>
<rtsrep:strike> <rtsrep:strike>
<fpml:price> <fpml:price>
<fpml:strikePrice>{ get(source \ "trade" \ "bondBasketOption" \ "strike" \\ "strikePrice") }</fpml:strikePrice> <fpml:strikePrice>{ get(source \\ "trade" \ "bondBasketOption" \ "strike" \\ "strikePrice") }</fpml:strikePrice>
<fpml:strikePercentage>{ get(source \ "trade" \ "bondBasketOption" \ "strike" \\ "strikePercentage") }</fpml:strikePercentage> <fpml:strikePercentage>{ get(source \\ "trade" \ "bondBasketOption" \ "strike" \\ "strikePercentage") }</fpml:strikePercentage>
<fpml:currency>{ get(source \ "trade" \ "bondBasketOption" \ "strike" \\ "currency") }</fpml:currency> <fpml:currency>{ get(source \\ "trade" \ "bondBasketOption" \ "strike" \\ "currency") }</fpml:currency>
</fpml:price> </fpml:price>
</rtsrep:strike> </rtsrep:strike>
<fpml:basket> <fpml:basket>
<fpml:openUnits>{ get(source \ "trade" \ "bondBasketOption" \ "basket" \ "openUnits") }</fpml:openUnits> <fpml:openUnits>{ get(source \\ "trade" \ "bondBasketOption" \ "basket" \ "openUnits") }</fpml:openUnits>
{ for (s <- source \ "trade" \ "bondBasketOption" \ "basket" \ "basketConstituent") yield { { for (s <- source \\ "trade" \ "bondBasketOption" \ "basket" \ "basketConstituent") yield {
<fpml:basketConstituent> <fpml:basketConstituent>
<fpml:bond id={ get(s \ "bond", "id") }> <fpml:bond id={ get(s \ "bond", "id") }>
<fpml:instrumentId instrumentIdScheme={ get(s \\ "instrumentId", "instrumentIdScheme") }>{ get(s \\ "instrumentId") }</fpml:instrumentId> <fpml:instrumentId instrumentIdScheme={ get(s \\ "instrumentId", "instrumentIdScheme") }>{ get(s \\ "instrumentId") }</fpml:instrumentId>
......
...@@ -5,42 +5,42 @@ import scala.xml.Node ...@@ -5,42 +5,42 @@ import scala.xml.Node
class BondForwardTemplate(source: Node) extends TradeTemplate(source) { class BondForwardTemplate(source: Node) extends TradeTemplate(source) {
protected[this] def templateTradeBody: Node = { protected[this] def templateTradeBody: Node = {
<rtsrep:bondForward> <rtsrep:bondForward>
<fpml:productType>{ get(source \ "trade" \ "bondForward" \ "productType") }</fpml:productType> <fpml:productType>{ get(source \\ "trade" \ "bondForward" \ "productType") }</fpml:productType>
<fpml:productId productIdScheme={ get(source \ "trade" \ "bondForward" \ "productId", "productIdScheme") }>{ get(source \ "trade" \ "bondForward" \ "productId") }</fpml:productId> <fpml:productId productIdScheme={ get(source \\ "trade" \ "bondForward" \ "productId", "productIdScheme") }>{ get(source \\ "trade" \ "bondForward" \ "productId") }</fpml:productId>
<fpml:buyerPartyReference href={ get(source \ "trade" \ "bondForward" \ "buyerPartyReference", "href") }/> <fpml:buyerPartyReference href={ get(source \\ "trade" \ "bondForward" \ "buyerPartyReference", "href") }/>
<fpml:sellerPartyReference href={ get(source \ "trade" \ "bondForward" \ "sellerPartyReference", "href") }/> <fpml:sellerPartyReference href={ get(source \\ "trade" \ "bondForward" \ "sellerPartyReference", "href") }/>
<rtsrep:underlyer> <rtsrep:underlyer>
<fpml:singleUnderlyer> <fpml:singleUnderlyer>
<fpml:equity id={ get(source \ "trade" \ "bondForward" \ "underlyer" \ "singleUnderlyer" \ "equity", "id") }> <fpml:equity id={ get(source \\ "trade" \ "bondForward" \ "underlyer" \ "singleUnderlyer" \ "equity", "id") }>
<fpml:instrumentId instrumentIdScheme={ get(source \ "trade" \ "bondForward" \ "underlyer" \ "singleUnderlyer" \ "equity" \ "instrumentId", "instrumentIdScheme") }>{ get(source \ "trade" \ "bondForward" \ "underlyer" \ "singleUnderlyer" \ "equity" \ "instrumentId") }</fpml:instrumentId> <fpml:instrumentId instrumentIdScheme={ get(source \\ "trade" \ "bondForward" \ "underlyer" \ "singleUnderlyer" \ "equity" \ "instrumentId", "instrumentIdScheme") }>{ get(source \\ "trade" \ "bondForward" \ "underlyer" \ "singleUnderlyer" \ "equity" \ "instrumentId") }</fpml:instrumentId>
</fpml:equity> </fpml:equity>
<fpml:bond id={ get(source \ "trade" \ "bondForward" \ "underlyer" \ "singleUnderlyer" \ "bond", "id") }> <fpml:bond id={ get(source \\ "trade" \ "bondForward" \ "underlyer" \ "singleUnderlyer" \ "bond", "id") }>
<fpml:instrumentId instrumentIdScheme={ get(source \ "trade" \ "bondForward" \ "underlyer" \ "singleUnderlyer" \ "bond" \ "instrumentId", "instrumentIdScheme") }>{ get(source \ "trade" \ "bondForward" \ "underlyer" \ "singleUnderlyer" \ "bond" \ "instrumentId") }</fpml:instrumentId> <fpml:instrumentId instrumentIdScheme={ get(source \\ "trade" \ "bondForward" \ "underlyer" \ "singleUnderlyer" \ "bond" \ "instrumentId", "instrumentIdScheme") }>{ get(source \\ "trade" \ "bondForward" \ "underlyer" \ "singleUnderlyer" \ "bond" \ "instrumentId") }</fpml:instrumentId>
</fpml:bond> </fpml:bond>
<fpml:index id={ get(source \ "trade" \ "bondForward" \ "underlyer" \ "singleUnderlyer" \ "index", "id") }> <fpml:index id={ get(source \\ "trade" \ "bondForward" \ "underlyer" \ "singleUnderlyer" \ "index", "id") }>
<fpml:instrumentId instrumentIdScheme={ get(source \ "trade" \ "bondForward" \ "underlyer" \ "singleUnderlyer" \ "index" \ "instrumentId", "instrumentIdScheme") }>{ get(source \ "trade" \ "bondForward" \ "underlyer" \ "singleUnderlyer" \ "index" \ "instrumentId") }</fpml:instrumentId> <fpml:instrumentId instrumentIdScheme={ get(source \\ "trade" \ "bondForward" \ "underlyer" \ "singleUnderlyer" \ "index" \ "instrumentId", "instrumentIdScheme") }>{ get(source \\ "trade" \ "bondForward" \ "underlyer" \ "singleUnderlyer" \ "index" \ "instrumentId") }</fpml:instrumentId>
</fpml:index> </fpml:index>
<fpml:openUnits>{ get(source \ "trade" \ "bondForward" \ "underlyer" \ "singleUnderlyer" \ "openUnits") }</fpml:openUnits> <fpml:openUnits>{ get(source \\ "trade" \ "bondForward" \ "underlyer" \ "singleUnderlyer" \ "openUnits") }</fpml:openUnits>
</fpml:singleUnderlyer> </fpml:singleUnderlyer>
</rtsrep:underlyer> </rtsrep:underlyer>
<rtsrep:notionalAmount> <rtsrep:notionalAmount>
<fpml:currency>{ get(source \ "trade" \ "bondForward" \ "notionalAmount" \ "currency") }</fpml:currency> <fpml:currency>{ get(source \\ "trade" \ "bondForward" \ "notionalAmount" \ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "bondForward" \ "notionalAmount" \ "amount") }</fpml:amount> <fpml:amount>{ get(source \\ "trade" \ "bondForward" \ "notionalAmount" \ "amount") }</fpml:amount>
</rtsrep:notionalAmount> </rtsrep:notionalAmount>
{ /* settlementType isn`t present in source!!!*/ } { /* settlementType isn`t present in source!!!*/ }
<rtsrep:settlementType>{ "CashOrPhysical" }</rtsrep:settlementType> <rtsrep:settlementType>{ "CashOrPhysical" }</rtsrep:settlementType>
<rtsrep:settlementDate> <rtsrep:settlementDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "bondForward" \ "settlementDate" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "bondForward" \ "settlementDate" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</rtsrep:settlementDate> </rtsrep:settlementDate>
<rtsrep:settlementCurrency>{ get(source \ "trade" \ "bondForward" \ "settlementCurrency") }</rtsrep:settlementCurrency> <rtsrep:settlementCurrency>{ get(source \\ "trade" \ "bondForward" \ "settlementCurrency") }</rtsrep:settlementCurrency>
<rtsrep:forwardPrice> <rtsrep:forwardPrice>
<rtsrep:forwardPricePerBond> <rtsrep:forwardPricePerBond>
<fpml:currency>{ get(source \ "trade" \ "bondForward" \ "forwardPrice" \\ "currency") }</fpml:currency> <fpml:currency>{ get(source \\ "trade" \ "bondForward" \ "forwardPrice" \\ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "bondForward" \ "forwardPrice" \\ "amount") }</fpml:amount> <fpml:amount>{ get(source \\ "trade" \ "bondForward" \ "forwardPrice" \\ "amount") }</fpml:amount>
</rtsrep:forwardPricePerBond> </rtsrep:forwardPricePerBond>
<rtsrep:forwardPricePercentage>{ get(source \ "trade" \ "bondForward" \ "forwardPrice" \ "forwardPricePercentage") }</rtsrep:forwardPricePercentage> <rtsrep:forwardPricePercentage>{ get(source \\ "trade" \ "bondForward" \ "forwardPrice" \ "forwardPricePercentage") }</rtsrep:forwardPricePercentage>
</rtsrep:forwardPrice> </rtsrep:forwardPrice>
</rtsrep:bondForward> </rtsrep:bondForward>
} }
......
...@@ -5,69 +5,69 @@ import scala.xml.Node ...@@ -5,69 +5,69 @@ import scala.xml.Node
class BondOptionTemplate(source: Node) extends TradeTemplate(source) { class BondOptionTemplate(source: Node) extends TradeTemplate(source) {
protected[this] def templateTradeBody: Node = { protected[this] def templateTradeBody: Node = {
<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") }/> <fpml:buyerPartyReference href={ get(source \\ "trade" \ "bondOption" \ "buyerPartyReference", "href") }/>
<fpml:sellerPartyReference href={ get(source \ "trade" \ "bondOption" \ "sellerPartyReference", "href") }/> <fpml:sellerPartyReference href={ get(source \\ "trade" \ "bondOption" \ "sellerPartyReference", "href") }/>
<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") }/> <fpml:payerPartyReference href={ get(source \\ "trade" \ "bondOption" \ "premium" \"payerPartyReference", "href") }/>
<fpml:receiverPartyReference href={ get(source \ "trade" \ "bondOption" \ "premium" \"receiverPartyReference", "href") }/> <fpml:receiverPartyReference href={ get(source \\ "trade" \ "bondOption" \ "premium" \"receiverPartyReference", "href") }/>
<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>
</fpml:paymentAmount> </fpml:paymentAmount>
{ /* paymentDate isn`t present in source!!!*/ } { /* paymentDate isn`t present in source!!!*/ }
<fpml:paymentDate> <fpml:paymentDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "bondOption" \ "americanExercise" \ "expirationDate" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "bondOption" \ "americanExercise" \ "expirationDate" \\ "unadjustedDate") }</fpml:unadjustedDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "bondOption" \ "bermudaExercise" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "bondOption" \ "bermudaExercise" \\ "unadjustedDate") }</fpml:unadjustedDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "bondOption" \ "europeanExercise" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "bondOption" \ "europeanExercise" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</fpml:paymentDate> </fpml:paymentDate>
</fpml:premium> </fpml:premium>
<fpml:americanExercise> <fpml:americanExercise>
<fpml:commencementDate> <fpml:commencementDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "bondOption" \ "americanExercise" \ "commencementDate" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "bondOption" \ "americanExercise" \ "commencementDate" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</fpml:commencementDate> </fpml:commencementDate>
<fpml:expirationDate> <fpml:expirationDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "bondOption" \ "americanExercise" \ "expirationDate" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "bondOption" \ "americanExercise" \ "expirationDate" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</fpml:expirationDate> </fpml:expirationDate>
</fpml:americanExercise> </fpml:americanExercise>
<fpml:bermudaExercise> <fpml:bermudaExercise>
<fpml:bermudaExerciseDates> <fpml:bermudaExerciseDates>
<fpml:adjustableDates> <fpml:adjustableDates>
<fpml:unadjustedDate>{ get(source \ "trade" \ "bondOption" \ "bermudaExercise" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "bondOption" \ "bermudaExercise" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDates> </fpml:adjustableDates>
</fpml:bermudaExerciseDates> </fpml:bermudaExerciseDates>
</fpml:bermudaExercise> </fpml:bermudaExercise>
<fpml:europeanExercise> <fpml:europeanExercise>
<fpml:expirationDate> <fpml:expirationDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "bondOption" \ "europeanExercise" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "bondOption" \ "europeanExercise" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</fpml:expirationDate> </fpml:expirationDate>
</fpml:europeanExercise> </fpml:europeanExercise>
<fpml:notionalAmount> <fpml:notionalAmount>
<fpml:currency>{ get(source \ "trade" \ "bondOption" \ "notionalAmount" \ "currency") }</fpml:currency> <fpml:currency>{ get(source \\ "trade" \ "bondOption" \ "notionalAmount" \ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "bondOption" \ "notionalAmount" \ "amount") }</fpml:amount> <fpml:amount>{ get(source \\ "trade" \ "bondOption" \ "notionalAmount" \ "amount") }</fpml:amount>
</fpml:notionalAmount> </fpml:notionalAmount>
<fpml:optionEntitlement>{ get(source \ "trade" \ "bondOption" \ "optionEntitlement") }</fpml:optionEntitlement> <fpml:optionEntitlement>{ get(source \\ "trade" \ "bondOption" \ "optionEntitlement") }</fpml:optionEntitlement>
<fpml:numberOfOptions>{ get(source \ "trade" \ "bondOption" \ "numberOfOptions") }</fpml:numberOfOptions> <fpml:numberOfOptions>{ get(source \\ "trade" \ "bondOption" \ "numberOfOptions") }</fpml:numberOfOptions>
<fpml:settlementType>{ get(source \ "trade" \ "bondOption" \ "settlementType") }</fpml:settlementType> <fpml:settlementType>{ get(source \\ "trade" \ "bondOption" \ "settlementType") }</fpml:settlementType>
<fpml:strike> <fpml:strike>
<fpml:price> <fpml:price>
<fpml:strikePrice>{ get(source \ "trade" \ "bondOption" \ "strike" \\ "strikePrice") }</fpml:strikePrice> <fpml:strikePrice>{ get(source \\ "trade" \ "bondOption" \ "strike" \\ "strikePrice") }</fpml:strikePrice>
<fpml:strikePercentage>{ get(source \ "trade" \ "bondOption" \ "strike" \\ "strikePercentage") }</fpml:strikePercentage> <fpml:strikePercentage>{ get(source \\ "trade" \ "bondOption" \ "strike" \\ "strikePercentage") }</fpml:strikePercentage>
<fpml:currency>{ get(source \ "trade" \ "bondOption" \ "strike" \\ "currency") }</fpml:currency> <fpml:currency>{ get(source \\ "trade" \ "bondOption" \ "strike" \\ "currency") }</fpml:currency>
</fpml:price> </fpml:price>
</fpml:strike> </fpml:strike>
<fpml:bond id={ get(source \ "trade" \ "bondOption" \ "bond", "id") }> <fpml:bond id={ get(source \\ "trade" \ "bondOption" \ "bond", "id") }>
<fpml:instrumentId instrumentIdScheme={ get(source \ "trade" \ "bondOption" \ "bond" \ "instrumentId", "instrumentIdScheme") }>{ get(source \ "trade" \ "bondOption" \ "bond" \ "instrumentId") }</fpml:instrumentId> <fpml:instrumentId instrumentIdScheme={ get(source \\ "trade" \ "bondOption" \ "bond" \ "instrumentId", "instrumentIdScheme") }>{ get(source \\ "trade" \ "bondOption" \ "bond" \ "instrumentId") }</fpml:instrumentId>
</fpml:bond> </fpml:bond>
</fpml:bondOption> </fpml:bondOption>
} }
......
...@@ -6,36 +6,36 @@ class CommodityOptionTemplate(source: Node) extends TradeTemplate(source) { ...@@ -6,36 +6,36 @@ class CommodityOptionTemplate(source: Node) extends TradeTemplate(source) {
protected[this] def templateTradeBody: Node = { protected[this] def templateTradeBody: Node = {
<fpml:commodityOption> <fpml:commodityOption>
{ /* 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") }/> <fpml:buyerPartyReference href={ get(source \\ "trade" \ "commodityOption" \ "buyerPartyReference", "href") }/>
<fpml:sellerPartyReference href={ get(source \ "trade" \ "commodityOption" \ "sellerPartyReference", "href") }/> <fpml:sellerPartyReference href={ get(source \\ "trade" \ "commodityOption" \ "sellerPartyReference", "href") }/>
{ /* 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>
<fpml:commodity id={ get(source \ "trade" \ "commodityOption" \ "commodity", "id") }> <fpml:commodity id={ get(source \\ "trade" \ "commodityOption" \ "commodity", "id") }>
<fpml:instrumentId instrumentIdScheme={ get(source \ "trade" \ "commodityOption" \ "commodity" \ "instrumentId", "instrumentIdScheme") }>{ get(source \ "trade" \ "commodityOption" \ "commodity" \ "instrumentId") }</fpml:instrumentId> <fpml:instrumentId instrumentIdScheme={ get(source \\ "trade" \ "commodityOption" \ "commodity" \ "instrumentId", "instrumentIdScheme") }>{ get(source \\ "trade" \ "commodityOption" \ "commodity" \ "instrumentId") }</fpml:instrumentId>
<fpml:unit>{ get(source \ "trade" \ "commodityOption" \ "commodity" \ "unit") }</fpml:unit> <fpml:unit>{ get(source \\ "trade" \ "commodityOption" \ "commodity" \ "unit") }</fpml:unit>
<fpml:currency>{ get(source \ "trade" \ "commodityOption" \ "commodity" \ "currency") }</fpml:currency> <fpml:currency>{ get(source \\ "trade" \ "commodityOption" \ "commodity" \ "currency") }</fpml:currency>
</fpml:commodity> </fpml:commodity>
{ /* effectiveDate isn`t present in source!!!*/ } { /* effectiveDate isn`t present in source!!!*/ }
<fpml:effectiveDate> <fpml:effectiveDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "commodityOption" \ "exercise" \ "paymentDates" \\ "unadjustedDate" ) }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "commodityOption" \ "exercise" \ "paymentDates" \\ "unadjustedDate" ) }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</fpml:effectiveDate> </fpml:effectiveDate>
<fpml:totalNotionalQuantity>{ get(source \ "trade" \ "commodityOption" \ "totalNotionalQuantity") }</fpml:totalNotionalQuantity> <fpml:totalNotionalQuantity>{ get(source \\ "trade" \ "commodityOption" \ "totalNotionalQuantity") }</fpml:totalNotionalQuantity>
<fpml:exercise> <fpml:exercise>
<fpml:americanExercise> <fpml:americanExercise>
<fpml:exercisePeriod> <fpml:exercisePeriod>
<fpml:commencementDate> <fpml:commencementDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "commodityOption" \\ "americanExercise" \\ "commencementDate" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "commodityOption" \\ "americanExercise" \\ "commencementDate" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</fpml:commencementDate> </fpml:commencementDate>
<fpml:expirationDate> <fpml:expirationDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "commodityOption" \\ "americanExercise" \\ "expirationDate" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "commodityOption" \\ "americanExercise" \\ "expirationDate" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</fpml:expirationDate> </fpml:expirationDate>
</fpml:exercisePeriod> </fpml:exercisePeriod>
...@@ -43,40 +43,40 @@ class CommodityOptionTemplate(source: Node) extends TradeTemplate(source) { ...@@ -43,40 +43,40 @@ class CommodityOptionTemplate(source: Node) extends TradeTemplate(source) {
<fpml:europeanExercise> <fpml:europeanExercise>
<fpml:expirationDate> <fpml:expirationDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "commodityOption" \\ "europeanExercise" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "commodityOption" \\ "europeanExercise" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</fpml:expirationDate> </fpml:expirationDate>
</fpml:europeanExercise> </fpml:europeanExercise>
<fpml:settlementCurrency>{ get(source \ "trade" \ "commodityOption" \ "exercise" \ "settlementCurrency") }</fpml:settlementCurrency> <fpml:settlementCurrency>{ get(source \\ "trade" \ "commodityOption" \ "exercise" \ "settlementCurrency") }</fpml:settlementCurrency>
<fpml:paymentDates> <fpml:paymentDates>
<fpml:adjustableDates> <fpml:adjustableDates>
<fpml:unadjustedDate>{ get(source \ "trade" \ "commodityOption" \ "exercise" \ "paymentDates" \\ "unadjustedDate" ) }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "commodityOption" \ "exercise" \ "paymentDates" \\ "unadjustedDate" ) }</fpml:unadjustedDate>
</fpml:adjustableDates> </fpml:adjustableDates>
</fpml:paymentDates> </fpml:paymentDates>
</fpml:exercise> </fpml:exercise>
<fpml:strikePricePerUnit> <fpml:strikePricePerUnit>
<fpml:currency>{ get(source \ "trade" \ "commodityOption" \ "strikePricePerUnit" \ "currency") }</fpml:currency> <fpml:currency>{ get(source \\ "trade" \ "commodityOption" \ "strikePricePerUnit" \ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "commodityOption" \ "strikePricePerUnit" \ "amount") }</fpml:amount> <fpml:amount>{ get(source \\ "trade" \ "commodityOption" \ "strikePricePerUnit" \ "amount") }</fpml:amount>
</fpml:strikePricePerUnit> </fpml:strikePricePerUnit>
<fpml:floatingStrikePricePerUnit> <fpml:floatingStrikePricePerUnit>
<fpml:pricingDates> <fpml:pricingDates>
<fpml:pricingDates> <fpml:pricingDates>
<fpml:unadjustedDate>{ get(source \ "trade" \ "commodityOption" \ "floatingStrikePricePerUnit" \ "pricingDates" \\ "unadjustedDate" ) }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "commodityOption" \ "floatingStrikePricePerUnit" \ "pricingDates" \\ "unadjustedDate" ) }</fpml:unadjustedDate>
</fpml:pricingDates> </fpml:pricingDates>
</fpml:pricingDates> </fpml:pricingDates>
<fpml:spread> <fpml:spread>
<fpml:currency>{ get(source \ "trade" \ "commodityOption" \ "floatingStrikePricePerUnit" \\ "currency") }</fpml:currency> <fpml:currency>{ get(source \\ "trade" \ "commodityOption" \ "floatingStrikePricePerUnit" \\ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "commodityOption" \ "floatingStrikePricePerUnit" \\ "amount") }</fpml:amount> <fpml:amount>{ get(source \\ "trade" \ "commodityOption" \ "floatingStrikePricePerUnit" \\ "amount") }</fpml:amount>
<fpml:spreadUnit>{ get(source \ "trade" \ "commodityOption" \ "floatingStrikePricePerUnit" \\ "spreadUnit") }</fpml:spreadUnit> <fpml:spreadUnit>{ get(source \\ "trade" \ "commodityOption" \ "floatingStrikePricePerUnit" \\ "spreadUnit") }</fpml:spreadUnit>
</fpml:spread> </fpml:spread>
<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") }/> <fpml:payerPartyReference href={ get(source \\ "trade" \ "commodityOption" \ "premium" \"payerPartyReference", "href") }/>
<fpml:receiverPartyReference href={ get(source \ "trade" \ "commodityOption" \ "premium" \"receiverPartyReference", "href") }/> <fpml:receiverPartyReference href={ get(source \\ "trade" \ "commodityOption" \ "premium" \"receiverPartyReference", "href") }/>
<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>
</fpml:paymentAmount> </fpml:paymentAmount>
</fpml:premium> </fpml:premium>
</fpml:commodityOption> </fpml:commodityOption>
......
...@@ -5,20 +5,20 @@ import scala.xml.Node ...@@ -5,20 +5,20 @@ import scala.xml.Node
class CommoditySwapTemplate(source: Node) extends TradeTemplate(source) { class CommoditySwapTemplate(source: Node) extends TradeTemplate(source) {
protected[this] def templateTradeBody: Node = { protected[this] def templateTradeBody: Node = {
<fpml:commoditySwap> <fpml:commoditySwap>
{ /* <fpml:productType>{ get(source \ "trade" \ "commoditySwap" \ "productType") }</fpml:productType> */} { /* <fpml:productType>{ get(source \\ "trade" \ "commoditySwap" \ "productType") }</fpml:productType> */}
<fpml:productId>{ get(source \ "trade" \ "commoditySwap" \ "productId") }</fpml:productId> <fpml:productId>{ get(source \\ "trade" \ "commoditySwap" \ "productId") }</fpml:productId>
<fpml:effectiveDate> <fpml:effectiveDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "commoditySwap" \ "effectiveDate" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "commoditySwap" \ "effectiveDate" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</fpml:effectiveDate> </fpml:effectiveDate>
<fpml:terminationDate> <fpml:terminationDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "commoditySwap" \ "terminationDate" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "commoditySwap" \ "terminationDate" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</fpml:terminationDate> </fpml:terminationDate>
<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")}/> <fpml:payerPartyReference href={get(s \ "payerPartyReference", "href")}/>
<fpml:receiverPartyReference href={get(s \ "receiverPartyReference", "href")}/> <fpml:receiverPartyReference href={get(s \ "receiverPartyReference", "href")}/>
......
...@@ -5,15 +5,15 @@ import scala.xml.Node ...@@ -5,15 +5,15 @@ import scala.xml.Node
class EquityForwardTemplate(source: Node) extends TradeTemplate(source) { class EquityForwardTemplate(source: Node) extends TradeTemplate(source) {
protected[this] def templateTradeBody: Node = { protected[this] def templateTradeBody: Node = {
<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") }/> <fpml:buyerPartyReference href={ get(source \\ "trade" \ "equityForward" \ "buyerPartyReference", "href") }/>
<fpml:sellerPartyReference href={ get(source \ "trade" \ "equityForward" \ "sellerPartyReference", "href") }/> <fpml:sellerPartyReference href={ get(source \\ "trade" \ "equityForward" \ "sellerPartyReference", "href") }/>
<fpml:optionType>{ "Forward" }</fpml:optionType> <fpml:optionType>{ "Forward" }</fpml:optionType>
<fpml:underlyer> <fpml:underlyer>
<fpml:basket> <fpml:basket>
<fpml:openUnits>{ get(source \ "trade" \ "equityForward" \ "underlyer" \\ "basket" \ "openUnits") }</fpml:openUnits> <fpml:openUnits>{ get(source \\ "trade" \ "equityForward" \ "underlyer" \\ "basket" \ "openUnits") }</fpml:openUnits>
{ for (s <- source \ "trade" \ "equityForward" \ "underlyer" \\ "basket" \ "basketConstituent") yield { { for (s <- source \\ "trade" \ "equityForward" \ "underlyer" \\ "basket" \ "basketConstituent") yield {
<fpml:basketConstituent> <fpml:basketConstituent>
<fpml:equity id={ get(s \ "equity", "id") }> <fpml:equity id={ get(s \ "equity", "id") }>
<fpml:instrumentId instrumentIdScheme={ get(s \\ "instrumentId", "instrumentIdScheme") }>{ get(s \\ "instrumentId") }</fpml:instrumentId> <fpml:instrumentId instrumentIdScheme={ get(s \\ "instrumentId", "instrumentIdScheme") }>{ get(s \\ "instrumentId") }</fpml:instrumentId>
...@@ -35,35 +35,35 @@ class EquityForwardTemplate(source: Node) extends TradeTemplate(source) { ...@@ -35,35 +35,35 @@ class EquityForwardTemplate(source: Node) extends TradeTemplate(source) {
<fpml:equityAmericanExercise> <fpml:equityAmericanExercise>
<fpml:commencementDate> <fpml:commencementDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "equityForward" \\ "equityAmericanExercise" \ "commencementDate" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "equityForward" \\ "equityAmericanExercise" \ "commencementDate" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</fpml:commencementDate> </fpml:commencementDate>
<fpml:expirationDate> <fpml:expirationDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "equityForward" \\ "equityAmericanExercise" \ "expirationDate" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "equityForward" \\ "equityAmericanExercise" \ "expirationDate" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</fpml:expirationDate> </fpml:expirationDate>
</fpml:equityAmericanExercise> </fpml:equityAmericanExercise>
<fpml:equityBermudaExercise> <fpml:equityBermudaExercise>
<fpml:bermudaExerciseDates> <fpml:bermudaExerciseDates>
<fpml:adjustableDates> <fpml:adjustableDates>
<fpml:unadjustedDate>{ get(source \ "trade" \ "equityForward" \\ "equityBermudaExercise" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "equityForward" \\ "equityBermudaExercise" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDates> </fpml:adjustableDates>
</fpml:bermudaExerciseDates> </fpml:bermudaExerciseDates>
</fpml:equityBermudaExercise> </fpml:equityBermudaExercise>
<fpml:equityEuropeanExercise> <fpml:equityEuropeanExercise>
<fpml:expirationDate> <fpml:expirationDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "equityForward" \\ "equityEuropeanExercise" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "equityForward" \\ "equityEuropeanExercise" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</fpml:expirationDate> </fpml:expirationDate>
</fpml:equityEuropeanExercise> </fpml:equityEuropeanExercise>
<fpml:settlementCurrency>{ get(source \ "trade" \ "equityForward" \ "equityExercise" \ "settlementCurrency") }</fpml:settlementCurrency> <fpml:settlementCurrency>{ get(source \\ "trade" \ "equityForward" \ "equityExercise" \ "settlementCurrency") }</fpml:settlementCurrency>
<fpml:settlementType>{ get(source \ "trade" \ "equityForward" \ "equityExercise" \ "settlementType") }</fpml:settlementType> <fpml:settlementType>{ get(source \\ "trade" \ "equityForward" \ "equityExercise" \ "settlementType") }</fpml:settlementType>
</fpml:equityExercise> </fpml:equityExercise>
<fpml:forwardPrice> <fpml:forwardPrice>
<fpml:currency>{ get(source \ "trade" \ "equityForward" \ "forwardPrice" \ "currency") }</fpml:currency> <fpml:currency>{ get(source \\ "trade" \ "equityForward" \ "forwardPrice" \ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "equityForward" \ "forwardPrice" \ "amount") }</fpml:amount> <fpml:amount>{ get(source \\ "trade" \ "equityForward" \ "forwardPrice" \ "amount") }</fpml:amount>
</fpml:forwardPrice> </fpml:forwardPrice>
</fpml:equityForward> </fpml:equityForward>
} }
......
...@@ -5,68 +5,68 @@ import scala.xml.Node ...@@ -5,68 +5,68 @@ import scala.xml.Node
class EquityOptionTemplate(source: Node) extends TradeTemplate(source) { class EquityOptionTemplate(source: Node) extends TradeTemplate(source) {
protected[this] def templateTradeBody: Node = { protected[this] def templateTradeBody: Node = {
<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") }/> <fpml:buyerPartyReference href={ get(source \\ "trade" \ "equityOption" \ "buyerPartyReference", "href") }/>
<fpml:sellerPartyReference href={ get(source \ "trade" \ "equityOption" \ "sellerPartyReference", "href") }/> <fpml:sellerPartyReference href={ get(source \\ "trade" \ "equityOption" \ "sellerPartyReference", "href") }/>
<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>
<fpml:equity id={ get(source \ "trade" \ "equityOption" \ "underlyer" \ "singleUnderlyer" \ "equity", "id") }> <fpml:equity id={ get(source \\ "trade" \ "equityOption" \ "underlyer" \ "singleUnderlyer" \ "equity", "id") }>
<fpml:instrumentId instrumentIdScheme={ get(source \ "trade" \ "equityOption" \ "underlyer" \ "singleUnderlyer" \ "equity" \ "instrumentId", "instrumentIdScheme") }>{ get(source \ "trade" \ "equityOption" \ "underlyer" \ "singleUnderlyer" \ "equity" \ "instrumentId") }</fpml:instrumentId> <fpml:instrumentId instrumentIdScheme={ get(source \\ "trade" \ "equityOption" \ "underlyer" \ "singleUnderlyer" \ "equity" \ "instrumentId", "instrumentIdScheme") }>{ get(source \\ "trade" \ "equityOption" \ "underlyer" \ "singleUnderlyer" \ "equity" \ "instrumentId") }</fpml:instrumentId>
</fpml:equity> </fpml:equity>
<fpml:bond id={ get(source \ "trade" \ "equityOption" \ "underlyer" \ "singleUnderlyer" \ "bond", "id") }> <fpml:bond id={ get(source \\ "trade" \ "equityOption" \ "underlyer" \ "singleUnderlyer" \ "bond", "id") }>
<fpml:instrumentId instrumentIdScheme={ get(source \ "trade" \ "equityOption" \ "underlyer" \ "singleUnderlyer" \ "bond" \ "instrumentId", "instrumentIdScheme") }>{ get(source \ "trade" \ "equityOption" \ "underlyer" \ "singleUnderlyer" \ "bond" \ "instrumentId") }</fpml:instrumentId> <fpml:instrumentId instrumentIdScheme={ get(source \\ "trade" \ "equityOption" \ "underlyer" \ "singleUnderlyer" \ "bond" \ "instrumentId", "instrumentIdScheme") }>{ get(source \\ "trade" \ "equityOption" \ "underlyer" \ "singleUnderlyer" \ "bond" \ "instrumentId") }</fpml:instrumentId>
</fpml:bond> </fpml:bond>
<fpml:index id={ get(source \ "trade" \ "equityOption" \ "underlyer" \ "singleUnderlyer" \ "index", "id") }> <fpml:index id={ get(source \\ "trade" \ "equityOption" \ "underlyer" \ "singleUnderlyer" \ "index", "id") }>
<fpml:instrumentId instrumentIdScheme={ get(source \ "trade" \ "equityOption" \ "underlyer" \ "singleUnderlyer" \ "index" \ "instrumentId", "instrumentIdScheme") }>{ get(source \ "trade" \ "equityOption" \ "underlyer" \ "singleUnderlyer" \ "index" \ "instrumentId") }</fpml:instrumentId> <fpml:instrumentId instrumentIdScheme={ get(source \\ "trade" \ "equityOption" \ "underlyer" \ "singleUnderlyer" \ "index" \ "instrumentId", "instrumentIdScheme") }>{ get(source \\ "trade" \ "equityOption" \ "underlyer" \ "singleUnderlyer" \ "index" \ "instrumentId") }</fpml:instrumentId>
</fpml:index> </fpml:index>
<fpml:openUnits>{ get(source \ "trade" \ "equityOption" \ "underlyer" \ "singleUnderlyer" \ "openUnits") }</fpml:openUnits> <fpml:openUnits>{ get(source \\ "trade" \ "equityOption" \ "underlyer" \ "singleUnderlyer" \ "openUnits") }</fpml:openUnits>
</fpml:singleUnderlyer> </fpml:singleUnderlyer>
</fpml:underlyer> </fpml:underlyer>
<fpml:equityExercise> <fpml:equityExercise>
<fpml:equityAmericanExercise> <fpml:equityAmericanExercise>
<fpml:commencementDate> <fpml:commencementDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "equityOption" \\ "equityAmericanExercise" \ "commencementDate" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "equityOption" \\ "equityAmericanExercise" \ "commencementDate" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</fpml:commencementDate> </fpml:commencementDate>
<fpml:expirationDate> <fpml:expirationDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "equityOption" \\ "equityAmericanExercise" \ "expirationDate" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "equityOption" \\ "equityAmericanExercise" \ "expirationDate" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</fpml:expirationDate> </fpml:expirationDate>
</fpml:equityAmericanExercise> </fpml:equityAmericanExercise>
<fpml:equityBermudaExercise> <fpml:equityBermudaExercise>
<fpml:bermudaExerciseDates> <fpml:bermudaExerciseDates>
<fpml:adjustableDates> <fpml:adjustableDates>
<fpml:unadjustedDate>{ get(source \ "trade" \ "equityOption" \\ "equityBermudaExercise" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "equityOption" \\ "equityBermudaExercise" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDates> </fpml:adjustableDates>
</fpml:bermudaExerciseDates> </fpml:bermudaExerciseDates>
</fpml:equityBermudaExercise> </fpml:equityBermudaExercise>
<fpml:equityEuropeanExercise> <fpml:equityEuropeanExercise>
<fpml:expirationDate> <fpml:expirationDate>
<fpml:adjustableDate> <fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "equityOption" \\ "equityEuropeanExercise" \\ "unadjustedDate") }</fpml:unadjustedDate> <fpml:unadjustedDate>{ get(source \\ "trade" \ "equityOption" \\ "equityEuropeanExercise" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate> </fpml:adjustableDate>
</fpml:expirationDate> </fpml:expirationDate>
</fpml:equityEuropeanExercise> </fpml:equityEuropeanExercise>
<fpml:settlementCurrency>{ get(source \ "trade" \ "equityOption" \ "equityExercise" \ "settlementCurrency") }</fpml:settlementCurrency> <fpml:settlementCurrency>{ get(source \\ "trade" \ "equityOption" \ "equityExercise" \ "settlementCurrency") }</fpml:settlementCurrency>
<fpml:settlementType>{ get(source \ "trade" \ "equityOption" \ "equityExercise" \ "settlementType") }</fpml:settlementType> <fpml:settlementType>{ get(source \\ "trade" \ "equityOption" \ "equityExercise" \ "settlementType") }</fpml:settlementType>
</fpml:equityExercise> </fpml:equityExercise>
<fpml:strike> <fpml:strike>
<fpml:strikePrice>{ get(source \ "trade" \ "equityOption" \ "strike" \\ "strikePrice") }</fpml:strikePrice> <fpml:strikePrice>{ get(source \\ "trade" \ "equityOption" \ "strike" \\ "strikePrice") }</fpml:strikePrice>
<fpml:strikePercentage>{ get(source \ "trade" \ "equityOption" \ "strike" \\ "strikePercentage") }</fpml:strikePercentage> <fpml:strikePercentage>{ get(source \\ "trade" \ "equityOption" \ "strike" \\ "strikePercentage") }</fpml:strikePercentage>
<fpml:currency>{ get(source \ "trade" \ "equityOption" \ "strike" \ "currency") }</fpml:currency> <fpml:currency>{ get(source \\ "trade" \ "equityOption" \ "strike" \ "currency") }</fpml:currency>
</fpml:strike> </fpml:strike>
<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") }/> <fpml:payerPartyReference href={ get(source \\ "trade" \ "equityOption" \ "equityPremium" \"payerPartyReference", "href") }/>
<fpml:receiverPartyReference href={ get(source \ "trade" \ "equityOption" \ "equityPremium" \"receiverPartyReference", "href") }/> <fpml:receiverPartyReference href={ get(source \\ "trade" \ "equityOption" \ "equityPremium" \"receiverPartyReference", "href") }/>
<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>
</fpml:paymentAmount> </fpml:paymentAmount>
</fpml:equityPremium> </fpml:equityPremium>
</fpml:equityOption> </fpml:equityOption>
......
package templates package templates
import scala.xml.Node import scala.xml.Node
class MasterAgreementTemplate(source: Node) extends Template(source) { class MasterAgreementTemplate(source: Node) extends RegAmendTerminateMasterAgreementTemplate(source) {
protected[this] def templateMATerms: Node = ???
def template: Node = {
<rtsrep:fairValueReportRegistration xmlns:fpml="http://www.fpml.org/FpML-5/recordkeeping"
xmlns:fpmlext="http://www.fpml.org/FpML-5/ext" xmlns:rtsrep="http://www.fpml.ru/repository"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" fpmlVersion="5-7">
<fpml:header>
<fpml:messageId>{ get(source \ "header" \"messageId") }</fpml:messageId>
<fpml:sentBy>{ get(source \ "header" \ "sentBy") }</fpml:sentBy>
<fpml:sendTo>{ get(source \ "header" \ "sendTo") }</fpml:sendTo>
<fpml:creationTimestamp>{ get(source \ "header" \ "creationTimestamp") }</fpml:creationTimestamp>
<fpml:implementationSpecification>
<fpml:version>2</fpml:version>
</fpml:implementationSpecification>
</fpml:header>
<fpml:isCorrection>{ get(source \ "isCorrection") }</fpml:isCorrection>
<fpml:correlationId correlationIdScheme="">{ get(source \ "correlationId") }</fpml:correlationId>
<rtsrep:fairValueReport>
<rtsrep:fairValueReportId>{ get(source \ "markToMarketValuation" \ "MTMIdentifier") }</rtsrep:fairValueReportId>
<rtsrep:tradeId>{ get(source \ "markToMarketValuation" \ "markToMarketDetails" \ "markToMarketInformation" \ "tradeId") }</rtsrep:tradeId>
<rtsrep:valuationTechnique>{ get(source \ "markToMarketValuation" \ "valuationMethod") }</rtsrep:valuationTechnique>
<rtsrep:fairValue>
<fpml:currency>{ get(source \ "markToMarketValuation" \ "markToMarketDetails" \ "markToMarketInformation" \ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "markToMarketValuation" \ "markToMarketDetails" \ "markToMarketInformation" \ "amount") }</fpml:amount>
</rtsrep:fairValue>
<rtsrep:valuationDate>{ get(source \ "markToMarketValuation" \ "markToMarketDetails" \ "valuationDateTime") }</rtsrep:valuationDate>
</rtsrep:fairValueReport>
{ for { s <- source \ "party"
id = get(s, "id").mkString
if id != "Sender" && id != "UTIGeneratingParty" } yield {
<fpml:party id={ id }>
<fpml:partyId partyIdScheme={ get(s \ "partyId", "partyIdScheme") }>{ get(s \ "partyId") }</fpml:partyId>
<fpml:partyName>{ get(s \ "partyName") }</fpml:partyName>
<fpml:country>{ get(s \ "country") }</fpml:country>
<fpml:organizationType>{ get(s \ "classification") }</fpml:organizationType>
</fpml:party>
}
}
</rtsrep:fairValueReportRegistration>
}
def isStraight = true def isStraight = true
} }
...@@ -20,12 +20,12 @@ abstract class RegAmendTradeTemplate(source: Node) extends Template(source) { ...@@ -20,12 +20,12 @@ abstract class RegAmendTradeTemplate(source: Node) extends Template(source) {
</fpml:header> </fpml:header>
<fpml:isCorrection>{ get(source \ "isCorrection") }</fpml:isCorrection> <fpml:isCorrection>{ get(source \ "isCorrection") }</fpml:isCorrection>
<fpml:correlationId correlationIdScheme="">{ get(source \ "correlationId") }</fpml:correlationId> <fpml:correlationId correlationIdScheme="">{ get(source \ "correlationId") }</fpml:correlationId>
{ if (get(source \ "isCorrection").mkString == "false") templateTrade { if ((source \ "amendment").isEmpty) templateTrade
else else
<fpml:amendment> <fpml:amendment>
{ templateTrade } { templateTrade }
{ /* agreementDate isn`t present in the source */ } <fpml:agreementDate>{ get(source \ "amendment" \ "agreementDate") }</fpml:agreementDate>
<fpml:agreementDate>{ get(source \ "asOfDate") }</fpml:agreementDate> <fpml:effectiveDate>{ get(source \ "amendment" \ "effectiveDate") }</fpml:effectiveDate>
</fpml:amendment> </fpml:amendment>
} }
{ for { s <- source \ "party" { for { s <- source \ "party"
...@@ -39,7 +39,7 @@ abstract class RegAmendTradeTemplate(source: Node) extends Template(source) { ...@@ -39,7 +39,7 @@ abstract class RegAmendTradeTemplate(source: Node) extends Template(source) {
</fpml:party> </fpml:party>
} }
} }
{ for (s <- source \ "trade" \ "nsdSpecificTradeFields" \ "clientDetails") yield { { for (s <- source \\ "trade" \ "nsdSpecificTradeFields" \ "clientDetails") yield {
<fpml:party id={ get(s \ "id") }> <fpml:party id={ get(s \ "id") }>
<fpml:partyId>{ get(s \ "id") }</fpml:partyId> <fpml:partyId>{ get(s \ "id") }</fpml:partyId>
<fpml:partyName>{ get(s \ "name") }</fpml:partyName> <fpml:partyName>{ get(s \ "name") }</fpml:partyName>
......
...@@ -5,80 +5,80 @@ import scala.xml.Node ...@@ -5,80 +5,80 @@ 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> <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>
} }
......
...@@ -5,10 +5,10 @@ import scala.xml.Node ...@@ -5,10 +5,10 @@ import scala.xml.Node
abstract class TradeTemplate(source: Node) extends RegAmendTradeTemplate(source) { abstract class TradeTemplate(source: Node) extends RegAmendTradeTemplate(source) {
protected[this] def templateTradeBody: Node protected[this] def templateTradeBody: Node
def templateTrade: Node = { protected[this] def templateTrade: Node = {
<fpml:trade> <fpml:trade>
<fpml:tradeHeader> <fpml:tradeHeader>
{ for { s <- source \ "trade" \ "tradeHeader" \ "partyTradeIdentifier" { for { s <- source \\ "trade" \ "tradeHeader" \ "partyTradeIdentifier"
id = get(s \ "partyReference", "href").mkString id = get(s \ "partyReference", "href").mkString
if id != "Sender" && id != "UTIGeneratingParty" } yield { if id != "Sender" && id != "UTIGeneratingParty" } yield {
<fpml:partyTradeIdentifier> <fpml:partyTradeIdentifier>
...@@ -18,20 +18,20 @@ abstract class TradeTemplate(source: Node) extends RegAmendTradeTemplate(source) ...@@ -18,20 +18,20 @@ abstract class TradeTemplate(source: Node) extends RegAmendTradeTemplate(source)
} }
} }
<fpml:partyTradeInformation> <fpml:partyTradeInformation>
<fpml:partyReference href={ get(source \ "trade" \ "tradeHeader" \ "partyTradeInformation" \ "partyReference", "href") }/> <fpml:partyReference href={ get(source \\ "trade" \ "tradeHeader" \ "partyTradeInformation" \ "partyReference", "href") }/>
<fpml:relatedParty> <fpml:relatedParty>
<fpml:partyReference href={ get(source \ "trade" \ "tradeHeader" \ "partyTradeInformation" \ "partyReference", "href") } /> <fpml:partyReference href={ get(source \\ "trade" \ "tradeHeader" \ "partyTradeInformation" \ "partyReference", "href") } />
<fpml:role>ClearingOrganization</fpml:role> <fpml:role>ClearingOrganization</fpml:role>
</fpml:relatedParty> </fpml:relatedParty>
<fpml:category categoryScheme="http://www.fpml.ru/repository/trade-settlement-type">{ get(source \ "trade" \ "nsdSpecificTradeFields" \ "clearSettlementType") }</fpml:category> <fpml:category categoryScheme="http://www.fpml.ru/repository/trade-settlement-type">{ get(source \\ "trade" \ "nsdSpecificTradeFields" \ "clearSettlementType") }</fpml:category>
<fpml:category categoryScheme="http://www.fpml.ru/repository/trade-settlement-method">{ get(source \ "trade" \ "nsdSpecificTradeFields" \ "clearSettlementMethod") }</fpml:category> <fpml:category categoryScheme="http://www.fpml.ru/repository/trade-settlement-method">{ get(source \\ "trade" \ "nsdSpecificTradeFields" \ "clearSettlementMethod") }</fpml:category>
<fpml:executionDateTime>{ get(source \ "trade" \ "tradeHeader" \ "tradeDate") + "T00:00:00" }</fpml:executionDateTime> <fpml:executionDateTime>{ get(source \\ "trade" \ "tradeHeader" \ "tradeDate") + "T00:00:00" }</fpml:executionDateTime>
<fpml:reportingRegime> <fpml:reportingRegime>
<fpml:name>{ get(source \ "trade" \ "tradeHeader" \ "partyTradeInformation" \ "reportingRegime" \ "name") }</fpml:name> <fpml:name>{ get(source \\ "trade" \ "tradeHeader" \ "partyTradeInformation" \ "reportingRegime" \ "name") }</fpml:name>
<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 { { for (s <- source \\ "trade" \ "nsdSpecificTradeFields" \ "clientDetails") yield {
<fpml:partyTradeInformation> <fpml:partyTradeInformation>
<fpml:partyReference href={ get(s \ "servicingParty", "href") } /> <fpml:partyReference href={ get(s \ "servicingParty", "href") } />
<fpml:relatedParty> <fpml:relatedParty>
...@@ -41,29 +41,29 @@ abstract class TradeTemplate(source: Node) extends RegAmendTradeTemplate(source) ...@@ -41,29 +41,29 @@ abstract class TradeTemplate(source: Node) extends RegAmendTradeTemplate(source)
</fpml:relatedParty> </fpml:relatedParty>
<fpml:timestamps> <fpml:timestamps>
<fpml:timestamp> <fpml:timestamp>
<fpml:type>{ if (get(source \ "trade" \ "nsdSpecificTradeFields" \ "clearedDate").mkString != msgNotFound) "InClearingPool" else msgNotFound}</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 msgNotFound 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 msgNotFound}</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 msgNotFound 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 msgNotFound}</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 msgNotFound if (d.mkString != msgNotFound) d + "T00:00:00" else msgNotFound
}</fpml:value> }</fpml:value>
</fpml:timestamp> </fpml:timestamp>
</fpml:timestamps> </fpml:timestamps>
<fpml:collateralizationType>{ <fpml:collateralizationType>{
get(source \ "trade" \ "collateral" \ "marginType").mkString match { get(source \\ "trade" \ "collateral" \ "marginType").mkString match {
case "FC" => "Fully" case "FC" => "Fully"
case "PC" => "Partially" case "PC" => "Partially"
case "OC" => "OneWay" case "OC" => "OneWay"
...@@ -71,7 +71,7 @@ abstract class TradeTemplate(source: Node) extends RegAmendTradeTemplate(source) ...@@ -71,7 +71,7 @@ abstract class TradeTemplate(source: Node) extends RegAmendTradeTemplate(source)
case _ => msgNotFound case _ => msgNotFound
} }
}</fpml:collateralizationType> }</fpml:collateralizationType>
<fpml:collateralPortfolio>{ get(source \ "trade" \ "collateral" \ "collateralForm") }</fpml:collateralPortfolio> <fpml:collateralPortfolio>{ get(source \\ "trade" \ "collateral" \ "collateralForm") }</fpml:collateralPortfolio>
</fpml:partyTradeInformation> </fpml:partyTradeInformation>
} }
} }
...@@ -79,7 +79,7 @@ abstract class TradeTemplate(source: Node) extends RegAmendTradeTemplate(source) ...@@ -79,7 +79,7 @@ abstract class TradeTemplate(source: Node) extends RegAmendTradeTemplate(source)
{ templateTradeBody } { templateTradeBody }
<fpml:documentation> <fpml:documentation>
<fpml:masterAgreement> <fpml:masterAgreement>
<fpml:masterAgreementId>{ get(source \ "trade" \ "tradeHeader" \ "partyTradeIdentifier" \ "linkId") }</fpml:masterAgreementId> <fpml:masterAgreementId>{ get(source \\ "trade" \ "tradeHeader" \ "partyTradeIdentifier" \ "linkId") }</fpml:masterAgreementId>
</fpml:masterAgreement> </fpml:masterAgreement>
</fpml:documentation> </fpml:documentation>
</fpml:trade> </fpml:trade>
......
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