-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloadMetaNodez.js
214 lines (210 loc) · 9.11 KB
/
loadMetaNodez.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
var n=require("nodez/nodezv3.js")
var async=require("async")
//use of meta meta here is simply to give the browser a handle - remove in production
meta=[
{name:"Meta",
schema: {
name: { type: "string" },
schema: { type: "textarea", format: "textarea" }
}},
{name:"BusinessProcess",
schema:{
name:{type:"string"},
description:{type:"textarea", format:"textarea"}
}},
{name:"BusinessInformationObject",
schema:{
name:{type:"string"},
description:{type:"textarea", format:"textarea"}
}},
{name:"Cluster",
schema:{
name:{type:"string"},
description:{type:"textarea", format:"textarea"}
}},
{name:"Application",
schema:{
name:{type:"string"},
version:{type:"string"},
description:{type:"textarea", format:"textarea"},
dateAcquired:{type:"date", format:"date"},
yearsOwned:{type:"number", format: "number"}
}}
];
legalRels=[
{from:"BusinessProcess",rel:"HAS_PARTS",to:"BusinessProcess",template:"{}"},
{from:"Cluster",rel:"HAS_PARTS",to:"Cluster",template:"{}"},
{from:"BusinessProcess",rel:"RELIES_ON",to:"Application",template:"{}"},
{from:"BusinessProcess",rel:"THEN",to:"BusinessProcess",template:"{}"},
{from:"Cluster",rel:"IS_ACCOUNTABLE_FOR",to:"BusinessProcess",template:"{}"},
{from:"BusinessProcess",rel:"PRODUCES",to:"BusinessInformationObject",template:"{}"},
{from:"Cluster",rel:"USES",to:"Application",template:"{}"},
{from:"BusinessProcess",rel:"NEEDS",to:"BusinessInformationObject",template:"{}"}
]
/*
* * Bank Treasury
* Produce capital plans
* Forecast capital needs
* Based on book run-off and new business
* Review regulatory headroom
* Perform stress testing
* Establish capital plan
* Manage the balance sheet
* Calculate the sensitivity of income to interest rate shifts (ALM)
* Establish possible funding and capital raising alternatives
and initiatives
* Fund the bank
* Execute funding plan
* Unsecured
* Execute and monitor deals and funding flows from branches
* Secured
* Develop portfolios of appropriate transactions
* Obtain ratings for portfolios
* SPV activities
* Establish SPV
* Perform ALM process for SPV incl behavioural modelling
* Establish hedging strategy
* Produce cash-flow forecasts
* Perform cash management
* Produce reports
* Perform SPV accounting cycles
* Manage non-trading risk
* Interest rate risk
* Calculate interest repricing ladder
* Perform interest rate sensitivity analysis
* Develop hedging and funding strategy
* Calculate exposure after hadging
* Produce reports
* Liquidity Risk
* Manage the liquidity
* Apply behavioural assumptions
* Generate balances
* Perform scenario modelling and analysis and conduct stress testing
* Produce results and reports
* Basel 3
* Foreign currency risk
* Produce FX position reports
* Analyse economic fundamentals
* Produce hedging and trading strategy
* Hedging and resulting risks
* Execute hedging strategy
* Produce IFRS documentation
* Perform effectiveness testing
* Perform hadge accounting
* Provide transfer prices to the business
* Establish FTP policy
* Interest rate component
* Liquidity component
* Calculate FTP according to the policy
* Publish FTP prices to the business
* Use FTP to calculate product level profits
* Generate MI/journal entries for product level profits
* Perform governance activities
* Monitor limits
* Produce reports
* Set policy and monitor adherance
*
*/
typedNodes=[
{type:"Application",data:{name:"QRM",description:"Quantitative Risk Manangement system uised for structural risk management",yearsOwned:15}}
,{type:"BusinessProcess",data:{name:"Set Policy and Monitor Adherance",description:""}}
,{type:"BusinessProcess",data:{name:"BP01",description:""}}
,{type:"BusinessProcess",data:{name:"BP01.01",description:""}}
,{type:"BusinessProcess",data:{name:"BP01.02",description:""}}
,{type:"BusinessProcess",data:{name:"BP01.02.01",description:""}}
,{type:"BusinessProcess",data:{name:"BP05",description:""}}
,{type:"BusinessProcess",data:{name:"BP04",description:""}}
,{type:"BusinessProcess",data:{name:"BP03",description:""}}
,{type:"BusinessProcess",data:{name:"BP02",description:""}}
,{type:"BusinessProcess",data:{name:"Hedge the structural IRR",description:""}}
,{type:"Cluster",data:{name:"Treasury",description:"",notes:"notes&comments"}}
,{type:"Cluster",data:{name:"ALM",description:"Asset and Liablility Management",notes:"notes&comments"}}
,{type:"Cluster",data:{name:"UK Retail Bank",description:"",notes:"notes&comments"}}
,{type:"Cluster",data:{name:"Investment Bank",description:"",notes:"notes&comments"}}
,{type:"Cluster",data:{name:"Western Europe",description:"",notes:"notes&comments"}}
,{type:"Cluster",data:{name:"Wealth",description:"",notes:"notes&comments"}}
,{type:"Cluster",data:{name:"Africa",description:"",notes:"notes&comments"}}
,{type:"Cluster",data:{name:"FTP",description:"Funds Transfer Pricing",notes:"notes&comments"}}
,{type:"Cluster",data:{name:"Liquidity",description:"Liquididity Management",notes:"notes&comments"}}
,{type:"Cluster",data:{name:"Funding",description:"Funding",notes:"notes&comments"}}
,{type:"Cluster",data:{name:"Capital",description:"Capital Management",notes:"notes&comments"}}
,{type:"Application",data:{name:"LDB",description:""}}
,{type:"Application",data:{name:"LCR",description:""}}
,{type:"Application",data:{name:"Poseidon",description:"Poseidon accumulates submissions from all clusters and prepres the FSA 47/48 reports"}}
,{type:"Application",data:{name:"UKBA",description:""}}
]
typedRelationships=[
{fromType:"Cluster",fromName:"Treasury",rel:"HAS_PARTS",toType:"Cluster",toName:"ALM",rdata:""}
,{fromType:"Cluster",fromName:"Treasury",rel:"HAS_PARTS",toType:"Cluster",toName:"FTP",rdata:""}
,{fromType:"Cluster",fromName:"Treasury",rel:"HAS_PARTS",toType:"Cluster",toName:"Liquidity",rdata:""}
,{fromType:"Cluster",fromName:"Treasury",rel:"HAS_PARTS",toType:"Cluster",toName:"Funding",rdata:""}
,{fromType:"Cluster",fromName:"Treasury",rel:"HAS_PARTS",toType:"Cluster",toName:"Capital",rdata:""}
,{fromType:"BusinessProcess",fromName:"Hedge the structural IRR",rel:"RELIES_ON",toType:"Application",toName:"QRM",rdata:""}
,{fromType:"BusinessProcess",fromName:"BP01",rel:"HAS_PARTS",toType:"BusinessProcess",toName:"BP01.01",rdata:""}
,{fromType:"BusinessProcess",fromName:"BP01",rel:"HAS_PARTS",toType:"BusinessProcess",toName:"BP01.02",rdata:""}
,{fromType:"BusinessProcess",fromName:"BP01.02",rel:"HAS_PARTS",toType:"BusinessProcess",toName:"BP01.02.01",rdata:""}
// ,{fromType:"BusinessProcess",fromName:"Hedge the structural IRR",rel:"HAS_PARTS",toType:"BusinessProcess",toName:"Hedge the wholesale structural IRR",rdata:""}
// ,{fromType:"BusinessProcess",fromName:"Hedge the structural IRR",rel:"HAS_PARTS",toType:"BusinessProcess",toName:"Hedge the retail structural IRR",rdata:""}
,{fromType:"Cluster",fromName:"ALM",rel:"IS_ACCOUNTABLE_FOR",toType:"BusinessProcess",toName:"Hedge the structural IRR",rdata:""}
,{fromType:"Cluster",fromName:"UK Retail Bank",rel:"USES",toType:"Application",toName:"UKBA",rdata:""}
,{fromType:"Cluster",fromName:"Wealth",rel:"USES",toType:"Application",toName:"UKBA",rdata:""}
]
function addMetaNodes(callback) {
async.map(meta,n.addMetaNode,
function (err,results){
console.log("Finished metanodes")
// console.log(results)
callback(err,results)
}
)
}
function addLegalRels(callback) {
async.map(legalRels,n.addLegalRelationship,
function (err,results){
console.log("Finished legal relationships")
// console.log(results)
callback(err,results)
}
)
}
function addTypedNodes(callback) {
async.map(typedNodes,n.addTypedNode,
function (err,results){
console.log("Finished typed nodes")
// console.log(results)
callback(err,results)
}
)
}
function addTypedRelationships(callback) {
async.map(typedRelationships,n.addTypedRelationship,
function (err,results){
console.log("Finished typed nodes")
// console.log(results)
callback(err,results)
}
)
}
async.series(
[
function (callback) {
n.deleteAll(callback)
},
function(callback) {
addMetaNodes(callback)
},
function(callback) {
addLegalRels(callback)
},
function(callback) {
addTypedNodes(callback)
},
function(callback) {
addTypedRelationships(callback)
}
],
function (err,results){
console.log("End of series");
console.log(results)
}
);