Commit 4ab58a85 by Amelin Konstantin

Add CommodityForwardTemplate

parent 58109300
......@@ -103,7 +103,7 @@
<nsdext:clientDetails>
<nsdext:servicingParty href="Party1"/>
<nsdext:type>P</nsdext:type>
<nsdext:id>PASS_23 08875145</nsdext:id>
<nsdext:id>PASS_23_08875145</nsdext:id>
<nsdext:name> </nsdext:name>
<nsdext:country countryScheme="http://www.fpml.org/ext/iso3166">RU</nsdext:country>
</nsdext:clientDetails>
......
......@@ -103,7 +103,7 @@
<nsdext:clientDetails>
<nsdext:servicingParty href="Party1"/>
<nsdext:type>P</nsdext:type>
<nsdext:id>PASS_23 01675418</nsdext:id>
<nsdext:id>PASS_23_01675418</nsdext:id>
<nsdext:name> </nsdext:name>
<nsdext:country countryScheme="http://www.fpml.org/ext/iso3166">RU</nsdext:country>
</nsdext:clientDetails>
......
......@@ -111,7 +111,7 @@
<nsdext:clientDetails>
<nsdext:servicingParty href="Party1"/>
<nsdext:type>P</nsdext:type>
<nsdext:id>PASS_57 87598732</nsdext:id>
<nsdext:id>PASS_57_87598732</nsdext:id>
<nsdext:name> </nsdext:name>
<nsdext:country countryScheme="http://www.fpml.org/ext/iso3166">RU</nsdext:country>
</nsdext:clientDetails>
......
......@@ -4,72 +4,75 @@ import scala.xml.Node
class CommodityForwardTemplate(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:premium>
<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: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:adjustableDate>
</fpml:paymentDate>
</fpml:premium>
<fpml:americanExercise>
<fpml:commencementDate>
<fpml:adjustableDate>
<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:adjustableDate>
</fpml:expirationDate>
</fpml:americanExercise>
<fpml:bermudaExercise>
<fpml:bermudaExerciseDates>
<fpml:commodityForward>
<fpml:productType>{ get(source \ "trade" \ "commodityForward" \ "productType") }</fpml:productType>
<fpml:productId>{ get(source \ "trade" \ "commodityForward" \ "productId") }</fpml:productId>
{ /* valueDate isn`t present in source!!!*/ }
<fpml:valueDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "commodityForward" \ "fixedLeg" \ "paymentDates" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate>
</fpml:valueDate>
<fpml:fixedLeg>
<fpml:buyerPartyReference href={ get(source \ "trade" \ "commodityForward" \ "fixedLeg" \ "buyerPartyReference", "href") }/>
<fpml:sellerPartyReference href={ get(source \ "trade" \ "commodityForward" \ "fixedLeg" \ "sellerPartyReference", "href") }/>
<fpml:fixedPrice>
<fpml:price>{ get(source \ "trade" \ "commodityForward" \ "fixedLeg" \ "fixedPrice" \ "price") }</fpml:price>
<fpml:priceCurrency>{ get(source \ "trade" \ "commodityForward" \ "fixedLeg" \ "fixedPrice" \ "priceCurrency") }</fpml:priceCurrency>
<fpml:priceUnit>{ get(source \ "trade" \ "commodityForward" \ "fixedLeg" \ "fixedPrice" \ "priceUnit") }</fpml:priceUnit>
</fpml:fixedPrice>
<fpml:totalPrice>
<fpml:currency>{ get(source \ "trade" \ "commodityForward" \ "fixedLeg" \ "totalPrice" \ "currency") }</fpml:currency>
<fpml:amount>{ get(source \ "trade" \ "commodityForward" \ "fixedLeg" \ "totalPrice" \ "amount") }</fpml:amount>
</fpml:totalPrice>
<fpml:paymentDates>
<fpml:adjustableDates>
<fpml:unadjustedDate>{ get(source \ "trade" \ "bondOption" \ "bermudaExercise" \\ "unadjustedDate") }</fpml:unadjustedDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "commodityForward" \ "fixedLeg" \ "paymentDates" \\ "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: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: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: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: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>
</fpml:bondOption>
</fpml:paymentDates>
</fpml:fixedLeg>
<rtsrep:commodityPhysicalLeg>
<fpml:payerPartyReference href={ get(source \ "trade" \ "commodityForward" \ "commodityForwardPhysicalLeg" \ "payerPartyReference", "href") }/>
<fpml:receiverPartyReference href={ get(source \ "trade" \ "commodityForward" \ "commodityForwardPhysicalLeg" \ "receiverPartyReference", "href") }/>
<rtsrep:commodity id={ get(source \ "trade" \ "commodityForward" \ "commodityForwardPhysicalLeg" \ "commodity", "id") }>
<fpml:instrumentId instrumentIdScheme={ get(source \ "trade" \ "commodityForward" \ "commodityForwardPhysicalLeg" \ "commodity" \ "instrumentId", "instrumentIdScheme") }>{ get(source \ "trade" \ "commodityForward" \ "commodityForwardPhysicalLeg" \ "commodity" \ "instrumentId") }</fpml:instrumentId>
<fpml:unit>{ get(source \ "trade" \ "commodityForward" \ "commodityForwardPhysicalLeg" \ "commodity" \ "unit") }</fpml:unit>
<fpml:currency>{ get(source \ "trade" \ "commodityForward" \ "commodityForwardPhysicalLeg" \ "commodity" \ "currency") }</fpml:currency>
<fpml:deliveryDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "commodityForward" \ "commodityForwardPhysicalLeg" \ "deliveryPeriods" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:deliveryDate>
</rtsrep:commodity>
<rtsrep:deliveryQuantity>
<fpml:totalPhysicalQuantity>
<fpml:quantityUnit>{ get(source \ "trade" \ "commodityForward" \ "commodityForwardPhysicalLeg" \ "deliveryQuantity" \\ "quantityUnit") }</fpml:quantityUnit>
<fpml:quantity>{ get(source \ "trade" \ "commodityForward" \ "commodityForwardPhysicalLeg" \ "deliveryQuantity" \\ "quantity") }</fpml:quantity>
</fpml:totalPhysicalQuantity>
</rtsrep:deliveryQuantity>
</rtsrep:commodityPhysicalLeg>
<rtsrep:floatingForwardLeg>
<fpml:payerPartyReference href={ get(source \ "trade" \ "commodityForward" \ "floatingForwardLeg" \ "payerPartyReference", "href") }/>
<fpml:receiverPartyReference href={ get(source \ "trade" \ "commodityForward" \ "floatingForwardLeg" \ "receiverPartyReference", "href") }/>
<rtsrep:commodity id={ get(source \ "trade" \ "commodityForward" \ "floatingForwardLeg" \ "commodity", "id") }>
<fpml:instrumentId instrumentIdScheme={ get(source \ "trade" \ "commodityForward" \ "floatingForwardLeg" \ "commodity" \ "instrumentId", "instrumentIdScheme") }>{ get(source \ "trade" \ "commodityForward" \ "floatingForwardLeg" \ "commodity" \ "instrumentId") }</fpml:instrumentId>
<fpml:unit>{ get(source \ "trade" \ "commodityForward" \ "floatingForwardLeg" \ "commodity" \ "unit") }</fpml:unit>
<fpml:currency>{ get(source \ "trade" \ "commodityForward" \ "floatingForwardLeg" \ "commodity" \ "currency") }</fpml:currency>
</rtsrep:commodity>
<fpml:totalNotionalQuantity>{ get(source \ "trade" \ "commodityForward" \ "floatingForwardLeg" \ "totalNotionalQuantity") }</fpml:totalNotionalQuantity>
{ /* calculation/pricingDates isn`t present in source!!!*/ }
<rtsrep:calculation>
<fpml:pricingDates>
<fpml:pricingDates>
<fpml:unadjustedDate>{ get(source \ "trade" \ "commodityForward" \ "floatingForwardLeg" \ "paymentDates" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:pricingDates>
</fpml:pricingDates>
</rtsrep:calculation>
<fpml:paymentDates>
<fpml:adjustableDates>
<fpml:unadjustedDate>{ get(source \ "trade" \ "commodityForward" \ "floatingForwardLeg" \ "paymentDates" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDates>
</fpml:paymentDates>
</rtsrep:floatingForwardLeg>
</fpml:commodityForward>
}
def isStraight = true
......
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