@decafhub/decaf-client-extras 0.3.0 → 0.4.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.
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.3.0"
2
+ ".": "0.4.0"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.4.0](https://github.com/teloscube/decaf-client-javascript-extras/compare/v0.3.0...v0.4.0) (2024-03-28)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * fix various type issues due to DECAF Barista v2 release
9
+
10
+ ### Bug Fixes
11
+
12
+ * fix various type issues due to DECAF Barista v2 release ([f15d9ac](https://github.com/teloscube/decaf-client-javascript-extras/commit/f15d9ac523b4911abd7fc9705803fd85e0e0acb5))
13
+
3
14
  ## [0.3.0](https://github.com/teloscube/decaf-client-javascript-extras/compare/v0.2.0...v0.3.0) (2023-12-05)
4
15
 
5
16
 
package/README.md CHANGED
@@ -6,10 +6,10 @@
6
6
 
7
7
  ## Install
8
8
 
9
- Install @decafhub/decaf-client-extras along with its peer dependency @decafhub/decaf-client:
9
+ Install `@decafhub/decaf-client-extras` along with its peer dependencies:
10
10
 
11
11
  ```bash
12
- npm install --save @decafhub/decaf-client-extras @decafhub/decaf-client
12
+ npm install --save dayjs @decafhub/decaf-client @decafhub/decaf-client-extras
13
13
  ```
14
14
 
15
15
  ## Testing
@@ -38,7 +38,7 @@ export interface RemotePortfolioValuationReport extends RemoteBaseValuationRepor
38
38
  * report.
39
39
  */
40
40
  export interface RemoteValuationShareClassValue {
41
- shareclass: RemoteValuationShareClass;
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(x: RemoteValuationShareClassValue): PortfolioValuationReportShareClassValue;
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(x) {
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
- id: x.shareclass.id,
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(x.nav),
86
- navAdjusted: unsafeDecimal(x.nav_adjusted),
87
- navAdjustedTotal: unsafeDecimal(x.nav_adjusted_total),
88
- coefficient: unsafeDecimal(x.coefficient),
89
- gavRefccy: unsafeDecimal(x.gav_refccy),
90
- gavClsccy: unsafeDecimal(x.gav_clsccy),
91
- sharecountPrev: unsafeDecimal(x.sharecount_prev),
92
- sharecountCurr: unsafeDecimal(x.sharecount_curr),
93
- sharecountDiff: unsafeDecimal(x.sharecount_diff),
94
- pxRefCcy: decimalFromNullable(x.px_refccy),
95
- pxClsCcy: decimalFromNullable(x.px_clsccy),
96
- ytdExt: decimalFromNullable(x.ytdext),
97
- ytdInt: decimalFromNullable(x.ytdint),
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
  /**
@@ -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>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decafhub/decaf-client-extras",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "DECAF Client Extras",
5
5
  "author": "Teloscube Pte Ltd",
6
6
  "license": "MIT",
@@ -38,7 +38,7 @@ export interface RemotePortfolioValuationReport extends RemoteBaseValuationRepor
38
38
  * report.
39
39
  */
40
40
  export interface RemoteValuationShareClassValue {
41
- shareclass: RemoteValuationShareClass;
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(x: RemoteValuationShareClassValue): PortfolioValuationReportShareClassValue;
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(x) {
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
- id: x.shareclass.id,
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)(x.nav),
137
- navAdjusted: (0, prelude_1.unsafeDecimal)(x.nav_adjusted),
138
- navAdjustedTotal: (0, prelude_1.unsafeDecimal)(x.nav_adjusted_total),
139
- coefficient: (0, prelude_1.unsafeDecimal)(x.coefficient),
140
- gavRefccy: (0, prelude_1.unsafeDecimal)(x.gav_refccy),
141
- gavClsccy: (0, prelude_1.unsafeDecimal)(x.gav_clsccy),
142
- sharecountPrev: (0, prelude_1.unsafeDecimal)(x.sharecount_prev),
143
- sharecountCurr: (0, prelude_1.unsafeDecimal)(x.sharecount_curr),
144
- sharecountDiff: (0, prelude_1.unsafeDecimal)(x.sharecount_diff),
145
- pxRefCcy: (0, prelude_1.decimalFromNullable)(x.px_refccy),
146
- pxClsCcy: (0, prelude_1.decimalFromNullable)(x.px_clsccy),
147
- ytdExt: (0, prelude_1.decimalFromNullable)(x.ytdext),
148
- ytdInt: (0, prelude_1.decimalFromNullable)(x.ytdint),
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;
@@ -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>;
@@ -67,7 +67,7 @@ export interface RemotePortfolioValuationReport extends RemoteBaseValuationRepor
67
67
  * report.
68
68
  */
69
69
  export interface RemoteValuationShareClassValue {
70
- shareclass: RemoteValuationShareClass;
70
+ shareclass?: RemoteValuationShareClass;
71
71
  external?: RemoteValuationExternalValue;
72
72
  nav: number;
73
73
  nav_adjusted: number;
@@ -177,35 +177,37 @@ export function fetchRemotePortfolioValuationReport(
177
177
  * @param x remote valuation report share class value object.
178
178
  * @return Recompiled valuation report share class value object.
179
179
  */
180
- export function toShareClassValue(x: RemoteValuationShareClassValue): PortfolioValuationReportShareClassValue {
180
+ export function toShareClassValue(s: RemoteValuationShareClassValue): PortfolioValuationReportShareClassValue {
181
+ const shareclass = Maybe.fromNullable(s.shareclass).map((x) => ({
182
+ id: x.id,
183
+ created: x.created,
184
+ creator: Maybe.fromNullable(x.creator),
185
+ updated: x.updated,
186
+ updater: Maybe.fromNullable(x.updater),
187
+ guid: x.guid,
188
+ portfolio: x.portfolio,
189
+ name: x.name,
190
+ currency: x.currency,
191
+ isin: sanitizedNonEmptyText(x.isin),
192
+ bbgticker: sanitizedNonEmptyText(x.bbgticker),
193
+ liquidity: sanitizedNonEmptyText(x.liquidity),
194
+ jurisdiction: sanitizedNonEmptyText(x.jurisdiction),
195
+ administrator: sanitizedNonEmptyText(x.administrator),
196
+ minimumInvestment: Maybe.fromNullable(x.mininvestment),
197
+ subscriptionRedemptionPeriod: sanitizedNonEmptyText(x.subredperiod),
198
+ managementFeeFrequency: Maybe.fromNullable(x.freqmngt),
199
+ performanceFeeFrequency: Maybe.fromNullable(x.freqperf),
200
+ benchmark: Maybe.fromNullable(x.benchmark),
201
+ description: sanitizedNonEmptyText(x.description),
202
+ feeScheduleIds: x.feeschedules,
203
+ effectiveFeeScheduleId: Maybe.fromNullable(x.effectivefeeschedule),
204
+ subscriptionIds: x.subscriptions,
205
+ outstanding: decimalFromNullable(x.outstanding),
206
+ }));
207
+
181
208
  return {
182
- shareclass: {
183
- id: x.shareclass.id,
184
- created: x.shareclass.created,
185
- creator: Maybe.fromNullable(x.shareclass.creator),
186
- updated: x.shareclass.updated,
187
- updater: Maybe.fromNullable(x.shareclass.updater),
188
- guid: x.shareclass.guid,
189
- portfolio: x.shareclass.portfolio,
190
- name: x.shareclass.name,
191
- currency: x.shareclass.currency,
192
- isin: sanitizedNonEmptyText(x.shareclass.isin),
193
- bbgticker: sanitizedNonEmptyText(x.shareclass.bbgticker),
194
- liquidity: sanitizedNonEmptyText(x.shareclass.liquidity),
195
- jurisdiction: sanitizedNonEmptyText(x.shareclass.jurisdiction),
196
- administrator: sanitizedNonEmptyText(x.shareclass.administrator),
197
- minimumInvestment: Maybe.fromNullable(x.shareclass.mininvestment),
198
- subscriptionRedemptionPeriod: sanitizedNonEmptyText(x.shareclass.subredperiod),
199
- managementFeeFrequency: Maybe.fromNullable(x.shareclass.freqmngt),
200
- performanceFeeFrequency: Maybe.fromNullable(x.shareclass.freqperf),
201
- benchmark: Maybe.fromNullable(x.shareclass.benchmark),
202
- description: sanitizedNonEmptyText(x.shareclass.description),
203
- feeScheduleIds: x.shareclass.feeschedules,
204
- effectiveFeeScheduleId: Maybe.fromNullable(x.shareclass.effectivefeeschedule),
205
- subscriptionIds: x.shareclass.subscriptions,
206
- outstanding: decimalFromNullable(x.shareclass.outstanding),
207
- },
208
- external: Maybe.fromNullable(x.external).map((ev) => ({
209
+ shareclass,
210
+ external: Maybe.fromNullable(s.external).map((ev) => ({
209
211
  id: ev.id,
210
212
  created: ev.created,
211
213
  creator: Maybe.fromNullable(ev.updater),
@@ -233,19 +235,19 @@ export function toShareClassValue(x: RemoteValuationShareClassValue): PortfolioV
233
235
  perfstart: decimalFromNullable(ev.perfstart),
234
236
  coefficient: decimalFromNullable(ev.coefficient),
235
237
  })),
236
- nav: unsafeDecimal(x.nav),
237
- navAdjusted: unsafeDecimal(x.nav_adjusted),
238
- navAdjustedTotal: unsafeDecimal(x.nav_adjusted_total),
239
- coefficient: unsafeDecimal(x.coefficient),
240
- gavRefccy: unsafeDecimal(x.gav_refccy),
241
- gavClsccy: unsafeDecimal(x.gav_clsccy),
242
- sharecountPrev: unsafeDecimal(x.sharecount_prev),
243
- sharecountCurr: unsafeDecimal(x.sharecount_curr),
244
- sharecountDiff: unsafeDecimal(x.sharecount_diff),
245
- pxRefCcy: decimalFromNullable(x.px_refccy),
246
- pxClsCcy: decimalFromNullable(x.px_clsccy),
247
- ytdExt: decimalFromNullable(x.ytdext),
248
- ytdInt: decimalFromNullable(x.ytdint),
238
+ nav: unsafeDecimal(s.nav),
239
+ navAdjusted: unsafeDecimal(s.nav_adjusted),
240
+ navAdjustedTotal: unsafeDecimal(s.nav_adjusted_total),
241
+ coefficient: unsafeDecimal(s.coefficient),
242
+ gavRefccy: unsafeDecimal(s.gav_refccy),
243
+ gavClsccy: unsafeDecimal(s.gav_clsccy),
244
+ sharecountPrev: Maybe.fromNullable(s.sharecount_prev).map(unsafeDecimal),
245
+ sharecountCurr: Maybe.fromNullable(s.sharecount_curr).map(unsafeDecimal),
246
+ sharecountDiff: Maybe.fromNullable(s.sharecount_diff).map(unsafeDecimal),
247
+ pxRefCcy: decimalFromNullable(s.px_refccy),
248
+ pxClsCcy: decimalFromNullable(s.px_clsccy),
249
+ ytdExt: decimalFromNullable(s.ytdext),
250
+ ytdInt: decimalFromNullable(s.ytdint),
249
251
  };
250
252
  }
251
253
 
@@ -18,7 +18,7 @@ export interface PortfolioValuationReport extends BaseValuationReport {
18
18
  }
19
19
 
20
20
  export interface PortfolioValuationReportShareClassValue {
21
- shareclass: PortfolioValuationReportShareClass;
21
+ shareclass: Maybe<PortfolioValuationReportShareClass>;
22
22
  external: Maybe<PortfolioValuationReportExternalValue>;
23
23
  nav: Decimal;
24
24
  navAdjusted: Decimal;
@@ -26,9 +26,9 @@ export interface PortfolioValuationReportShareClassValue {
26
26
  coefficient: Decimal;
27
27
  gavRefccy: Decimal;
28
28
  gavClsccy: Decimal;
29
- sharecountPrev: Decimal;
30
- sharecountCurr: Decimal;
31
- sharecountDiff: Decimal;
29
+ sharecountPrev: Maybe<Decimal>;
30
+ sharecountCurr: Maybe<Decimal>;
31
+ sharecountDiff: Maybe<Decimal>;
32
32
  pxRefCcy: Maybe<Decimal>;
33
33
  pxClsCcy: Maybe<Decimal>;
34
34
  ytdExt: Maybe<Decimal>;