@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.5.0](https://github.com/teloscube/decaf-client-javascript-extras/compare/v0.4.0...v0.5.0) (2024-08-14)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* drop support for Node 16 and add Node 22
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* implement account valuation report ([26cb078](https://github.com/teloscube/decaf-client-javascript-extras/commit/26cb078a3e9a13811366be1f22b25326bdc79fa9))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Miscellaneous Chores
|
|
16
|
+
|
|
17
|
+
* drop support for Node 16 and add Node 22 ([e23f398](https://github.com/teloscube/decaf-client-javascript-extras/commit/e23f398d19e1c95630e690ed8323e0561afae787))
|
|
18
|
+
|
|
19
|
+
## [0.4.0](https://github.com/teloscube/decaf-client-javascript-extras/compare/v0.3.0...v0.4.0) (2024-03-28)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### ⚠ BREAKING CHANGES
|
|
23
|
+
|
|
24
|
+
* fix various type issues due to DECAF Barista v2 release
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* fix various type issues due to DECAF Barista v2 release ([f15d9ac](https://github.com/teloscube/decaf-client-javascript-extras/commit/f15d9ac523b4911abd7fc9705803fd85e0e0acb5))
|
|
29
|
+
|
|
3
30
|
## [0.3.0](https://github.com/teloscube/decaf-client-javascript-extras/compare/v0.2.0...v0.3.0) (2023-12-05)
|
|
4
31
|
|
|
5
32
|
|
package/README.md
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
|
-
Install
|
|
9
|
+
Install `@decafhub/decaf-client-extras` along with its peer dependencies:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
npm install --save @decafhub/decaf-client
|
|
12
|
+
npm install --save dayjs @decafhub/decaf-client @decafhub/decaf-client-extras
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Testing
|
|
@@ -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,135 @@
|
|
|
1
|
+
import { customError, decimalFromNullable, Left, Maybe, Right, sanitizedNonEmptyText, unsafeDecimal, zero, } from '@telostat/prelude';
|
|
2
|
+
import { recompileBaseValuationReport } from './-remote-valuation-report-shared';
|
|
3
|
+
/**
|
|
4
|
+
* Attempts to retrieve remote account valuation report.
|
|
5
|
+
*
|
|
6
|
+
* @param client DECAF Barista client.
|
|
7
|
+
* @param query Remote account valuation report endpoint query parameters.
|
|
8
|
+
* @returns Remote (raw) account valuation report data.
|
|
9
|
+
*/
|
|
10
|
+
export async function fetchRemoteAccountValuationReport(client, query) {
|
|
11
|
+
return client.barista
|
|
12
|
+
.get('/reports/valuation/account/', {
|
|
13
|
+
params: {
|
|
14
|
+
ccy: query.currency,
|
|
15
|
+
date: query.date,
|
|
16
|
+
type: query.dateType,
|
|
17
|
+
account: `${query.account}`,
|
|
18
|
+
},
|
|
19
|
+
})
|
|
20
|
+
.then((x) => Right(x.data))
|
|
21
|
+
.catch((err) => Left(customError('Error while attempting to fetch remote account valuation report', err)));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Attempts to recompile remote valuation report share class value.
|
|
25
|
+
*
|
|
26
|
+
* @param x remote valuation report share class value object.
|
|
27
|
+
* @return Recompiled valuation report share class value object.
|
|
28
|
+
*/
|
|
29
|
+
export function toShareClassValue(s) {
|
|
30
|
+
const shareclass = Maybe.fromNullable(s.shareclass).map((x) => ({
|
|
31
|
+
id: x.id,
|
|
32
|
+
created: x.created,
|
|
33
|
+
creator: Maybe.fromNullable(x.creator),
|
|
34
|
+
updated: x.updated,
|
|
35
|
+
updater: Maybe.fromNullable(x.updater),
|
|
36
|
+
guid: x.guid,
|
|
37
|
+
portfolio: x.portfolio,
|
|
38
|
+
name: x.name,
|
|
39
|
+
currency: x.currency,
|
|
40
|
+
isin: sanitizedNonEmptyText(x.isin),
|
|
41
|
+
bbgticker: sanitizedNonEmptyText(x.bbgticker),
|
|
42
|
+
liquidity: sanitizedNonEmptyText(x.liquidity),
|
|
43
|
+
jurisdiction: sanitizedNonEmptyText(x.jurisdiction),
|
|
44
|
+
administrator: sanitizedNonEmptyText(x.administrator),
|
|
45
|
+
minimumInvestment: Maybe.fromNullable(x.mininvestment),
|
|
46
|
+
subscriptionRedemptionPeriod: sanitizedNonEmptyText(x.subredperiod),
|
|
47
|
+
managementFeeFrequency: Maybe.fromNullable(x.freqmngt),
|
|
48
|
+
performanceFeeFrequency: Maybe.fromNullable(x.freqperf),
|
|
49
|
+
benchmark: Maybe.fromNullable(x.benchmark),
|
|
50
|
+
description: sanitizedNonEmptyText(x.description),
|
|
51
|
+
feeScheduleIds: x.feeschedules,
|
|
52
|
+
effectiveFeeScheduleId: Maybe.fromNullable(x.effectivefeeschedule),
|
|
53
|
+
subscriptionIds: x.subscriptions,
|
|
54
|
+
outstanding: decimalFromNullable(x.outstanding),
|
|
55
|
+
}));
|
|
56
|
+
return {
|
|
57
|
+
shareclass,
|
|
58
|
+
external: Maybe.fromNullable(s.external).map((ev) => ({
|
|
59
|
+
id: ev.id,
|
|
60
|
+
created: ev.created,
|
|
61
|
+
creator: Maybe.fromNullable(ev.updater),
|
|
62
|
+
updated: ev.updated,
|
|
63
|
+
updater: Maybe.fromNullable(ev.updater),
|
|
64
|
+
guid: ev.guid,
|
|
65
|
+
portfolio: ev.portfolio,
|
|
66
|
+
shareclass: Maybe.fromNullable(ev.shareclass),
|
|
67
|
+
date: ev.date,
|
|
68
|
+
ccy: ev.ccy,
|
|
69
|
+
shares: decimalFromNullable(ev.shares),
|
|
70
|
+
price: decimalFromNullable(ev.price),
|
|
71
|
+
nav: decimalFromNullable(ev.nav),
|
|
72
|
+
aum: decimalFromNullable(ev.aum),
|
|
73
|
+
hedgepnl: decimalFromNullable(ev.hedgepnl),
|
|
74
|
+
feemngt: decimalFromNullable(ev.feemngt),
|
|
75
|
+
feeperf: decimalFromNullable(ev.feeperf),
|
|
76
|
+
otheraccrued: decimalFromNullable(ev.otheraccrued),
|
|
77
|
+
totalaccrued: decimalFromNullable(ev.totalaccrued),
|
|
78
|
+
subred: decimalFromNullable(ev.subred),
|
|
79
|
+
perfdaily: decimalFromNullable(ev.perfdaily),
|
|
80
|
+
perfweekly: decimalFromNullable(ev.perfweekly),
|
|
81
|
+
perfmonthly: decimalFromNullable(ev.perfmonthly),
|
|
82
|
+
perfytd: decimalFromNullable(ev.perfytd),
|
|
83
|
+
perfstart: decimalFromNullable(ev.perfstart),
|
|
84
|
+
coefficient: decimalFromNullable(ev.coefficient),
|
|
85
|
+
})),
|
|
86
|
+
nav: unsafeDecimal(s.nav),
|
|
87
|
+
navAdjusted: unsafeDecimal(s.nav_adjusted),
|
|
88
|
+
navAdjustedTotal: unsafeDecimal(s.nav_adjusted_total),
|
|
89
|
+
coefficient: unsafeDecimal(s.coefficient),
|
|
90
|
+
gavRefccy: unsafeDecimal(s.gav_refccy),
|
|
91
|
+
gavClsccy: unsafeDecimal(s.gav_clsccy),
|
|
92
|
+
sharecountPrev: Maybe.fromNullable(s.sharecount_prev).map(unsafeDecimal),
|
|
93
|
+
sharecountCurr: Maybe.fromNullable(s.sharecount_curr).map(unsafeDecimal),
|
|
94
|
+
sharecountDiff: Maybe.fromNullable(s.sharecount_diff).map(unsafeDecimal),
|
|
95
|
+
pxRefCcy: decimalFromNullable(s.px_refccy),
|
|
96
|
+
pxClsCcy: decimalFromNullable(s.px_clsccy),
|
|
97
|
+
ytdExt: decimalFromNullable(s.ytdext),
|
|
98
|
+
ytdInt: decimalFromNullable(s.ytdint),
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Attempts to re-compile the raw, remote account valuation report and
|
|
103
|
+
* return it.
|
|
104
|
+
*
|
|
105
|
+
* @param x Raw, remote account valuation report.
|
|
106
|
+
* @returns Either of an error message or the re-compiled account valuation
|
|
107
|
+
* report.
|
|
108
|
+
*/
|
|
109
|
+
export function recompileAccountValuationReport(x) {
|
|
110
|
+
// Attempt to get the base valuation report:
|
|
111
|
+
const baseReport = recompileBaseValuationReport(x);
|
|
112
|
+
// Add consolidated valuation report specific fields and return:
|
|
113
|
+
return baseReport.map((report) => {
|
|
114
|
+
return {
|
|
115
|
+
...report,
|
|
116
|
+
account: x.account,
|
|
117
|
+
subscriptions: decimalFromNullable(x.subscriptions).orDefault(zero),
|
|
118
|
+
shareClassValues: x.scvals.map(toShareClassValue),
|
|
119
|
+
};
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Attempts to retrieve remote account valuation report, compiles it to
|
|
124
|
+
* {@link AccountValuationReport} and return it.
|
|
125
|
+
*
|
|
126
|
+
* @param client DECAF Barista client.
|
|
127
|
+
* @param query Remote account valuation report endpoint query parameters.
|
|
128
|
+
* @returns Recompiled account valuation report data.
|
|
129
|
+
*/
|
|
130
|
+
export async function fetchAccountValuationReport(client, query) {
|
|
131
|
+
// Attempt to fetch the remote, raw report:
|
|
132
|
+
const rawReport = await fetchRemoteAccountValuationReport(client, query);
|
|
133
|
+
// Attempt to recompile the report (if any) and return:
|
|
134
|
+
return rawReport.chain(recompileAccountValuationReport);
|
|
135
|
+
}
|
|
@@ -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.
|
|
@@ -26,35 +26,36 @@ export function fetchRemotePortfolioValuationReport(client, query) {
|
|
|
26
26
|
* @param x remote valuation report share class value object.
|
|
27
27
|
* @return Recompiled valuation report share class value object.
|
|
28
28
|
*/
|
|
29
|
-
export function toShareClassValue(
|
|
29
|
+
export function toShareClassValue(s) {
|
|
30
|
+
const shareclass = Maybe.fromNullable(s.shareclass).map((x) => ({
|
|
31
|
+
id: x.id,
|
|
32
|
+
created: x.created,
|
|
33
|
+
creator: Maybe.fromNullable(x.creator),
|
|
34
|
+
updated: x.updated,
|
|
35
|
+
updater: Maybe.fromNullable(x.updater),
|
|
36
|
+
guid: x.guid,
|
|
37
|
+
portfolio: x.portfolio,
|
|
38
|
+
name: x.name,
|
|
39
|
+
currency: x.currency,
|
|
40
|
+
isin: sanitizedNonEmptyText(x.isin),
|
|
41
|
+
bbgticker: sanitizedNonEmptyText(x.bbgticker),
|
|
42
|
+
liquidity: sanitizedNonEmptyText(x.liquidity),
|
|
43
|
+
jurisdiction: sanitizedNonEmptyText(x.jurisdiction),
|
|
44
|
+
administrator: sanitizedNonEmptyText(x.administrator),
|
|
45
|
+
minimumInvestment: Maybe.fromNullable(x.mininvestment),
|
|
46
|
+
subscriptionRedemptionPeriod: sanitizedNonEmptyText(x.subredperiod),
|
|
47
|
+
managementFeeFrequency: Maybe.fromNullable(x.freqmngt),
|
|
48
|
+
performanceFeeFrequency: Maybe.fromNullable(x.freqperf),
|
|
49
|
+
benchmark: Maybe.fromNullable(x.benchmark),
|
|
50
|
+
description: sanitizedNonEmptyText(x.description),
|
|
51
|
+
feeScheduleIds: x.feeschedules,
|
|
52
|
+
effectiveFeeScheduleId: Maybe.fromNullable(x.effectivefeeschedule),
|
|
53
|
+
subscriptionIds: x.subscriptions,
|
|
54
|
+
outstanding: decimalFromNullable(x.outstanding),
|
|
55
|
+
}));
|
|
30
56
|
return {
|
|
31
|
-
shareclass
|
|
32
|
-
|
|
33
|
-
created: x.shareclass.created,
|
|
34
|
-
creator: Maybe.fromNullable(x.shareclass.creator),
|
|
35
|
-
updated: x.shareclass.updated,
|
|
36
|
-
updater: Maybe.fromNullable(x.shareclass.updater),
|
|
37
|
-
guid: x.shareclass.guid,
|
|
38
|
-
portfolio: x.shareclass.portfolio,
|
|
39
|
-
name: x.shareclass.name,
|
|
40
|
-
currency: x.shareclass.currency,
|
|
41
|
-
isin: sanitizedNonEmptyText(x.shareclass.isin),
|
|
42
|
-
bbgticker: sanitizedNonEmptyText(x.shareclass.bbgticker),
|
|
43
|
-
liquidity: sanitizedNonEmptyText(x.shareclass.liquidity),
|
|
44
|
-
jurisdiction: sanitizedNonEmptyText(x.shareclass.jurisdiction),
|
|
45
|
-
administrator: sanitizedNonEmptyText(x.shareclass.administrator),
|
|
46
|
-
minimumInvestment: Maybe.fromNullable(x.shareclass.mininvestment),
|
|
47
|
-
subscriptionRedemptionPeriod: sanitizedNonEmptyText(x.shareclass.subredperiod),
|
|
48
|
-
managementFeeFrequency: Maybe.fromNullable(x.shareclass.freqmngt),
|
|
49
|
-
performanceFeeFrequency: Maybe.fromNullable(x.shareclass.freqperf),
|
|
50
|
-
benchmark: Maybe.fromNullable(x.shareclass.benchmark),
|
|
51
|
-
description: sanitizedNonEmptyText(x.shareclass.description),
|
|
52
|
-
feeScheduleIds: x.shareclass.feeschedules,
|
|
53
|
-
effectiveFeeScheduleId: Maybe.fromNullable(x.shareclass.effectivefeeschedule),
|
|
54
|
-
subscriptionIds: x.shareclass.subscriptions,
|
|
55
|
-
outstanding: decimalFromNullable(x.shareclass.outstanding),
|
|
56
|
-
},
|
|
57
|
-
external: Maybe.fromNullable(x.external).map((ev) => ({
|
|
57
|
+
shareclass,
|
|
58
|
+
external: Maybe.fromNullable(s.external).map((ev) => ({
|
|
58
59
|
id: ev.id,
|
|
59
60
|
created: ev.created,
|
|
60
61
|
creator: Maybe.fromNullable(ev.updater),
|
|
@@ -82,19 +83,19 @@ export function toShareClassValue(x) {
|
|
|
82
83
|
perfstart: decimalFromNullable(ev.perfstart),
|
|
83
84
|
coefficient: decimalFromNullable(ev.coefficient),
|
|
84
85
|
})),
|
|
85
|
-
nav: unsafeDecimal(
|
|
86
|
-
navAdjusted: unsafeDecimal(
|
|
87
|
-
navAdjustedTotal: unsafeDecimal(
|
|
88
|
-
coefficient: unsafeDecimal(
|
|
89
|
-
gavRefccy: unsafeDecimal(
|
|
90
|
-
gavClsccy: unsafeDecimal(
|
|
91
|
-
sharecountPrev:
|
|
92
|
-
sharecountCurr:
|
|
93
|
-
sharecountDiff:
|
|
94
|
-
pxRefCcy: decimalFromNullable(
|
|
95
|
-
pxClsCcy: decimalFromNullable(
|
|
96
|
-
ytdExt: decimalFromNullable(
|
|
97
|
-
ytdInt: decimalFromNullable(
|
|
86
|
+
nav: unsafeDecimal(s.nav),
|
|
87
|
+
navAdjusted: unsafeDecimal(s.nav_adjusted),
|
|
88
|
+
navAdjustedTotal: unsafeDecimal(s.nav_adjusted_total),
|
|
89
|
+
coefficient: unsafeDecimal(s.coefficient),
|
|
90
|
+
gavRefccy: unsafeDecimal(s.gav_refccy),
|
|
91
|
+
gavClsccy: unsafeDecimal(s.gav_clsccy),
|
|
92
|
+
sharecountPrev: Maybe.fromNullable(s.sharecount_prev).map(unsafeDecimal),
|
|
93
|
+
sharecountCurr: Maybe.fromNullable(s.sharecount_curr).map(unsafeDecimal),
|
|
94
|
+
sharecountDiff: Maybe.fromNullable(s.sharecount_diff).map(unsafeDecimal),
|
|
95
|
+
pxRefCcy: decimalFromNullable(s.px_refccy),
|
|
96
|
+
pxClsCcy: decimalFromNullable(s.px_clsccy),
|
|
97
|
+
ytdExt: decimalFromNullable(s.ytdext),
|
|
98
|
+
ytdInt: decimalFromNullable(s.ytdint),
|
|
98
99
|
};
|
|
99
100
|
}
|
|
100
101
|
/**
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { fetchConsolidatedValuationReport } from './-remote-valuation-report-consolidated';
|
|
2
2
|
export { fetchPortfolioValuationReport } from './-remote-valuation-report-portfolio';
|
|
3
|
+
export { fetchAccountValuationReport } from './-remote-valuation-report-account';
|
|
3
4
|
export * from './-valuation-report-consolidated';
|
|
4
5
|
export * from './-valuation-report-holdings-tree';
|
|
5
6
|
export * from './-valuation-report-portfolio';
|
|
6
7
|
export * from './-valuation-report-shared';
|
|
8
|
+
export * from './-valuation-report-account';
|
package/package.json
CHANGED