@decafhub/decaf-client-extras 0.0.3 → 0.0.5
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/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +14 -0
- package/README.md +13 -1
- package/commons/-currency.d.ts +8 -8
- package/commons/-currency.js +7 -7
- package/commons/-date-type.d.ts +1 -1
- package/commons/-id.d.ts +14 -14
- package/es/commons/-currency.d.ts +8 -8
- package/es/commons/-currency.js +7 -7
- package/es/commons/-date-type.d.ts +1 -1
- package/es/commons/-id.d.ts +14 -14
- package/es/reports/valuation/-remote-valuation-report-consolidated.d.ts +1 -1
- package/es/reports/valuation/-remote-valuation-report-consolidated.js +1 -1
- package/es/reports/valuation/-remote-valuation-report-portfolio.d.ts +1 -1
- package/es/reports/valuation/-remote-valuation-report-portfolio.js +1 -1
- package/es/reports/valuation/-valuation-report-consolidated.d.ts +1 -1
- package/es/reports/valuation/-valuation-report-holdings-tree/-machinery.js +5 -2
- package/es/reports/valuation/-valuation-report-shared.d.ts +2 -2
- package/package.json +21 -21
- package/reports/valuation/-remote-valuation-report-consolidated.d.ts +1 -1
- package/reports/valuation/-remote-valuation-report-consolidated.js +2 -2
- package/reports/valuation/-remote-valuation-report-portfolio.d.ts +1 -1
- package/reports/valuation/-remote-valuation-report-portfolio.js +2 -2
- package/reports/valuation/-valuation-report-consolidated.d.ts +1 -1
- package/reports/valuation/-valuation-report-holdings-tree/-machinery.js +7 -2
- package/reports/valuation/-valuation-report-shared.d.ts +2 -2
- package/src/commons/-currency.ts +7 -7
- package/src/index.test.ts +31 -2
- package/src/reports/valuation/-remote-valuation-report-consolidated.ts +1 -1
- package/src/reports/valuation/-remote-valuation-report-portfolio.ts +1 -1
- package/src/reports/valuation/-valuation-report-holdings-tree/-machinery.ts +13 -2
- package/src/reports/valuation/-valuation-report-shared.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.5](https://github.com/teloscube/decaf-client-javascript-extras/compare/v0.0.4...v0.0.5) (2022-12-28)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* exclude cash holdings from total exposure calculation ([09d7133](https://github.com/teloscube/decaf-client-javascript-extras/commit/09d7133515d9670dc3c5a641dd84d1e57fa5d5ee))
|
|
9
|
+
|
|
10
|
+
## [0.0.4](https://github.com/teloscube/decaf-client-javascript-extras/compare/v0.0.3...v0.0.4) (2022-11-07)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Miscellaneous Chores
|
|
14
|
+
|
|
15
|
+
* release 0.0.4 ([b3f7a12](https://github.com/teloscube/decaf-client-javascript-extras/commit/b3f7a12b5dbd1ffac7db06f03958d71581889d92))
|
|
16
|
+
|
|
3
17
|
## [0.0.3](https://github.com/teloscube/decaf-client-javascript-extras/compare/v0.0.2...v0.0.3) (2022-08-25)
|
|
4
18
|
|
|
5
19
|
|
package/README.md
CHANGED
|
@@ -4,7 +4,19 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/@decafhub/decaf-client-extras)
|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
Install @decafhub/decaf-client-extras along with its peer dependency @decafhub/decaf-client:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install --save @decafhub/decaf-client-extras @decafhub/decaf-client
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Or with yarn:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
yarn add @decafhub/decaf-client-extras @decafhub/decaf-client
|
|
19
|
+
```
|
|
8
20
|
|
|
9
21
|
## Testing
|
|
10
22
|
|
package/commons/-currency.d.ts
CHANGED
|
@@ -9,34 +9,34 @@ import { Maybe, NewTypeWithPhantom } from '@telostat/prelude';
|
|
|
9
9
|
*
|
|
10
10
|
* A currency code is (typically) defined as all-uppercase, three letters.
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export type CurrencyCode = NewTypeWithPhantom<'CurrencyCode', string>;
|
|
13
13
|
/**
|
|
14
|
-
* Attempts to create a
|
|
14
|
+
* Attempts to create a {@link CurrencyCode} value with the given currency code.
|
|
15
15
|
*
|
|
16
16
|
* This function returns a `Maybe` value. For the version that throws an
|
|
17
|
-
* error, see
|
|
17
|
+
* error, see {@link mkCurrencyCodeError}.
|
|
18
18
|
*
|
|
19
19
|
* @param x A currency code represented as string.
|
|
20
20
|
* @returns If the argument has leading or trailing spaces OR it is empty,
|
|
21
|
-
* `Nothing` is retured, `Just`
|
|
21
|
+
* `Nothing` is retured, `Just` {@link CurrencyCode} otherwise.
|
|
22
22
|
*/
|
|
23
23
|
export declare function mkCurrencyCode(x: string): Maybe<CurrencyCode>;
|
|
24
24
|
/**
|
|
25
|
-
* (Unsafely) attempts to create a
|
|
25
|
+
* (Unsafely) attempts to create a {@link CurrencyCode} value with the given
|
|
26
26
|
* currency code.
|
|
27
27
|
*
|
|
28
28
|
* This function may throw an error if the given argument is not a valid
|
|
29
|
-
* currency code. For the monadic version, see
|
|
29
|
+
* currency code. For the monadic version, see {@link mkCurrencyCode}.
|
|
30
30
|
*
|
|
31
31
|
* @param x A currency code represented as string.
|
|
32
32
|
* @returns If the argument has leading or trailing spaces OR it is empty, an
|
|
33
|
-
* error is thrown,
|
|
33
|
+
* error is thrown, {@link CurrencyCode} is returned otherwise.
|
|
34
34
|
*/
|
|
35
35
|
export declare function mkCurrencyCodeError(x: string): CurrencyCode;
|
|
36
36
|
/**
|
|
37
37
|
* Return the currency code as a string value.
|
|
38
38
|
*
|
|
39
|
-
* @param x
|
|
39
|
+
* @param x {@link CurrencyCode} to be extracted string from.
|
|
40
40
|
* @returns Currency code as a string.
|
|
41
41
|
*/
|
|
42
42
|
export declare function unCurrencyCode(x: CurrencyCode): string;
|
package/commons/-currency.js
CHANGED
|
@@ -8,29 +8,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.unCurrencyCode = exports.mkCurrencyCodeError = exports.mkCurrencyCode = void 0;
|
|
9
9
|
var prelude_1 = require("@telostat/prelude");
|
|
10
10
|
/**
|
|
11
|
-
* Attempts to create a
|
|
11
|
+
* Attempts to create a {@link CurrencyCode} value with the given currency code.
|
|
12
12
|
*
|
|
13
13
|
* This function returns a `Maybe` value. For the version that throws an
|
|
14
|
-
* error, see
|
|
14
|
+
* error, see {@link mkCurrencyCodeError}.
|
|
15
15
|
*
|
|
16
16
|
* @param x A currency code represented as string.
|
|
17
17
|
* @returns If the argument has leading or trailing spaces OR it is empty,
|
|
18
|
-
* `Nothing` is retured, `Just`
|
|
18
|
+
* `Nothing` is retured, `Just` {@link CurrencyCode} otherwise.
|
|
19
19
|
*/
|
|
20
20
|
function mkCurrencyCode(x) {
|
|
21
21
|
return x !== x.trim() || x === '' ? prelude_1.Nothing : (0, prelude_1.Just)((0, prelude_1.mkPhantom)(x));
|
|
22
22
|
}
|
|
23
23
|
exports.mkCurrencyCode = mkCurrencyCode;
|
|
24
24
|
/**
|
|
25
|
-
* (Unsafely) attempts to create a
|
|
25
|
+
* (Unsafely) attempts to create a {@link CurrencyCode} value with the given
|
|
26
26
|
* currency code.
|
|
27
27
|
*
|
|
28
28
|
* This function may throw an error if the given argument is not a valid
|
|
29
|
-
* currency code. For the monadic version, see
|
|
29
|
+
* currency code. For the monadic version, see {@link mkCurrencyCode}.
|
|
30
30
|
*
|
|
31
31
|
* @param x A currency code represented as string.
|
|
32
32
|
* @returns If the argument has leading or trailing spaces OR it is empty, an
|
|
33
|
-
* error is thrown,
|
|
33
|
+
* error is thrown, {@link CurrencyCode} is returned otherwise.
|
|
34
34
|
*/
|
|
35
35
|
function mkCurrencyCodeError(x) {
|
|
36
36
|
return mkCurrencyCode(x).orDefaultLazy(function () {
|
|
@@ -41,7 +41,7 @@ exports.mkCurrencyCodeError = mkCurrencyCodeError;
|
|
|
41
41
|
/**
|
|
42
42
|
* Return the currency code as a string value.
|
|
43
43
|
*
|
|
44
|
-
* @param x
|
|
44
|
+
* @param x {@link CurrencyCode} to be extracted string from.
|
|
45
45
|
* @returns Currency code as a string.
|
|
46
46
|
*/
|
|
47
47
|
function unCurrencyCode(x) {
|
package/commons/-date-type.d.ts
CHANGED
package/commons/-id.d.ts
CHANGED
|
@@ -3,56 +3,56 @@ import { NewTypeWithPhantom } from '@telostat/prelude';
|
|
|
3
3
|
* Type definition for identifiers with value spaces discriminated over the
|
|
4
4
|
* given phantom type.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type Id<P, V> = NewTypeWithPhantom<P, V>;
|
|
7
7
|
/**
|
|
8
8
|
* Type definition for DECAF artifact identifiers.
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export type ArtifactId = NewTypeWithPhantom<'DecafArtifact', string | number>;
|
|
11
11
|
/**
|
|
12
12
|
* Type definition for DECAF artifact type identifiers.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export type ArtifactTypeId = NewTypeWithPhantom<'DecafArtifactType', string>;
|
|
15
15
|
/**
|
|
16
16
|
* Type definition for DECAF share class identifiers.
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
18
|
+
export type ShareClassId = NewTypeWithPhantom<'DecafShareClass', string | number>;
|
|
19
19
|
/**
|
|
20
20
|
* Type definition for DECAF principal identifiers.
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
22
|
+
export type PrincipalId = NewTypeWithPhantom<'DecafPrincipal', string | number>;
|
|
23
23
|
/**
|
|
24
24
|
* Type definition for DECAF institution identifiers.
|
|
25
25
|
*/
|
|
26
|
-
export
|
|
26
|
+
export type InstitutionId = NewTypeWithPhantom<'DecafInstitution', string | number>;
|
|
27
27
|
/**
|
|
28
28
|
* Type definition for DECAF team identifiers.
|
|
29
29
|
*/
|
|
30
|
-
export
|
|
30
|
+
export type TeamId = NewTypeWithPhantom<'DecafTeam', string | number>;
|
|
31
31
|
/**
|
|
32
32
|
* Type definition for DECAF portfolio identifiers.
|
|
33
33
|
*/
|
|
34
|
-
export
|
|
34
|
+
export type PortfolioId = NewTypeWithPhantom<'DecafPortfolio', string | number>;
|
|
35
35
|
/**
|
|
36
36
|
* Type definition for DECAF portfolio group identifiers.
|
|
37
37
|
*/
|
|
38
|
-
export
|
|
38
|
+
export type PortfolioGroupId = NewTypeWithPhantom<'DecafPortfolioGroup', string | number>;
|
|
39
39
|
/**
|
|
40
40
|
* Type definition for DECAF account identifiers.
|
|
41
41
|
*/
|
|
42
|
-
export
|
|
42
|
+
export type AccountId = NewTypeWithPhantom<'DecafAccount', string | number>;
|
|
43
43
|
/**
|
|
44
44
|
* Type definition for DECAF OHLC series identifiers.
|
|
45
45
|
*/
|
|
46
|
-
export
|
|
46
|
+
export type OhlcSeriesId = NewTypeWithPhantom<'DecafOhlcSeries', string | number>;
|
|
47
47
|
/**
|
|
48
48
|
* Type definition for DECAF share class fee schedule identifiers.
|
|
49
49
|
*/
|
|
50
|
-
export
|
|
50
|
+
export type ShareClassFeeScheduleId = NewTypeWithPhantom<'DecafShareClassFeeSchedule', string | number>;
|
|
51
51
|
/**
|
|
52
52
|
* Type definition for DECAF action identifiers.
|
|
53
53
|
*/
|
|
54
|
-
export
|
|
54
|
+
export type ActionId = NewTypeWithPhantom<'DecafAction', string | number>;
|
|
55
55
|
/**
|
|
56
56
|
* Type definition for DECAF external valuation identifiers.
|
|
57
57
|
*/
|
|
58
|
-
export
|
|
58
|
+
export type ExternalValuationId = NewTypeWithPhantom<'DecafExternalValuation', string | number>;
|
|
@@ -9,34 +9,34 @@ import { Maybe, NewTypeWithPhantom } from '@telostat/prelude';
|
|
|
9
9
|
*
|
|
10
10
|
* A currency code is (typically) defined as all-uppercase, three letters.
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export type CurrencyCode = NewTypeWithPhantom<'CurrencyCode', string>;
|
|
13
13
|
/**
|
|
14
|
-
* Attempts to create a
|
|
14
|
+
* Attempts to create a {@link CurrencyCode} value with the given currency code.
|
|
15
15
|
*
|
|
16
16
|
* This function returns a `Maybe` value. For the version that throws an
|
|
17
|
-
* error, see
|
|
17
|
+
* error, see {@link mkCurrencyCodeError}.
|
|
18
18
|
*
|
|
19
19
|
* @param x A currency code represented as string.
|
|
20
20
|
* @returns If the argument has leading or trailing spaces OR it is empty,
|
|
21
|
-
* `Nothing` is retured, `Just`
|
|
21
|
+
* `Nothing` is retured, `Just` {@link CurrencyCode} otherwise.
|
|
22
22
|
*/
|
|
23
23
|
export declare function mkCurrencyCode(x: string): Maybe<CurrencyCode>;
|
|
24
24
|
/**
|
|
25
|
-
* (Unsafely) attempts to create a
|
|
25
|
+
* (Unsafely) attempts to create a {@link CurrencyCode} value with the given
|
|
26
26
|
* currency code.
|
|
27
27
|
*
|
|
28
28
|
* This function may throw an error if the given argument is not a valid
|
|
29
|
-
* currency code. For the monadic version, see
|
|
29
|
+
* currency code. For the monadic version, see {@link mkCurrencyCode}.
|
|
30
30
|
*
|
|
31
31
|
* @param x A currency code represented as string.
|
|
32
32
|
* @returns If the argument has leading or trailing spaces OR it is empty, an
|
|
33
|
-
* error is thrown,
|
|
33
|
+
* error is thrown, {@link CurrencyCode} is returned otherwise.
|
|
34
34
|
*/
|
|
35
35
|
export declare function mkCurrencyCodeError(x: string): CurrencyCode;
|
|
36
36
|
/**
|
|
37
37
|
* Return the currency code as a string value.
|
|
38
38
|
*
|
|
39
|
-
* @param x
|
|
39
|
+
* @param x {@link CurrencyCode} to be extracted string from.
|
|
40
40
|
* @returns Currency code as a string.
|
|
41
41
|
*/
|
|
42
42
|
export declare function unCurrencyCode(x: CurrencyCode): string;
|
package/es/commons/-currency.js
CHANGED
|
@@ -5,28 +5,28 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { Just, mkPhantom, Nothing, unPhantom } from '@telostat/prelude';
|
|
7
7
|
/**
|
|
8
|
-
* Attempts to create a
|
|
8
|
+
* Attempts to create a {@link CurrencyCode} value with the given currency code.
|
|
9
9
|
*
|
|
10
10
|
* This function returns a `Maybe` value. For the version that throws an
|
|
11
|
-
* error, see
|
|
11
|
+
* error, see {@link mkCurrencyCodeError}.
|
|
12
12
|
*
|
|
13
13
|
* @param x A currency code represented as string.
|
|
14
14
|
* @returns If the argument has leading or trailing spaces OR it is empty,
|
|
15
|
-
* `Nothing` is retured, `Just`
|
|
15
|
+
* `Nothing` is retured, `Just` {@link CurrencyCode} otherwise.
|
|
16
16
|
*/
|
|
17
17
|
export function mkCurrencyCode(x) {
|
|
18
18
|
return x !== x.trim() || x === '' ? Nothing : Just(mkPhantom(x));
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
* (Unsafely) attempts to create a
|
|
21
|
+
* (Unsafely) attempts to create a {@link CurrencyCode} value with the given
|
|
22
22
|
* currency code.
|
|
23
23
|
*
|
|
24
24
|
* This function may throw an error if the given argument is not a valid
|
|
25
|
-
* currency code. For the monadic version, see
|
|
25
|
+
* currency code. For the monadic version, see {@link mkCurrencyCode}.
|
|
26
26
|
*
|
|
27
27
|
* @param x A currency code represented as string.
|
|
28
28
|
* @returns If the argument has leading or trailing spaces OR it is empty, an
|
|
29
|
-
* error is thrown,
|
|
29
|
+
* error is thrown, {@link CurrencyCode} is returned otherwise.
|
|
30
30
|
*/
|
|
31
31
|
export function mkCurrencyCodeError(x) {
|
|
32
32
|
return mkCurrencyCode(x).orDefaultLazy(() => {
|
|
@@ -36,7 +36,7 @@ export function mkCurrencyCodeError(x) {
|
|
|
36
36
|
/**
|
|
37
37
|
* Return the currency code as a string value.
|
|
38
38
|
*
|
|
39
|
-
* @param x
|
|
39
|
+
* @param x {@link CurrencyCode} to be extracted string from.
|
|
40
40
|
* @returns Currency code as a string.
|
|
41
41
|
*/
|
|
42
42
|
export function unCurrencyCode(x) {
|
package/es/commons/-id.d.ts
CHANGED
|
@@ -3,56 +3,56 @@ import { NewTypeWithPhantom } from '@telostat/prelude';
|
|
|
3
3
|
* Type definition for identifiers with value spaces discriminated over the
|
|
4
4
|
* given phantom type.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type Id<P, V> = NewTypeWithPhantom<P, V>;
|
|
7
7
|
/**
|
|
8
8
|
* Type definition for DECAF artifact identifiers.
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export type ArtifactId = NewTypeWithPhantom<'DecafArtifact', string | number>;
|
|
11
11
|
/**
|
|
12
12
|
* Type definition for DECAF artifact type identifiers.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export type ArtifactTypeId = NewTypeWithPhantom<'DecafArtifactType', string>;
|
|
15
15
|
/**
|
|
16
16
|
* Type definition for DECAF share class identifiers.
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
18
|
+
export type ShareClassId = NewTypeWithPhantom<'DecafShareClass', string | number>;
|
|
19
19
|
/**
|
|
20
20
|
* Type definition for DECAF principal identifiers.
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
22
|
+
export type PrincipalId = NewTypeWithPhantom<'DecafPrincipal', string | number>;
|
|
23
23
|
/**
|
|
24
24
|
* Type definition for DECAF institution identifiers.
|
|
25
25
|
*/
|
|
26
|
-
export
|
|
26
|
+
export type InstitutionId = NewTypeWithPhantom<'DecafInstitution', string | number>;
|
|
27
27
|
/**
|
|
28
28
|
* Type definition for DECAF team identifiers.
|
|
29
29
|
*/
|
|
30
|
-
export
|
|
30
|
+
export type TeamId = NewTypeWithPhantom<'DecafTeam', string | number>;
|
|
31
31
|
/**
|
|
32
32
|
* Type definition for DECAF portfolio identifiers.
|
|
33
33
|
*/
|
|
34
|
-
export
|
|
34
|
+
export type PortfolioId = NewTypeWithPhantom<'DecafPortfolio', string | number>;
|
|
35
35
|
/**
|
|
36
36
|
* Type definition for DECAF portfolio group identifiers.
|
|
37
37
|
*/
|
|
38
|
-
export
|
|
38
|
+
export type PortfolioGroupId = NewTypeWithPhantom<'DecafPortfolioGroup', string | number>;
|
|
39
39
|
/**
|
|
40
40
|
* Type definition for DECAF account identifiers.
|
|
41
41
|
*/
|
|
42
|
-
export
|
|
42
|
+
export type AccountId = NewTypeWithPhantom<'DecafAccount', string | number>;
|
|
43
43
|
/**
|
|
44
44
|
* Type definition for DECAF OHLC series identifiers.
|
|
45
45
|
*/
|
|
46
|
-
export
|
|
46
|
+
export type OhlcSeriesId = NewTypeWithPhantom<'DecafOhlcSeries', string | number>;
|
|
47
47
|
/**
|
|
48
48
|
* Type definition for DECAF share class fee schedule identifiers.
|
|
49
49
|
*/
|
|
50
|
-
export
|
|
50
|
+
export type ShareClassFeeScheduleId = NewTypeWithPhantom<'DecafShareClassFeeSchedule', string | number>;
|
|
51
51
|
/**
|
|
52
52
|
* Type definition for DECAF action identifiers.
|
|
53
53
|
*/
|
|
54
|
-
export
|
|
54
|
+
export type ActionId = NewTypeWithPhantom<'DecafAction', string | number>;
|
|
55
55
|
/**
|
|
56
56
|
* Type definition for DECAF external valuation identifiers.
|
|
57
57
|
*/
|
|
58
|
-
export
|
|
58
|
+
export type ExternalValuationId = NewTypeWithPhantom<'DecafExternalValuation', string | number>;
|
|
@@ -60,7 +60,7 @@ export declare function fetchRemoteConsolidatedValuationReport(client: DecafClie
|
|
|
60
60
|
export declare function recompileConsolidatedValuationReport(x: RemoteConsolidatedValuationReport): Either<CustomError, ConsolidatedValuationReport>;
|
|
61
61
|
/**
|
|
62
62
|
* Attempts to retrieve remote consolidated valuation report, compiles it to
|
|
63
|
-
*
|
|
63
|
+
* {@link ConsolidatedValuationReport} and return it.
|
|
64
64
|
*
|
|
65
65
|
* @param client DECAF Barista client.
|
|
66
66
|
* @param query Remote consolidated valuation report endpoint query parameters.
|
|
@@ -42,7 +42,7 @@ export function recompileConsolidatedValuationReport(x) {
|
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
44
|
* Attempts to retrieve remote consolidated valuation report, compiles it to
|
|
45
|
-
*
|
|
45
|
+
* {@link ConsolidatedValuationReport} and return it.
|
|
46
46
|
*
|
|
47
47
|
* @param client DECAF Barista client.
|
|
48
48
|
* @param query Remote consolidated valuation report endpoint query parameters.
|
|
@@ -141,7 +141,7 @@ export declare function toShareClassValue(x: RemoteValuationShareClassValue): Po
|
|
|
141
141
|
export declare function recompilePortfolioValuationReport(x: RemotePortfolioValuationReport): Either<CustomError, PortfolioValuationReport>;
|
|
142
142
|
/**
|
|
143
143
|
* Attempts to retrieve remote portfolio valuation report, compiles it to
|
|
144
|
-
*
|
|
144
|
+
* {@link PortfolioValuationReport} and return it.
|
|
145
145
|
*
|
|
146
146
|
* @param client DECAF Barista client.
|
|
147
147
|
* @param query Remote portolio valuation report endpoint query parameters.
|
|
@@ -120,7 +120,7 @@ export function recompilePortfolioValuationReport(x) {
|
|
|
120
120
|
}
|
|
121
121
|
/**
|
|
122
122
|
* Attempts to retrieve remote portfolio valuation report, compiles it to
|
|
123
|
-
*
|
|
123
|
+
* {@link PortfolioValuationReport} and return it.
|
|
124
124
|
*
|
|
125
125
|
* @param client DECAF Barista client.
|
|
126
126
|
* @param query Remote portolio valuation report endpoint query parameters.
|
|
@@ -15,7 +15,7 @@ export interface ConsolidatedValuationReport extends BaseValuationReport {
|
|
|
15
15
|
/**
|
|
16
16
|
* Type definition for container types to be consolidated.
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
18
|
+
export type ConsolidatedValuationReportContainerType = 'account' | 'portfolio' | 'team' | 'custodian' | 'portfolio-group';
|
|
19
19
|
/**
|
|
20
20
|
* Type definition for valuation report containers.
|
|
21
21
|
*/
|
|
@@ -23,8 +23,11 @@ export function updateTotals(nav, investment, tree) {
|
|
|
23
23
|
const children = tree.children;
|
|
24
24
|
const netValue = sumDecimals(holdings.map((x) => x.valuation.value.net.ref)).add(sumDecimals(children.map((x) => x.totals.netValue)));
|
|
25
25
|
const absValue = sumDecimals(holdings.map((x) => x.valuation.value.abs.ref)).add(sumDecimals(children.map((x) => x.totals.absValue)));
|
|
26
|
-
const
|
|
27
|
-
|
|
26
|
+
const holdingsForExposure = holdings.filter((h) => !(h.artifact.type.id === 'CCY' ||
|
|
27
|
+
h.artifact.type.id === 'DEPO' ||
|
|
28
|
+
h.artifact.type.id === 'LOAN'));
|
|
29
|
+
const netExposure = sumDecimals(holdingsForExposure.map((x) => x.valuation.exposure.net.ref)).add(sumDecimals(children.map((x) => x.totals.netExposure)));
|
|
30
|
+
const absExposure = sumDecimals(holdingsForExposure.map((x) => x.valuation.exposure.abs.ref)).add(sumDecimals(children.map((x) => x.totals.absExposure)));
|
|
28
31
|
const pnl = sumDecimals(holdings.map((x) => x.pnl)).add(sumDecimals(children.map((x) => x.totals.pnl)));
|
|
29
32
|
const accruedsHoldings = holdings.map((x) => x.investment.accrued.map((x) => x.ref));
|
|
30
33
|
const accruedsChildren = children.map((x) => x.totals.accrued);
|
|
@@ -53,7 +53,7 @@ export interface ValuationReportAccounts {
|
|
|
53
53
|
/**
|
|
54
54
|
* The definition for valuation report holding classification.
|
|
55
55
|
*/
|
|
56
|
-
export
|
|
56
|
+
export type ValuationReportHoldingClassification = ValuationReportHoldingClassificationNode[];
|
|
57
57
|
/**
|
|
58
58
|
* Type definition for valuation report holding classification node.
|
|
59
59
|
*/
|
|
@@ -63,7 +63,7 @@ export interface ValuationReportHoldingClassificationNode {
|
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
* Type definition for base valuation report holding (shared by
|
|
66
|
-
*
|
|
66
|
+
* {@link ValuationReportHolding} and {@link ValuationReportChildHolding}).
|
|
67
67
|
*/
|
|
68
68
|
export interface BaseValuationReportHolding {
|
|
69
69
|
artifact: ValuationReportArtifact;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decafhub/decaf-client-extras",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "DECAF Client Extras",
|
|
5
5
|
"author": "Teloscube Pte Ltd",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,36 +26,36 @@
|
|
|
26
26
|
"node": ">=14"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@decafhub/decaf-client": "
|
|
29
|
+
"@decafhub/decaf-client": "^0.3.1"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@telostat/prelude": "^0.1.
|
|
32
|
+
"@telostat/prelude": "^0.1.2"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@commitlint/cli": "^17.0
|
|
36
|
-
"@commitlint/config-conventional": "^17.0
|
|
37
|
-
"@decafhub/decaf-client": "^0.
|
|
38
|
-
"@types/jest": "^
|
|
39
|
-
"@types/node": "^18.
|
|
40
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
41
|
-
"@typescript-eslint/parser": "^5.
|
|
42
|
-
"dotenv": "^16.0.
|
|
43
|
-
"eslint": "^8.
|
|
35
|
+
"@commitlint/cli": "^17.3.0",
|
|
36
|
+
"@commitlint/config-conventional": "^17.3.0",
|
|
37
|
+
"@decafhub/decaf-client": "^0.3.1",
|
|
38
|
+
"@types/jest": "^29.2.4",
|
|
39
|
+
"@types/node": "^18.11.18",
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
|
41
|
+
"@typescript-eslint/parser": "^5.47.1",
|
|
42
|
+
"dotenv": "^16.0.3",
|
|
43
|
+
"eslint": "^8.30.0",
|
|
44
44
|
"eslint-config-prettier": "^8.5.0",
|
|
45
45
|
"eslint-config-standard": "^17.0.0",
|
|
46
46
|
"eslint-plugin-import": "^2.26.0",
|
|
47
|
-
"eslint-plugin-n": "^15.
|
|
47
|
+
"eslint-plugin-n": "^15.6.0",
|
|
48
48
|
"eslint-plugin-prettier": "^4.2.1",
|
|
49
|
-
"eslint-plugin-promise": "^6.
|
|
49
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
50
50
|
"eslint-plugin-standard": "^5.0.0",
|
|
51
51
|
"gh-pages": "^4.0.0",
|
|
52
|
-
"husky": "^8.0.
|
|
53
|
-
"jest": "^
|
|
54
|
-
"lint-staged": "^13.0
|
|
55
|
-
"prettier": "^2.
|
|
56
|
-
"ts-jest": "^
|
|
57
|
-
"typedoc": "^0.23.
|
|
58
|
-
"typescript": "^4.
|
|
52
|
+
"husky": "^8.0.2",
|
|
53
|
+
"jest": "^29.3.1",
|
|
54
|
+
"lint-staged": "^13.1.0",
|
|
55
|
+
"prettier": "^2.8.1",
|
|
56
|
+
"ts-jest": "^29.0.3",
|
|
57
|
+
"typedoc": "^0.23.23",
|
|
58
|
+
"typescript": "^4.9.4"
|
|
59
59
|
},
|
|
60
60
|
"lint-staged": {
|
|
61
61
|
"src/**/*.{ts,tsx}": [
|
|
@@ -60,7 +60,7 @@ export declare function fetchRemoteConsolidatedValuationReport(client: DecafClie
|
|
|
60
60
|
export declare function recompileConsolidatedValuationReport(x: RemoteConsolidatedValuationReport): Either<CustomError, ConsolidatedValuationReport>;
|
|
61
61
|
/**
|
|
62
62
|
* Attempts to retrieve remote consolidated valuation report, compiles it to
|
|
63
|
-
*
|
|
63
|
+
* {@link ConsolidatedValuationReport} and return it.
|
|
64
64
|
*
|
|
65
65
|
* @param client DECAF Barista client.
|
|
66
66
|
* @param query Remote consolidated valuation report endpoint query parameters.
|
|
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
25
25
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
26
|
function step(op) {
|
|
27
27
|
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (_) try {
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
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
30
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
31
|
switch (op[0]) {
|
|
@@ -90,7 +90,7 @@ function recompileConsolidatedValuationReport(x) {
|
|
|
90
90
|
exports.recompileConsolidatedValuationReport = recompileConsolidatedValuationReport;
|
|
91
91
|
/**
|
|
92
92
|
* Attempts to retrieve remote consolidated valuation report, compiles it to
|
|
93
|
-
*
|
|
93
|
+
* {@link ConsolidatedValuationReport} and return it.
|
|
94
94
|
*
|
|
95
95
|
* @param client DECAF Barista client.
|
|
96
96
|
* @param query Remote consolidated valuation report endpoint query parameters.
|
|
@@ -141,7 +141,7 @@ export declare function toShareClassValue(x: RemoteValuationShareClassValue): Po
|
|
|
141
141
|
export declare function recompilePortfolioValuationReport(x: RemotePortfolioValuationReport): Either<CustomError, PortfolioValuationReport>;
|
|
142
142
|
/**
|
|
143
143
|
* Attempts to retrieve remote portfolio valuation report, compiles it to
|
|
144
|
-
*
|
|
144
|
+
* {@link PortfolioValuationReport} and return it.
|
|
145
145
|
*
|
|
146
146
|
* @param client DECAF Barista client.
|
|
147
147
|
* @param query Remote portolio valuation report endpoint query parameters.
|
|
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
25
25
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
26
|
function step(op) {
|
|
27
27
|
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (_) try {
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
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
30
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
31
|
switch (op[0]) {
|
|
@@ -168,7 +168,7 @@ function recompilePortfolioValuationReport(x) {
|
|
|
168
168
|
exports.recompilePortfolioValuationReport = recompilePortfolioValuationReport;
|
|
169
169
|
/**
|
|
170
170
|
* Attempts to retrieve remote portfolio valuation report, compiles it to
|
|
171
|
-
*
|
|
171
|
+
* {@link PortfolioValuationReport} and return it.
|
|
172
172
|
*
|
|
173
173
|
* @param client DECAF Barista client.
|
|
174
174
|
* @param query Remote portolio valuation report endpoint query parameters.
|
|
@@ -15,7 +15,7 @@ export interface ConsolidatedValuationReport extends BaseValuationReport {
|
|
|
15
15
|
/**
|
|
16
16
|
* Type definition for container types to be consolidated.
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
18
|
+
export type ConsolidatedValuationReportContainerType = 'account' | 'portfolio' | 'team' | 'custodian' | 'portfolio-group';
|
|
19
19
|
/**
|
|
20
20
|
* Type definition for valuation report containers.
|
|
21
21
|
*/
|
|
@@ -63,8 +63,13 @@ function updateTotals(nav, investment, tree) {
|
|
|
63
63
|
var children = tree.children;
|
|
64
64
|
var netValue = (0, prelude_1.sumDecimals)(holdings.map(function (x) { return x.valuation.value.net.ref; })).add((0, prelude_1.sumDecimals)(children.map(function (x) { return x.totals.netValue; })));
|
|
65
65
|
var absValue = (0, prelude_1.sumDecimals)(holdings.map(function (x) { return x.valuation.value.abs.ref; })).add((0, prelude_1.sumDecimals)(children.map(function (x) { return x.totals.absValue; })));
|
|
66
|
-
var
|
|
67
|
-
|
|
66
|
+
var holdingsForExposure = holdings.filter(function (h) {
|
|
67
|
+
return !(h.artifact.type.id === 'CCY' ||
|
|
68
|
+
h.artifact.type.id === 'DEPO' ||
|
|
69
|
+
h.artifact.type.id === 'LOAN');
|
|
70
|
+
});
|
|
71
|
+
var netExposure = (0, prelude_1.sumDecimals)(holdingsForExposure.map(function (x) { return x.valuation.exposure.net.ref; })).add((0, prelude_1.sumDecimals)(children.map(function (x) { return x.totals.netExposure; })));
|
|
72
|
+
var absExposure = (0, prelude_1.sumDecimals)(holdingsForExposure.map(function (x) { return x.valuation.exposure.abs.ref; })).add((0, prelude_1.sumDecimals)(children.map(function (x) { return x.totals.absExposure; })));
|
|
68
73
|
var pnl = (0, prelude_1.sumDecimals)(holdings.map(function (x) { return x.pnl; })).add((0, prelude_1.sumDecimals)(children.map(function (x) { return x.totals.pnl; })));
|
|
69
74
|
var accruedsHoldings = holdings.map(function (x) { return x.investment.accrued.map(function (x) { return x.ref; }); });
|
|
70
75
|
var accruedsChildren = children.map(function (x) { return x.totals.accrued; });
|
|
@@ -53,7 +53,7 @@ export interface ValuationReportAccounts {
|
|
|
53
53
|
/**
|
|
54
54
|
* The definition for valuation report holding classification.
|
|
55
55
|
*/
|
|
56
|
-
export
|
|
56
|
+
export type ValuationReportHoldingClassification = ValuationReportHoldingClassificationNode[];
|
|
57
57
|
/**
|
|
58
58
|
* Type definition for valuation report holding classification node.
|
|
59
59
|
*/
|
|
@@ -63,7 +63,7 @@ export interface ValuationReportHoldingClassificationNode {
|
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
* Type definition for base valuation report holding (shared by
|
|
66
|
-
*
|
|
66
|
+
* {@link ValuationReportHolding} and {@link ValuationReportChildHolding}).
|
|
67
67
|
*/
|
|
68
68
|
export interface BaseValuationReportHolding {
|
|
69
69
|
artifact: ValuationReportArtifact;
|
package/src/commons/-currency.ts
CHANGED
|
@@ -14,29 +14,29 @@ import { Just, Maybe, mkPhantom, NewTypeWithPhantom, Nothing, unPhantom } from '
|
|
|
14
14
|
export type CurrencyCode = NewTypeWithPhantom<'CurrencyCode', string>;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* Attempts to create a
|
|
17
|
+
* Attempts to create a {@link CurrencyCode} value with the given currency code.
|
|
18
18
|
*
|
|
19
19
|
* This function returns a `Maybe` value. For the version that throws an
|
|
20
|
-
* error, see
|
|
20
|
+
* error, see {@link mkCurrencyCodeError}.
|
|
21
21
|
*
|
|
22
22
|
* @param x A currency code represented as string.
|
|
23
23
|
* @returns If the argument has leading or trailing spaces OR it is empty,
|
|
24
|
-
* `Nothing` is retured, `Just`
|
|
24
|
+
* `Nothing` is retured, `Just` {@link CurrencyCode} otherwise.
|
|
25
25
|
*/
|
|
26
26
|
export function mkCurrencyCode(x: string): Maybe<CurrencyCode> {
|
|
27
27
|
return x !== x.trim() || x === '' ? Nothing : Just(mkPhantom(x));
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* (Unsafely) attempts to create a
|
|
31
|
+
* (Unsafely) attempts to create a {@link CurrencyCode} value with the given
|
|
32
32
|
* currency code.
|
|
33
33
|
*
|
|
34
34
|
* This function may throw an error if the given argument is not a valid
|
|
35
|
-
* currency code. For the monadic version, see
|
|
35
|
+
* currency code. For the monadic version, see {@link mkCurrencyCode}.
|
|
36
36
|
*
|
|
37
37
|
* @param x A currency code represented as string.
|
|
38
38
|
* @returns If the argument has leading or trailing spaces OR it is empty, an
|
|
39
|
-
* error is thrown,
|
|
39
|
+
* error is thrown, {@link CurrencyCode} is returned otherwise.
|
|
40
40
|
*/
|
|
41
41
|
export function mkCurrencyCodeError(x: string): CurrencyCode {
|
|
42
42
|
return mkCurrencyCode(x).orDefaultLazy(() => {
|
|
@@ -47,7 +47,7 @@ export function mkCurrencyCodeError(x: string): CurrencyCode {
|
|
|
47
47
|
/**
|
|
48
48
|
* Return the currency code as a string value.
|
|
49
49
|
*
|
|
50
|
-
* @param x
|
|
50
|
+
* @param x {@link CurrencyCode} to be extracted string from.
|
|
51
51
|
* @returns Currency code as a string.
|
|
52
52
|
*/
|
|
53
53
|
export function unCurrencyCode(x: CurrencyCode): string {
|
package/src/index.test.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { buildDecafClient, DecafClient, gql } from '@decafhub/decaf-client';
|
|
2
|
-
import { mk, PDateTime } from '@telostat/prelude';
|
|
2
|
+
import { mk, PDateTime, safeDiv, zero } from '@telostat/prelude';
|
|
3
3
|
import { fail } from 'assert';
|
|
4
4
|
import { PortfolioId } from './commons';
|
|
5
|
-
import {
|
|
5
|
+
import { makeValuationReportHoldingsTree } from './reports/valuation/';
|
|
6
|
+
import {
|
|
7
|
+
fetchPortfolioValuationReport,
|
|
8
|
+
fetchRemotePortfolioValuationReport,
|
|
9
|
+
} from './reports/valuation/-remote-valuation-report-portfolio';
|
|
6
10
|
|
|
7
11
|
const API_URL = process.env.TESTING_API_URL;
|
|
8
12
|
const API_KEY = process.env.TESTING_API_KEY;
|
|
@@ -64,4 +68,29 @@ describe('Main', () => {
|
|
|
64
68
|
},
|
|
65
69
|
});
|
|
66
70
|
});
|
|
71
|
+
|
|
72
|
+
test('get a portfolio report, check the tree', async () => {
|
|
73
|
+
const eValue = await fetchPortfolioValuationReport(client, {
|
|
74
|
+
portfolio: portfolioId,
|
|
75
|
+
date: PDateTime(new Date()).format('YYYY-MM-DD'),
|
|
76
|
+
dateType: 'settlement',
|
|
77
|
+
currency: mk('EUR'),
|
|
78
|
+
});
|
|
79
|
+
eValue.caseOf({
|
|
80
|
+
Left: (e) => fail('Error while fetching the remote portfolio report: ' + e.msg),
|
|
81
|
+
Right: (value) => {
|
|
82
|
+
console.log(`Success! remote valuation for portfolio ID ${value.portfolio.id} is reported at ${value.asof}`);
|
|
83
|
+
|
|
84
|
+
expect(value).toBeDefined();
|
|
85
|
+
|
|
86
|
+
const nav = value.figures.nav;
|
|
87
|
+
const inv = value.figures.investment;
|
|
88
|
+
const holdings = value.holdings;
|
|
89
|
+
const tree = makeValuationReportHoldingsTree(nav, inv, holdings);
|
|
90
|
+
|
|
91
|
+
expect(tree).toBeDefined();
|
|
92
|
+
expect(safeDiv(tree.totals.netExposure, nav).orDefault(zero)).toEqual(tree.totals.netExposureRatio);
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
});
|
|
67
96
|
});
|
|
@@ -103,7 +103,7 @@ export function recompileConsolidatedValuationReport(
|
|
|
103
103
|
|
|
104
104
|
/**
|
|
105
105
|
* Attempts to retrieve remote consolidated valuation report, compiles it to
|
|
106
|
-
*
|
|
106
|
+
* {@link ConsolidatedValuationReport} and return it.
|
|
107
107
|
*
|
|
108
108
|
* @param client DECAF Barista client.
|
|
109
109
|
* @param query Remote consolidated valuation report endpoint query parameters.
|
|
@@ -276,7 +276,7 @@ export function recompilePortfolioValuationReport(
|
|
|
276
276
|
|
|
277
277
|
/**
|
|
278
278
|
* Attempts to retrieve remote portfolio valuation report, compiles it to
|
|
279
|
-
*
|
|
279
|
+
* {@link PortfolioValuationReport} and return it.
|
|
280
280
|
*
|
|
281
281
|
* @param client DECAF Barista client.
|
|
282
282
|
* @param query Remote portolio valuation report endpoint query parameters.
|
|
@@ -2,6 +2,7 @@ import { Decimal, safeDiv, sumDecimals, Tuple, zero } from '@telostat/prelude';
|
|
|
2
2
|
import { Just, Maybe, Nothing } from 'purify-ts';
|
|
3
3
|
import { List } from 'purify-ts/List';
|
|
4
4
|
import { ValuationReportHolding, ValuationReportHoldingClassification } from '../-valuation-report-shared';
|
|
5
|
+
import { ArtifactTypeId } from '../../../commons';
|
|
5
6
|
import { ValuationReportHoldingsTreeNode, ValuationReportHoldingsTreeNodeValue } from './-types';
|
|
6
7
|
import { compareStringArrays } from './-utils';
|
|
7
8
|
|
|
@@ -36,10 +37,20 @@ export function updateTotals(
|
|
|
36
37
|
const absValue = sumDecimals(holdings.map((x) => x.valuation.value.abs.ref)).add(
|
|
37
38
|
sumDecimals(children.map((x) => x.totals.absValue))
|
|
38
39
|
);
|
|
39
|
-
|
|
40
|
+
|
|
41
|
+
const holdingsForExposure = holdings.filter(
|
|
42
|
+
(h) =>
|
|
43
|
+
!(
|
|
44
|
+
h.artifact.type.id === ('CCY' as unknown as ArtifactTypeId) ||
|
|
45
|
+
h.artifact.type.id === ('DEPO' as unknown as ArtifactTypeId) ||
|
|
46
|
+
h.artifact.type.id === ('LOAN' as unknown as ArtifactTypeId)
|
|
47
|
+
)
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
const netExposure = sumDecimals(holdingsForExposure.map((x) => x.valuation.exposure.net.ref)).add(
|
|
40
51
|
sumDecimals(children.map((x) => x.totals.netExposure))
|
|
41
52
|
);
|
|
42
|
-
const absExposure = sumDecimals(
|
|
53
|
+
const absExposure = sumDecimals(holdingsForExposure.map((x) => x.valuation.exposure.abs.ref)).add(
|
|
43
54
|
sumDecimals(children.map((x) => x.totals.absExposure))
|
|
44
55
|
);
|
|
45
56
|
const pnl = sumDecimals(holdings.map((x) => x.pnl)).add(sumDecimals(children.map((x) => x.totals.pnl)));
|
|
@@ -70,7 +70,7 @@ export interface ValuationReportHoldingClassificationNode {
|
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
* Type definition for base valuation report holding (shared by
|
|
73
|
-
*
|
|
73
|
+
* {@link ValuationReportHolding} and {@link ValuationReportChildHolding}).
|
|
74
74
|
*/
|
|
75
75
|
export interface BaseValuationReportHolding {
|
|
76
76
|
artifact: ValuationReportArtifact;
|