Commit cce0c27f by Amelin Konstantin

Fix path 'source \\ "trade"'

parent 4e0c2844
......@@ -14,7 +14,7 @@ object Main {
val logFileName: String = conf.getString("log")
implicit def templateFactory(source: Node): Template = {
Try { (source \ "trade").head.child
Try { (source \\ "trade").head.child
.filter {
case v: Elem => true
case _ => false
......
......@@ -5,70 +5,70 @@ import scala.xml.Node
class BondBasketOptionTemplate(source: Node) extends TradeTemplate(source) {
protected[this] def templateTradeBody: Node = {
<rtsrep:bondBasketOption>
<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:buyerPartyReference href={ get(source \ "trade" \ "bondBasketOption" \ "buyerPartyReference", "href") }/>
<fpml:sellerPartyReference href={ get(source \ "trade" \ "bondBasketOption" \ "sellerPartyReference", "href") }/>
<fpml:optionType>{ get(source \ "trade" \ "bondBasketOption" \ "optionType") }</fpml:optionType>
<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:buyerPartyReference href={ get(source \\ "trade" \ "bondBasketOption" \ "buyerPartyReference", "href") }/>
<fpml:sellerPartyReference href={ get(source \\ "trade" \ "bondBasketOption" \ "sellerPartyReference", "href") }/>
<fpml:optionType>{ get(source \\ "trade" \ "bondBasketOption" \ "optionType") }</fpml:optionType>
<fpml:premium>
<fpml:payerPartyReference href={ get(source \ "trade" \ "bondBasketOption" \ "premium" \"payerPartyReference", "href") }/>
<fpml:receiverPartyReference href={ get(source \ "trade" \ "bondBasketOption" \ "premium" \"receiverPartyReference", "href") }/>
<fpml:payerPartyReference href={ get(source \\ "trade" \ "bondBasketOption" \ "premium" \"payerPartyReference", "href") }/>
<fpml:receiverPartyReference href={ get(source \\ "trade" \ "bondBasketOption" \ "premium" \"receiverPartyReference", "href") }/>
<fpml:paymentAmount>
<fpml:currency>{ get(source \ "trade" \ "bondBasketOption" \ "premium" \\ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "bondBasketOption" \ "premium" \\ "amount") }</fpml:amount>
<fpml:currency>{ get(source \\ "trade" \ "bondBasketOption" \ "premium" \\ "currency") }</fpml:currency>
<fpml:amount>{ get(source \\ "trade" \ "bondBasketOption" \ "premium" \\ "amount") }</fpml:amount>
</fpml:paymentAmount>
{ /* paymentDate isn`t present in source!!!*/ }
<fpml:paymentDate>
<fpml:adjustableDate>
<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" \ "europeanExercise" \\ "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" \ "europeanExercise" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate>
</fpml:paymentDate>
</fpml:premium>
<fpml:americanExercise>
<fpml:commencementDate>
<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:commencementDate>
<fpml:expirationDate>
<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:expirationDate>
</fpml:americanExercise>
<fpml:bermudaExercise>
<fpml:bermudaExerciseDates>
<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:bermudaExerciseDates>
</fpml:bermudaExercise>
<fpml:europeanExercise>
<fpml:expirationDate>
<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:expirationDate>
</fpml:europeanExercise>
<fpml:notionalAmount>
<fpml:currency>{ get(source \ "trade" \ "bondBasketOption" \ "notionalAmount" \ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "bondBasketOption" \ "notionalAmount" \ "amount") }</fpml:amount>
<fpml:currency>{ get(source \\ "trade" \ "bondBasketOption" \ "notionalAmount" \ "currency") }</fpml:currency>
<fpml:amount>{ get(source \\ "trade" \ "bondBasketOption" \ "notionalAmount" \ "amount") }</fpml:amount>
</fpml:notionalAmount>
<fpml:optionEntitlement>{ get(source \ "trade" \ "bondBasketOption" \ "optionEntitlement") }</fpml:optionEntitlement>
<fpml:numberOfOptions>{ get(source \ "trade" \ "bondBasketOption" \ "numberOfOptions") }</fpml:numberOfOptions>
<fpml:settlementType>{ get(source \ "trade" \ "bondBasketOption" \ "settlementType") }</fpml:settlementType>
<fpml:optionEntitlement>{ get(source \\ "trade" \ "bondBasketOption" \ "optionEntitlement") }</fpml:optionEntitlement>
<fpml:numberOfOptions>{ get(source \\ "trade" \ "bondBasketOption" \ "numberOfOptions") }</fpml:numberOfOptions>
<fpml:settlementType>{ get(source \\ "trade" \ "bondBasketOption" \ "settlementType") }</fpml:settlementType>
<rtsrep:strike>
<fpml:price>
<fpml:strikePrice>{ get(source \ "trade" \ "bondBasketOption" \ "strike" \\ "strikePrice") }</fpml:strikePrice>
<fpml:strikePercentage>{ get(source \ "trade" \ "bondBasketOption" \ "strike" \\ "strikePercentage") }</fpml:strikePercentage>
<fpml:currency>{ get(source \ "trade" \ "bondBasketOption" \ "strike" \\ "currency") }</fpml:currency>
<fpml:strikePrice>{ get(source \\ "trade" \ "bondBasketOption" \ "strike" \\ "strikePrice") }</fpml:strikePrice>
<fpml:strikePercentage>{ get(source \\ "trade" \ "bondBasketOption" \ "strike" \\ "strikePercentage") }</fpml:strikePercentage>
<fpml:currency>{ get(source \\ "trade" \ "bondBasketOption" \ "strike" \\ "currency") }</fpml:currency>
</fpml:price>
</rtsrep:strike>
<fpml:basket>
<fpml:openUnits>{ get(source \ "trade" \ "bondBasketOption" \ "basket" \ "openUnits") }</fpml:openUnits>
{ for (s <- source \ "trade" \ "bondBasketOption" \ "basket" \ "basketConstituent") yield {
<fpml:openUnits>{ get(source \\ "trade" \ "bondBasketOption" \ "basket" \ "openUnits") }</fpml:openUnits>
{ for (s <- source \\ "trade" \ "bondBasketOption" \ "basket" \ "basketConstituent") yield {
<fpml:basketConstituent>
<fpml:bond id={ get(s \ "bond", "id") }>
<fpml:instrumentId instrumentIdScheme={ get(s \\ "instrumentId", "instrumentIdScheme") }>{ get(s \\ "instrumentId") }</fpml:instrumentId>
......
......@@ -5,42 +5,42 @@ import scala.xml.Node
class BondForwardTemplate(source: Node) extends TradeTemplate(source) {
protected[this] def templateTradeBody: Node = {
<rtsrep:bondForward>
<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:buyerPartyReference href={ get(source \ "trade" \ "bondForward" \ "buyerPartyReference", "href") }/>
<fpml:sellerPartyReference href={ get(source \ "trade" \ "bondForward" \ "sellerPartyReference", "href") }/>
<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:buyerPartyReference href={ get(source \\ "trade" \ "bondForward" \ "buyerPartyReference", "href") }/>
<fpml:sellerPartyReference href={ get(source \\ "trade" \ "bondForward" \ "sellerPartyReference", "href") }/>
<rtsrep:underlyer>
<fpml:singleUnderlyer>
<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: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:equity>
<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: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:bond>
<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: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: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>
</rtsrep:underlyer>
<rtsrep:notionalAmount>
<fpml:currency>{ get(source \ "trade" \ "bondForward" \ "notionalAmount" \ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "bondForward" \ "notionalAmount" \ "amount") }</fpml:amount>
<fpml:currency>{ get(source \\ "trade" \ "bondForward" \ "notionalAmount" \ "currency") }</fpml:currency>
<fpml:amount>{ get(source \\ "trade" \ "bondForward" \ "notionalAmount" \ "amount") }</fpml:amount>
</rtsrep:notionalAmount>
{ /* settlementType isn`t present in source!!!*/ }
<rtsrep:settlementType>{ "CashOrPhysical" }</rtsrep:settlementType>
<rtsrep:settlementDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "bondForward" \ "settlementDate" \\ "unadjustedDate") }</fpml:unadjustedDate>
<fpml:unadjustedDate>{ get(source \\ "trade" \ "bondForward" \ "settlementDate" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate>
</rtsrep:settlementDate>
<rtsrep:settlementCurrency>{ get(source \ "trade" \ "bondForward" \ "settlementCurrency") }</rtsrep:settlementCurrency>
<rtsrep:settlementCurrency>{ get(source \\ "trade" \ "bondForward" \ "settlementCurrency") }</rtsrep:settlementCurrency>
<rtsrep:forwardPrice>
<rtsrep:forwardPricePerBond>
<fpml:currency>{ get(source \ "trade" \ "bondForward" \ "forwardPrice" \\ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "bondForward" \ "forwardPrice" \\ "amount") }</fpml:amount>
<fpml:currency>{ get(source \\ "trade" \ "bondForward" \ "forwardPrice" \\ "currency") }</fpml:currency>
<fpml:amount>{ get(source \\ "trade" \ "bondForward" \ "forwardPrice" \\ "amount") }</fpml:amount>
</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:bondForward>
}
......
......@@ -5,69 +5,69 @@ import scala.xml.Node
class BondOptionTemplate(source: Node) extends TradeTemplate(source) {
protected[this] def templateTradeBody: Node = {
<fpml:bondOption>
<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:buyerPartyReference href={ get(source \ "trade" \ "bondOption" \ "buyerPartyReference", "href") }/>
<fpml:sellerPartyReference href={ get(source \ "trade" \ "bondOption" \ "sellerPartyReference", "href") }/>
<fpml:optionType>{ get(source \ "trade" \ "bondOption" \ "optionType") }</fpml:optionType>
<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:buyerPartyReference href={ get(source \\ "trade" \ "bondOption" \ "buyerPartyReference", "href") }/>
<fpml:sellerPartyReference href={ get(source \\ "trade" \ "bondOption" \ "sellerPartyReference", "href") }/>
<fpml:optionType>{ get(source \\ "trade" \ "bondOption" \ "optionType") }</fpml:optionType>
<fpml:premium>
<fpml:payerPartyReference href={ get(source \ "trade" \ "bondOption" \ "premium" \"payerPartyReference", "href") }/>
<fpml:receiverPartyReference href={ get(source \ "trade" \ "bondOption" \ "premium" \"receiverPartyReference", "href") }/>
<fpml:payerPartyReference href={ get(source \\ "trade" \ "bondOption" \ "premium" \"payerPartyReference", "href") }/>
<fpml:receiverPartyReference href={ get(source \\ "trade" \ "bondOption" \ "premium" \"receiverPartyReference", "href") }/>
<fpml:paymentAmount>
<fpml:currency>{ get(source \ "trade" \ "bondOption" \ "premium" \\ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "bondOption" \ "premium" \\ "amount") }</fpml:amount>
<fpml:currency>{ get(source \\ "trade" \ "bondOption" \ "premium" \\ "currency") }</fpml:currency>
<fpml:amount>{ get(source \\ "trade" \ "bondOption" \ "premium" \\ "amount") }</fpml:amount>
</fpml:paymentAmount>
{ /* paymentDate isn`t present in source!!!*/ }
<fpml:paymentDate>
<fpml:adjustableDate>
<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" \ "europeanExercise" \\ "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" \ "europeanExercise" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate>
</fpml:paymentDate>
</fpml:premium>
<fpml:americanExercise>
<fpml:commencementDate>
<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:commencementDate>
<fpml:expirationDate>
<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:expirationDate>
</fpml:americanExercise>
<fpml:bermudaExercise>
<fpml:bermudaExerciseDates>
<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:bermudaExerciseDates>
</fpml:bermudaExercise>
<fpml:europeanExercise>
<fpml:expirationDate>
<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:expirationDate>
</fpml:europeanExercise>
<fpml:notionalAmount>
<fpml:currency>{ get(source \ "trade" \ "bondOption" \ "notionalAmount" \ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "bondOption" \ "notionalAmount" \ "amount") }</fpml:amount>
<fpml:currency>{ get(source \\ "trade" \ "bondOption" \ "notionalAmount" \ "currency") }</fpml:currency>
<fpml:amount>{ get(source \\ "trade" \ "bondOption" \ "notionalAmount" \ "amount") }</fpml:amount>
</fpml:notionalAmount>
<fpml:optionEntitlement>{ get(source \ "trade" \ "bondOption" \ "optionEntitlement") }</fpml:optionEntitlement>
<fpml:numberOfOptions>{ get(source \ "trade" \ "bondOption" \ "numberOfOptions") }</fpml:numberOfOptions>
<fpml:settlementType>{ get(source \ "trade" \ "bondOption" \ "settlementType") }</fpml:settlementType>
<fpml:optionEntitlement>{ get(source \\ "trade" \ "bondOption" \ "optionEntitlement") }</fpml:optionEntitlement>
<fpml:numberOfOptions>{ get(source \\ "trade" \ "bondOption" \ "numberOfOptions") }</fpml:numberOfOptions>
<fpml:settlementType>{ get(source \\ "trade" \ "bondOption" \ "settlementType") }</fpml:settlementType>
<fpml:strike>
<fpml:price>
<fpml:strikePrice>{ get(source \ "trade" \ "bondOption" \ "strike" \\ "strikePrice") }</fpml:strikePrice>
<fpml:strikePercentage>{ get(source \ "trade" \ "bondOption" \ "strike" \\ "strikePercentage") }</fpml:strikePercentage>
<fpml:currency>{ get(source \ "trade" \ "bondOption" \ "strike" \\ "currency") }</fpml:currency>
<fpml:strikePrice>{ get(source \\ "trade" \ "bondOption" \ "strike" \\ "strikePrice") }</fpml:strikePrice>
<fpml:strikePercentage>{ get(source \\ "trade" \ "bondOption" \ "strike" \\ "strikePercentage") }</fpml:strikePercentage>
<fpml:currency>{ get(source \\ "trade" \ "bondOption" \ "strike" \\ "currency") }</fpml:currency>
</fpml:price>
</fpml:strike>
<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: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:bond>
</fpml:bondOption>
}
......
......@@ -6,36 +6,36 @@ class CommodityOptionTemplate(source: Node) extends TradeTemplate(source) {
protected[this] def templateTradeBody: Node = {
<fpml:commodityOption>
{ /* productType is unknown for RTS */ }
{ /*<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:buyerPartyReference href={ get(source \ "trade" \ "commodityOption" \ "buyerPartyReference", "href") }/>
<fpml:sellerPartyReference href={ get(source \ "trade" \ "commodityOption" \ "sellerPartyReference", "href") }/>
{ /*<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:buyerPartyReference href={ get(source \\ "trade" \ "commodityOption" \ "buyerPartyReference", "href") }/>
<fpml:sellerPartyReference href={ get(source \\ "trade" \ "commodityOption" \ "sellerPartyReference", "href") }/>
{ /* optionType isn`t present in source!!!*/ }
{ /* { <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: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:unit>{ get(source \ "trade" \ "commodityOption" \ "commodity" \ "unit") }</fpml:unit>
<fpml:currency>{ get(source \ "trade" \ "commodityOption" \ "commodity" \ "currency") }</fpml:currency>
{ /* { <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: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:unit>{ get(source \\ "trade" \ "commodityOption" \ "commodity" \ "unit") }</fpml:unit>
<fpml:currency>{ get(source \\ "trade" \ "commodityOption" \ "commodity" \ "currency") }</fpml:currency>
</fpml:commodity>
{ /* effectiveDate isn`t present in source!!!*/ }
<fpml:effectiveDate>
<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:effectiveDate>
<fpml:totalNotionalQuantity>{ get(source \ "trade" \ "commodityOption" \ "totalNotionalQuantity") }</fpml:totalNotionalQuantity>
<fpml:totalNotionalQuantity>{ get(source \\ "trade" \ "commodityOption" \ "totalNotionalQuantity") }</fpml:totalNotionalQuantity>
<fpml:exercise>
<fpml:americanExercise>
<fpml:exercisePeriod>
<fpml:commencementDate>
<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:commencementDate>
<fpml:expirationDate>
<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:expirationDate>
</fpml:exercisePeriod>
......@@ -43,40 +43,40 @@ class CommodityOptionTemplate(source: Node) extends TradeTemplate(source) {
<fpml:europeanExercise>
<fpml:expirationDate>
<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:expirationDate>
</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: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:paymentDates>
</fpml:exercise>
<fpml:strikePricePerUnit>
<fpml:currency>{ get(source \ "trade" \ "commodityOption" \ "strikePricePerUnit" \ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "commodityOption" \ "strikePricePerUnit" \ "amount") }</fpml:amount>
<fpml:currency>{ get(source \\ "trade" \ "commodityOption" \ "strikePricePerUnit" \ "currency") }</fpml:currency>
<fpml:amount>{ get(source \\ "trade" \ "commodityOption" \ "strikePricePerUnit" \ "amount") }</fpml:amount>
</fpml:strikePricePerUnit>
<fpml:floatingStrikePricePerUnit>
<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:spread>
<fpml:currency>{ get(source \ "trade" \ "commodityOption" \ "floatingStrikePricePerUnit" \\ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "commodityOption" \ "floatingStrikePricePerUnit" \\ "amount") }</fpml:amount>
<fpml:spreadUnit>{ get(source \ "trade" \ "commodityOption" \ "floatingStrikePricePerUnit" \\ "spreadUnit") }</fpml:spreadUnit>
<fpml:currency>{ get(source \\ "trade" \ "commodityOption" \ "floatingStrikePricePerUnit" \\ "currency") }</fpml:currency>
<fpml:amount>{ get(source \\ "trade" \ "commodityOption" \ "floatingStrikePricePerUnit" \\ "amount") }</fpml:amount>
<fpml:spreadUnit>{ get(source \\ "trade" \ "commodityOption" \ "floatingStrikePricePerUnit" \\ "spreadUnit") }</fpml:spreadUnit>
</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:premium>
<fpml:payerPartyReference href={ get(source \ "trade" \ "commodityOption" \ "premium" \"payerPartyReference", "href") }/>
<fpml:receiverPartyReference href={ get(source \ "trade" \ "commodityOption" \ "premium" \"receiverPartyReference", "href") }/>
<fpml:payerPartyReference href={ get(source \\ "trade" \ "commodityOption" \ "premium" \"payerPartyReference", "href") }/>
<fpml:receiverPartyReference href={ get(source \\ "trade" \ "commodityOption" \ "premium" \"receiverPartyReference", "href") }/>
<fpml:paymentAmount>
<fpml:currency>{ get(source \ "trade" \ "commodityOption" \ "premium" \\ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "commodityOption" \ "premium" \\ "amount") }</fpml:amount>
<fpml:currency>{ get(source \\ "trade" \ "commodityOption" \ "premium" \\ "currency") }</fpml:currency>
<fpml:amount>{ get(source \\ "trade" \ "commodityOption" \ "premium" \\ "amount") }</fpml:amount>
</fpml:paymentAmount>
</fpml:premium>
</fpml:commodityOption>
......
......@@ -5,20 +5,20 @@ import scala.xml.Node
class CommoditySwapTemplate(source: Node) extends TradeTemplate(source) {
protected[this] def templateTradeBody: Node = {
<fpml:commoditySwap>
{ /* <fpml:productType>{ get(source \ "trade" \ "commoditySwap" \ "productType") }</fpml:productType> */}
<fpml:productId>{ get(source \ "trade" \ "commoditySwap" \ "productId") }</fpml:productId>
{ /* <fpml:productType>{ get(source \\ "trade" \ "commoditySwap" \ "productType") }</fpml:productType> */}
<fpml:productId>{ get(source \\ "trade" \ "commoditySwap" \ "productId") }</fpml:productId>
<fpml:effectiveDate>
<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:effectiveDate>
<fpml:terminationDate>
<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:terminationDate>
<fpml:settlementCurrency>{ get(source \ "trade" \ "commoditySwap" \ "settlementCurrency") }</fpml:settlementCurrency>
{ for (s <- source \ "trade" \ "commoditySwap" \ "fixedLeg") yield {
<fpml:settlementCurrency>{ get(source \\ "trade" \ "commoditySwap" \ "settlementCurrency") }</fpml:settlementCurrency>
{ for (s <- source \\ "trade" \ "commoditySwap" \ "fixedLeg") yield {
<fpml:fixedLeg>
<fpml:payerPartyReference href={get(s \ "payerPartyReference", "href")}/>
<fpml:receiverPartyReference href={get(s \ "receiverPartyReference", "href")}/>
......
......@@ -5,15 +5,15 @@ import scala.xml.Node
class EquityForwardTemplate(source: Node) extends TradeTemplate(source) {
protected[this] def templateTradeBody: Node = {
<fpml:equityForward>
<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:buyerPartyReference href={ get(source \ "trade" \ "equityForward" \ "buyerPartyReference", "href") }/>
<fpml:sellerPartyReference href={ get(source \ "trade" \ "equityForward" \ "sellerPartyReference", "href") }/>
<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:buyerPartyReference href={ get(source \\ "trade" \ "equityForward" \ "buyerPartyReference", "href") }/>
<fpml:sellerPartyReference href={ get(source \\ "trade" \ "equityForward" \ "sellerPartyReference", "href") }/>
<fpml:optionType>{ "Forward" }</fpml:optionType>
<fpml:underlyer>
<fpml:basket>
<fpml:openUnits>{ get(source \ "trade" \ "equityForward" \ "underlyer" \\ "basket" \ "openUnits") }</fpml:openUnits>
{ for (s <- source \ "trade" \ "equityForward" \ "underlyer" \\ "basket" \ "basketConstituent") yield {
<fpml:openUnits>{ get(source \\ "trade" \ "equityForward" \ "underlyer" \\ "basket" \ "openUnits") }</fpml:openUnits>
{ for (s <- source \\ "trade" \ "equityForward" \ "underlyer" \\ "basket" \ "basketConstituent") yield {
<fpml:basketConstituent>
<fpml:equity id={ get(s \ "equity", "id") }>
<fpml:instrumentId instrumentIdScheme={ get(s \\ "instrumentId", "instrumentIdScheme") }>{ get(s \\ "instrumentId") }</fpml:instrumentId>
......@@ -35,35 +35,35 @@ class EquityForwardTemplate(source: Node) extends TradeTemplate(source) {
<fpml:equityAmericanExercise>
<fpml:commencementDate>
<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:commencementDate>
<fpml:expirationDate>
<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:expirationDate>
</fpml:equityAmericanExercise>
<fpml:equityBermudaExercise>
<fpml:bermudaExerciseDates>
<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:bermudaExerciseDates>
</fpml:equityBermudaExercise>
<fpml:equityEuropeanExercise>
<fpml:expirationDate>
<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:expirationDate>
</fpml:equityEuropeanExercise>
<fpml:settlementCurrency>{ get(source \ "trade" \ "equityForward" \ "equityExercise" \ "settlementCurrency") }</fpml:settlementCurrency>
<fpml:settlementType>{ get(source \ "trade" \ "equityForward" \ "equityExercise" \ "settlementType") }</fpml:settlementType>
<fpml:settlementCurrency>{ get(source \\ "trade" \ "equityForward" \ "equityExercise" \ "settlementCurrency") }</fpml:settlementCurrency>
<fpml:settlementType>{ get(source \\ "trade" \ "equityForward" \ "equityExercise" \ "settlementType") }</fpml:settlementType>
</fpml:equityExercise>
<fpml:forwardPrice>
<fpml:currency>{ get(source \ "trade" \ "equityForward" \ "forwardPrice" \ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "equityForward" \ "forwardPrice" \ "amount") }</fpml:amount>
<fpml:currency>{ get(source \\ "trade" \ "equityForward" \ "forwardPrice" \ "currency") }</fpml:currency>
<fpml:amount>{ get(source \\ "trade" \ "equityForward" \ "forwardPrice" \ "amount") }</fpml:amount>
</fpml:forwardPrice>
</fpml:equityForward>
}
......
......@@ -5,68 +5,68 @@ import scala.xml.Node
class EquityOptionTemplate(source: Node) extends TradeTemplate(source) {
protected[this] def templateTradeBody: Node = {
<fpml:equityOption>
<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:buyerPartyReference href={ get(source \ "trade" \ "equityOption" \ "buyerPartyReference", "href") }/>
<fpml:sellerPartyReference href={ get(source \ "trade" \ "equityOption" \ "sellerPartyReference", "href") }/>
<fpml:optionType>{ get(source \ "trade" \ "equityOption" \ "optionType") }</fpml:optionType>
<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:buyerPartyReference href={ get(source \\ "trade" \ "equityOption" \ "buyerPartyReference", "href") }/>
<fpml:sellerPartyReference href={ get(source \\ "trade" \ "equityOption" \ "sellerPartyReference", "href") }/>
<fpml:optionType>{ get(source \\ "trade" \ "equityOption" \ "optionType") }</fpml:optionType>
<fpml:underlyer>
<fpml:singleUnderlyer>
<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: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:equity>
<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: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:bond>
<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: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: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:underlyer>
<fpml:equityExercise>
<fpml:equityAmericanExercise>
<fpml:commencementDate>
<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:commencementDate>
<fpml:expirationDate>
<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:expirationDate>
</fpml:equityAmericanExercise>
<fpml:equityBermudaExercise>
<fpml:bermudaExerciseDates>
<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:bermudaExerciseDates>
</fpml:equityBermudaExercise>
<fpml:equityEuropeanExercise>
<fpml:expirationDate>
<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:expirationDate>
</fpml:equityEuropeanExercise>
<fpml:settlementCurrency>{ get(source \ "trade" \ "equityOption" \ "equityExercise" \ "settlementCurrency") }</fpml:settlementCurrency>
<fpml:settlementType>{ get(source \ "trade" \ "equityOption" \ "equityExercise" \ "settlementType") }</fpml:settlementType>
<fpml:settlementCurrency>{ get(source \\ "trade" \ "equityOption" \ "equityExercise" \ "settlementCurrency") }</fpml:settlementCurrency>
<fpml:settlementType>{ get(source \\ "trade" \ "equityOption" \ "equityExercise" \ "settlementType") }</fpml:settlementType>
</fpml:equityExercise>
<fpml:strike>
<fpml:strikePrice>{ get(source \ "trade" \ "equityOption" \ "strike" \\ "strikePrice") }</fpml:strikePrice>
<fpml:strikePercentage>{ get(source \ "trade" \ "equityOption" \ "strike" \\ "strikePercentage") }</fpml:strikePercentage>
<fpml:currency>{ get(source \ "trade" \ "equityOption" \ "strike" \ "currency") }</fpml:currency>
<fpml:strikePrice>{ get(source \\ "trade" \ "equityOption" \ "strike" \\ "strikePrice") }</fpml:strikePrice>
<fpml:strikePercentage>{ get(source \\ "trade" \ "equityOption" \ "strike" \\ "strikePercentage") }</fpml:strikePercentage>
<fpml:currency>{ get(source \\ "trade" \ "equityOption" \ "strike" \ "currency") }</fpml:currency>
</fpml:strike>
<fpml:numberOfOptions>{ get(source \ "trade" \ "equityOption" \ "numberOfOptions") }</fpml:numberOfOptions>
<fpml:optionEntitlement>{ get(source \ "trade" \ "equityOption" \ "optionEntitlement") }</fpml:optionEntitlement>
<fpml:numberOfOptions>{ get(source \\ "trade" \ "equityOption" \ "numberOfOptions") }</fpml:numberOfOptions>
<fpml:optionEntitlement>{ get(source \\ "trade" \ "equityOption" \ "optionEntitlement") }</fpml:optionEntitlement>
<fpml:equityPremium>
<fpml:payerPartyReference href={ get(source \ "trade" \ "equityOption" \ "equityPremium" \"payerPartyReference", "href") }/>
<fpml:receiverPartyReference href={ get(source \ "trade" \ "equityOption" \ "equityPremium" \"receiverPartyReference", "href") }/>
<fpml:payerPartyReference href={ get(source \\ "trade" \ "equityOption" \ "equityPremium" \"payerPartyReference", "href") }/>
<fpml:receiverPartyReference href={ get(source \\ "trade" \ "equityOption" \ "equityPremium" \"receiverPartyReference", "href") }/>
<fpml:paymentAmount>
<fpml:currency>{ get(source \ "trade" \ "equityOption" \ "equityPremium" \\ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "equityOption" \ "equityPremium" \\ "amount") }</fpml:amount>
<fpml:currency>{ get(source \\ "trade" \ "equityOption" \ "equityPremium" \\ "currency") }</fpml:currency>
<fpml:amount>{ get(source \\ "trade" \ "equityOption" \ "equityPremium" \\ "amount") }</fpml:amount>
</fpml:paymentAmount>
</fpml:equityPremium>
</fpml:equityOption>
......
package templates
import scala.xml.Node
class MasterAgreementTemplate(source: Node) extends Template(source) {
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>
}
class MasterAgreementTemplate(source: Node) extends RegAmendTerminateMasterAgreementTemplate(source) {
protected[this] def templateMATerms: Node = ???
def isStraight = true
}
......@@ -20,12 +20,12 @@ abstract class RegAmendTradeTemplate(source: Node) extends Template(source) {
</fpml:header>
<fpml:isCorrection>{ get(source \ "isCorrection") }</fpml:isCorrection>
<fpml:correlationId correlationIdScheme="">{ get(source \ "correlationId") }</fpml:correlationId>
{ if (get(source \ "isCorrection").mkString == "false") templateTrade
{ if ((source \ "amendment").isEmpty) templateTrade
else
<fpml:amendment>
{ templateTrade }
{ /* agreementDate isn`t present in the source */ }
<fpml:agreementDate>{ get(source \ "asOfDate") }</fpml:agreementDate>
<fpml:agreementDate>{ get(source \ "amendment" \ "agreementDate") }</fpml:agreementDate>
<fpml:effectiveDate>{ get(source \ "amendment" \ "effectiveDate") }</fpml:effectiveDate>
</fpml:amendment>
}
{ for { s <- source \ "party"
......@@ -39,7 +39,7 @@ abstract class RegAmendTradeTemplate(source: Node) extends Template(source) {
</fpml:party>
}
}
{ for (s <- source \ "trade" \ "nsdSpecificTradeFields" \ "clientDetails") yield {
{ for (s <- source \\ "trade" \ "nsdSpecificTradeFields" \ "clientDetails") yield {
<fpml:party id={ get(s \ "id") }>
<fpml:partyId>{ get(s \ "id") }</fpml:partyId>
<fpml:partyName>{ get(s \ "name") }</fpml:partyName>
......
......@@ -5,80 +5,80 @@ import scala.xml.Node
class RepoTemplate(source: Node) extends TradeTemplate(source) {
protected[this] def templateTradeBody: Node = {
<fpmlext:repo xsi:type="rtsrep:Repo">
<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>{ get(source \\ "trade" \ "repo" \ "productType") }</fpml:productId>
<fpml:productId productIdScheme={ get(source \\ "trade" \ "repo" \ "productId", "productIdScheme") }>{ get(source \\ "trade" \ "repo" \ "productId") }</fpml:productId>
<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:stepDate>{ get(source \ "trade" \ "repo" \ "fixedRateSchedule" \\ "stepDate") }</fpml:stepDate>
<fpml:stepValue>{ get(source \ "trade" \ "repo" \ "fixedRateSchedule" \\ "stepValue") }</fpml:stepValue>
<fpml:stepDate>{ get(source \\ "trade" \ "repo" \ "fixedRateSchedule" \\ "stepDate") }</fpml:stepDate>
<fpml:stepValue>{ get(source \\ "trade" \ "repo" \ "fixedRateSchedule" \\ "stepValue") }</fpml:stepValue>
</fpml:step>
</fpmlext:fixedRateSchedule>
<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:periodMultiplier>{ get(source \ "trade" \ "repo" \ "floatingRateCalculation" \\ "periodMultiplier") }</fpml:periodMultiplier>
<fpml:period>{ get(source \ "trade" \ "repo" \ "floatingRateCalculation" \\ "period") }</fpml:period>
<fpml:periodMultiplier>{ get(source \\ "trade" \ "repo" \ "floatingRateCalculation" \\ "periodMultiplier") }</fpml:periodMultiplier>
<fpml:period>{ get(source \\ "trade" \ "repo" \ "floatingRateCalculation" \\ "period") }</fpml:period>
</fpml:indexTenor>
<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:initialRate>{ get(source \ "trade" \ "repo" \ "floatingRateCalculation" \\ "initialRate") }</fpml:initialRate>
<fpml:initialRate>{ get(source \\ "trade" \ "repo" \ "floatingRateCalculation" \\ "initialRate") }</fpml:initialRate>
</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">
<fpml:buyerPartyReference href={ get(source \ "trade" \ "repo" \ "spotLeg" \ "buyerPartyReference", "href") } />
<fpml:sellerPartyReference href={ get(source \ "trade" \ "repo" \ "spotLeg" \ "sellerPartyReference", "href") } />
<fpml:buyerPartyReference href={ get(source \\ "trade" \ "repo" \ "spotLeg" \ "buyerPartyReference", "href") } />
<fpml:sellerPartyReference href={ get(source \\ "trade" \ "repo" \ "spotLeg" \ "sellerPartyReference", "href") } />
<fpmlext:settlementDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "repo" \ "spotLeg" \\ "unadjustedDate") }</fpml:unadjustedDate>
<fpml:unadjustedDate>{ get(source \\ "trade" \ "repo" \ "spotLeg" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate>
</fpmlext:settlementDate>
<fpml:settlementAmount>
<fpml:currency>{ get(source \ "trade" \ "repo" \ "spotLeg" \\ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "repo" \ "spotLeg" \\ "amount") }</fpml:amount>
<fpml:currency>{ get(source \\ "trade" \ "repo" \ "spotLeg" \\ "currency") }</fpml:currency>
<fpml:amount>{ get(source \\ "trade" \ "repo" \ "spotLeg" \\ "amount") }</fpml:amount>
</fpml:settlementAmount>
<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>
<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:currency>{ get(source \\ "trade" \ "repo" \ "spotLeg" \ "collateral" \ "unitPrice" \ "currency") }</fpml:currency>
<fpml:amount>{ get(source \\ "trade" \ "repo" \ "spotLeg" \ "collateral" \ "unitPrice" \ "amount") }</fpml:amount>
</fpmlext:unitPrice>
<fpmlext:nominalAmount>
<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:currency>{ get(source \\ "trade" \ "repo" \ "spotLeg" \ "collateral" \ "nominalAmount" \ "currency") }</fpml:currency>
<fpml:amount>{ get(source \\ "trade" \ "repo" \ "spotLeg" \ "collateral" \ "nominalAmount" \ "amount") }</fpml:amount>
</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>
<rtsrep:deliveryDate>
<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>
</rtsrep:deliveryDate>
</fpmlext:spotLeg>
<fpmlext:forwardLeg xsi:type="rtsrep:ForwardRepoTransactionLeg">
<fpml:buyerPartyReference href={ get(source \ "trade" \ "repo" \ "forwardLeg" \ "buyerPartyReference", "href") } />
<fpml:sellerPartyReference href={ get(source \ "trade" \ "repo" \ "forwardLeg" \ "sellerPartyReference", "href") } />
<fpml:buyerPartyReference href={ get(source \\ "trade" \ "repo" \ "forwardLeg" \ "buyerPartyReference", "href") } />
<fpml:sellerPartyReference href={ get(source \\ "trade" \ "repo" \ "forwardLeg" \ "sellerPartyReference", "href") } />
<fpmlext:settlementDate>
<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>
</fpmlext:settlementDate>
<fpml:settlementAmount>
<fpml:currency>{ get(source \ "trade" \ "repo" \ "forwardLeg" \\ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "repo" \ "forwardLeg" \\ "amount") }</fpml:amount>
<fpml:currency>{ get(source \\ "trade" \ "repo" \ "forwardLeg" \\ "currency") }</fpml:currency>
<fpml:amount>{ get(source \\ "trade" \ "repo" \ "forwardLeg" \\ "amount") }</fpml:amount>
</fpml:settlementAmount>
<rtsrep:deliveryDate>
<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>
</rtsrep:deliveryDate>
</fpmlext:forwardLeg>
<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: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:equity>
<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: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:bond>
</fpmlext:repo>
}
......
......@@ -5,10 +5,10 @@ import scala.xml.Node
abstract class TradeTemplate(source: Node) extends RegAmendTradeTemplate(source) {
protected[this] def templateTradeBody: Node
def templateTrade: Node = {
protected[this] def templateTrade: Node = {
<fpml:trade>
<fpml:tradeHeader>
{ for { s <- source \ "trade" \ "tradeHeader" \ "partyTradeIdentifier"
{ for { s <- source \\ "trade" \ "tradeHeader" \ "partyTradeIdentifier"
id = get(s \ "partyReference", "href").mkString
if id != "Sender" && id != "UTIGeneratingParty" } yield {
<fpml:partyTradeIdentifier>
......@@ -18,20 +18,20 @@ abstract class TradeTemplate(source: Node) extends RegAmendTradeTemplate(source)
}
}
<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: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: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-method">{ get(source \ "trade" \ "nsdSpecificTradeFields" \ "clearSettlementMethod") }</fpml:category>
<fpml:executionDateTime>{ get(source \ "trade" \ "tradeHeader" \ "tradeDate") + "T00:00:00" }</fpml:executionDateTime>
<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:executionDateTime>{ get(source \\ "trade" \ "tradeHeader" \ "tradeDate") + "T00:00:00" }</fpml:executionDateTime>
<fpml:reportingRegime>
<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: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:reportingRegime>
</fpml:partyTradeInformation>
{ for (s <- source \ "trade" \ "nsdSpecificTradeFields" \ "clientDetails") yield {
{ for (s <- source \\ "trade" \ "nsdSpecificTradeFields" \ "clientDetails") yield {
<fpml:partyTradeInformation>
<fpml:partyReference href={ get(s \ "servicingParty", "href") } />
<fpml:relatedParty>
......@@ -41,29 +41,29 @@ abstract class TradeTemplate(source: Node) extends RegAmendTradeTemplate(source)
</fpml:relatedParty>
<fpml:timestamps>
<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>{
val d = get(source \ "trade" \ "nsdSpecificTradeFields" \ "clearedDate")
val d = get(source \\ "trade" \ "nsdSpecificTradeFields" \ "clearedDate")
if (d.mkString != msgNotFound) d + "T00:00:00" else msgNotFound
}</fpml:value>
</fpml:timestamp>
<fpml:timestamp>
<fpml:type>{ if (get(source \ "trade" \ "nsdSpecificTradeFields" \ "startAgreementDate").mkString != msgNotFound) "InPortfolio" else msgNotFound}</fpml:type>
<fpml:type>{ if (get(source \\ "trade" \ "nsdSpecificTradeFields" \ "startAgreementDate").mkString != msgNotFound) "InPortfolio" else msgNotFound}</fpml:type>
<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
}</fpml:value>
</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>{
val d = get(source \ "trade" \ "nsdSpecificTradeFields" \ "endAgreementDate")
val d = get(source \\ "trade" \ "nsdSpecificTradeFields" \ "endAgreementDate")
if (d.mkString != msgNotFound) d + "T00:00:00" else msgNotFound
}</fpml:value>
</fpml:timestamp>
</fpml:timestamps>
<fpml:collateralizationType>{
get(source \ "trade" \ "collateral" \ "marginType").mkString match {
get(source \\ "trade" \ "collateral" \ "marginType").mkString match {
case "FC" => "Fully"
case "PC" => "Partially"
case "OC" => "OneWay"
......@@ -71,7 +71,7 @@ abstract class TradeTemplate(source: Node) extends RegAmendTradeTemplate(source)
case _ => msgNotFound
}
}</fpml:collateralizationType>
<fpml:collateralPortfolio>{ get(source \ "trade" \ "collateral" \ "collateralForm") }</fpml:collateralPortfolio>
<fpml:collateralPortfolio>{ get(source \\ "trade" \ "collateral" \ "collateralForm") }</fpml:collateralPortfolio>
</fpml:partyTradeInformation>
}
}
......@@ -79,7 +79,7 @@ abstract class TradeTemplate(source: Node) extends RegAmendTradeTemplate(source)
{ templateTradeBody }
<fpml:documentation>
<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:documentation>
</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