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
51cbf3d6
Commit
51cbf3d6
authored
Feb 22, 2020
by
Amelin Konstantin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix TradeTemplate. partyTradeInformation -> Clients (one to many)
parent
c5d4c356
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
49 deletions
+51
-49
src/main/scala/templates/TradeTemplate.scala
+51
-49
No files found.
src/main/scala/templates/TradeTemplate.scala
View file @
51cbf3d6
...
@@ -41,58 +41,60 @@ abstract class TradeTemplate(source: Node) extends RegiAmendTradeTemplate(source
...
@@ -41,58 +41,60 @@ abstract class TradeTemplate(source: Node) extends RegiAmendTradeTemplate(source
<fpml:mandatorilyClearable>
{
if
(
get
(
source
\\
"
trade
"
\
"
nsdSpecificTradeFields
"
\
"
cleared
"
)
.mkString.contains
(
"
Y
"
))
"
true
"
else
msgNotFound
}
</fpml:mandatorilyClearable>
<fpml:mandatorilyClearable>
{
if
(
get
(
source
\\
"
trade
"
\
"
nsdSpecificTradeFields
"
\
"
cleared
"
)
.mkString.contains
(
"
Y
"
))
"
true
"
else
msgNotFound
}
</fpml:mandatorilyClearable>
</fpml:reportingRegime>
</fpml:reportingRegime>
</fpml:partyTradeInformation>
</fpml:partyTradeInformation>
{
for
(
s
<-
source
\\
"
trade
"
\
"
nsdSpecificTradeFields
"
\
"
clientDetails
"
)
yield
{
{
/*
Uses
dictionary
from
PartyTemplate
for
identifier
*/
for
(
p
<-
parties.filterKeys
(
_
.startsWith
(
"
Party
"
)))
yield
<fpml:partyTradeInformation>
<fpml:partyTradeInformation>
{
/*
Uses
dictionary
from
PartyTemplate
for
identifier
*/
}
<fpml:partyReference
href
={
p
.
_2
.
_1
}
/>
<fpml:partyReference
href
={
parties
(
get
(
s
\
"
servicingParty
"
,
"
href
"
)
.mkString
)
.
_
1
}
/>
{
for
{
s
<-
source
\\
"trade"
\
"nsdSpecificTradeFields"
\
"clientDetails"
{
val
id
=
get
(
s
\
"
id
"
)
.mkString
if
parties
(
get
(
s
\
"servicingParty"
,
"href"
).
mkString
).
_1
==
p
.
_2
.
_1
if
(
id
!=
msgNotFound
)
id
=
get
(
s
\
"id"
).
mkString
<
fpml
:
relatedParty>
if
id
!=
msgNotFound
}
yield
{
<fpml:partyReference
href
={
parties
(
id
).
_1
}
/>
<
fpml
:
relatedParty>
<
fpml
:
role>
{
"
Client
"
}
</fpml:role>
<fpml:partyReference
href
={
parties
(
id
).
_1
}
/>
<fpml:
type
>
{
get
(
s
\
"
type
"
)
}
</fpml:
type
>
<
fpml
:
role>
{
"
Client
"
}
</fpml:role>
</fpml:relatedParty>
<fpml:
type
>
{
get
(
s
\
"
type
"
)
}
</fpml:
type
>
}
</fpml:relatedParty>
<
fpml
:
timestamps>
}
<fpml:timestamp>
<fpml:
type
>
{
if
(
get
(
source
\\
"
trade
"
\
"
nsdSpecificTradeFields
"
\
"
clearedDate
"
)
.mkString
!=
msgNotFound
)
"
InClearingPool
"
else
msgNotFound
}
</fpml:
type
>
{
/*
value
isn`t
present
in
the
source
*/
}
<fpml:value>
{
val
d
=
get
(
source
\\
"
trade
"
\
"
nsdSpecificTradeFields
"
\
"
clearedDate
"
)
if
(
d.mkString
!=
msgNotFound
)
d
+
"
T00:
00
:
00"
else
msgNotFound
}</
fpml
:
value>
</fpml:timestamp>
<fpml:timestamp>
<fpml:
type
>
{
if
(
get
(
source
\\
"
trade
"
\
"
nsdSpecificTradeFields
"
\
"
startAgreementDate
"
)
.mkString
!=
msgNotFound
)
"
InPortfolio
"
else
msgNotFound
}
</fpml:
type
>
{
/*
value
isn`t
present
in
the
source
*/
}
<fpml:value>
{
val
d
=
get
(
source
\\
"
trade
"
\
"
nsdSpecificTradeFields
"
\
"
startAgreementDate
"
)
if
(
d.mkString
!=
msgNotFound
)
d
+
"
T00:
00
:
00"
else
msgNotFound
}</
fpml
:
value>
</fpml:timestamp>
<fpml:timestamp>
<fpml:
type
>
{
if
(
get
(
source
\\
"
trade
"
\
"
nsdSpecificTradeFields
"
\
"
endAgreementDate
"
)
.mkString
!=
msgNotFound
)
"
OutPortfolio
"
else
msgNotFound
}
</fpml:
type
>
{
/*
value
isn`t
present
in
the
source
*/
}
<fpml:value>
{
val
d
=
get
(
source
\\
"
trade
"
\
"
nsdSpecificTradeFields
"
\
"
endAgreementDate
"
)
if
(
d.mkString
!=
msgNotFound
)
d
+
"
T00:
00
:
00"
else
msgNotFound
}</
fpml
:
value>
</fpml:timestamp>
</fpml:timestamps>
{
/*
value
isn`t
present
in
the
source
*/
}
<fpml:collateralizationType>
{
get
(
source
\\
"
trade
"
\
"
collateral
"
\
"
marginType
"
)
.mkString
match
{
case
"
FC
"
=>
"
Fully
"
case
"
PC
"
=>
"
Partially
"
case
"
OC
"
=>
"OneWay"
case
"U"
=>
"Uncollateralized"
case
_
=>
msgNotFound
}
}
}</
fpml
:
collateralizationType>
<
fpml
:
timestamps>
{
/*
value
isn`t
present
in
the
source
*/
}
<fpml:timestamp>
<fpml:collateralPortfolio>
{
get
(
source
\\
"
trade
"
\
"
collateral
"
\
"
collateralForm
"
)
}
</fpml:collateralPortfolio>
<fpml:
type
>
{
if
(
get
(
source
\\
"
trade
"
\
"
nsdSpecificTradeFields
"
\
"
clearedDate
"
)
.mkString
!=
msgNotFound
)
"
InClearingPool
"
else
msgNotFound
}
</fpml:
type
>
{
/*
value
isn`t
present
in
the
source
*/
}
<fpml:value>
{
val
d
=
get
(
source
\\
"
trade
"
\
"
nsdSpecificTradeFields
"
\
"
clearedDate
"
)
if
(
d.mkString
!=
msgNotFound
)
d
+
"
T00:
00
:
00"
else
msgNotFound
}</
fpml
:
value>
</fpml:timestamp>
<fpml:timestamp>
<fpml:
type
>
{
if
(
get
(
source
\\
"
trade
"
\
"
nsdSpecificTradeFields
"
\
"
startAgreementDate
"
)
.mkString
!=
msgNotFound
)
"
InPortfolio
"
else
msgNotFound
}
</fpml:
type
>
{
/*
value
isn`t
present
in
the
source
*/
}
<fpml:value>
{
val
d
=
get
(
source
\\
"
trade
"
\
"
nsdSpecificTradeFields
"
\
"
startAgreementDate
"
)
if
(
d.mkString
!=
msgNotFound
)
d
+
"
T00:
00
:
00"
else
msgNotFound
}</
fpml
:
value>
</fpml:timestamp>
<fpml:timestamp>
<fpml:
type
>
{
if
(
get
(
source
\\
"
trade
"
\
"
nsdSpecificTradeFields
"
\
"
endAgreementDate
"
)
.mkString
!=
msgNotFound
)
"
OutPortfolio
"
else
msgNotFound
}
</fpml:
type
>
{
/*
value
isn`t
present
in
the
source
*/
}
<fpml:value>
{
val
d
=
get
(
source
\\
"
trade
"
\
"
nsdSpecificTradeFields
"
\
"
endAgreementDate
"
)
if
(
d.mkString
!=
msgNotFound
)
d
+
"
T00:
00
:
00"
else
msgNotFound
}</
fpml
:
value>
</fpml:timestamp>
</fpml:timestamps>
{
/*
value
isn`t
present
in
the
source
*/
}
<fpml:collateralizationType>
{
get
(
source
\\
"
trade
"
\
"
collateral
"
\
"
marginType
"
)
.mkString
match
{
case
"
FC
"
=>
"
Fully
"
case
"
PC
"
=>
"
Partially
"
case
"
OC
"
=>
"OneWay"
case
"U"
=>
"Uncollateralized"
case
_
=>
msgNotFound
}
}</
fpml
:
collateralizationType>
{
/*
value
isn`t
present
in
the
source
*/
}
<fpml:collateralPortfolio>
{
get
(
source
\\
"
trade
"
\
"
collateral
"
\
"
collateralForm
"
)
}
</fpml:collateralPortfolio>
</fpml:partyTradeInformation>
</fpml:partyTradeInformation>
}
}
}
</
fpml
:
tradeHeader>
</
fpml
:
tradeHeader>
{
templateTradeBody
}
{
templateTradeBody
}
...
...
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