Commit cce0c27f by Amelin Konstantin

Fix path 'source \\ "trade"'

parent 4e0c2844
<?xml version="1.0" encoding="utf-8"?>
<nonpublicExecutionReport xmlns="http://www.fpml.org/FpML-5/recordkeeping" xmlns:nsdext="http://www.fpml.org/FpML-5/recordkeeping/nsd-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:fpmlext="http://www.fpml.org/FpML-5/ext" xsi:schemaLocation="http://www.fpml.org/FpML-5/recordkeeping ../fpml-recordkeeping-merged-schema.xsd http://www.fpml.org/FpML-5/recordkeeping/nsd-ext ../nsd-ext-merged-schema.xsd" fpmlVersion="5-4" actualBuild="5">
<!--Заголовок сообщения.-->
<!--Message header.-->
<header>
<!--Номер сообщения-->
<!--Message identifier-->
<messageId messageIdScheme="http://repository.nsd.ru/coding-scheme/messageid(nsdrus)">MesIdfra-1</messageId>
<!--Отправитель сообщения-->
<!--Message sender-->
<sentBy>P00000000111</sentBy>
<!--Получатель сообщения-->
<!--Message receiver-->
<sendTo>NDC000000000</sendTo>
<!--Время создания сообщения-->
<!--Message creation time-->
<creationTimestamp>2015-07-27T19:03:13</creationTimestamp>
<!--Версия спецификации.-->
<!--The version(s) of specifications.-->
<implementationSpecification>
<!--Версия спецификации.-->
<!--Version of specification.-->
<version>4.4</version>
</implementationSpecification>
</header>
<!--Признак корректирующего сообщения-->
<!--Correction message mark-->
<isCorrection>false</isCorrection>
<!--Уникальный код цепочки сообщений-->
<!--Messages chain identifier-->
<correlationId correlationIdScheme="http://repository.nsd.ru/coding-scheme/correlationId(nsdrus)">[P00000000111]-[2015]-[MesIdfra-1]</correlationId>
<!--Дата совершения отчитываемого события-->
<!--Event's actual date-->
<asOfDate>2013-01-21</asOfDate>
<!--Изменение условий Анкеты-->
<!--Form values negotiated amendment-->
<amendment>
<!--Параметры сделки.-->
<!--Trade details.-->
<trade xsi:type="nsdext:TradeNsd">
<!--Общая информация о генсоглашении/договоре.-->
<!--Trade/Master agreement general information.-->
<tradeHeader>
<!--Регистрационный номер, присвоенный участником-->
<!--Party's identifiers-->
<partyTradeIdentifier>
<!--Участник.-->
<!--Party.-->
<partyReference href="TradeRepository" />
<!--Регистрационный номер-->
<!--Trade/Master agreement/Report identifier-->
<tradeId>NONREF</tradeId>
<!--Регистрационный номер генерального соглашения-->
<!--Master agreement identifier.-->
<linkId linkIdScheme="http://repository.nsd.ru/coding-scheme/linkid(nsdrus)">MA0000000123</linkId>
</partyTradeIdentifier>
<!--Регистрационный номер, присвоенный участником-->
<!--Party's identifiers-->
<partyTradeIdentifier>
<!--Участник.-->
<!--Party.-->
<partyReference href="Party1" />
<!--Регистрационный номер-->
<!--Trade/Master agreement/Report identifier-->
<tradeId>Fra-Party1-NUM1</tradeId>
</partyTradeIdentifier>
<!--Регистрационный номер, присвоенный участником-->
<!--Party's identifiers-->
<partyTradeIdentifier>
<!--Участник.-->
<!--Party.-->
<partyReference href="Party2" />
<!--Регистрационный номер-->
<!--Trade/Master agreement/Report identifier-->
<tradeId>NONREF</tradeId>
</partyTradeIdentifier>
<!--Регистрационный номер, присвоенный участником-->
<!--Party's identifiers-->
<partyTradeIdentifier>
<!--Участник.-->
<!--Party.-->
<partyReference href="UTIGeneratingParty" />
<!--Регистрационный номер-->
<!--Trade/Master agreement/Report identifier-->
<tradeId>VRKSDFKJH000000004DA2A92861A8A4A1B822DFGP5M2809T02</tradeId>
</partyTradeIdentifier>
<!--Информация стороны о сделке.-->
<!--Party trade information.-->
<partyTradeInformation>
<!--Участник.-->
<!--Party.-->
<partyReference href="TradeRepository" />
<!--Регулятивный режим отчетности.-->
<!--Reporting regime.-->
<reportingRegime>
<!--Наименование правил регулятивной отчетности.-->
<!--Reporting regime name.-->
<name reportingRegimeNameScheme="http://www.fpml.org/coding-scheme/reporting-regime">RussianFederation</name>
</reportingRegime>
</partyTradeInformation>
<!--Дата сделки.-->
<!--Trade date.-->
<tradeDate>2013-01-21</tradeDate>
</tradeHeader>
<!--Сделка репо-->
<!--Repo transaction-->
<fpmlext:repo xsi:type="nsdext:RepoNsd">
<!--Тип продукта.-->
<!--Product type.-->
<productType productTypeScheme="http://www.fpml.org/coding-scheme/product-taxonomy">Equity:Repo:EquityRepo</productType>
<!--Код классификации ПФИ и договоров РЕПО-->
<!--Derivatives classification code.-->
<productId>UKWN</productId>
<!--Фиксированная процентная ставка.-->
<!--Fixed rate schedule.-->
<fpmlext:fixedRateSchedule>
<!--Начальное значение.-->
<!--Initial value.-->
<initialValue>0.0600000</initialValue>
<!--Шаг изменений.-->
<!--Step.-->
<step>
<!--Очередная дата.-->
<!--Step date.-->
<stepDate>2013-10-15</stepDate>
<!--Очередное значение.-->
<!--Step value.-->
<stepValue>0.0650000</stepValue>
</step>
</fpmlext:fixedRateSchedule>
<!--Коэффициент для расчета дней в процентном периоде.-->
<!--Day count fraction.-->
<fpmlext:dayCountFraction dayCountFractionScheme="http://www.fpml.org/coding-scheme/day-count-fraction">ACT/ACT.ICMA</fpmlext:dayCountFraction>
<!--Тип срока репо.-->
<!--Repo duration type.-->
<fpmlext:duration>Term</fpmlext:duration>
<!--Первая часть сделки репо.-->
<!--Repo spot leg.-->
<fpmlext:spotLeg xsi:type="nsdext:RepoTransactionLegNsd">
<!--Сторона-покупатель инструмента.-->
<!--Buyer party.-->
<buyerPartyReference href="Party1" />
<!--Сторона-продавец инструмента.-->
<!--Seller party.-->
<sellerPartyReference href="Party2" />
<!--Дата расчетов.-->
<!--Settlement date.-->
<fpmlext:settlementDate>
<!--Дата.-->
<!--Date-->
<adjustableDate>
<!--Дата-->
<!--Date-->
<unadjustedDate>2015-09-10</unadjustedDate>
</adjustableDate>
</fpmlext:settlementDate>
<!--Сумма расчетов.-->
<!--Settlement amount.-->
<settlementAmount>
<!--Валюта суммы.-->
<!--Currency of money amount.-->
<currency currencyScheme="http://www.fpml.org/ext/iso4217-2001-08-15">RUB</currency>
<!--Сумма.-->
<!--Amount.-->
<amount>123.0000000</amount>
</settlementAmount>
</fpmlext:spotLeg>
<!--Вторая часть сделки репо.-->
<!--Repo forward leg.-->
<fpmlext:forwardLeg xsi:type="nsdext:ForwardRepoTransactionLegNsd">
<!--Сторона-покупатель инструмента.-->
<!--Buyer party.-->
<buyerPartyReference href="Party1" />
<!--Сторона-продавец инструмента.-->
<!--Seller party.-->
<sellerPartyReference href="Party2" />
<!--Дата расчетов.-->
<!--Settlement date.-->
<fpmlext:settlementDate>
<!--Дата.-->
<!--Date-->
<adjustableDate>
<!--Дата-->
<!--Date-->
<unadjustedDate>2015-09-10</unadjustedDate>
</adjustableDate>
</fpmlext:settlementDate>
<!--Сумма расчетов.-->
<!--Settlement amount.-->
<settlementAmount>
<!--Валюта суммы.-->
<!--Currency of money amount.-->
<currency currencyScheme="http://www.fpml.org/ext/iso4217-2001-08-15">RUB</currency>
<!--Сумма.-->
<!--Amount.-->
<amount>123.0000000</amount>
</settlementAmount>
</fpmlext:forwardLeg>
<!--Фондовый актив.-->
<!--Equity.-->
<equity id="RU000A0JR779">
<!--Идентификатор базового актива.-->
<!--Asset identifier.-->
<instrumentId instrumentIdScheme="">RU000A0JR779</instrumentId>
</equity>
</fpmlext:repo>
<!--Обеспечение по сделке-->
<!--Collateral-->
<nsdext:collateral>
<!--Тип обеспечения по договору.-->
<!--Collateral type for the trade.-->
<nsdext:marginType>FC</nsdext:marginType>
<!--Форма обеспечения-->
<!--Form of collateral-->
<nsdext:collateralForm>T</nsdext:collateralForm>
</nsdext:collateral>
<!--Специальные атрибуты сделок.-->
<!--Specific regulatory trade attributes.-->
<nsdext:nsdSpecificTradeFields>
<!--Обязанность централизованного клиринга-->
<!--Cleared-->
<nsdext:cleared>N</nsdext:cleared>
<!--Код клиринговой организации.-->
<!--Clearing organization code.-->
<nsdext:clearingOrganizationCode>NDC000000001</nsdext:clearingOrganizationCode>
<!--Дата включения обязательств из договора в клиринговый пул-->
<!--Cleared date-->
<nsdext:clearedDate>2015-04-15</nsdext:clearedDate>
<!--Условия согласования параметров сделки (договора).-->
<!--Trade parameters reconciliation type.-->
<nsdext:reconciliationType>FULL</nsdext:reconciliationType>
<!--Тип расчетов.-->
<!--Settlement type.-->
<nsdext:clearSettlementType clearSettlementTypeScheme="http://repository.nsd.ru/coding-scheme/clear-settlement-type">CS</nsdext:clearSettlementType>
<!--Метод расчетов.-->
<!--Settlement method.-->
<nsdext:clearSettlementMethod clearSettlementMethodScheme="http://repository.nsd.ru/coding-scheme/clear-settlement-method">C</nsdext:clearSettlementMethod>
<!--Способ подтверждения сделки-->
<!--Contract details matching method-->
<nsdext:confirmationMethod>MATH</nsdext:confirmationMethod>
<!--Автоматическое закрытие сделки в дату окончания срока действия договора-->
<!--Automatic trade execution on the agreement end date-->
<nsdext:automaticExecution>Y</nsdext:automaticExecution>
<!--Признак связанности стороны 1 и стороны 2-->
<!--Parties are affiliated-->
<nsdext:partiesAreAffiliated>N</nsdext:partiesAreAffiliated>
<!--Регуляторный тип сделки.-->
<!--Transaction regulatory class.-->
<nsdext:regulatoryStatus regulatoryAdviceScheme="http://repository.nsd.ru/coding-scheme/regulatory-status">Derivative</nsdext:regulatoryStatus>
<!--Дата начала срока действия договора.-->
<!--Agreement start date.-->
<nsdext:startAgreementDate>2015-07-17</nsdext:startAgreementDate>
<!--Дата окончания срока действия договора.-->
<!--Agreement end date.-->
<nsdext:endAgreementDate>2015-07-09</nsdext:endAgreementDate>
<!--Информация о клиенте стороны-->
<!--Information about Party clients-->
<nsdext:clientDetails>
<!--Сторона, обслуживающая клиента-->
<!--Party, servicing a client-->
<nsdext:servicingParty href="Party1" />
<!--Тип клиента-->
<!--Client type-->
<nsdext:type>P</nsdext:type>
<!--Идентификатор клиента-->
<!--Identifier-->
<nsdext:id>INN_123456789</nsdext:id>
<!--Наименование клиента-->
<!--Name-->
<nsdext:name>Клиент физическое лицо</nsdext:name>
<!--Код страны клиента-->
<!--Country code-->
<nsdext:country countryScheme="http://www.fpml.org/ext/iso3166">AE</nsdext:country>
</nsdext:clientDetails>
<!--Информация о клиенте стороны-->
<!--Information about Party clients-->
<nsdext:clientDetails>
<!--Сторона, обслуживающая клиента-->
<!--Party, servicing a client-->
<nsdext:servicingParty href="Party2" />
<!--Договор заключен не в интересах клиента-->
<!--Own party trade-->
<nsdext:ownTrade>true</nsdext:ownTrade>
</nsdext:clientDetails>
</nsdext:nsdSpecificTradeFields>
</trade>
<!--Дата согласования изменений-->
<!--Change agreed date-->
<agreementDate>2000-01-01</agreementDate>
<!--Дата вступления изменений в силу-->
<!--Amendment effective date-->
<effectiveDate>2000-01-01</effectiveDate>
</amendment>
<!--Участники Анкеты-->
<!--Party-->
<party id="TradeRepository">
<!--Идентификационный код-->
<!--Party's identifier.-->
<partyId>NDC000000000</partyId>
<!--Идентификационный код-->
<!--Party's identifier.-->
<partyId>LEI_00000000000000000001</partyId>
<!--Наименование участника.-->
<!--Party's name.-->
<partyName>НКО АО НРД</partyName>
</party>
<!--Участники Анкеты-->
<!--Party-->
<party id="UTIGeneratingParty">
<!--Идентификационный код-->
<!--Party's identifier.-->
<partyId>P00000000111</partyId>
<!--Идентификационный код-->
<!--Party's identifier.-->
<partyId>LEI_00000000000000000001</partyId>
<!--Наименование участника.-->
<!--Party's name.-->
<partyName>Клиент репозитария 1</partyName>
</party>
<!--Участники Анкеты-->
<!--Party-->
<party id="Party1">
<!--Идентификационный код-->
<!--Party's identifier.-->
<partyId>P00000000111</partyId>
<!--Идентификационный код-->
<!--Party's identifier.-->
<partyId>LEI_00000000000000000001</partyId>
<!--Наименование участника.-->
<!--Party's name.-->
<partyName>Клиент репозитария 1</partyName>
<!--Вид экономической деятельности-->
<!--Industry classification-->
<classification industryClassificationScheme="http://www.fpml.org/coding-scheme/external/north-american-industry-classification-system">Other</classification>
<!--Страна.-->
<!--Country.-->
<country countryScheme="http://www.fpml.org/ext/iso3166">RU</country>
<!--Тип лица-->
<!--Organization type-->
<organizationType organizationTypeScheme="http://www.fpml.org/coding-scheme/organization-type">L</organizationType>
</party>
<!--Участники Анкеты-->
<!--Party-->
<party id="Party2">
<!--Идентификационный код-->
<!--Party's identifier.-->
<partyId>P00000000222</partyId>
<!--Идентификационный код-->
<!--Party's identifier.-->
<partyId>LEI_00000000000000000002</partyId>
<!--Наименование участника.-->
<!--Party's name.-->
<partyName>Клиент репозитария 2</partyName>
<!--Вид экономической деятельности-->
<!--Industry classification-->
<classification industryClassificationScheme="http://www.fpml.org/coding-scheme/external/north-american-industry-classification-system">Other</classification>
<!--Страна.-->
<!--Country.-->
<country countryScheme="http://www.fpml.org/ext/iso3166">RU</country>
<!--Тип лица-->
<!--Organization type-->
<organizationType organizationTypeScheme="http://www.fpml.org/coding-scheme/organization-type">L</organizationType>
</party>
<!--Участники Анкеты-->
<!--Party-->
<party id="Sender">
<!--Идентификационный код-->
<!--Party's identifier.-->
<partyId>P00000000111</partyId>
<!--Идентификационный код-->
<!--Party's identifier.-->
<partyId>LEI_00000000000000000001</partyId>
<!--Наименование участника.-->
<!--Party's name.-->
<partyName>Клиент репозитария 1</partyName>
</party>
</nonpublicExecutionReport>
......@@ -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>
}
......
......@@ -5,71 +5,71 @@ import scala.xml.Node
class CommodityForwardTemplate(source: Node) extends TradeTemplate(source) {
protected[this] def templateTradeBody: Node = {
<fpml:commodityForward>
<fpml:productType>{ get(source \ "trade" \ "commodityForward" \ "productType") }</fpml:productType>
<fpml:productId>{ get(source \ "trade" \ "commodityForward" \ "productId") }</fpml:productId>
<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:unadjustedDate>{ get(source \\ "trade" \ "commodityForward" \ "fixedLeg" \ "paymentDates" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate>
</fpml:valueDate>
<fpml:fixedLeg>
<fpml:payerPartyReference href={ get(source \ "trade" \ "commodityForward" \ "fixedLeg" \ "payerPartyReference", "href") }/>
<fpml:receiverPartyReference href={ get(source \ "trade" \ "commodityForward" \ "fixedLeg" \ "receiverPartyReference", "href") }/>
<fpml:payerPartyReference href={ get(source \\ "trade" \ "commodityForward" \ "fixedLeg" \ "payerPartyReference", "href") }/>
<fpml:receiverPartyReference href={ get(source \\ "trade" \ "commodityForward" \ "fixedLeg" \ "receiverPartyReference", "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: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: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" \ "commodityForward" \ "fixedLeg" \ "paymentDates" \\ "unadjustedDate") }</fpml:unadjustedDate>
<fpml:unadjustedDate>{ get(source \\ "trade" \ "commodityForward" \ "fixedLeg" \ "paymentDates" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDates>
</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: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>
{ /* deliveryDate isn`t present in source!!! */ }
<fpml:deliveryDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "commodityForward" \ "commodityForwardPhysicalLeg" \ "deliveryPeriods" \\ "unadjustedDate") }</fpml:unadjustedDate>
<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: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>
<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>
<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: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:unadjustedDate>{ get(source \\ "trade" \ "commodityForward" \ "floatingForwardLeg" \ "paymentDates" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDates>
</fpml:paymentDates>
</rtsrep:floatingForwardLeg>
......
......@@ -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