Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SPB_Exchange_Repo
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Amelin Konstantin
SPB_Exchange_Repo
Commits
664c7156
Commit
664c7156
authored
Nov 02, 2018
by
Amelin Konstantin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Complete MasterAgreementTemplate
parent
96929bd4
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
398 additions
and
9 deletions
+398
-9
input/Master Agreement_Amend NSD.xml
+209
-0
input/Master Agreement_Term NSD.xml
+126
-0
src/main/scala/Main.scala
+9
-4
src/main/scala/templates/MasterAgreementTemplate.scala
+37
-2
src/main/scala/templates/RegiAmendTermMasterAgreementTemplate.scala
+17
-3
No files found.
input/Master Agreement_Amend NSD.xml
0 → 100644
View file @
664c7156
<?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>
<!--Общая информация о генсоглашении/договоре.-->
<!--Trade/Master agreement general information.-->
<tradeHeader>
<!--Регистрационный номер, присвоенный участником-->
<!--Party's identifiers-->
<partyTradeIdentifier>
<!--Участник.-->
<!--Party.-->
<partyReference
href=
"TradeRepository"
/>
<!--Регистрационный номер-->
<!--Trade/Master agreement/Report identifier-->
<tradeId>
NONREF
</tradeId>
</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>
<!--Условия генерального соглашения.-->
<!--Master Agreement Terms.-->
<nsdext:masterAgreementTerms>
<!--Тип генерального соглашения.-->
<!--Master Agreement Type.-->
<nsdext:masterAgreementType
masterAgreementTypeScheme=
"http://www.fpml.org/coding-scheme/master-agreement-type"
>
RusDeriv
</nsdext:masterAgreementType>
<!--Версия формы генерального соглашения.-->
<!--The version of the master agreement form.-->
<nsdext:masterAgreementVersion
masterAgreementVersionScheme=
"http://www.fpml.org/coding-scheme/master-agreement-version"
>
RusDeriv2011
</nsdext:masterAgreementVersion>
<!--Способ подтверждения сделки-->
<!--Contract details matching method-->
<nsdext:confirmationMethod>
MATH
</nsdext:confirmationMethod>
<!--Признак связанности стороны 1 и стороны 2-->
<!--Parties are affiliated-->
<nsdext:partiesAreAffiliated>
N
</nsdext:partiesAreAffiliated>
</nsdext:masterAgreementTerms>
</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>
input/Master Agreement_Term NSD.xml
0 → 100644
View file @
664c7156
<?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>
<nsdext:masterAgreementTermination>
<!--Регистрационный номер генерального соглашения-->
<!--Master agreement number is assigned by repository at registration.-->
<nsdext:masterAgreementId>
MA0123456789
</nsdext:masterAgreementId>
<!--Причина прекращения генерального соглашения.-->
<!--Master agreement terminating reason.-->
<nsdext:maTerminatingReason>
Close
</nsdext:maTerminatingReason>
</nsdext:masterAgreementTermination>
<!--Участники Анкеты-->
<!--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>
src/main/scala/Main.scala
View file @
664c7156
...
...
@@ -37,13 +37,18 @@ object Main {
if
(
debugMode
)
new
CommodityForwardTemplate
(
source
)
with
Logger
else
new
CommodityForwardTemplate
(
source
)
case
Success
(
v
)
if
v
==
"commoditySwap"
=>
if
(
debugMode
)
new
CommoditySwapTemplate
(
source
)
with
Logger
else
new
CommoditySwapTemplate
(
source
)
case
Success
(
v
)
if
v
==
"masterAgreementTerms"
=>
if
(
debugMode
)
new
MasterAgreementTemplate
(
source
)
with
Logger
else
new
MasterAgreementTemplate
(
source
)
case
Failure
(
_
)
=>
case
_
=>
Try
{
(
source
\\
"markToMarketValuation"
).
head
}
match
{
case
Success
(
_
)
=>
if
(
debugMode
)
new
FairValueReportTemplate
(
source
)
with
Logger
else
new
FairValueReportTemplate
(
source
)
case
Failure
(
_
)
=>
throw
new
Exception
(
"Undefined trade type"
)
case
_
=>
Try
{
(
source
\\
"masterAgreementTerms"
).
head
}
match
{
case
Success
(
_
)
=>
if
(
debugMode
)
new
MasterAgreementTemplate
(
source
)
with
Logger
else
new
MasterAgreementTemplate
(
source
)
case
_
=>
Try
{
(
source
\\
"masterAgreementTermination"
).
head
}
match
{
case
Success
(
_
)
=>
if
(
debugMode
)
new
MasterAgreementTemplate
(
source
)
with
Logger
else
new
MasterAgreementTemplate
(
source
)
case
_
=>
throw
new
Exception
(
"Undefined trade type"
)
}
}
}
}
}
...
...
src/main/scala/templates/MasterAgreementTemplate.scala
View file @
664c7156
package
templates
import
scala.xml.
Node
import
scala.xml.
{
Node
,
NodeSeq
}
class
MasterAgreementTemplate
(
source
:
Node
)
extends
RegiAmendTermMasterAgreementTemplate
(
source
)
{
protected
[
this
]
def
templateMATerms
:
Node
=
???
protected
[
this
]
def
templateMATerms
:
NodeSeq
=
{
val
utip
=
(
source
\\
"trade"
\
"tradeHeader"
\
"partyTradeIdentifier"
)
.
filter
(
_
.
child
.
filter
(
_
.
attributes
.
nonEmpty
).
head
.
attributes
(
"href"
).
text
.
mkString
==
"UTIGeneratingParty"
)
val
rp
=
(
source
\\
"trade"
\
"tradeHeader"
\
"partyTradeIdentifier"
)
.
filter
(
_
.
child
.
filter
(
_
.
attributes
.
nonEmpty
).
head
.
attributes
(
"href"
).
text
.
mkString
==
"Party1"
)
val
nrp
=
(
source
\\
"trade"
\
"tradeHeader"
\
"partyTradeIdentifier"
)
.
filter
(
_
.
child
.
filter
(
_
.
attributes
.
nonEmpty
).
head
.
attributes
(
"href"
).
text
.
mkString
==
"Party2"
)
<
rtsrep
:
masterAgreement>
<rtsrep:masterAgreementId>
{
"
NONREF
"
}
</rtsrep:masterAgreementId>
<rtsrep:masterAgreementType>
{
get
(
source
\\
"
trade
"
\
"
masterAgreementTerms
"
\
"
masterAgreementType
"
)
}
</rtsrep:masterAgreementType>
<rtsrep:masterAgreementVersion>
{
get
(
source
\\
"
trade
"
\
"
masterAgreementTerms
"
\
"
masterAgreementVersion
"
)
}
</rtsrep:masterAgreementVersion>
{
/*
masterAgreementDate
isn`t
present
in
the
source
*/
}
<rtsrep:masterAgreementDate>
{
get
(
source
\\
"
trade
"
\
"
tradeHeader
"
\
"
tradeDate
"
)
}
</rtsrep:masterAgreementDate>
</rtsrep:masterAgreement>
<rtsrep:masterAgreementParty>
<rtsrep:masterAgreementPartyReference
href
={
get
(
rp
\
"partyReference"
,
"href"
)
}/>
<
rtsrep
:
masterAgreementId>
{
get
(
utip
\
"
tradeId
"
)
}
</rtsrep:masterAgreementId>
<rtsrep:reportingParty>
<rtsrep:reportingPartyReference
href
={
get
(
rp
\
"partyReference"
,
"href"
)
}/>
{
/* productType isn`t present in the source */
}
<
rtsrep
:
productType>
{
"
All
"
}
</rtsrep:productType>
</rtsrep:reportingParty>
</rtsrep:masterAgreementParty>
<rtsrep:nonreportingParty>
<rtsrep:partyReference
href
={
get
(
nrp
\
"partyReference"
,
"href"
)
}/>
</
rtsrep
:
nonreportingParty>
<rtsrep:partyRelatedType>
{
get
(
source
\\
"
trade
"
\
"
masterAgreementTerms
"
\
"
partiesAreAffiliated
"
)
}
</rtsrep:partyRelatedType>
++
<rtsrep:attachment>
<fpml:name></fpml:name>
</rtsrep:attachment>
}
def
isStraight
=
true
}
src/main/scala/templates/RegiAmendTermMasterAgreementTemplate.scala
View file @
664c7156
package
templates
import
scala.xml.
Node
import
scala.xml.
{
Node
,
NodeSeq
}
abstract
class
RegiAmendTermMasterAgreementTemplate
(
source
:
Node
)
extends
Template
(
source
)
{
protected
[
this
]
def
templateMATerms
:
Node
protected
[
this
]
def
templateMATerms
:
Node
Seq
def
template
:
Node
=
{
<
rtsrep
:
masterAgreementRegistration
xmlns:fpml
=
"http://www.fpml.org/FpML-5/recordkeeping"
...
...
@@ -20,9 +20,23 @@ abstract class RegiAmendTermMasterAgreementTemplate(source: Node) extends Templa
</fpml:header>
<fpml:isCorrection>
{
get
(
source
\
"
isCorrection
"
)
}
</fpml:isCorrection>
<fpml:correlationId
correlationIdScheme
=
""
>{
get
(
source
\
"correlationId"
)
}</
fpml
:
correlationId>
{
if
((
source
\
"
masterAgreementTermination
"
)
.nonEmpty
)
<rtsrep:terminationMasterAgreement>
<rtsrep:masterAgreementId>
{
get
(
source
\
"
masterAgreementTermination
"
\
"
masterAgreementId
"
)
}
</rtsrep:masterAgreementId>
<rtsrep:terminationDate>
{
get
(
source
\
"
masterAgreementTermination
"
\
"
terminationDate
"
)
}
</rtsrep:terminationDate>
<rtsrep:reason>
{
get
(
source
\
"
masterAgreementTermination
"
\
"
maTerminatingReason
"
)
}
</rtsrep:reason>
</rtsrep:terminationMasterAgreement>
else
if
((
source
\
"
amendment
"
)
.isEmpty
)
<rtsrep:registrationMasterAgreement>
{
templateMATerms
}
</rtsrep:registrationMasterAgreement>
else
<rtsrep:amendmentMasterAgreement>
{
templateMATerms
}
<fpml:agreementDate>
{
get
(
source
\
"
amendment
"
\
"
agreementDate
"
)
}
</fpml:agreementDate>
<fpml:effectiveDate>
{
get
(
source
\
"
amendment
"
\
"
effectiveDate
"
)
}
</fpml:effectiveDate>
</rtsrep:amendmentMasterAgreement>
}
{
for
{
s
<-
source
\
"party"
id
=
get
(
s
,
"id"
).
mkString
if
id
!=
"Sender"
&&
id
!=
"UTIGeneratingParty"
}
yield
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment