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
40caf52c
Commit
40caf52c
authored
Dec 04, 2018
by
Amelin Konstantin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Complete all templates with identifier dictionary.
parent
8dbcd1c2
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
65 additions
and
41 deletions
+65
-41
src/main/scala/templates/BondBasketOptionTemplate.scala
+6
-4
src/main/scala/templates/BondOptionTemplate.scala
+6
-4
src/main/scala/templates/CommodityForwardTemplate.scala
+9
-6
src/main/scala/templates/CommodityOptionTemplate.scala
+6
-4
src/main/scala/templates/CommoditySwapTemplate.scala
+3
-2
src/main/scala/templates/EquityForwardTemplate.scala
+3
-2
src/main/scala/templates/EquityOptionTemplate.scala
+6
-4
src/main/scala/templates/FairValueReportTemplate.scala
+3
-2
src/main/scala/templates/MasterAgreementTemplate.scala
+6
-3
src/main/scala/templates/PartyTemplate.scala
+5
-4
src/main/scala/templates/RegiAmendTermMasterAgreementTemplate.scala
+3
-2
src/main/scala/templates/RepoTemplate.scala
+6
-4
src/main/scala/templates/TradeTemplate.scala
+3
-0
No files found.
src/main/scala/templates/BondBasketOptionTemplate.scala
View file @
40caf52c
...
...
@@ -7,12 +7,14 @@ class BondBasketOptionTemplate(source: Node) extends TradeTemplate(source) {
<
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"
)
}/>
{
/*
Uses
dictionary
from
PartyTemplate
for
identifier
*/
}
<fpml:buyerPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"bondBasketOption"
\
"buyerPartyReference"
,
"href"
).
mkString
).
_1
}/>
<
fpml
:
sellerPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"bondBasketOption"
\
"sellerPartyReference"
,
"href"
).
mkString
).
_1
}/>
<
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"
)
}/>
{
/*
Uses
dictionary
from
PartyTemplate
for
identifier
*/
}
<fpml:payerPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"bondBasketOption"
\
"premium"
\
"payerPartyReference"
,
"href"
).
mkString
).
_1
}/>
<
fpml
:
receiverPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"bondBasketOption"
\
"premium"
\
"receiverPartyReference"
,
"href"
).
mkString
).
_1
}/>
<
fpml
:
paymentAmount>
<fpml:currency>
{
get
(
source
\\
"
trade
"
\
"
bondBasketOption
"
\
"
premium
"
\\
"
currency
"
)
}
</fpml:currency>
<fpml:amount>
{
get
(
source
\\
"
trade
"
\
"
bondBasketOption
"
\
"
premium
"
\\
"
amount
"
)
}
</fpml:amount>
...
...
src/main/scala/templates/BondOptionTemplate.scala
View file @
40caf52c
...
...
@@ -7,12 +7,14 @@ class BondOptionTemplate(source: Node) extends TradeTemplate(source) {
<
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"
)
}/>
{
/*
Uses
dictionary
from
PartyTemplate
for
identifier
*/
}
<fpml:buyerPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"bondOption"
\
"buyerPartyReference"
,
"href"
).
mkString
).
_1
}/>
<
fpml
:
sellerPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"bondOption"
\
"sellerPartyReference"
,
"href"
).
mkString
).
_1
}/>
<
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"
)
}/>
{
/*
Uses
dictionary
from
PartyTemplate
for
identifier
*/
}
<fpml:payerPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"bondOption"
\
"premium"
\
"payerPartyReference"
,
"href"
).
mkString
).
_1
}/>
<
fpml
:
receiverPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"bondOption"
\
"premium"
\
"receiverPartyReference"
,
"href"
).
mkString
).
_1
}/>
<
fpml
:
paymentAmount>
<fpml:currency>
{
get
(
source
\\
"
trade
"
\
"
bondOption
"
\
"
premium
"
\\
"
currency
"
)
}
</fpml:currency>
<fpml:amount>
{
get
(
source
\\
"
trade
"
\
"
bondOption
"
\
"
premium
"
\\
"
amount
"
)
}
</fpml:amount>
...
...
src/main/scala/templates/CommodityForwardTemplate.scala
View file @
40caf52c
...
...
@@ -14,8 +14,9 @@ class CommodityForwardTemplate(source: Node) extends TradeTemplate(source) {
</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"
)
}/>
{
/*
Uses
dictionary
from
PartyTemplate
for
identifier
*/
}
<fpml:payerPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"commodityForward"
\
"fixedLeg"
\
"payerPartyReference"
,
"href"
).
mkString
).
_1
}/>
<
fpml
:
receiverPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"commodityForward"
\
"fixedLeg"
\
"receiverPartyReference"
,
"href"
).
mkString
).
_1
}/>
<
fpml
:
fixedPrice>
<fpml:price>
{
get
(
source
\\
"
trade
"
\
"
commodityForward
"
\
"
fixedLeg
"
\
"
fixedPrice
"
\
"
price
"
)
}
</fpml:price>
<fpml:priceCurrency>
{
get
(
source
\\
"
trade
"
\
"
commodityForward
"
\
"
fixedLeg
"
\
"
fixedPrice
"
\
"
priceCurrency
"
)
}
</fpml:priceCurrency>
...
...
@@ -32,8 +33,9 @@ class CommodityForwardTemplate(source: Node) extends TradeTemplate(source) {
</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"
)
}/>
{
/*
Uses
dictionary
from
PartyTemplate
for
identifier
*/
}
<fpml:payerPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"commodityForward"
\
"commodityForwardPhysicalLeg"
\
"payerPartyReference"
,
"href"
).
mkString
).
_1
}/>
<
fpml
:
receiverPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"commodityForward"
\
"commodityForwardPhysicalLeg"
\
"receiverPartyReference"
,
"href"
).
mkString
).
_1
}/>
<
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>
...
...
@@ -51,8 +53,9 @@ class CommodityForwardTemplate(source: Node) extends TradeTemplate(source) {
</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"
)
}/>
{
/*
Uses
dictionary
from
PartyTemplate
for
identifier
*/
}
<fpml:payerPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"commodityForward"
\
"floatingForwardLeg"
\
"payerPartyReference"
,
"href"
).
mkString
).
_1
}/>
<
fpml
:
receiverPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"commodityForward"
\
"floatingForwardLeg"
\
"receiverPartyReference"
,
"href"
).
mkString
).
_1
}/>
<
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>
...
...
src/main/scala/templates/CommodityOptionTemplate.scala
View file @
40caf52c
...
...
@@ -8,8 +8,9 @@ class CommodityOptionTemplate(source: Node) extends TradeTemplate(source) {
{
/*
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"
)
}/>
{
/*
Uses
dictionary
from
PartyTemplate
for
identifier
*/
}
<fpml:buyerPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"commodityOption"
\
"buyerPartyReference"
,
"href"
).
mkString
).
_1
}/>
<
fpml
:
sellerPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"commodityOption"
\
"sellerPartyReference"
,
"href"
).
mkString
).
_1
}/>
{
/* 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>
...
...
@@ -72,8 +73,9 @@ class CommodityOptionTemplate(source: Node) extends TradeTemplate(source) {
<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"
)
}/>
{
/*
Uses
dictionary
from
PartyTemplate
for
identifier
*/
}
<fpml:payerPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"commodityOption"
\
"premium"
\
"payerPartyReference"
,
"href"
).
mkString
).
_1
}/>
<
fpml
:
receiverPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"commodityOption"
\
"premium"
\
"receiverPartyReference"
,
"href"
).
mkString
).
_1
}/>
<
fpml
:
paymentAmount>
<fpml:currency>
{
get
(
source
\\
"
trade
"
\
"
commodityOption
"
\
"
premium
"
\\
"
currency
"
)
}
</fpml:currency>
<fpml:amount>
{
get
(
source
\\
"
trade
"
\
"
commodityOption
"
\
"
premium
"
\\
"
amount
"
)
}
</fpml:amount>
...
...
src/main/scala/templates/CommoditySwapTemplate.scala
View file @
40caf52c
...
...
@@ -20,8 +20,9 @@ class CommoditySwapTemplate(source: Node) extends TradeTemplate(source) {
<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"
)}/>
{
/*
Uses
dictionary
from
PartyTemplate
for
identifier
*/
}
<fpml:payerPartyReference
href
={
parties
(
get
(
s
\
"
payerPartyReference
"
,
"
href
"
)
.mkString
)
.
_
1
}
/>
<fpml:receiverPartyReference
href
={
parties
(
get
(
s
\
"receiverPartyReference"
,
"href"
).
mkString
).
_1
}/>
<
fpml
:
calculationDates>
<fpml:unadjustedDate>
{
get
(
s
\
"
calculationDates
"
\
"
unadjustedDate
"
)
}
</fpml:unadjustedDate>
</fpml:calculationDates>
...
...
src/main/scala/templates/EquityForwardTemplate.scala
View file @
40caf52c
...
...
@@ -7,8 +7,9 @@ class EquityForwardTemplate(source: Node) extends TradeTemplate(source) {
<
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"
)
}/>
{
/*
Uses
dictionary
from
PartyTemplate
for
identifier
*/
}
<fpml:buyerPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"equityForward"
\
"buyerPartyReference"
,
"href"
).
mkString
).
_1
}/>
<
fpml
:
sellerPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"equityForward"
\
"sellerPartyReference"
,
"href"
).
mkString
).
_1
}/>
<
fpml
:
optionType>
{
"
Forward
"
}
</fpml:optionType>
<fpml:underlyer>
<fpml:basket>
...
...
src/main/scala/templates/EquityOptionTemplate.scala
View file @
40caf52c
...
...
@@ -7,8 +7,9 @@ class EquityOptionTemplate(source: Node) extends TradeTemplate(source) {
<
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"
)
}/>
{
/*
Uses
dictionary
from
PartyTemplate
for
identifier
*/
}
<fpml:buyerPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"equityOption"
\
"buyerPartyReference"
,
"href"
).
mkString
).
_1
}/>
<
fpml
:
sellerPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"equityOption"
\
"sellerPartyReference"
,
"href"
).
mkString
).
_1
}/>
<
fpml
:
optionType>
{
get
(
source
\\
"
trade
"
\
"
equityOption
"
\
"
optionType
"
)
}
</fpml:optionType>
<fpml:underlyer>
<fpml:singleUnderlyer>
...
...
@@ -62,8 +63,9 @@ class EquityOptionTemplate(source: Node) extends TradeTemplate(source) {
<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"
)
}/>
{
/*
Uses
dictionary
from
PartyTemplate
for
identifier
*/
}
<fpml:payerPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"equityOption"
\
"equityPremium"
\
"payerPartyReference"
,
"href"
).
mkString
).
_1
}/>
<
fpml
:
receiverPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"equityOption"
\
"equityPremium"
\
"receiverPartyReference"
,
"href"
).
mkString
).
_1
}/>
<
fpml
:
paymentAmount>
<fpml:currency>
{
get
(
source
\\
"
trade
"
\
"
equityOption
"
\
"
equityPremium
"
\\
"
currency
"
)
}
</fpml:currency>
<fpml:amount>
{
get
(
source
\\
"
trade
"
\
"
equityOption
"
\
"
equityPremium
"
\\
"
amount
"
)
}
</fpml:amount>
...
...
src/main/scala/templates/FairValueReportTemplate.scala
View file @
40caf52c
...
...
@@ -29,11 +29,12 @@ class FairValueReportTemplate(source: Node) extends PartyTemplate(source) {
</rtsrep:fairValue>
<rtsrep:valuationDate>
{
get
(
source
\
"
markToMarketValuation
"
\
"
markToMarketDetails
"
\
"
valuationDateTime
"
)
}
</rtsrep:valuationDate>
</rtsrep:fairValueReport>
{
/*
Uses
dictionary
from
PartyTemplate
for
identifier
*/
}
{
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
:
party
id
={
parties
(
id
).
_1
}>
<
fpml
:
partyId
partyIdScheme
={
parties
(
id
).
_2
}>{
parties
(
id
).
_1
}</
fpml
:
partyId>
<fpml:partyName>
{
get
(
s
\
"
partyName
"
)
}
</fpml:partyName>
<fpml:country>
{
get
(
s
\
"
country
"
)
}
</fpml:country>
<fpml:organizationType>
{
get
(
s
\
"
classification
"
)
}
</fpml:organizationType>
...
...
src/main/scala/templates/MasterAgreementTemplate.scala
View file @
40caf52c
...
...
@@ -23,16 +23,19 @@ class MasterAgreementTemplate(source: Node) extends RegiAmendTermMasterAgreement
<rtsrep:masterAgreementDate>
{
get
(
source
\\
"
trade
"
\
"
tradeHeader
"
\
"
tradeDate
"
)
}
</rtsrep:masterAgreementDate>
</rtsrep:masterAgreement>
<rtsrep:masterAgreementParty>
<rtsrep:masterAgreementPartyReference
href
={
get
(
rp
\
"partyReference"
,
"href"
)
}/>
{
/*
Uses
dictionary
from
PartyTemplate
for
identifier
*/
}
<rtsrep:masterAgreementPartyReference
href
={
parties
(
get
(
rp
\
"partyReference"
,
"href"
).
mkString
).
_1
}/>
<
rtsrep
:
masterAgreementId>
{
get
(
utip
\
"
tradeId
"
)
}
</rtsrep:masterAgreementId>
<rtsrep:reportingParty>
<rtsrep:reportingPartyReference
href
={
get
(
rp
\
"partyReference"
,
"href"
)
}/>
{
/*
Uses
dictionary
from
PartyTemplate
for
identifier
*/
}
<rtsrep:reportingPartyReference
href
={
parties
(
get
(
rp
\
"partyReference"
,
"href"
).
mkString
).
_1
}/>
{
/* 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"
)
}/>
{
/*
Uses
dictionary
from
PartyTemplate
for
identifier
*/
}
<rtsrep:partyReference
href
={
parties
(
get
(
nrp
\
"partyReference"
,
"href"
).
mkString
).
_1
}/>
</
rtsrep
:
nonreportingParty>
<rtsrep:partyRelatedType>
{
get
(
source
\\
"
trade
"
\
"
masterAgreementTerms
"
\
"
partiesAreAffiliated
"
)
}
</rtsrep:partyRelatedType>
<rtsrep:attachment>
...
...
src/main/scala/templates/PartyTemplate.scala
View file @
40caf52c
package
templates
import
scala.util.
{
Failure
,
Success
,
Try
}
import
scala.xml.Node
abstract
class
PartyTemplate
(
source
:
Node
)
extends
Template
(
source
)
{
var
c
=
0
protected
[
this
]
val
parties
=
{
val
p1
=
for
{
s
<-
source
\
"party"
...
...
@@ -13,7 +15,7 @@ abstract class PartyTemplate(source: Node) extends Template(source) {
if
(
partyId0
!=
"NONREF"
)
id
->
(
partyId0
,
msgNotFound
)
else
{
val
partyId1
=
get
(
s
\
"partyId"
,
null
,
1
).
mkString
.
filterNot
(
_
.
isWhitespace
)
val
partyId1
=
get
(
s
\
"partyId"
,
null
,
1
).
mkString
.
filterNot
(
_
.
isWhitespace
)
.
replace
(
"INN"
,
"ITN"
)
id
->
(
partyId1
,
partyId1
.
split
(
'_')
.
head
)
}
...
...
@@ -23,12 +25,11 @@ abstract class PartyTemplate(source: Node) extends Template(source) {
for
{
s
<-
source
\\
"trade"
\
"nsdSpecificTradeFields"
\
"clientDetails"
id
=
get
(
s
\
"id"
).
mkString
if
id
!=
msgNotFound
}
yield
{
val
partyId
=
id
.
filterNot
(
_
.
isWhitespace
)
val
partyId
=
id
.
filterNot
(
_
.
isWhitespace
)
.
replace
(
"INN"
,
"ITN"
)
id
->
(
partyId
,
partyId
.
split
(
'_')
.
head
)
}
(
p1
++
p2
).
toMap
(
p1
++
p2
).
toMap
.
withDefaultValue
((
msgNotFound
,
msgNotFound
))
}
println
(
parties
)
}
src/main/scala/templates/RegiAmendTermMasterAgreementTemplate.scala
View file @
40caf52c
...
...
@@ -37,11 +37,12 @@ abstract class RegiAmendTermMasterAgreementTemplate(source: Node) extends PartyT
<fpml:effectiveDate>
{
get
(
source
\
"
amendment
"
\
"
effectiveDate
"
)
}
</fpml:effectiveDate>
</rtsrep:amendmentMasterAgreement>
}
{
/* Uses dictionary from PartyTemplate for identifier */
}
{
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
:
party
id
={
parties
(
id
).
_1
}>
<
fpml
:
partyId
partyIdScheme
={
parties
(
id
).
_2
}>{
parties
(
id
).
_1
}</
fpml
:
partyId>
<fpml:partyName>
{
get
(
s
\
"
partyName
"
)
}
</fpml:partyName>
<fpml:country>
{
get
(
s
\
"
country
"
)
}
</fpml:country>
<fpml:organizationType>
{
get
(
s
\
"
classification
"
)
}
</fpml:organizationType>
...
...
src/main/scala/templates/RepoTemplate.scala
View file @
40caf52c
...
...
@@ -27,8 +27,9 @@ class RepoTemplate(source: Node) extends TradeTemplate(source) {
</fpmlext:floatingRateCalculation>
<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"
)
}
/>
{
/* Uses dictionary from PartyTemplate for identifier */
}
<
fpml
:
buyerPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"repo"
\
"spotLeg"
\
"buyerPartyReference"
,
"href"
).
mkString
).
_1
}
/>
<
fpml
:
sellerPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"repo"
\
"spotLeg"
\
"sellerPartyReference"
,
"href"
).
mkString
).
_1
}
/>
<
fpmlext
:
settlementDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>
{
get
(
source
\\
"
trade
"
\
"
repo
"
\
"
spotLeg
"
\\
"
unadjustedDate
"
)
}
</fpml:unadjustedDate>
...
...
@@ -57,8 +58,9 @@ class RepoTemplate(source: Node) extends TradeTemplate(source) {
</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"
)
}
/>
{
/* Uses dictionary from PartyTemplate for identifier */
}
<
fpml
:
buyerPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"repo"
\
"forwardLeg"
\
"buyerPartyReference"
,
"href"
).
mkString
).
_1
}
/>
<
fpml
:
sellerPartyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"repo"
\
"forwardLeg"
\
"sellerPartyReference"
,
"href"
).
mkString
).
_1
}
/>
<
fpmlext
:
settlementDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>
{
get
(
source
\\
"
trade
"
\
"
repo
"
\
"
forwardLeg
"
\
"
settlementDate
"
\\
"
unadjustedDate
"
)
}
</fpml:unadjustedDate>
...
...
src/main/scala/templates/TradeTemplate.scala
View file @
40caf52c
...
...
@@ -19,8 +19,10 @@ abstract class TradeTemplate(source: Node) extends RegiAmendTradeTemplate(source
}
}
<
fpml
:
partyTradeInformation>
{
/*
Uses
dictionary
from
PartyTemplate
for
identifier
*/
}
<fpml:partyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"tradeHeader"
\
"partyTradeInformation"
\
"partyReference"
,
"href"
).
mkString
).
_1
}/>
<
fpml
:
relatedParty>
{
/*
Uses
dictionary
from
PartyTemplate
for
identifier
*/
}
<fpml:partyReference
href
={
parties
(
get
(
source
\\
"trade"
\
"tradeHeader"
\
"partyTradeInformation"
\
"partyReference"
,
"href"
).
mkString
).
_1
}
/>
<
fpml
:
role>ClearingOrganization</fpml:role>
</fpml:relatedParty>
...
...
@@ -35,6 +37,7 @@ abstract class TradeTemplate(source: Node) extends RegiAmendTradeTemplate(source
</fpml:partyTradeInformation>
{
for
(
s
<-
source
\\
"
trade
"
\
"
nsdSpecificTradeFields
"
\
"
clientDetails
"
)
yield
{
<fpml:partyTradeInformation>
{
/*
Uses
dictionary
from
PartyTemplate
for
identifier
*/
}
<fpml:partyReference
href
={
parties
(
get
(
s
\
"
servicingParty
"
,
"
href
"
)
.mkString
)
.
_
1
}
/>
{
val
id
=
get
(
s
\
"
id
"
)
.mkString
if
(
id
!=
msgNotFound
)
...
...
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