Commit 554aa95f by Amelin Konstantin

Add client party to TradeTemplate

parent 5cbca951
<?xml version="1.0" encoding="windows-1251"?>
<nonpublicExecutionReport xmlns="http://www.fpml.org/FpML-5/recordkeeping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:fpmlext="http://www.fpml.org/FpML-5/ext" xmlns:nsdext="http://www.fpml.org/FpML-5/recordkeeping/nsd-ext" fpmlVersion="5-4" 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">
<header>
<messageId messageIdScheme="http://repository.nsd.ru/coding-scheme/messageid(nsdrus)">BCS9151431ca24348a5b4bf569ee7e9a760</messageId>
<sentBy>RP0058900001</sentBy>
<sendTo>NDC000000000</sendTo>
<creationTimestamp>2018-04-05T10:37:37</creationTimestamp>
<implementationSpecification>
<version>4.4</version>
</implementationSpecification>
</header>
<isCorrection>false</isCorrection>
<correlationId correlationIdScheme="http://repository.nsd.ru/coding-scheme/correlationId(nsdrus)">[RP0058900001]-[2018]-[BCS9151431ca24348a5b4bf569ee7e9a760]</correlationId>
<asOfDate>2018-04-03</asOfDate>
<trade xsi:type="nsdext:TradeNsd">
<tradeHeader>
<partyTradeIdentifier>
<partyReference href="TradeRepository"/>
<tradeId>NONREF</tradeId>
</partyTradeIdentifier>
<partyTradeIdentifier>
<partyReference href="Party1"/>
<tradeId>030418-05</tradeId>
</partyTradeIdentifier>
<partyTradeIdentifier>
<partyReference href="Party2"/>
<tradeId>030418-05</tradeId>
</partyTradeIdentifier>
<partyTradeIdentifier>
<partyReference href="UTIGeneratingParty"/>
<tradeId>253400GRCV94X91GAW80TNGSR03041805</tradeId>
</partyTradeIdentifier>
<partyTradeInformation>
<partyReference href="TradeRepository"/>
<reportingRegime>
<name reportingRegimeNameScheme="http://www.fpml.org/coding-scheme/reporting-regime">RussianFederation</name>
</reportingRegime>
<nonStandardTerms>true</nonStandardTerms>
</partyTradeInformation>
<tradeDate>2018-04-03</tradeDate>
</tradeHeader>
<fpmlext:repo xsi:type="nsdext:RepoNsd">
<productType productTypeScheme="http://www.fpml.org/coding-scheme/product-taxonomy">Equity:Repo:EquityRepo</productType>
<productId>REOFE</productId>
<fpmlext:fixedRateSchedule>
<initialValue>0.0525</initialValue>
</fpmlext:fixedRateSchedule>
<fpmlext:dayCountFraction dayCountFractionScheme="http://www.fpml.org/coding-scheme/day-count-fraction">ACT/365L</fpmlext:dayCountFraction>
<fpmlext:duration>Term</fpmlext:duration>
<fpmlext:spotLeg xsi:type="nsdext:RepoTransactionLegNsd">
<buyerPartyReference href="Party1"/>
<sellerPartyReference href="Party2"/>
<fpmlext:settlementDate>
<adjustableDate>
<unadjustedDate>2018-04-03</unadjustedDate>
</adjustableDate>
</fpmlext:settlementDate>
<settlementAmount>
<currency currencyScheme="http://www.fpml.org/ext/iso4217-2001-08-15">RUB</currency>
<amount>4999960.0000000</amount>
</settlementAmount>
<fpmlext:collateral xsi:type="nsdext:CollateralValuationNsd">
<fpmlext:numberOfUnits>35714</fpmlext:numberOfUnits>
<fpmlext:unitPrice>
<currency currencyScheme="http://www.fpml.org/ext/iso4217-2001-08-15">RUB</currency>
<amount>140.0000000</amount>
</fpmlext:unitPrice>
<fpmlext:assetReference href="RU0007661625"/>
</fpmlext:collateral>
<nsdext:deliveryDate>
<adjustableDate>
<unadjustedDate>2018-04-04</unadjustedDate>
</adjustableDate>
</nsdext:deliveryDate>
</fpmlext:spotLeg>
<fpmlext:forwardLeg xsi:type="nsdext:ForwardRepoTransactionLegNsd">
<buyerPartyReference href="Party2"/>
<sellerPartyReference href="Party1"/>
<fpmlext:settlementDate>
<adjustableDate>
<unadjustedDate>2018-04-04</unadjustedDate>
</adjustableDate>
</fpmlext:settlementDate>
<settlementAmount>
<currency currencyScheme="http://www.fpml.org/ext/iso4217-2001-08-15">RUB</currency>
<amount>5000679.1700000</amount>
</settlementAmount>
<nsdext:deliveryDate>
<adjustableDate>
<unadjustedDate>2018-04-04</unadjustedDate>
</adjustableDate>
</nsdext:deliveryDate>
</fpmlext:forwardLeg>
<equity id="RU0007661625">
<instrumentId instrumentIdScheme="">RU0007661625</instrumentId>
</equity>
</fpmlext:repo>
<nsdext:collateral>
<nsdext:marginType>U</nsdext:marginType>
<nsdext:collateralForm>U</nsdext:collateralForm>
</nsdext:collateral>
<nsdext:nsdSpecificTradeFields>
<nsdext:cleared>N</nsdext:cleared>
<nsdext:reconciliationType>GENF</nsdext:reconciliationType>
<nsdext:clearSettlementType clearSettlementTypeScheme="http://repository.nsd.ru/coding-scheme/clear-settlement-type">OTC</nsdext:clearSettlementType>
<nsdext:clearSettlementMethod clearSettlementMethodScheme="http://repository.nsd.ru/coding-scheme/clear-settlement-method">E</nsdext:clearSettlementMethod>
<nsdext:confirmationMethod>MXME</nsdext:confirmationMethod>
<nsdext:automaticExecution>N</nsdext:automaticExecution>
<nsdext:partiesAreAffiliated>N</nsdext:partiesAreAffiliated>
<nsdext:endAgreementDate>2018-04-04</nsdext:endAgreementDate>
<nsdext:clientDetails>
<nsdext:servicingParty href="Party1"/>
<nsdext:type>L</nsdext:type>
<nsdext:id>INN_9686012123</nsdext:id>
<nsdext:name> "-"</nsdext:name>
<nsdext:country countryScheme="http://www.fpml.org/ext/iso3166">RU</nsdext:country>
</nsdext:clientDetails>
<nsdext:clientDetails>
<nsdext:servicingParty href="Party2"/>
<nsdext:ownTrade>true</nsdext:ownTrade>
</nsdext:clientDetails>
</nsdext:nsdSpecificTradeFields>
</trade>
<party id="TradeRepository">
<partyId>NDC000000000</partyId>
<partyId>LEI_253400M18U5TB02TW421</partyId>
<partyName> </partyName>
</party>
<party id="Party1">
<partyId>RP0058900001</partyId>
<partyId>LEI_253400GRCV94X91GAW80</partyId>
<partyName> " "</partyName>
<classification>B</classification>
<country>RU</country>
<organizationType>L</organizationType>
</party>
<party id="Party2">
<partyId>NONREF</partyId>
<partyId>INN_8852792274</partyId>
<partyName> ""</partyName>
<classification>Other</classification>
<country>RU</country>
<organizationType>L</organizationType>
</party>
<party id="Sender">
<partyId>RP0058900001</partyId>
<partyId>LEI_253400GRCV94X91GAW80</partyId>
<partyName> " "</partyName>
</party>
<party id="UTIGeneratingParty">
<partyId>RP0058900001</partyId>
<partyId>LEI_253400GRCV94X91GAW80</partyId>
<partyName> " "</partyName>
</party>
</nonpublicExecutionReport>
\ No newline at end of file
......@@ -17,7 +17,7 @@ object Main extends App {
}
val p = new PrettyPrinter(140, 2)
val sourceXml = XML.loadFile("src/main/resources/nsd/Repo NSD bond.xml")
val sourceXml = XML.loadFile("src/main/resources/nsd/Repo Client equity.xml")
val template = Template(sourceXml)
val outputXml = XML.loadString(p.format(template.render))
//val outputXml = template.template
......
......@@ -43,11 +43,11 @@ class RepoTemplate(source: Node) extends TradeTemplate(source) {
<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" \ "ammount") }</fpml:amount>
<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" \ "ammount") }</fpml:amount>
<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:collateral>
......
......@@ -24,9 +24,11 @@ abstract class TradeTemplate(source: Node) extends Template(source) {
<fpml:correlationId correlationIdScheme="">{ get(source \ "correlationId") }</fpml:correlationId>
<fpml:trade>
<fpml:tradeHeader>
{ for (s <- source \ "trade" \ "tradeHeader" \ "partyTradeIdentifier") yield {
{ for { s <- source \ "trade" \ "tradeHeader" \ "partyTradeIdentifier"
id = get(s \ "partyReference", "href").mkString
if id != "Sender" && id != "UTIGeneratingParty" } yield {
<fpml:partyTradeIdentifier>
<fpml:partyReference href={ get(s \ "partyReference", "href") }/>
<fpml:partyReference href={ id }/>
<fpml:tradeId tradeIdScheme={ get(s \ "tradeId", "tradeIdScheme") }>{ get(s \ "tradeId") }</fpml:tradeId>
</fpml:partyTradeIdentifier>
}
......@@ -48,23 +50,32 @@ abstract class TradeTemplate(source: Node) extends Template(source) {
{ for (s <- source \ "trade" \ "nsdSpecificTradeFields" \ "clientDetails") yield {
<fpml:partyTradeInformation>
<fpml:partyReference href={ get(s \ "servicingParty", "href") } />
{ /*<fpml:relatedParty>
<fpml:relatedParty>
<fpml:partyReference href={ get(s \ "id") } />
<fpml:role>{ if (get(s \ "id").mkString != msgNotFound) "Client" else ""}</fpml:role>
<fpml:type>{ get(s \ "type") }</fpml:type>
</fpml:relatedParty> */}
</fpml:relatedParty>
<fpml:timestamps>
<fpml:timestamp>
<fpml:type>{ if (get(source \ "trade" \ "nsdSpecificTradeFields" \ "clearedDate").mkString != msgNotFound) "InClearingPool" else ""}</fpml:type>
<fpml:value>{ get(source \ "trade" \ "nsdSpecificTradeFields" \ "clearedDate") + "T00:00:00" }</fpml:value>
<fpml:value>{
val d = get(source \ "trade" \ "nsdSpecificTradeFields" \ "clearedDate")
if (d.mkString != msgNotFound) d + "T00:00:00" else ""
}</fpml:value>
</fpml:timestamp>
<fpml:timestamp>
<fpml:type>{ if (get(source \ "trade" \ "nsdSpecificTradeFields" \ "startAgreementDate").mkString != msgNotFound) "InPortfolio" else ""}</fpml:type>
<fpml:value>{ get(source \ "trade" \ "nsdSpecificTradeFields" \ "startAgreementDate") + "T00:00:00" }</fpml:value>
<fpml:value>{
val d = get(source \ "trade" \ "nsdSpecificTradeFields" \ "startAgreementDate")
if (d.mkString != msgNotFound) d + "T00:00:00" else ""
}</fpml:value>
</fpml:timestamp>
<fpml:timestamp>
<fpml:type>{ if (get(source \ "trade" \ "nsdSpecificTradeFields" \ "endAgreementDate").mkString != msgNotFound) "OutPortfolio" else ""}</fpml:type>
<fpml:value>{ get(source \ "trade" \ "nsdSpecificTradeFields" \ "endAgreementDate") + "T00:00:00" }</fpml:value>
<fpml:value>{
val d = get(source \ "trade" \ "nsdSpecificTradeFields" \ "endAgreementDate")
if (d.mkString != msgNotFound) d + "T00:00:00" else ""
}</fpml:value>
</fpml:timestamp>
</fpml:timestamps>
<fpml:collateralizationType>{
......@@ -88,8 +99,10 @@ abstract class TradeTemplate(source: Node) extends Template(source) {
</fpml:masterAgreement>
</fpml:documentation>
</fpml:trade>
{ for (s <- source \ "party") yield {
<fpml:party id={ get(s, "id") }>
{ 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>
......@@ -97,6 +110,15 @@ abstract class TradeTemplate(source: Node) extends Template(source) {
</fpml:party>
}
}
{ 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>
<fpml:country>{ get(s \ "country") }</fpml:country>
<fpml:organizationType>{ get(s \ "classification") }</fpml:organizationType>
</fpml:party>
}
}
</fpml:nonpublicExecutionReport>
</document>
</signedDocument>
......
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