@decafhub/decaf-client-extras 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/test.yml +1 -1
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +27 -0
- package/README.md +2 -2
- package/es/reports/valuation/-remote-valuation-report-account.d.ts +150 -0
- package/es/reports/valuation/-remote-valuation-report-account.js +135 -0
- package/es/reports/valuation/-remote-valuation-report-portfolio.d.ts +2 -2
- package/es/reports/valuation/-remote-valuation-report-portfolio.js +42 -41
- package/es/reports/valuation/-valuation-report-account.d.ts +79 -0
- package/es/reports/valuation/-valuation-report-account.js +1 -0
- package/es/reports/valuation/-valuation-report-portfolio.d.ts +4 -4
- package/es/reports/valuation/index.d.ts +3 -0
- package/es/reports/valuation/index.js +2 -0
- package/package.json +1 -1
- package/release-please-config.json +1 -0
- package/reports/valuation/-remote-valuation-report-account.d.ts +150 -0
- package/reports/valuation/-remote-valuation-report-account.js +196 -0
- package/reports/valuation/-remote-valuation-report-portfolio.d.ts +2 -2
- package/reports/valuation/-remote-valuation-report-portfolio.js +42 -41
- package/reports/valuation/-valuation-report-account.d.ts +79 -0
- package/reports/valuation/-valuation-report-account.js +2 -0
- package/reports/valuation/-valuation-report-portfolio.d.ts +4 -4
- package/reports/valuation/index.d.ts +3 -0
- package/reports/valuation/index.js +4 -1
- package/src/{index.test.ts → reports/index.test.ts} +70 -4
- package/src/reports/valuation/-remote-valuation-report-account.ts +297 -0
- package/src/reports/valuation/-remote-valuation-report-portfolio.ts +44 -42
- package/src/reports/valuation/-valuation-report-account.ts +92 -0
- package/src/reports/valuation/-valuation-report-portfolio.ts +4 -4
- package/src/reports/valuation/index.ts +3 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { DecafClient } from '@decafhub/decaf-client';
|
|
2
|
+
import { CustomError, Either, SDate, SDateTime } from '@telostat/prelude';
|
|
3
|
+
import { CurrencyCode, DateType, DecafAccountId, DecafActionId, DecafExternalValuationId, DecafOhlcSeriesId, DecafPortfolioId, DecafPrincipalId, DecafShareClassFeeScheduleId, DecafShareClassId } from '../../commons';
|
|
4
|
+
import { RemoteBaseValuationReport } from './-remote-valuation-report-shared';
|
|
5
|
+
import { ValuationReportAccount } from './-valuation-report-shared';
|
|
6
|
+
import { AccountValuationReport, AccountValuationReportShareClassValue } from './-valuation-report-account';
|
|
7
|
+
/**
|
|
8
|
+
* Remote account valuation report query type.
|
|
9
|
+
*/
|
|
10
|
+
export interface AccountValuationReportQuery {
|
|
11
|
+
/**
|
|
12
|
+
* Date of valuation report.
|
|
13
|
+
*/
|
|
14
|
+
date: SDate;
|
|
15
|
+
/**
|
|
16
|
+
* Date type of the valuation report.
|
|
17
|
+
*/
|
|
18
|
+
dateType: DateType;
|
|
19
|
+
/**
|
|
20
|
+
* Reference currency of the valuation report.
|
|
21
|
+
*/
|
|
22
|
+
currency: CurrencyCode;
|
|
23
|
+
/**
|
|
24
|
+
* Account the valuation report is requested for.
|
|
25
|
+
*/
|
|
26
|
+
account: DecafAccountId;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Type definition for the remote (raw) account valuation report data.
|
|
30
|
+
*/
|
|
31
|
+
export interface RemoteAccountValuationReport extends RemoteBaseValuationReport {
|
|
32
|
+
account: ValuationReportAccount;
|
|
33
|
+
scvals: RemoteValuationShareClassValue[];
|
|
34
|
+
subscriptions?: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Type definition for share class valuation on the remote account valuation
|
|
38
|
+
* report.
|
|
39
|
+
*/
|
|
40
|
+
export interface RemoteValuationShareClassValue {
|
|
41
|
+
shareclass?: RemoteValuationShareClass;
|
|
42
|
+
external?: RemoteValuationExternalValue;
|
|
43
|
+
nav: number;
|
|
44
|
+
nav_adjusted: number;
|
|
45
|
+
nav_adjusted_total: number;
|
|
46
|
+
coefficient: number;
|
|
47
|
+
gav_refccy: number;
|
|
48
|
+
gav_clsccy: number;
|
|
49
|
+
sharecount_prev: number;
|
|
50
|
+
sharecount_curr: number;
|
|
51
|
+
sharecount_diff: number;
|
|
52
|
+
px_refccy: number;
|
|
53
|
+
px_clsccy: number;
|
|
54
|
+
ytdext?: number;
|
|
55
|
+
ytdint?: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Type definition for share class on the remote account valuation report.
|
|
59
|
+
*/
|
|
60
|
+
export interface RemoteValuationShareClass {
|
|
61
|
+
id: DecafShareClassId;
|
|
62
|
+
created: SDateTime;
|
|
63
|
+
creator: DecafPrincipalId;
|
|
64
|
+
updated: SDateTime;
|
|
65
|
+
updater: DecafPrincipalId;
|
|
66
|
+
guid: string;
|
|
67
|
+
portfolio: DecafPortfolioId;
|
|
68
|
+
name: string;
|
|
69
|
+
currency: CurrencyCode;
|
|
70
|
+
isin?: string;
|
|
71
|
+
bbgticker?: string;
|
|
72
|
+
liquidity?: string;
|
|
73
|
+
jurisdiction?: string;
|
|
74
|
+
administrator?: string;
|
|
75
|
+
mininvestment?: number;
|
|
76
|
+
subredperiod?: string;
|
|
77
|
+
freqmngt?: number;
|
|
78
|
+
freqperf?: number;
|
|
79
|
+
benchmark?: DecafOhlcSeriesId;
|
|
80
|
+
description?: string;
|
|
81
|
+
feeschedules: DecafShareClassFeeScheduleId[];
|
|
82
|
+
effectivefeeschedule?: DecafShareClassFeeScheduleId;
|
|
83
|
+
subscriptions: DecafActionId[];
|
|
84
|
+
outstanding?: number;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Type definition for external valuation on the remote account valuation
|
|
88
|
+
* report.
|
|
89
|
+
*/
|
|
90
|
+
export interface RemoteValuationExternalValue {
|
|
91
|
+
id: DecafExternalValuationId;
|
|
92
|
+
created: SDateTime;
|
|
93
|
+
creator: DecafPrincipalId;
|
|
94
|
+
updated: SDateTime;
|
|
95
|
+
updater: DecafPrincipalId;
|
|
96
|
+
guid: string;
|
|
97
|
+
portfolio: DecafPortfolioId;
|
|
98
|
+
shareclass?: DecafShareClassId;
|
|
99
|
+
date: SDate;
|
|
100
|
+
ccy: CurrencyCode;
|
|
101
|
+
shares?: number;
|
|
102
|
+
price?: number;
|
|
103
|
+
nav?: number;
|
|
104
|
+
aum?: number;
|
|
105
|
+
hedgepnl?: number;
|
|
106
|
+
feemngt?: number;
|
|
107
|
+
feeperf?: number;
|
|
108
|
+
otheraccrued?: number;
|
|
109
|
+
totalaccrued?: number;
|
|
110
|
+
subred?: number;
|
|
111
|
+
perfdaily?: number;
|
|
112
|
+
perfweekly?: number;
|
|
113
|
+
perfmonthly?: number;
|
|
114
|
+
perfytd?: number;
|
|
115
|
+
perfstart?: number;
|
|
116
|
+
coefficient?: number;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Attempts to retrieve remote account valuation report.
|
|
120
|
+
*
|
|
121
|
+
* @param client DECAF Barista client.
|
|
122
|
+
* @param query Remote account valuation report endpoint query parameters.
|
|
123
|
+
* @returns Remote (raw) account valuation report data.
|
|
124
|
+
*/
|
|
125
|
+
export declare function fetchRemoteAccountValuationReport(client: DecafClient, query: AccountValuationReportQuery): Promise<Either<CustomError, RemoteAccountValuationReport>>;
|
|
126
|
+
/**
|
|
127
|
+
* Attempts to recompile remote valuation report share class value.
|
|
128
|
+
*
|
|
129
|
+
* @param x remote valuation report share class value object.
|
|
130
|
+
* @return Recompiled valuation report share class value object.
|
|
131
|
+
*/
|
|
132
|
+
export declare function toShareClassValue(s: RemoteValuationShareClassValue): AccountValuationReportShareClassValue;
|
|
133
|
+
/**
|
|
134
|
+
* Attempts to re-compile the raw, remote account valuation report and
|
|
135
|
+
* return it.
|
|
136
|
+
*
|
|
137
|
+
* @param x Raw, remote account valuation report.
|
|
138
|
+
* @returns Either of an error message or the re-compiled account valuation
|
|
139
|
+
* report.
|
|
140
|
+
*/
|
|
141
|
+
export declare function recompileAccountValuationReport(x: RemoteAccountValuationReport): Either<CustomError, AccountValuationReport>;
|
|
142
|
+
/**
|
|
143
|
+
* Attempts to retrieve remote account valuation report, compiles it to
|
|
144
|
+
* {@link AccountValuationReport} and return it.
|
|
145
|
+
*
|
|
146
|
+
* @param client DECAF Barista client.
|
|
147
|
+
* @param query Remote account valuation report endpoint query parameters.
|
|
148
|
+
* @returns Recompiled account valuation report data.
|
|
149
|
+
*/
|
|
150
|
+
export declare function fetchAccountValuationReport(client: DecafClient, query: AccountValuationReportQuery): Promise<Either<CustomError, AccountValuationReport>>;
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
exports.fetchAccountValuationReport = exports.recompileAccountValuationReport = exports.toShareClassValue = exports.fetchRemoteAccountValuationReport = void 0;
|
|
51
|
+
var prelude_1 = require("@telostat/prelude");
|
|
52
|
+
var _remote_valuation_report_shared_1 = require("./-remote-valuation-report-shared");
|
|
53
|
+
/**
|
|
54
|
+
* Attempts to retrieve remote account valuation report.
|
|
55
|
+
*
|
|
56
|
+
* @param client DECAF Barista client.
|
|
57
|
+
* @param query Remote account valuation report endpoint query parameters.
|
|
58
|
+
* @returns Remote (raw) account valuation report data.
|
|
59
|
+
*/
|
|
60
|
+
function fetchRemoteAccountValuationReport(client, query) {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
62
|
+
return __generator(this, function (_a) {
|
|
63
|
+
return [2 /*return*/, client.barista
|
|
64
|
+
.get('/reports/valuation/account/', {
|
|
65
|
+
params: {
|
|
66
|
+
ccy: query.currency,
|
|
67
|
+
date: query.date,
|
|
68
|
+
type: query.dateType,
|
|
69
|
+
account: "".concat(query.account),
|
|
70
|
+
},
|
|
71
|
+
})
|
|
72
|
+
.then(function (x) { return (0, prelude_1.Right)(x.data); })
|
|
73
|
+
.catch(function (err) { return (0, prelude_1.Left)((0, prelude_1.customError)('Error while attempting to fetch remote account valuation report', err)); })];
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
exports.fetchRemoteAccountValuationReport = fetchRemoteAccountValuationReport;
|
|
78
|
+
/**
|
|
79
|
+
* Attempts to recompile remote valuation report share class value.
|
|
80
|
+
*
|
|
81
|
+
* @param x remote valuation report share class value object.
|
|
82
|
+
* @return Recompiled valuation report share class value object.
|
|
83
|
+
*/
|
|
84
|
+
function toShareClassValue(s) {
|
|
85
|
+
var shareclass = prelude_1.Maybe.fromNullable(s.shareclass).map(function (x) { return ({
|
|
86
|
+
id: x.id,
|
|
87
|
+
created: x.created,
|
|
88
|
+
creator: prelude_1.Maybe.fromNullable(x.creator),
|
|
89
|
+
updated: x.updated,
|
|
90
|
+
updater: prelude_1.Maybe.fromNullable(x.updater),
|
|
91
|
+
guid: x.guid,
|
|
92
|
+
portfolio: x.portfolio,
|
|
93
|
+
name: x.name,
|
|
94
|
+
currency: x.currency,
|
|
95
|
+
isin: (0, prelude_1.sanitizedNonEmptyText)(x.isin),
|
|
96
|
+
bbgticker: (0, prelude_1.sanitizedNonEmptyText)(x.bbgticker),
|
|
97
|
+
liquidity: (0, prelude_1.sanitizedNonEmptyText)(x.liquidity),
|
|
98
|
+
jurisdiction: (0, prelude_1.sanitizedNonEmptyText)(x.jurisdiction),
|
|
99
|
+
administrator: (0, prelude_1.sanitizedNonEmptyText)(x.administrator),
|
|
100
|
+
minimumInvestment: prelude_1.Maybe.fromNullable(x.mininvestment),
|
|
101
|
+
subscriptionRedemptionPeriod: (0, prelude_1.sanitizedNonEmptyText)(x.subredperiod),
|
|
102
|
+
managementFeeFrequency: prelude_1.Maybe.fromNullable(x.freqmngt),
|
|
103
|
+
performanceFeeFrequency: prelude_1.Maybe.fromNullable(x.freqperf),
|
|
104
|
+
benchmark: prelude_1.Maybe.fromNullable(x.benchmark),
|
|
105
|
+
description: (0, prelude_1.sanitizedNonEmptyText)(x.description),
|
|
106
|
+
feeScheduleIds: x.feeschedules,
|
|
107
|
+
effectiveFeeScheduleId: prelude_1.Maybe.fromNullable(x.effectivefeeschedule),
|
|
108
|
+
subscriptionIds: x.subscriptions,
|
|
109
|
+
outstanding: (0, prelude_1.decimalFromNullable)(x.outstanding),
|
|
110
|
+
}); });
|
|
111
|
+
return {
|
|
112
|
+
shareclass: shareclass,
|
|
113
|
+
external: prelude_1.Maybe.fromNullable(s.external).map(function (ev) { return ({
|
|
114
|
+
id: ev.id,
|
|
115
|
+
created: ev.created,
|
|
116
|
+
creator: prelude_1.Maybe.fromNullable(ev.updater),
|
|
117
|
+
updated: ev.updated,
|
|
118
|
+
updater: prelude_1.Maybe.fromNullable(ev.updater),
|
|
119
|
+
guid: ev.guid,
|
|
120
|
+
portfolio: ev.portfolio,
|
|
121
|
+
shareclass: prelude_1.Maybe.fromNullable(ev.shareclass),
|
|
122
|
+
date: ev.date,
|
|
123
|
+
ccy: ev.ccy,
|
|
124
|
+
shares: (0, prelude_1.decimalFromNullable)(ev.shares),
|
|
125
|
+
price: (0, prelude_1.decimalFromNullable)(ev.price),
|
|
126
|
+
nav: (0, prelude_1.decimalFromNullable)(ev.nav),
|
|
127
|
+
aum: (0, prelude_1.decimalFromNullable)(ev.aum),
|
|
128
|
+
hedgepnl: (0, prelude_1.decimalFromNullable)(ev.hedgepnl),
|
|
129
|
+
feemngt: (0, prelude_1.decimalFromNullable)(ev.feemngt),
|
|
130
|
+
feeperf: (0, prelude_1.decimalFromNullable)(ev.feeperf),
|
|
131
|
+
otheraccrued: (0, prelude_1.decimalFromNullable)(ev.otheraccrued),
|
|
132
|
+
totalaccrued: (0, prelude_1.decimalFromNullable)(ev.totalaccrued),
|
|
133
|
+
subred: (0, prelude_1.decimalFromNullable)(ev.subred),
|
|
134
|
+
perfdaily: (0, prelude_1.decimalFromNullable)(ev.perfdaily),
|
|
135
|
+
perfweekly: (0, prelude_1.decimalFromNullable)(ev.perfweekly),
|
|
136
|
+
perfmonthly: (0, prelude_1.decimalFromNullable)(ev.perfmonthly),
|
|
137
|
+
perfytd: (0, prelude_1.decimalFromNullable)(ev.perfytd),
|
|
138
|
+
perfstart: (0, prelude_1.decimalFromNullable)(ev.perfstart),
|
|
139
|
+
coefficient: (0, prelude_1.decimalFromNullable)(ev.coefficient),
|
|
140
|
+
}); }),
|
|
141
|
+
nav: (0, prelude_1.unsafeDecimal)(s.nav),
|
|
142
|
+
navAdjusted: (0, prelude_1.unsafeDecimal)(s.nav_adjusted),
|
|
143
|
+
navAdjustedTotal: (0, prelude_1.unsafeDecimal)(s.nav_adjusted_total),
|
|
144
|
+
coefficient: (0, prelude_1.unsafeDecimal)(s.coefficient),
|
|
145
|
+
gavRefccy: (0, prelude_1.unsafeDecimal)(s.gav_refccy),
|
|
146
|
+
gavClsccy: (0, prelude_1.unsafeDecimal)(s.gav_clsccy),
|
|
147
|
+
sharecountPrev: prelude_1.Maybe.fromNullable(s.sharecount_prev).map(prelude_1.unsafeDecimal),
|
|
148
|
+
sharecountCurr: prelude_1.Maybe.fromNullable(s.sharecount_curr).map(prelude_1.unsafeDecimal),
|
|
149
|
+
sharecountDiff: prelude_1.Maybe.fromNullable(s.sharecount_diff).map(prelude_1.unsafeDecimal),
|
|
150
|
+
pxRefCcy: (0, prelude_1.decimalFromNullable)(s.px_refccy),
|
|
151
|
+
pxClsCcy: (0, prelude_1.decimalFromNullable)(s.px_clsccy),
|
|
152
|
+
ytdExt: (0, prelude_1.decimalFromNullable)(s.ytdext),
|
|
153
|
+
ytdInt: (0, prelude_1.decimalFromNullable)(s.ytdint),
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
exports.toShareClassValue = toShareClassValue;
|
|
157
|
+
/**
|
|
158
|
+
* Attempts to re-compile the raw, remote account valuation report and
|
|
159
|
+
* return it.
|
|
160
|
+
*
|
|
161
|
+
* @param x Raw, remote account valuation report.
|
|
162
|
+
* @returns Either of an error message or the re-compiled account valuation
|
|
163
|
+
* report.
|
|
164
|
+
*/
|
|
165
|
+
function recompileAccountValuationReport(x) {
|
|
166
|
+
// Attempt to get the base valuation report:
|
|
167
|
+
var baseReport = (0, _remote_valuation_report_shared_1.recompileBaseValuationReport)(x);
|
|
168
|
+
// Add consolidated valuation report specific fields and return:
|
|
169
|
+
return baseReport.map(function (report) {
|
|
170
|
+
return __assign(__assign({}, report), { account: x.account, subscriptions: (0, prelude_1.decimalFromNullable)(x.subscriptions).orDefault(prelude_1.zero), shareClassValues: x.scvals.map(toShareClassValue) });
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
exports.recompileAccountValuationReport = recompileAccountValuationReport;
|
|
174
|
+
/**
|
|
175
|
+
* Attempts to retrieve remote account valuation report, compiles it to
|
|
176
|
+
* {@link AccountValuationReport} and return it.
|
|
177
|
+
*
|
|
178
|
+
* @param client DECAF Barista client.
|
|
179
|
+
* @param query Remote account valuation report endpoint query parameters.
|
|
180
|
+
* @returns Recompiled account valuation report data.
|
|
181
|
+
*/
|
|
182
|
+
function fetchAccountValuationReport(client, query) {
|
|
183
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
184
|
+
var rawReport;
|
|
185
|
+
return __generator(this, function (_a) {
|
|
186
|
+
switch (_a.label) {
|
|
187
|
+
case 0: return [4 /*yield*/, fetchRemoteAccountValuationReport(client, query)];
|
|
188
|
+
case 1:
|
|
189
|
+
rawReport = _a.sent();
|
|
190
|
+
// Attempt to recompile the report (if any) and return:
|
|
191
|
+
return [2 /*return*/, rawReport.chain(recompileAccountValuationReport)];
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
exports.fetchAccountValuationReport = fetchAccountValuationReport;
|
|
@@ -38,7 +38,7 @@ export interface RemotePortfolioValuationReport extends RemoteBaseValuationRepor
|
|
|
38
38
|
* report.
|
|
39
39
|
*/
|
|
40
40
|
export interface RemoteValuationShareClassValue {
|
|
41
|
-
shareclass
|
|
41
|
+
shareclass?: RemoteValuationShareClass;
|
|
42
42
|
external?: RemoteValuationExternalValue;
|
|
43
43
|
nav: number;
|
|
44
44
|
nav_adjusted: number;
|
|
@@ -129,7 +129,7 @@ export declare function fetchRemotePortfolioValuationReport(client: DecafClient,
|
|
|
129
129
|
* @param x remote valuation report share class value object.
|
|
130
130
|
* @return Recompiled valuation report share class value object.
|
|
131
131
|
*/
|
|
132
|
-
export declare function toShareClassValue(
|
|
132
|
+
export declare function toShareClassValue(s: RemoteValuationShareClassValue): PortfolioValuationReportShareClassValue;
|
|
133
133
|
/**
|
|
134
134
|
* Attempts to re-compile the raw, remote portfolio valuation report and
|
|
135
135
|
* return it.
|
|
@@ -77,35 +77,36 @@ exports.fetchRemotePortfolioValuationReport = fetchRemotePortfolioValuationRepor
|
|
|
77
77
|
* @param x remote valuation report share class value object.
|
|
78
78
|
* @return Recompiled valuation report share class value object.
|
|
79
79
|
*/
|
|
80
|
-
function toShareClassValue(
|
|
80
|
+
function toShareClassValue(s) {
|
|
81
|
+
var shareclass = prelude_1.Maybe.fromNullable(s.shareclass).map(function (x) { return ({
|
|
82
|
+
id: x.id,
|
|
83
|
+
created: x.created,
|
|
84
|
+
creator: prelude_1.Maybe.fromNullable(x.creator),
|
|
85
|
+
updated: x.updated,
|
|
86
|
+
updater: prelude_1.Maybe.fromNullable(x.updater),
|
|
87
|
+
guid: x.guid,
|
|
88
|
+
portfolio: x.portfolio,
|
|
89
|
+
name: x.name,
|
|
90
|
+
currency: x.currency,
|
|
91
|
+
isin: (0, prelude_1.sanitizedNonEmptyText)(x.isin),
|
|
92
|
+
bbgticker: (0, prelude_1.sanitizedNonEmptyText)(x.bbgticker),
|
|
93
|
+
liquidity: (0, prelude_1.sanitizedNonEmptyText)(x.liquidity),
|
|
94
|
+
jurisdiction: (0, prelude_1.sanitizedNonEmptyText)(x.jurisdiction),
|
|
95
|
+
administrator: (0, prelude_1.sanitizedNonEmptyText)(x.administrator),
|
|
96
|
+
minimumInvestment: prelude_1.Maybe.fromNullable(x.mininvestment),
|
|
97
|
+
subscriptionRedemptionPeriod: (0, prelude_1.sanitizedNonEmptyText)(x.subredperiod),
|
|
98
|
+
managementFeeFrequency: prelude_1.Maybe.fromNullable(x.freqmngt),
|
|
99
|
+
performanceFeeFrequency: prelude_1.Maybe.fromNullable(x.freqperf),
|
|
100
|
+
benchmark: prelude_1.Maybe.fromNullable(x.benchmark),
|
|
101
|
+
description: (0, prelude_1.sanitizedNonEmptyText)(x.description),
|
|
102
|
+
feeScheduleIds: x.feeschedules,
|
|
103
|
+
effectiveFeeScheduleId: prelude_1.Maybe.fromNullable(x.effectivefeeschedule),
|
|
104
|
+
subscriptionIds: x.subscriptions,
|
|
105
|
+
outstanding: (0, prelude_1.decimalFromNullable)(x.outstanding),
|
|
106
|
+
}); });
|
|
81
107
|
return {
|
|
82
|
-
shareclass:
|
|
83
|
-
|
|
84
|
-
created: x.shareclass.created,
|
|
85
|
-
creator: prelude_1.Maybe.fromNullable(x.shareclass.creator),
|
|
86
|
-
updated: x.shareclass.updated,
|
|
87
|
-
updater: prelude_1.Maybe.fromNullable(x.shareclass.updater),
|
|
88
|
-
guid: x.shareclass.guid,
|
|
89
|
-
portfolio: x.shareclass.portfolio,
|
|
90
|
-
name: x.shareclass.name,
|
|
91
|
-
currency: x.shareclass.currency,
|
|
92
|
-
isin: (0, prelude_1.sanitizedNonEmptyText)(x.shareclass.isin),
|
|
93
|
-
bbgticker: (0, prelude_1.sanitizedNonEmptyText)(x.shareclass.bbgticker),
|
|
94
|
-
liquidity: (0, prelude_1.sanitizedNonEmptyText)(x.shareclass.liquidity),
|
|
95
|
-
jurisdiction: (0, prelude_1.sanitizedNonEmptyText)(x.shareclass.jurisdiction),
|
|
96
|
-
administrator: (0, prelude_1.sanitizedNonEmptyText)(x.shareclass.administrator),
|
|
97
|
-
minimumInvestment: prelude_1.Maybe.fromNullable(x.shareclass.mininvestment),
|
|
98
|
-
subscriptionRedemptionPeriod: (0, prelude_1.sanitizedNonEmptyText)(x.shareclass.subredperiod),
|
|
99
|
-
managementFeeFrequency: prelude_1.Maybe.fromNullable(x.shareclass.freqmngt),
|
|
100
|
-
performanceFeeFrequency: prelude_1.Maybe.fromNullable(x.shareclass.freqperf),
|
|
101
|
-
benchmark: prelude_1.Maybe.fromNullable(x.shareclass.benchmark),
|
|
102
|
-
description: (0, prelude_1.sanitizedNonEmptyText)(x.shareclass.description),
|
|
103
|
-
feeScheduleIds: x.shareclass.feeschedules,
|
|
104
|
-
effectiveFeeScheduleId: prelude_1.Maybe.fromNullable(x.shareclass.effectivefeeschedule),
|
|
105
|
-
subscriptionIds: x.shareclass.subscriptions,
|
|
106
|
-
outstanding: (0, prelude_1.decimalFromNullable)(x.shareclass.outstanding),
|
|
107
|
-
},
|
|
108
|
-
external: prelude_1.Maybe.fromNullable(x.external).map(function (ev) { return ({
|
|
108
|
+
shareclass: shareclass,
|
|
109
|
+
external: prelude_1.Maybe.fromNullable(s.external).map(function (ev) { return ({
|
|
109
110
|
id: ev.id,
|
|
110
111
|
created: ev.created,
|
|
111
112
|
creator: prelude_1.Maybe.fromNullable(ev.updater),
|
|
@@ -133,19 +134,19 @@ function toShareClassValue(x) {
|
|
|
133
134
|
perfstart: (0, prelude_1.decimalFromNullable)(ev.perfstart),
|
|
134
135
|
coefficient: (0, prelude_1.decimalFromNullable)(ev.coefficient),
|
|
135
136
|
}); }),
|
|
136
|
-
nav: (0, prelude_1.unsafeDecimal)(
|
|
137
|
-
navAdjusted: (0, prelude_1.unsafeDecimal)(
|
|
138
|
-
navAdjustedTotal: (0, prelude_1.unsafeDecimal)(
|
|
139
|
-
coefficient: (0, prelude_1.unsafeDecimal)(
|
|
140
|
-
gavRefccy: (0, prelude_1.unsafeDecimal)(
|
|
141
|
-
gavClsccy: (0, prelude_1.unsafeDecimal)(
|
|
142
|
-
sharecountPrev:
|
|
143
|
-
sharecountCurr:
|
|
144
|
-
sharecountDiff:
|
|
145
|
-
pxRefCcy: (0, prelude_1.decimalFromNullable)(
|
|
146
|
-
pxClsCcy: (0, prelude_1.decimalFromNullable)(
|
|
147
|
-
ytdExt: (0, prelude_1.decimalFromNullable)(
|
|
148
|
-
ytdInt: (0, prelude_1.decimalFromNullable)(
|
|
137
|
+
nav: (0, prelude_1.unsafeDecimal)(s.nav),
|
|
138
|
+
navAdjusted: (0, prelude_1.unsafeDecimal)(s.nav_adjusted),
|
|
139
|
+
navAdjustedTotal: (0, prelude_1.unsafeDecimal)(s.nav_adjusted_total),
|
|
140
|
+
coefficient: (0, prelude_1.unsafeDecimal)(s.coefficient),
|
|
141
|
+
gavRefccy: (0, prelude_1.unsafeDecimal)(s.gav_refccy),
|
|
142
|
+
gavClsccy: (0, prelude_1.unsafeDecimal)(s.gav_clsccy),
|
|
143
|
+
sharecountPrev: prelude_1.Maybe.fromNullable(s.sharecount_prev).map(prelude_1.unsafeDecimal),
|
|
144
|
+
sharecountCurr: prelude_1.Maybe.fromNullable(s.sharecount_curr).map(prelude_1.unsafeDecimal),
|
|
145
|
+
sharecountDiff: prelude_1.Maybe.fromNullable(s.sharecount_diff).map(prelude_1.unsafeDecimal),
|
|
146
|
+
pxRefCcy: (0, prelude_1.decimalFromNullable)(s.px_refccy),
|
|
147
|
+
pxClsCcy: (0, prelude_1.decimalFromNullable)(s.px_clsccy),
|
|
148
|
+
ytdExt: (0, prelude_1.decimalFromNullable)(s.ytdext),
|
|
149
|
+
ytdInt: (0, prelude_1.decimalFromNullable)(s.ytdint),
|
|
149
150
|
};
|
|
150
151
|
}
|
|
151
152
|
exports.toShareClassValue = toShareClassValue;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Decimal, Maybe, SDate, SDateTime } from '@telostat/prelude';
|
|
2
|
+
import { DecafActionId, CurrencyCode, DecafExternalValuationId, DecafOhlcSeriesId, DecafPortfolioId, DecafPrincipalId, DecafShareClassFeeScheduleId, DecafShareClassId } from '../../commons';
|
|
3
|
+
import { BaseValuationReport, ValuationReportAccount } from './-valuation-report-shared';
|
|
4
|
+
export interface AccountValuationReport extends BaseValuationReport {
|
|
5
|
+
account: ValuationReportAccount;
|
|
6
|
+
subscriptions: Decimal;
|
|
7
|
+
shareClassValues: AccountValuationReportShareClassValue[];
|
|
8
|
+
}
|
|
9
|
+
export interface AccountValuationReportShareClassValue {
|
|
10
|
+
shareclass: Maybe<AccountValuationReportShareClass>;
|
|
11
|
+
external: Maybe<AccountValuationReportExternalValue>;
|
|
12
|
+
nav: Decimal;
|
|
13
|
+
navAdjusted: Decimal;
|
|
14
|
+
navAdjustedTotal: Decimal;
|
|
15
|
+
coefficient: Decimal;
|
|
16
|
+
gavRefccy: Decimal;
|
|
17
|
+
gavClsccy: Decimal;
|
|
18
|
+
sharecountPrev: Maybe<Decimal>;
|
|
19
|
+
sharecountCurr: Maybe<Decimal>;
|
|
20
|
+
sharecountDiff: Maybe<Decimal>;
|
|
21
|
+
pxRefCcy: Maybe<Decimal>;
|
|
22
|
+
pxClsCcy: Maybe<Decimal>;
|
|
23
|
+
ytdExt: Maybe<Decimal>;
|
|
24
|
+
ytdInt: Maybe<Decimal>;
|
|
25
|
+
}
|
|
26
|
+
export interface AccountValuationReportShareClass {
|
|
27
|
+
id: DecafShareClassId;
|
|
28
|
+
created: SDateTime;
|
|
29
|
+
creator: Maybe<DecafPrincipalId>;
|
|
30
|
+
updated: SDateTime;
|
|
31
|
+
updater: Maybe<DecafPrincipalId>;
|
|
32
|
+
guid: string;
|
|
33
|
+
portfolio: DecafPortfolioId;
|
|
34
|
+
name: string;
|
|
35
|
+
currency: CurrencyCode;
|
|
36
|
+
isin: Maybe<string>;
|
|
37
|
+
bbgticker: Maybe<string>;
|
|
38
|
+
liquidity: Maybe<string>;
|
|
39
|
+
jurisdiction: Maybe<string>;
|
|
40
|
+
administrator: Maybe<string>;
|
|
41
|
+
minimumInvestment: Maybe<number>;
|
|
42
|
+
subscriptionRedemptionPeriod: Maybe<string>;
|
|
43
|
+
managementFeeFrequency: Maybe<number>;
|
|
44
|
+
performanceFeeFrequency: Maybe<number>;
|
|
45
|
+
benchmark: Maybe<DecafOhlcSeriesId>;
|
|
46
|
+
description: Maybe<string>;
|
|
47
|
+
feeScheduleIds: DecafShareClassFeeScheduleId[];
|
|
48
|
+
effectiveFeeScheduleId: Maybe<DecafShareClassFeeScheduleId>;
|
|
49
|
+
subscriptionIds: DecafActionId[];
|
|
50
|
+
outstanding: Maybe<Decimal>;
|
|
51
|
+
}
|
|
52
|
+
export interface AccountValuationReportExternalValue {
|
|
53
|
+
id: DecafExternalValuationId;
|
|
54
|
+
created: SDateTime;
|
|
55
|
+
creator: Maybe<DecafPrincipalId>;
|
|
56
|
+
updated: SDateTime;
|
|
57
|
+
updater: Maybe<DecafPrincipalId>;
|
|
58
|
+
guid: string;
|
|
59
|
+
portfolio: DecafPortfolioId;
|
|
60
|
+
shareclass: Maybe<DecafShareClassId>;
|
|
61
|
+
date: SDate;
|
|
62
|
+
ccy: CurrencyCode;
|
|
63
|
+
shares: Maybe<Decimal>;
|
|
64
|
+
price: Maybe<Decimal>;
|
|
65
|
+
nav: Maybe<Decimal>;
|
|
66
|
+
aum: Maybe<Decimal>;
|
|
67
|
+
hedgepnl: Maybe<Decimal>;
|
|
68
|
+
feemngt: Maybe<Decimal>;
|
|
69
|
+
feeperf: Maybe<Decimal>;
|
|
70
|
+
otheraccrued: Maybe<Decimal>;
|
|
71
|
+
totalaccrued: Maybe<Decimal>;
|
|
72
|
+
subred: Maybe<Decimal>;
|
|
73
|
+
perfdaily: Maybe<Decimal>;
|
|
74
|
+
perfweekly: Maybe<Decimal>;
|
|
75
|
+
perfmonthly: Maybe<Decimal>;
|
|
76
|
+
perfytd: Maybe<Decimal>;
|
|
77
|
+
perfstart: Maybe<Decimal>;
|
|
78
|
+
coefficient: Maybe<Decimal>;
|
|
79
|
+
}
|
|
@@ -7,7 +7,7 @@ export interface PortfolioValuationReport extends BaseValuationReport {
|
|
|
7
7
|
shareClassValues: PortfolioValuationReportShareClassValue[];
|
|
8
8
|
}
|
|
9
9
|
export interface PortfolioValuationReportShareClassValue {
|
|
10
|
-
shareclass: PortfolioValuationReportShareClass
|
|
10
|
+
shareclass: Maybe<PortfolioValuationReportShareClass>;
|
|
11
11
|
external: Maybe<PortfolioValuationReportExternalValue>;
|
|
12
12
|
nav: Decimal;
|
|
13
13
|
navAdjusted: Decimal;
|
|
@@ -15,9 +15,9 @@ export interface PortfolioValuationReportShareClassValue {
|
|
|
15
15
|
coefficient: Decimal;
|
|
16
16
|
gavRefccy: Decimal;
|
|
17
17
|
gavClsccy: Decimal;
|
|
18
|
-
sharecountPrev: Decimal
|
|
19
|
-
sharecountCurr: Decimal
|
|
20
|
-
sharecountDiff: Decimal
|
|
18
|
+
sharecountPrev: Maybe<Decimal>;
|
|
19
|
+
sharecountCurr: Maybe<Decimal>;
|
|
20
|
+
sharecountDiff: Maybe<Decimal>;
|
|
21
21
|
pxRefCcy: Maybe<Decimal>;
|
|
22
22
|
pxClsCcy: Maybe<Decimal>;
|
|
23
23
|
ytdExt: Maybe<Decimal>;
|
|
@@ -2,7 +2,10 @@ export { fetchConsolidatedValuationReport } from './-remote-valuation-report-con
|
|
|
2
2
|
export type { ConsolidatedValuationReportQuery } from './-remote-valuation-report-consolidated';
|
|
3
3
|
export { fetchPortfolioValuationReport } from './-remote-valuation-report-portfolio';
|
|
4
4
|
export type { PortfolioValuationReportQuery } from './-remote-valuation-report-portfolio';
|
|
5
|
+
export { fetchAccountValuationReport } from './-remote-valuation-report-account';
|
|
6
|
+
export type { AccountValuationReportQuery } from './-remote-valuation-report-account';
|
|
5
7
|
export * from './-valuation-report-consolidated';
|
|
6
8
|
export * from './-valuation-report-holdings-tree';
|
|
7
9
|
export * from './-valuation-report-portfolio';
|
|
8
10
|
export * from './-valuation-report-shared';
|
|
11
|
+
export * from './-valuation-report-account';
|
|
@@ -14,12 +14,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.fetchPortfolioValuationReport = exports.fetchConsolidatedValuationReport = void 0;
|
|
17
|
+
exports.fetchAccountValuationReport = exports.fetchPortfolioValuationReport = exports.fetchConsolidatedValuationReport = void 0;
|
|
18
18
|
var _remote_valuation_report_consolidated_1 = require("./-remote-valuation-report-consolidated");
|
|
19
19
|
Object.defineProperty(exports, "fetchConsolidatedValuationReport", { enumerable: true, get: function () { return _remote_valuation_report_consolidated_1.fetchConsolidatedValuationReport; } });
|
|
20
20
|
var _remote_valuation_report_portfolio_1 = require("./-remote-valuation-report-portfolio");
|
|
21
21
|
Object.defineProperty(exports, "fetchPortfolioValuationReport", { enumerable: true, get: function () { return _remote_valuation_report_portfolio_1.fetchPortfolioValuationReport; } });
|
|
22
|
+
var _remote_valuation_report_account_1 = require("./-remote-valuation-report-account");
|
|
23
|
+
Object.defineProperty(exports, "fetchAccountValuationReport", { enumerable: true, get: function () { return _remote_valuation_report_account_1.fetchAccountValuationReport; } });
|
|
22
24
|
__exportStar(require("./-valuation-report-consolidated"), exports);
|
|
23
25
|
__exportStar(require("./-valuation-report-holdings-tree"), exports);
|
|
24
26
|
__exportStar(require("./-valuation-report-portfolio"), exports);
|
|
25
27
|
__exportStar(require("./-valuation-report-shared"), exports);
|
|
28
|
+
__exportStar(require("./-valuation-report-account"), exports);
|