Commit 10f1a8fa by Amelin Konstantin

Initial commit

parents
# sbt
# (may want to keep parts of 'project')
project/project
project/target
target/
build/
lib/
output/*
# eclipse
build
.classpath
.project
.settings
.worksheet
# intellij idea
*.log
*.iml
*.ipr
*.iws
.idea
# vscode
/.vscode
# mac
.DS_Store
# other?
.history
.scala_dependencies
.cache
.cache-main
#general
*.class
/RUNNING_PID
\ No newline at end of file
name := "SPB_Exchange_Repo"
version := "0.1"
scalaVersion := "2.12.6"
libraryDependencies += "org.scala-lang.modules" %% "scala-xml" % "1.1.0"
libraryDependencies += "org.scalactic" %% "scalactic" % "3.0.5"
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.5" % "test"
sbt.version = 1.1.6
\ No newline at end of file
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.7")
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="utf-8"?>
<signedDocument xmlns="http://www.fpml.ru/repository">
<document>
<fpml:nonpublicExecutionReport 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>NFKSP-TO-SPB01-REPO-602-2016-06-28</fpml:messageId>
<fpml:sentBy>NFKSP</fpml:sentBy>
<fpml:sendTo>SPB01</fpml:sendTo>
<fpml:creationTimestamp>2016-06-28T11:00:00</fpml:creationTimestamp>
<fpml:implementationSpecification>
<fpml:version>2</fpml:version>
</fpml:implementationSpecification>
</fpml:header>
<fpml:isCorrection>false</fpml:isCorrection>
<fpml:correlationId correlationIdScheme=""
>NFKSP-TO-SPB01-REPO-602-2016-06-28</fpml:correlationId>
<fpml:trade>
<fpml:tradeHeader>
<fpml:partyTradeIdentifier>
<fpml:partyReference href="NFKSP"/>
<fpml:tradeId>604(1)-0416-ДИЛ-П/604(2)-0416-ДИЛ-П</fpml:tradeId>
</fpml:partyTradeIdentifier>
<fpml:partyTradeIdentifier>
<fpml:partyReference href="ITN_7718173549"/>
<fpml:tradeId>604(1)-0416-ДИЛ-П/604(2)-0416-ДИЛ-П</fpml:tradeId>
</fpml:partyTradeIdentifier>
<fpml:partyTradeInformation>
<fpml:partyReference href="SPB01"/>
<fpml:category categoryScheme="http://www.fpml.ru/repository/trade-settlement-type"
>OTC</fpml:category>
<fpml:category categoryScheme="http://www.fpml.ru/repository/trade-settlement-method"
>E</fpml:category>
<fpml:executionDateTime>2016-04-20T00:00:00</fpml:executionDateTime>
<fpml:reportingRegime>
<fpml:name>RussianFederation</fpml:name>
<fpml:mandatorilyClearable>false</fpml:mandatorilyClearable>
</fpml:reportingRegime>
</fpml:partyTradeInformation>
<fpml:partyTradeInformation>
<fpml:partyReference href="NFKSP"/>
<fpml:collateralizationType>Uncollateralized</fpml:collateralizationType>
</fpml:partyTradeInformation>
<fpml:partyTradeInformation>
<fpml:partyReference href="ITN_7718173549"/>
<fpml:collateralizationType>Uncollateralized</fpml:collateralizationType>
</fpml:partyTradeInformation>
</fpml:tradeHeader>
<fpmlext:repo xsi:type="rtsrep:Repo">
<fpml:productId>Equity:Repo:EquityRepo</fpml:productId>
<fpml:productId>RU000A0JV8K5</fpml:productId>
<fpmlext:fixedRateSchedule>
<fpml:initialValue>0.1025</fpml:initialValue>
</fpmlext:fixedRateSchedule>
<fpmlext:dayCountFraction>1/1</fpmlext:dayCountFraction>
<fpmlext:spotLeg xsi:type="rtsrep:RepoTransactionLeg">
<fpml:buyerPartyReference href="ITN_7718173549"/>
<fpml:sellerPartyReference href="NFKSP"/>
<fpmlext:settlementDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>2016-04-21</fpml:unadjustedDate>
</fpml:adjustableDate>
</fpmlext:settlementDate>
<fpml:settlementAmount>
<fpml:currency>RUB</fpml:currency>
<fpml:amount>119003352.32</fpml:amount>
</fpml:settlementAmount>
<fpmlext:collateral xsi:type="rtsrep:CollateralValuation">
<fpmlext:numberOfUnits>1371</fpmlext:numberOfUnits>
<fpmlext:unitPrice>
<fpml:currency>RUB</fpml:currency>
<fpml:amount>86800.40286</fpml:amount>
</fpmlext:unitPrice>
<fpmlext:assetReference href="RU000A0JV8K5"/>
</fpmlext:collateral>
<rtsrep:deliveryMethod>FreeOfPayment</rtsrep:deliveryMethod>
<rtsrep:deliveryDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>2016-04-21</fpml:unadjustedDate>
</fpml:adjustableDate>
</rtsrep:deliveryDate>
</fpmlext:spotLeg>
<fpmlext:forwardLeg xsi:type="rtsrep:ForwardRepoTransactionLeg">
<fpml:buyerPartyReference href="NFKSP"/>
<fpml:sellerPartyReference href="ITN_7718173549"/>
<fpmlext:settlementDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>2017-04-20</fpml:unadjustedDate>
</fpml:adjustableDate>
</fpmlext:settlementDate>
<fpml:settlementAmount>
<fpml:currency>RUB</fpml:currency>
<fpml:amount>119003352.32</fpml:amount>
</fpml:settlementAmount>
</fpmlext:forwardLeg>
<fpml:equity id="RU000A0JV8K5">
<fpml:instrumentId instrumentIdScheme="">RU000A0JV8K5</fpml:instrumentId>
<fpml:description>ПТК-Холдинг, ПАО ao01</fpml:description>
</fpml:equity>
</fpmlext:repo>
<fpml:documentation>
<fpml:masterAgreement>
<fpml:masterAgreementId>MA-20160628-00000001</fpml:masterAgreementId>
</fpml:masterAgreement>
</fpml:documentation>
</fpml:trade>
<fpml:party id="NFKSP">
<fpml:partyId>NFKSP</fpml:partyId>
<fpml:partyName>ООО «НФК-Сбережения»</fpml:partyName>
</fpml:party>
<fpml:party id="ITN_7718173549">
<fpml:partyId partyIdScheme="ITN">ITN_7718173549</fpml:partyId>
<fpml:partyName>ЗАО "Дельта Инвестмент"</fpml:partyName>
<fpml:country>RU</fpml:country>
<fpml:organizationType>Other</fpml:organizationType>
</fpml:party>
<fpml:party id="SPB01">
<fpml:partyId>SPB01</fpml:partyId>
<fpml:partyName>ПАО «Санкт-Петербургская биржа»</fpml:partyName>
</fpml:party>
</fpml:nonpublicExecutionReport>
</document>
</signedDocument>
<fpml:nonpublicExecutionReport 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>Repo-20181010-13:28:57.551-1</fpml:messageId>
<fpml:sentBy>NFKSP</fpml:sentBy>
<fpml:sendTo>SPB01</fpml:sendTo>
<fpml:creationTimestamp>2018-10-10T13:28:57</fpml:creationTimestamp>
<fpml:implementationSpecification>
<fpml:version>2</fpml:version>
</fpml:implementationSpecification>
</fpml:header>
<fpml:isCorrection>false</fpml:isCorrection>
<fpml:correlationId correlationIdScheme="">Repo-20181010-13:28:57.552-1</fpml:correlationId>
<fpml:trade>
<fpml:tradeHeader>
<fpml:partyTradeIdentifier>
<fpml:partyReference href="SPB01" />
<fpml:tradeId tradeIdScheme="UTI">S9DKA7JG1J9651B357729143488154A5EB6BBBB6B1</fpml:tradeId>
</fpml:partyTradeIdentifier>
<fpml:partyTradeIdentifier>
<fpml:partyReference href="LEI_253400S2HGY7JG1JWC41" />
<fpml:tradeId>123</fpml:tradeId>
</fpml:partyTradeIdentifier>
<fpml:partyTradeIdentifier>
<fpml:partyReference href="TEST" />
<fpml:tradeId>321</fpml:tradeId>
</fpml:partyTradeIdentifier>
<fpml:partyTradeInformation>
<fpml:partyReference href="SPB01" />
<fpml:relatedParty>
<fpml:partyReference href="LEI_vvv" />
<fpml:role>ClearingOrganization</fpml:role>
</fpml:relatedParty>
<fpml:category categoryScheme="http://www.fpml.ru/repository/trade-settlement-type">ОТС</fpml:category>
<fpml:category categoryScheme="http://www.fpml.ru/repository/trade-settlement-method">C</fpml:category>
<fpml:executionDateTime>2018-10-05T00:00:00</fpml:executionDateTime>
<fpml:reportingRegime>
<fpml:name>RussianFederation</fpml:name>
<fpml:mandatorilyClearable>true</fpml:mandatorilyClearable>
</fpml:reportingRegime>
</fpml:partyTradeInformation>
<fpml:partyTradeInformation>
<fpml:partyReference href="LEI_253400S2HGY7JG1JWC41" />
<fpml:relatedParty>
<fpml:partyReference href="LEI_12548741" />
<fpml:role>Client</fpml:role>
<fpml:type>L</fpml:type>
</fpml:relatedParty>
<fpml:relatedParty>
<fpml:partyReference href="LEI_43382" />
<fpml:role>ClearingOrganization</fpml:role>
</fpml:relatedParty>
<fpml:relatedParty>
<fpml:partyReference href="TEST" />
<fpml:role>Party</fpml:role>
</fpml:relatedParty>
<fpml:timestamps>
<fpml:timestamp>
<fpml:type>InClearingPool</fpml:type>
<fpml:value>2018-10-09T09:00:00</fpml:value>
</fpml:timestamp>
<fpml:timestamp>
<fpml:type>InPortfolio</fpml:type>
<fpml:value>2018-10-09T09:00:00</fpml:value>
</fpml:timestamp>
<fpml:timestamp>
<fpml:type>OutPortfolio</fpml:type>
<fpml:value>2018-10-09T09:00:00</fpml:value>
</fpml:timestamp>
</fpml:timestamps>
<fpml:collateralizationType>Uncollateralized</fpml:collateralizationType>
<fpml:collateralPortfolio>Fully</fpml:collateralPortfolio>
</fpml:partyTradeInformation>
<fpml:partyTradeInformation>
<fpml:partyReference href="TEST" />
<fpml:relatedParty>
<fpml:partyReference href="PASS_9999445555" />
<fpml:role>Client</fpml:role>
<fpml:type>TR</fpml:type>
</fpml:relatedParty>
<fpml:relatedParty>
<fpml:partyReference href="LEI_NNN" />
<fpml:role>ClearingOrganization</fpml:role>
</fpml:relatedParty>
<fpml:relatedParty>
<fpml:partyReference href="LEI_253400S2HGY7JG1JWC41" />
<fpml:role>Party</fpml:role>
</fpml:relatedParty>
<timestamps>
<timestamp>
<type>InClearingPool</type>
<value>2018-10-09T09:00:00</value>
</timestamp>
<timestamp>
<type>InPortfolio</type>
<value>2018-10-09T09:00:00</value>
</timestamp>
<timestamp>
<type>OutPortfolio</type>
<value>2018-10-10T10:00:00</value>
</timestamp>
</timestamps>
<fpml:collatealizationType>Uncollateralized</fpml:collatealizationType>
<fpml:collateralPortfolio>Fully</fpml:collateralPortfolio>
</fpml:partyTradeInformation>
</fpml:tradeHeader>
<fpmlext:repo xsi:type="rtsrep:Repo">
<fpml:productId productIdScheme="UnderlyingAsset">RU0009109391</fpml:productId>
<fpmlext:fixedRateSchedule>
<fpml:initialValue>0.1025</fpml:initialValue>
</fpmlext:fixedRateSchedule>
<fpmlext:spotLeg xsi:type="rtsrep:RepoTransactionLeg">
<fpml:buyerPartyReference href="LEI_253400S2HGY7JG1JWC41" />
<fpml:sellerPartyReference href="TEST" />
<fpmlext:settlementDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>2018-10-09</fpml:unadjustedDate>
</fpml:adjustableDate>
</fpmlext:settlementDate>
<fpml:settlementAmount>
<fpml:currency>RUB</fpml:currency>
<fpml:amount>1000000</fpml:amount>
</fpml:settlementAmount>
<fpmlext:collateral xsi:type="rtsrep:CollateralValuation">
<fpmlext:numberOfUnits>100</fpmlext:numberOfUnits>
<fpmlext:assetReference href="RU0009109391" />
</fpmlext:collateral>
<rtsrep:deliveryDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>2018-10-08</fpml:unadjustedDate>
</fpml:adjustableDate>
</rtsrep:deliveryDate>
</fpmlext:spotLeg>
<fpmlext:forwardLeg xsi:type="rtsrep:ForwardRepoTransactionLeg">
<fpml:buyerPartyReference href="TEST" />
<fpml:sellerPartyReference href="LEI_253400S2HGY7JG1JWC41" />
<fpmlext:settlementDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>2018-10-09</fpml:unadjustedDate>
</fpml:adjustableDate>
</fpmlext:settlementDate>
<rtsrep:deliveryDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>2018-10-09</fpml:unadjustedDate>
</fpml:adjustableDate>
</rtsrep:deliveryDate>
</fpmlext:forwardLeg>
<fpml:equity id="RU0009109391">
<fpml:instrumentId instrumentIdScheme="">RU0009109391</fpml:instrumentId>
</fpml:equity>
</fpmlext:repo>
<fpml:documentation>
<fpml:masterAgreement>
<fpml:masterAgreementId>444</fpml:masterAgreementId>
</fpml:masterAgreement>
</fpml:documentation>
</fpml:trade>
<fpml:party id="SPB01">
<fpml:partyId>SPB01</fpml:partyId>
<fpml:partyName>ПАО «Санкт-Петербургская биржа»</fpml:partyName>
</fpml:party>
<fpml:party id="LEI_253400S2HGY7JG1JWC41">
<fpml:partyId partyIdScheme="LEI">LEI_253400S2HGY7JG1JWC41</fpml:partyId>
<fpml:partyName>Ассоциация НП РТС</fpml:partyName>
<fpml:country>RU</fpml:country>
<fpml:organizationType>Other</fpml:organizationType>
</fpml:party>
<fpml:party id="LEI_12548741">
<fpml:partyId partyIdScheme="LEI">LEI_12548741</fpml:partyId>
<fpml:partyName>BANK</fpml:partyName>
<fpml:country>RU</fpml:country>
</fpml:party>
<fpml:party id="TEST">
<fpml:partyId>TEST</fpml:partyId>
<fpml:partyName>ООО ТЕСТ</fpml:partyName>
<fpml:country>RU</fpml:country>
<fpml:organizationType>BR</fpml:organizationType>
</fpml:party>
<fpml:party id="PASS_9999445555">
<fpml:partyId partyIdScheme="PASS">PASS_9999445555</fpml:partyId>
<fpml:partyName>Иванов</fpml:partyName>
<fpml:country>RU</fpml:country>
</fpml:party>
<fpml:party id="vvv">
<fpml:partyId partyIdScheme="LEI">vvv</fpml:partyId>
</fpml:party>
<fpml:party id="43382">
<fpml:partyId partyIdScheme="LEI">43382</fpml:partyId>
</fpml:party>
<fpml:party id="NNN">
<fpml:partyId partyIdScheme="LEI">NNN</fpml:partyId>
</fpml:party>
</fpml:nonpublicExecutionReport>
\ No newline at end of file
<fpml:nonpublicExecutionReport 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>Repo-20181010-15:37:33.434-1</fpml:messageId>
<fpml:sentBy>NFKSP</fpml:sentBy>
<fpml:sendTo>SPB01</fpml:sendTo>
<fpml:creationTimestamp>2018-10-10T15:37:33</fpml:creationTimestamp>
<fpml:implementationSpecification>
<fpml:version>2</fpml:version>
</fpml:implementationSpecification>
</fpml:header>
<fpml:isCorrection>false</fpml:isCorrection>
<fpml:correlationId correlationIdScheme="">Repo-20181010-15:37:33.434-1</fpml:correlationId>
<fpml:trade>
<fpml:tradeHeader>
<fpml:partyTradeIdentifier>
<fpml:partyReference href="SPB01" />
<fpml:tradeId tradeIdScheme="UTI">S9DKA7JG1J9651B357729143488154A5EB6BBBB6B1</fpml:tradeId>
</fpml:partyTradeIdentifier>
<fpml:partyTradeIdentifier>
<fpml:partyReference href="LEI_253400S2HGY7JG1JWC41" />
<fpml:tradeId>123</fpml:tradeId>
</fpml:partyTradeIdentifier>
<fpml:partyTradeIdentifier>
<fpml:partyReference href="TEST" />
<fpml:tradeId>321</fpml:tradeId>
</fpml:partyTradeIdentifier>
<fpml:partyTradeInformation>
<fpml:partyReference href="SPB01" />
<fpml:relatedParty>
<fpml:partyReference href="LEI_vvv" />
<fpml:role>ClearingOrganization</fpml:role>
</fpml:relatedParty>
<fpml:category categoryScheme="http://www.fpml.ru/repository/trade-settlement-type">ОТС</fpml:category>
<fpml:category categoryScheme="http://www.fpml.ru/repository/trade-settlement-method">C</fpml:category>
<fpml:executionDateTime>2018-10-05T00:00:00</fpml:executionDateTime>
<fpml:reportingRegime>
<fpml:name>RussianFederation</fpml:name>
<fpml:mandatorilyClearable>true</fpml:mandatorilyClearable>
</fpml:reportingRegime>
</fpml:partyTradeInformation>
<fpml:partyTradeInformation>
<fpml:partyReference href="LEI_253400S2HGY7JG1JWC41" />
<fpml:relatedParty>
<fpml:partyReference href="LEI_12548741" />
<fpml:role>Client</fpml:role>
<fpml:type>L</fpml:type>
</fpml:relatedParty>
<fpml:relatedParty>
<fpml:partyReference href="LEI_43382" />
<fpml:role>ClearingOrganization</fpml:role>
</fpml:relatedParty>
<fpml:relatedParty>
<fpml:partyReference href="TEST" />
<fpml:role>Party</fpml:role>
</fpml:relatedParty>
<fpml:timestamps>
<fpml:timestamp>
<fpml:type>InClearingPool</fpml:type>
<fpml:value>2018-10-09T09:00:00</fpml:value>
</fpml:timestamp>
<fpml:timestamp>
<fpml:type>InPortfolio</fpml:type>
<fpml:value>2018-10-09T09:00:00</fpml:value>
</fpml:timestamp>
<fpml:timestamp>
<fpml:type>OutPortfolio</fpml:type>
<fpml:value>2018-10-09T09:00:00</fpml:value>
</fpml:timestamp>
</fpml:timestamps>
<fpml:collateralizationType>Uncollateralized</fpml:collateralizationType>
<fpml:collateralPortfolio>Fully</fpml:collateralPortfolio>
</fpml:partyTradeInformation>
<fpml:partyTradeInformation>
<fpml:partyReference href="TEST" />
<fpml:relatedParty>
<fpml:partyReference href="PASS_9999445555" />
<fpml:role>Client</fpml:role>
<fpml:type>TR</fpml:type>
</fpml:relatedParty>
<fpml:relatedParty>
<fpml:partyReference href="LEI_NNN" />
<fpml:role>ClearingOrganization</fpml:role>
</fpml:relatedParty>
<fpml:relatedParty>
<fpml:partyReference href="LEI_253400S2HGY7JG1JWC41" />
<fpml:role>Party</fpml:role>
</fpml:relatedParty>
<timestamps>
<timestamp>
<type>InClearingPool</type>
<value>2018-10-09T09:00:00</value>
</timestamp>
<timestamp>
<type>InPortfolio</type>
<value>2018-10-09T09:00:00</value>
</timestamp>
<timestamp>
<type>OutPortfolio</type>
<value>2018-10-10T10:00:00</value>
</timestamp>
</timestamps>
<fpml:collateralizationType>Uncollateralized</fpml:collateralizationType>
<fpml:collateralPortfolio>Fully</fpml:collateralPortfolio>
</fpml:partyTradeInformation>
</fpml:tradeHeader>
<fpmlext:repo xsi:type="rtsrep:Repo">
<fpml:productId productIdScheme="UnderlyingAsset">RU0009109391</fpml:productId>
<fpmlext:floatingRateCalculation>
<fpml:floatingRateIndex>EUR-EONIA-OIS-COMPOUND</fpml:floatingRateIndex>
</fpmlext:floatingRateCalculation>
<fpmlext:spotLeg xsi:type="rtsrep:RepoTransactionLeg">
<fpml:buyerPartyReference href="LEI_253400S2HGY7JG1JWC41" />
<fpml:sellerPartyReference href="TEST" />
<fpmlext:settlementDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>2018-10-09</fpml:unadjustedDate>
</fpml:adjustableDate>
</fpmlext:settlementDate>
<fpml:settlementAmount>
<fpml:currency>RUB</fpml:currency>
<fpml:amount>1000000</fpml:amount>
</fpml:settlementAmount>
<fpmlext:collateral xsi:type="rtsrep:CollateralValuation">
<fpmlext:nominalAmount>
<fpml:currency>RUB</fpml:currency>
<fpml:amount>1000</fpml:amount>
</fpmlext:nominalAmount>
<fpmlext:assetReference href="RU0009109391" />
</fpmlext:collateral>
<rtsrep:deliveryDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>2018-10-08</fpml:unadjustedDate>
</fpml:adjustableDate>
</rtsrep:deliveryDate>
</fpmlext:spotLeg>
<fpmlext:forwardLeg xsi:type="rtsrep:ForwardRepoTransactionLeg">
<fpml:buyerPartyReference href="TEST" />
<fpml:sellerPartyReference href="LEI_253400S2HGY7JG1JWC41" />
<fpmlext:settlementDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>2018-10-09</fpml:unadjustedDate>
</fpml:adjustableDate>
</fpmlext:settlementDate>
<rtsrep:deliveryDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>2018-10-09</fpml:unadjustedDate>
</fpml:adjustableDate>
</rtsrep:deliveryDate>
</fpmlext:forwardLeg>
<fpml:bond id="RU0009109391">
<fpml:instrumentId instrumentIdScheme="">RU0009109391</fpml:instrumentId>
</fpml:bond>
</fpmlext:repo>
<fpml:documentation>
<fpml:masterAgreement>
<fpml:masterAgreementId>444</fpml:masterAgreementId>
</fpml:masterAgreement>
</fpml:documentation>
</fpml:trade>
<fpml:party id="SPB01">
<fpml:partyId>SPB01</fpml:partyId>
<fpml:partyName>ПАО «Санкт-Петербургская биржа»</fpml:partyName>
</fpml:party>
<fpml:party id="LEI_253400S2HGY7JG1JWC41">
<fpml:partyId partyIdScheme="LEI">LEI_253400S2HGY7JG1JWC41</fpml:partyId>
<fpml:partyName>Ассоциация НП РТС</fpml:partyName>
<fpml:country>RU</fpml:country>
<fpml:organizationType>Other</fpml:organizationType>
</fpml:party>
<fpml:party id="LEI_12548741">
<fpml:partyId partyIdScheme="LEI">LEI_12548741</fpml:partyId>
<fpml:partyName>BANK</fpml:partyName>
<fpml:country>RU</fpml:country>
</fpml:party>
<fpml:party id="TEST">
<fpml:partyId>TEST</fpml:partyId>
<fpml:partyName>ООО ТЕСТ</fpml:partyName>
<fpml:country>RU</fpml:country>
<fpml:organizationType>BR</fpml:organizationType>
</fpml:party>
<fpml:party id="PASS_9999445555">
<fpml:partyId partyIdScheme="PASS">PASS_9999445555</fpml:partyId>
<fpml:partyName>Иванов</fpml:partyName>
<fpml:country>RU</fpml:country>
</fpml:party>
<fpml:party id="vvv">
<fpml:partyId partyIdScheme="LEI">vvv</fpml:partyId>
</fpml:party>
<fpml:party id="43382">
<fpml:partyId partyIdScheme="LEI">43382</fpml:partyId>
</fpml:party>
<fpml:party id="NNN">
<fpml:partyId partyIdScheme="LEI">NNN</fpml:partyId>
</fpml:party>
</fpml:nonpublicExecutionReport>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
import xmlvalid._
import scala.util.{Failure, Success, Try}
import scala.xml._
import templates._
object Main extends App {
//val p = new PrettyPrinter(120, 2)
val sourceXml = XML.loadFile("src/main/resources/nsd/Example repo NSD.xml")
val template = new RepoTemplate(sourceXml)
//val outputXml = XML.loadString(p.format(template.render))
val outputXml = template.template
template.log()
Try {
XMLValid("src/main/resources/nsd/nsd-ext-merged-schema.xsd").loadString(sourceXml.mkString)
} match {
case Success(_) => println("Source xml success check against NSD schema")
case Failure(ex) => println(s"Source xml isn`t wellformed or invalid: ${ex.getMessage}")
}
Try {
XMLValid("src/main/resources/rts/fpml-recordkeeping-merged-schema.xsd").loadString(outputXml.mkString)
} match {
case Success(_) => println("Output xml success check against RTS schema")
case Failure(ex) => println(s"Output xml isn`t wellformed or invalid: ${ex.getMessage}")
}
XML.save("output/Output repo RTS.xml", outputXml, xmlDecl = true)
}
package templates
import scala.util.Try
import scala.xml.Node
final class RepoTemplate(source: Node) extends TradeTemplate(source) {
override protected[this] val msgNotFound = "No elem found"
protected[this] def templateTrade: Node = {
<fpml:trade>
<fpml:tradeHeader>
{ for (s <- source \ "trade" \ "tradeHeader" \ "partyTradeIdentifier") yield {
<fpml:partyTradeIdentifier>
<fpml:partyReference href={ get(Try { (s \ "partyReference").head }, "href") } />
<fpml:tradeId tradeIdScheme={ get(Try { (s \ "tradeId").head }, "tradeIdScheme") }>{ get(Try { (s \ "tradeId").head }) }</fpml:tradeId>
</fpml:partyTradeIdentifier>
}
}
{/* for (s <- source \ "trade" \ "tradeHeader" \ "partyTradeInformation") yield {
<fpml:partyTradeInformation>
<fpml:partyReference href="SPB01" />
<fpml:relatedParty>
<fpml:partyReference href="LEI_vvv" />
<fpml:role>ClearingOrganization</fpml:role>
</fpml:relatedParty>
<fpml:category categoryScheme="http://www.fpml.ru/repository/trade-settlement-type">ОТС</fpml:category>
<fpml:category categoryScheme="http://www.fpml.ru/repository/trade-settlement-method">C</fpml:category>
<fpml:executionDateTime>2018-10-05T00:00:00</fpml:executionDateTime>
<fpml:reportingRegime>
<fpml:name>RussianFederation</fpml:name>
<fpml:mandatorilyClearable>true</fpml:mandatorilyClearable>
</fpml:reportingRegime>
</fpml:partyTradeInformation>
}
*/}
{/*
<fpml:partyTradeInformation>
<fpml:partyReference href="SPB01" />
<fpml:relatedParty>
<fpml:partyReference href="LEI_vvv" />
<fpml:role>ClearingOrganization</fpml:role>
</fpml:relatedParty>
<fpml:category categoryScheme="http://www.fpml.ru/repository/trade-settlement-type">ОТС</fpml:category>
<fpml:category categoryScheme="http://www.fpml.ru/repository/trade-settlement-method">C</fpml:category>
<fpml:executionDateTime>2018-10-05T00:00:00</fpml:executionDateTime>
<fpml:reportingRegime>
<fpml:name>RussianFederation</fpml:name>
<fpml:mandatorilyClearable>true</fpml:mandatorilyClearable>
</fpml:reportingRegime>
</fpml:partyTradeInformation>
<fpml:partyTradeInformation>
<fpml:partyReference href="LEI_253400S2HGY7JG1JWC41" />
<fpml:relatedParty>
<fpml:partyReference href="LEI_12548741" />
<fpml:role>Client</fpml:role>
<fpml:type>L</fpml:type>
</fpml:relatedParty>
<fpml:relatedParty>
<fpml:partyReference href="LEI_43382" />
<fpml:role>ClearingOrganization</fpml:role>
</fpml:relatedParty>
<fpml:relatedParty>
<fpml:partyReference href="TEST" />
<fpml:role>Party</fpml:role>
</fpml:relatedParty>
<fpml:timestamps>
<fpml:timestamp>
<fpml:type>InClearingPool</fpml:type>
<fpml:value>2018-10-09T09:00:00</fpml:value>
</fpml:timestamp>
<fpml:timestamp>
<fpml:type>InPortfolio</fpml:type>
<fpml:value>2018-10-09T09:00:00</fpml:value>
</fpml:timestamp>
<fpml:timestamp>
<fpml:type>OutPortfolio</fpml:type>
<fpml:value>2018-10-09T09:00:00</fpml:value>
</fpml:timestamp>
</fpml:timestamps>
<fpml:collateralizationType>Uncollateralized</fpml:collateralizationType>
<fpml:collateralPortfolio>Fully</fpml:collateralPortfolio>
</fpml:partyTradeInformation>
<fpml:partyTradeInformation>
<fpml:partyReference href="TEST" />
<fpml:relatedParty>
<fpml:partyReference href="PASS_9999445555" />
<fpml:role>Client</fpml:role>
<fpml:type>TR</fpml:type>
</fpml:relatedParty>
<fpml:relatedParty>
<fpml:partyReference href="LEI_NNN" />
<fpml:role>ClearingOrganization</fpml:role>
</fpml:relatedParty>
<fpml:relatedParty>
<fpml:partyReference href="LEI_253400S2HGY7JG1JWC41" />
<fpml:role>Party</fpml:role>
</fpml:relatedParty>
<timestamps>
<timestamp>
<type>InClearingPool</type>
<value>2018-10-09T09:00:00</value>
</timestamp>
<timestamp>
<type>InPortfolio</type>
<value>2018-10-09T09:00:00</value>
</timestamp>
<timestamp>
<type>OutPortfolio</type>
<value>2018-10-10T10:00:00</value>
</timestamp>
</timestamps>
<fpml:collateralizationType>Uncollateralized</fpml:collateralizationType>
<fpml:collateralPortfolio>Fully</fpml:collateralPortfolio>
</fpml:partyTradeInformation>
*/}
</fpml:tradeHeader>
<fpmlext:repo xsi:type="rtsrep:Repo">
<fpml:productId>{ get(Try { (source \ "trade" \ "repo" \ "productType" ).head }) }</fpml:productId>
<fpml:productId productIdScheme={ get(Try { (source \ "trade" \ "repo" \ "productId" ).head }, "productIdScheme") }>{ get(Try { (source \ "trade" \ "repo" \ "productId" ).head }) }</fpml:productId>
{ val iv = get(Try { (source \ "trade" \ "repo" \ "fixedRateSchedule" \ "initialValue").head })
if (iv.mkString != msgNotFound)
<fpmlext:fixedRateSchedule>
<fpml:initialValue>{ iv }</fpml:initialValue>
</fpmlext:fixedRateSchedule>
else
/* Add different type to template */
<fpmlext:floatingRateCalculation>
<fpml:floatingRateIndex>{ get(Try { (source \ "trade" \ "repo" \ "floatingRateCalculation" \ "floatingRateIndex" ).head }) }</fpml:floatingRateIndex>
</fpmlext:floatingRateCalculation>
/*---------------------------------*/
}
<fpmlext:dayCountFraction>{ get(Try { (source \ "trade" \ "repo" \ "dayCountFraction" ).head }) }</fpmlext:dayCountFraction>
<fpmlext:spotLeg xsi:type="rtsrep:RepoTransactionLeg">
<fpml:buyerPartyReference href={ get(Try { (source \ "trade" \ "repo" \ "spotLeg" \ "buyerPartyReference").head }, "href") } />
<fpml:sellerPartyReference href={ get(Try { (source \ "trade" \ "repo" \ "spotLeg" \ "sellerPartyReference").head }, "href") } />
<fpmlext:settlementDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>{ get(Try { (source \ "trade" \ "repo" \ "spotLeg" \\ "unadjustedDate").head }) }</fpml:unadjustedDate>
</fpml:adjustableDate>
</fpmlext:settlementDate>
<fpml:settlementAmount>
<fpml:currency>{ get(Try { (source \ "trade" \ "repo" \ "spotLeg" \\ "currency").head }) }</fpml:currency>
<fpml:amount>{ get(Try { (source \ "trade" \ "repo" \ "spotLeg" \\ "amount").head }) }</fpml:amount>
</fpml:settlementAmount>
{/*
<fpmlext:collateral xsi:type="rtsrep:CollateralValuation">
<fpmlext:numberOfUnits>100</fpmlext:numberOfUnits>
<fpmlext:assetReference href="RU0009109391" />
</fpmlext:collateral>
*/}
<rtsrep:deliveryDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>{ get(Try { (source \ "trade" \ "repo" \ "spotLeg" \ "deliveryDate" \\ "unadjustedDate").head }) }</fpml:unadjustedDate>
</fpml:adjustableDate>
</rtsrep:deliveryDate>
</fpmlext:spotLeg>
<fpmlext:forwardLeg xsi:type="rtsrep:ForwardRepoTransactionLeg">
<fpml:buyerPartyReference href={ get(Try { (source \ "trade" \ "repo" \ "forwardLeg" \ "buyerPartyReference").head }, "href") } />
<fpml:sellerPartyReference href={ get(Try { (source \ "trade" \ "repo" \ "forwardLeg" \ "sellerPartyReference").head }, "href") } />
<fpmlext:settlementDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>{ get(Try { (source \ "trade" \ "repo" \ "forwardLeg" \ "settlementDate" \\ "unadjustedDate").head }) }</fpml:unadjustedDate>
</fpml:adjustableDate>
</fpmlext:settlementDate>
<fpml:settlementAmount>
<fpml:currency>{ get(Try { (source \ "trade" \ "repo" \ "forwardLeg" \\ "currency").head }) }</fpml:currency>
<fpml:amount>{ get(Try { (source \ "trade" \ "repo" \ "forwardLeg" \\ "amount").head }) }</fpml:amount>
</fpml:settlementAmount>
<rtsrep:deliveryDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>{ get(Try { (source \ "trade" \ "repo" \ "forwardLeg" \ "deliveryDate" \\ "unadjustedDate").head }) }</fpml:unadjustedDate>
</fpml:adjustableDate>
</rtsrep:deliveryDate>
</fpmlext:forwardLeg>
{/*Its necessary to add instrument choice */}
<fpml:equity id={ get(Try { (source \ "trade" \ "repo" \ "equity").head }, "id") }>
<fpml:instrumentId instrumentIdScheme="">{ get(Try { (source \ "trade" \ "repo" \ "equity" \ "instrumentId").head }) }</fpml:instrumentId>
</fpml:equity>
</fpmlext:repo>
<fpml:documentation>
<fpml:masterAgreement>
<fpml:masterAgreementId>{ get(Try { (source \ "trade" \ "tradeHeader" \ "partyTradeIdentifier" \ "linkId").head }) }</fpml:masterAgreementId>
</fpml:masterAgreement>
</fpml:documentation>
</fpml:trade>
}
}
package templates
import scala.collection.mutable
import scala.util.{Success, Try}
import scala.xml.transform.{RewriteRule, RuleTransformer}
import scala.xml.{Node, NodeSeq, Text}
abstract class Template(protected[this] val source: Node) {
protected[this] val msgNotFound = "Not found"
private[this] val data = {
val m:mutable.LinkedHashMap[Int, mutable.Queue[(String, String, mutable.LinkedHashMap[Int, (String, String)])]] =
mutable.LinkedHashMap()
val items = source \\ "_"
for (i <- items) {
if (i.attributes.nonEmpty || (i.child.length == 1)) {
val idx = i.hashCode
val attr: mutable.LinkedHashMap[Int, (String, String)] =
if (i.attributes.nonEmpty) mutable.LinkedHashMap() else null
val text = if (i.child.nonEmpty && !i.child.head.text.contains("\n")) i.child.head.text else null
m.get(idx) match {
case None =>
m(idx) = mutable.Queue((s"tag: ${i.label}", text, attr))
case _ =>
m(idx).enqueue((s"tag: ${i.label}", text, attr))
}
if (i.attributes.nonEmpty) {
for (a <- i.attributes) {
m(idx).last._3(a.value.hashCode) = (a.key, a.value.text)
}
}
}
}
m
}
protected[this] def get(content: Try[Node], attr: String = null): Text =
content match {
case Success(v) =>
var res = Text(v.text)
if (attr != null) v.attribute(attr) match {
case None =>
res = Text(msgNotFound)
case o =>
data(v.hashCode).head._3 -= o.get.hashCode
res = Text(o.get.text)
} else if (data(v.hashCode).nonEmpty) {
if (data(v.hashCode).head._3 != null) {
val e = data(v.hashCode).head.copy(_2 = null)
data(v.hashCode).enqueue(e)
}
data(v.hashCode).dequeue()
}
res
case _ => Text(msgNotFound)
}
def template: Node
def render: Node = {
val rule: RewriteRule = new RewriteRule {
override def transform(n: Node): NodeSeq = n match {
case v if v.attributes.nonEmpty && v.attributes.filter(_.value.text == msgNotFound).nonEmpty =>
NodeSeq.Empty
case v if v.child.length == 1 && v.child.head.text == msgNotFound =>
NodeSeq.Empty
case _ => n
}
}
new RuleTransformer(rule).transform(template).head
}
def log(): Unit = data.foreach(e => println(e._2))
}
package templates
import scala.util.Try
import scala.xml.Node
abstract class TradeTemplate(source: Node) extends Template(source) {
protected[this] def templateTrade: Node
def template: Node = {
<signedDocument xmlns="http://www.fpml.ru/repository">
<document>
<fpml:nonpublicExecutionReport 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(Try { (source \ "header" \"messageId").head }) }</fpml:messageId>
<fpml:sentBy>{ get(Try { (source \ "header" \ "sentBy").head }) }</fpml:sentBy>
<fpml:sendTo>{ get(Try { (source \ "header" \ "sendTo").head }) }</fpml:sendTo>
<fpml:creationTimestamp>{ get(Try { (source \ "header" \ "creationTimestamp").head }) }</fpml:creationTimestamp>
<fpml:implementationSpecification>
<fpml:version>2</fpml:version>
</fpml:implementationSpecification>
</fpml:header>
<fpml:isCorrection>{ get(Try { (source \ "isCorrection").head }) }</fpml:isCorrection>
<fpml:correlationId correlationIdScheme="">{get(Try { (source \ "correlationId").head }) }</fpml:correlationId>
{ templateTrade }
{ for (s <- source \ "party") yield {
<fpml:party id={ get(Try { s.head }, "id") }>
<fpml:partyId partyIdScheme={ get(Try { (s \ "partyId").head }, "partyIdScheme") }>{ get(Try { (s \ "partyId").head }) }</fpml:partyId>
<fpml:partyName>{ get(Try { (s \ "partyName").head }) }</fpml:partyName>
<fpml:country>{ get(Try { (s \ "country").head }) }</fpml:country>
<fpml:organizationType>{ get(Try { (s \ "classification").head }) }</fpml:organizationType>
</fpml:party>
}
}
</fpml:nonpublicExecutionReport>
</document>
</signedDocument>
}
}
package xmlvalid
import java.io.File
import javax.xml.XMLConstants
import javax.xml.parsers.SAXParser
import javax.xml.parsers.SAXParserFactory
import javax.xml.validation.SchemaFactory
import scala.xml._
import scala.xml.factory.XMLLoader
import scala.xml.parsing.{ConsoleErrorHandler, NoBindingFactoryAdapter}
/** Provides operations with xml checked against schema
*
* {{{
* scala> val xml = XMLValid("schema.xsd").loadFile("source.xml")
* }}}
*
* @constructor Creates instance from path to xsd schema
* @param xsdPath path to xsd file (URI)
*/
class XMLValid(xsdPath: String) extends XMLLoader[Node] {
private[this] val schema = SchemaFactory
.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI)
.newSchema(new File(xsdPath))
override def adapter: NoBindingFactoryAdapter with ConsoleErrorHandler =
new NoBindingFactoryAdapter with ConsoleErrorHandler {
override def error(ex: SAXParseException): Unit = throw ex
override def fatalError(ex: SAXParseException): Unit = throw ex
}
override def parser: SAXParser = {
val f = SAXParserFactory.newInstance
f.setNamespaceAware(true)
f.setFeature("http://xml.org/sax/features/namespace-prefixes", true)
f.setSchema(schema)
f.newSAXParser
}
}
/** Factory for [[XMLValid]] instances. */
object XMLValid {
/** Creates a ValidXML instance with given xsd schema
*
* @param xsdPath path to xsd file (URI)
* @return XMLValid instance
*/
def apply(xsdPath: String) = new XMLValid(xsdPath)
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="utf-8"?>
<signedDocument xmlns="http://www.fpml.ru/repository">
<document>
<fpml:nonpublicExecutionReport 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>NFKSP-TO-SPB01-REPO-602-2016-06-28</fpml:messageId>
<fpml:sentBy>NFKSP</fpml:sentBy>
<fpml:sendTo>SPB01</fpml:sendTo>
<fpml:creationTimestamp>2016-06-28T11:00:00</fpml:creationTimestamp>
<fpml:implementationSpecification>
<fpml:version>2</fpml:version>
</fpml:implementationSpecification>
</fpml:header>
<fpml:isCorrection>false</fpml:isCorrection>
<fpml:correlationId correlationIdScheme=""
>NFKSP-TO-SPB01-REPO-602-2016-06-28</fpml:correlationId>
<fpml:trade>
<fpml:tradeHeader>
<fpml:partyTradeIdentifier>
<fpml:partyReference href="NFKSP"/>
<fpml:tradeId>604(1)-0416-ДИЛ-П/604(2)-0416-ДИЛ-П</fpml:tradeId>
</fpml:partyTradeIdentifier>
<fpml:partyTradeIdentifier>
<fpml:partyReference href="ITN_7718173549"/>
<fpml:tradeId>604(1)-0416-ДИЛ-П/604(2)-0416-ДИЛ-П</fpml:tradeId>
</fpml:partyTradeIdentifier>
<fpml:partyTradeInformation>
<fpml:partyReference href="SPB01"/>
<fpml:category categoryScheme="http://www.fpml.ru/repository/trade-settlement-type"
>OTC</fpml:category>
<fpml:category categoryScheme="http://www.fpml.ru/repository/trade-settlement-method"
>E</fpml:category>
<fpml:executionDateTime>2016-04-20T00:00:00</fpml:executionDateTime>
<fpml:reportingRegime>
<fpml:name>RussianFederation</fpml:name>
<fpml:mandatorilyClearable>false</fpml:mandatorilyClearable>
</fpml:reportingRegime>
</fpml:partyTradeInformation>
<fpml:partyTradeInformation>
<fpml:partyReference href="NFKSP"/>
<fpml:collateralizationType>Uncollateralized</fpml:collateralizationType>
</fpml:partyTradeInformation>
<fpml:partyTradeInformation>
<fpml:partyReference href="ITN_7718173549"/>
<fpml:collateralizationType>Uncollateralized</fpml:collateralizationType>
</fpml:partyTradeInformation>
</fpml:tradeHeader>
<fpmlext:repo xsi:type="rtsrep:Repo">
<fpml:productId>Equity:Repo:EquityRepo</fpml:productId>
<fpml:productId>RU000A0JV8K5</fpml:productId>
<fpmlext:fixedRateSchedule>
<fpml:initialValue>0.1025</fpml:initialValue>
</fpmlext:fixedRateSchedule>
<fpmlext:dayCountFraction>1/1</fpmlext:dayCountFraction>
<fpmlext:spotLeg xsi:type="rtsrep:RepoTransactionLeg">
<fpml:buyerPartyReference href="ITN_7718173549"/>
<fpml:sellerPartyReference href="NFKSP"/>
<fpmlext:settlementDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>2016-04-21</fpml:unadjustedDate>
</fpml:adjustableDate>
</fpmlext:settlementDate>
<fpml:settlementAmount>
<fpml:currency>RUB</fpml:currency>
<fpml:amount>119003352.32</fpml:amount>
</fpml:settlementAmount>
<fpmlext:collateral xsi:type="rtsrep:CollateralValuation">
<fpmlext:numberOfUnits>1371</fpmlext:numberOfUnits>
<fpmlext:unitPrice>
<fpml:currency>RUB</fpml:currency>
<fpml:amount>86800.40286</fpml:amount>
</fpmlext:unitPrice>
<fpmlext:assetReference href="RU000A0JV8K5"/>
</fpmlext:collateral>
<rtsrep:deliveryMethod>FreeOfPayment</rtsrep:deliveryMethod>
<rtsrep:deliveryDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>2016-04-21</fpml:unadjustedDate>
</fpml:adjustableDate>
</rtsrep:deliveryDate>
</fpmlext:spotLeg>
<!-- changed -->
<fpmlext:forwardLeg xsi:type="rtsrep:ForwardRepoTransactionLeg1">
<!-- changed -->
<fpml:buyerPartyReference href="NFKSP"/>
<fpml:sellerPartyReference href="ITN_7718173549"/>
<fpmlext:settlementDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>2017-04-20</fpml:unadjustedDate>
</fpml:adjustableDate>
</fpmlext:settlementDate>
<fpml:settlementAmount>
<fpml:currency>RUB</fpml:currency>
<fpml:amount>119003352.32</fpml:amount>
</fpml:settlementAmount>
</fpmlext:forwardLeg>
<fpml:equity id="RU000A0JV8K5">
<fpml:instrumentId instrumentIdScheme="">RU000A0JV8K5</fpml:instrumentId>
<fpml:description>ПТК-Холдинг, ПАО ao01</fpml:description>
</fpml:equity>
</fpmlext:repo>
<fpml:documentation>
<fpml:masterAgreement>
<fpml:masterAgreementId>MA-20160628-00000001</fpml:masterAgreementId>
</fpml:masterAgreement>
</fpml:documentation>
</fpml:trade>
<fpml:party id="NFKSP">
<fpml:partyId>NFKSP</fpml:partyId>
<fpml:partyName>ООО «НФК-Сбережения»</fpml:partyName>
</fpml:party>
<fpml:party id="ITN_7718173549">
<fpml:partyId partyIdScheme="ITN">ITN_7718173549</fpml:partyId>
<fpml:partyName>ЗАО "Дельта Инвестмент"</fpml:partyName>
<fpml:country>RU</fpml:country>
<fpml:organizationType>Other</fpml:organizationType>
</fpml:party>
<fpml:party id="SPB01">
<fpml:partyId>SPB01</fpml:partyId>
<fpml:partyName>ПАО «Санкт-Петербургская биржа»</fpml:partyName>
</fpml:party>
</fpml:nonpublicExecutionReport>
</document>
</signedDocument>
<?xml version="1.0" encoding="utf-8"?>
<signedDocument xmlns="http://www.fpml.ru/repository">
<document>
<fpml:nonpublicExecutionReport 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>NFKSP-TO-SPB01-REPO-602-2016-06-28</fpml:messageId>
<fpml:sentBy>NFKSP</fpml:sentBy>
<fpml:sendTo>SPB01</fpml:sendTo>
<fpml:creationTimestamp>2016-06-28T11:00:00</fpml:creationTimestamp>
<fpml:implementationSpecification>
<fpml:version>2</fpml:version>
</fpml:implementationSpecification>
</fpml:header>
<fpml:isCorrection>false</fpml:isCorrection>
<fpml:correlationId correlationIdScheme=""
>NFKSP-TO-SPB01-REPO-602-2016-06-28</fpml:correlationId>
<fpml:trade>
<fpml:tradeHeader>
<fpml:partyTradeIdentifier>
<fpml:partyReference href="NFKSP"/>
<fpml:tradeId>604(1)-0416-ДИЛ-П/604(2)-0416-ДИЛ-П</fpml:tradeId>
</fpml:partyTradeIdentifier>
<fpml:partyTradeIdentifier>
<fpml:partyReference href="ITN_7718173549"/>
<fpml:tradeId>604(1)-0416-ДИЛ-П/604(2)-0416-ДИЛ-П</fpml:tradeId>
</fpml:partyTradeIdentifier>
<fpml:partyTradeInformation>
<fpml:partyReference href="SPB01"/>
<fpml:category categoryScheme="http://www.fpml.ru/repository/trade-settlement-type"
>OTC</fpml:category>
<fpml:category categoryScheme="http://www.fpml.ru/repository/trade-settlement-method"
>E</fpml:category>
<fpml:executionDateTime>2016-04-20T00:00:00</fpml:executionDateTime>
<fpml:reportingRegime>
<fpml:name>RussianFederation</fpml:name>
<fpml:mandatorilyClearable>false</fpml:mandatorilyClearable>
</fpml:reportingRegime>
</fpml:partyTradeInformation>
<fpml:partyTradeInformation>
<fpml:partyReference href="NFKSP"/>
<fpml:collateralizationType>Uncollateralized</fpml:collateralizationType>
</fpml:partyTradeInformation>
<fpml:partyTradeInformation>
<fpml:partyReference href="ITN_7718173549"/>
<fpml:collateralizationType>Uncollateralized</fpml:collateralizationType>
</fpml:partyTradeInformation>
</fpml:tradeHeader>
<fpmlext:repo xsi:type="rtsrep:Repo">
<fpml:productId>Equity:Repo:EquityRepo</fpml:productId>
<fpml:productId>RU000A0JV8K5</fpml:productId>
<fpmlext:fixedRateSchedule>
<fpml:initialValue>0.1025</fpml:initialValue>
</fpmlext:fixedRateSchedule>
<fpmlext:dayCountFraction>1/1</fpmlext:dayCountFraction>
<fpmlext:spotLeg xsi:type="rtsrep:RepoTransactionLeg">
<fpml:buyerPartyReference href="ITN_7718173549"/>
<fpml:sellerPartyReference href="NFKSP"/>
<fpmlext:settlementDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>2016-04-21</fpml:unadjustedDate>
</fpml:adjustableDate>
</fpmlext:settlementDate>
<fpml:settlementAmount>
<fpml:currency>RUB</fpml:currency>
<fpml:amount>119003352.32</fpml:amount>
</fpml:settlementAmount>
<fpmlext:collateral xsi:type="rtsrep:CollateralValuation">
<fpmlext:numberOfUnits>1371</fpmlext:numberOfUnits>
<fpmlext:unitPrice>
<fpml:currency>RUB</fpml:currency>
<fpml:amount>86800.40286</fpml:amount>
</fpmlext:unitPrice>
<fpmlext:assetReference href="RU000A0JV8K5"/>
</fpmlext:collateral>
<rtsrep:deliveryMethod>FreeOfPayment</rtsrep:deliveryMethod>
<rtsrep:deliveryDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>2016-04-21</fpml:unadjustedDate>
</fpml:adjustableDate>
</rtsrep:deliveryDate>
</fpmlext:spotLeg>
<fpmlext:forwardLeg xsi:type="rtsrep:ForwardRepoTransactionLeg">
<fpml:buyerPartyReference href="NFKSP"/>
<fpml:sellerPartyReference href="ITN_7718173549"/>
<fpmlext:settlementDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>2017-04-20</fpml:unadjustedDate>
</fpml:adjustableDate>
</fpmlext:settlementDate>
<fpml:settlementAmount>
<fpml:currency>RUB</fpml:currency>
<fpml:amount>119003352.32</fpml:amount>
</fpml:settlementAmount>
</fpmlext:forwardLeg>
<fpml:equity id="RU000A0JV8K5">
<fpml:instrumentId instrumentIdScheme="">RU000A0JV8K5</fpml:instrumentId>
<fpml:description>ПТК-Холдинг, ПАО ao01</fpml:description>
</fpml:equity>
</fpmlext:repo>
<fpml:documentation>
<fpml:masterAgreement>
<fpml:masterAgreementId>MA-20160628-00000001</fpml:masterAgreementId>
</fpml:masterAgreement>
</fpml:documentation>
</fpml:trade>
<fpml:party id="NFKSP">
<fpml:partyId>NFKSP</fpml:partyId>
<fpml:partyName>ООО «НФК-Сбережения»</fpml:partyName>
</fpml:party>
<fpml:party id="ITN_7718173549">
<fpml:partyId partyIdScheme="ITN">ITN_7718173549</fpml:partyId>
<fpml:partyName>ЗАО "Дельта Инвестмент"</fpml:partyName>
<fpml:country>RU</fpml:country>
<fpml:organizationType>Other</fpml:organizationType>
</fpml:party>
<fpml:party id="SPB01">
<fpml:partyId>SPB01</fpml:partyId>
<fpml:partyName>ПАО «Санкт-Петербургская биржа»</fpml:partyName>
</fpml:party>
</fpml:nonpublicExecutionReport>
</document>
</signedDocument>
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0"?>
<note
xmlns="https://www.w3schools.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.w3schools.com test_valid.xsd">
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading
<body>Don't forget me this weekend!</body>
</note>
<?xml version="1.0"?>
<note
xmlns="https://www.w3schools.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.w3schools.com test_valid.xsd">
<to>Tove</to>
<from>Jani</from>
<Heading>Reminder</Heading>
<body>Don't forget me this weekend!</body>
</note>
\ No newline at end of file
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.w3schools.com"
xmlns="https://www.w3schools.com"
elementFormDefault="qualified">
<xs:element name="note" type="Note" />
<xs:complexType name="Note">
<xs:sequence>
<xs:e name="to" type="xs:string"/>
<xs:element name="from" type="xs:string"/>
<xs:element name="heading" type="xs:string"/>
<xs:element name="body" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
<?xml version="1.0"?>
<note
xmlns="https://www.w3schools.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.w3schools.com test_valid.xsd">
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
\ No newline at end of file
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.w3schools.com"
xmlns="https://www.w3schools.com"
elementFormDefault="qualified">
<xs:element name="note" type="Note" />
<xs:complexType name="Note">
<xs:sequence>
<xs:element name="to" type="xs:string"/>
<xs:element name="from" type="xs:string"/>
<xs:element name="heading" type="xs:string"/>
<xs:element name="body" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
\ No newline at end of file
package templates
import org.scalatest._
import xmlvalid._
import scala.xml.{Node, XML}
class RepoSpec extends WordSpec {
"XMLValid for RTS example" should {
"successfully loadFile(xmlPath) with well formed and valid xml" in {
val validXml = XMLValid("src/test/resources/templates/rts/fpml-recordkeeping-merged-schema.xsd")
val xml = validXml.loadFile("src/test/resources/templates/rts/Example repo RTS.xml")
assert(xml.isInstanceOf[Node])
}
}
it should {
"throw exception in loadFile(xmlPath) with well formed but invalid xml" in {
assertThrows[Exception] {
val validXml = XMLValid("src/test/resources/templates/rts/fpml-recordkeeping-merged-schema.xsd")
val xml = validXml.loadFile("src/test/resources/templates/rts/Example repo RTS invalid.xml")
}
}
}
"XMLValid for NSD example" should {
"successfully loadFile(xmlPath) with well formed and valid xml" in {
val validXml = XMLValid("src/test/resources/templates/nsd/nsd-ext-merged-schema.xsd")
val xml = validXml.loadFile("src/test/resources/templates/nsd/Example repo NSD.xml")
assert(xml.isInstanceOf[Node])
}
}
it should {
"throw exception in loadFile(xmlPath) with well formed but invalid xml" in {
assertThrows[Exception] {
val validXml = XMLValid("src/test/resources/templates/nsd/nsd-ext-merged-schema.xsd")
val xml = validXml.loadFile("src/test/resources/templates/nsd/Example repo NSD invalid.xml")
}
}
}
"RepoTemplate" should {
"generate valid RTS output xml using valid NSD source xml" ignore {
val sourceXml: Node = XML.loadFile("src/test/resources/templates/nsd/Example repo NSD.xml")
val outputXml = new RepoTemplate(sourceXml).template
val checkedXml = XMLValid("src/test/resources/templates/rts/fpml-recordkeeping-merged-schema.xsd").loadString(outputXml.mkString)
assert(checkedXml.isInstanceOf[Node])
}
}
}
package xmlvalid
import org.scalatest._
import scala.xml.{Node, SAXParser}
class XMLValidSpec extends WordSpec {
"XMLValid" can {
"envoke parser:SAXParser if schema is valid" in {
val validXml = XMLValid("src/test/resources/xmlvalid/test_valid.xsd")
assert(validXml.parser.isInstanceOf[SAXParser])
}
}
it should {
"successfully loadFile(xmlPath) with well formed and valid xml" in {
val validXml = XMLValid("src/test/resources/xmlvalid/test_valid.xsd")
val xml = validXml.loadFile("src/test/resources/xmlvalid/test_valid.xml")
assert(xml.isInstanceOf[Node])
}
}
it should {
"throw exception with nonexisting schema" in {
assertThrows[Exception] {
val validXml = XMLValid("src/test/resources/xmlvalid/test_foo.xsd")
}
}
}
it should {
"throw exception with invalid schema" in {
assertThrows[Exception] {
val validXml = XMLValid("src/test/resources/xmlvalid/test_invalid.xsd")
}
}
}
it should {
"throw exception in loadFile(xmlPath) with nonexisting xml" in {
assertThrows[Exception] {
val validXml = XMLValid("src/test/resources/xmlvalid/test_valid.xsd")
val xml = validXml.loadFile("src/test/resources/xmlvalid/test_foo.xml")
}
}
}
it should {
"throw exception in loadFile(xmlPath) with well formed but invalid xml" in {
assertThrows[Exception] {
val validXml = XMLValid("src/test/resources/xmlvalid/test.xsd")
val xml = validXml.loadFile("src/test/resources/xmlvalid/test_invalid.xml")
}
}
}
it should {
"throw exception with error xml" in {
assertThrows[Exception] {
val validXml = XMLValid("src/test/resources/xmlvalid/test.xsd")
val xml = validXml.loadFile("src/test/resources/xmlvalid/test_error.xml")
}
}
}
}
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