@zeniai/client-epic-state 5.0.88-betaAR1 → 5.0.88-betaAS1
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/lib/entity/tenant/tenantPayload.d.ts +3 -0
- package/lib/entity/tenant/tenantReducer.d.ts +2 -2
- package/lib/entity/tenant/tenantReducer.js +25 -15
- package/lib/entity/tenant/tenantState.d.ts +4 -1
- package/lib/epic.d.ts +3 -1
- package/lib/epic.js +3 -1
- package/lib/esm/entity/tenant/tenantReducer.js +24 -14
- package/lib/esm/epic.js +3 -1
- package/lib/esm/index.js +4 -4
- package/lib/esm/view/dashboard/dashboardReducer.js +11 -1
- package/lib/esm/view/expenseAutomationView/transactionFilterHelpers.js +18 -78
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +18 -0
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +18 -0
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +1 -1
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +45 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.js +9 -7
- package/lib/view/dashboard/dashboardReducer.js +11 -1
- package/lib/view/expenseAutomationView/transactionFilterHelpers.js +18 -78
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.d.ts +8 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +22 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.d.ts +8 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +22 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +1 -1
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.d.ts +1 -1
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +46 -2
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewState.d.ts +2 -0
- package/package.json +1 -1
|
@@ -31,69 +31,28 @@ exports.TRANSACTION_FILTER_CATEGORIES = [
|
|
|
31
31
|
{ value: 'class', type: 'dropdown' },
|
|
32
32
|
{ value: 'amount', type: 'numberRange' },
|
|
33
33
|
];
|
|
34
|
-
/**
|
|
35
|
-
* Per-line amounts for a transaction, preserving the canonical source
|
|
36
|
-
* precedence:
|
|
37
|
-
*
|
|
38
|
-
* 1. `transactionLocalData.transactionReviewLocalData.lineItemById` —
|
|
39
|
-
* the locally-edited line items the user sees in the grid. Reflects
|
|
40
|
-
* unsaved edits so the filter matches what the user actually has on
|
|
41
|
-
* screen, not the pre-edit server state.
|
|
42
|
-
* 2. `transaction.transaction.lines` — persisted lines from the
|
|
43
|
-
* transaction payload.
|
|
44
|
-
* 3. `[transaction.amount.amount]` — single-element fallback for
|
|
45
|
-
* transactions that don't have a `lines` array at all (treat the
|
|
46
|
-
* transaction-level amount as a one-line transaction).
|
|
47
|
-
*
|
|
48
|
-
* Returned as an array so the amount filter in `transactionMatchesCategory`
|
|
49
|
-
* can OR-combine per-line `matchAmount` results: a transaction is included
|
|
50
|
-
* if ANY of its lines satisfies the operator, and the full row (with all
|
|
51
|
-
* lines, matching or not) renders downstream. Before the per-line change
|
|
52
|
-
* this helper's predecessor in `getCategoryValueForTransaction` summed
|
|
53
|
-
* these values into a single aggregate and compared the sum.
|
|
54
|
-
*
|
|
55
|
-
* Defensive `?.` / `?? 0` on every nested access: the static types declare
|
|
56
|
-
* `transaction`, `transaction.transaction`, and `transaction.amount` as
|
|
57
|
-
* required, but in practice this selector chain can be fed partial
|
|
58
|
-
* payloads — e.g. while state is initializing, while a transaction is
|
|
59
|
-
* mid-sync after a Pusher delta, or when a `TransactionView` is
|
|
60
|
-
* constructed from a server response that hasn't fully resolved its
|
|
61
|
-
* embedded `amount` envelope. A missing amount field collapses to `0`
|
|
62
|
-
* rather than throwing; an absent line is treated as `0` so the operator
|
|
63
|
-
* comparison still produces a deterministic boolean (e.g. `greater_than
|
|
64
|
-
* 100` won't include a transaction just because one of its lines failed
|
|
65
|
-
* to deserialize).
|
|
66
|
-
*/
|
|
67
|
-
const getLineAmountsForTransaction = (transaction) => {
|
|
68
|
-
const localData = transaction?.transactionLocalData?.transactionReviewLocalData;
|
|
69
|
-
if (localData?.lineItemById != null) {
|
|
70
|
-
const lineItems = Object.values(localData.lineItemById);
|
|
71
|
-
if (lineItems.length > 0) {
|
|
72
|
-
return lineItems.map((lineItem) => lineItem?.amount?.amount ?? 0);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
if (transaction?.transaction?.lines != null &&
|
|
76
|
-
transaction.transaction.lines.length > 0) {
|
|
77
|
-
return transaction.transaction.lines.map((line) => line?.amount?.amount ?? 0);
|
|
78
|
-
}
|
|
79
|
-
return [transaction?.amount?.amount ?? 0];
|
|
80
|
-
};
|
|
81
34
|
/**
|
|
82
35
|
* Resolve the comparable value for a transaction against a given filter field.
|
|
83
36
|
* Returns undefined when the transaction doesn't carry the field — callers
|
|
84
37
|
* decide whether absence counts as a match (for 'not_equal' it does).
|
|
85
|
-
*
|
|
86
|
-
* NOTE: the `'amount'` field is NOT handled here. Amount matching is
|
|
87
|
-
* per-line (see `getLineAmountsForTransaction` + the early-return in
|
|
88
|
-
* `transactionMatchesCategory`) and would otherwise need to return a
|
|
89
|
-
* non-scalar value that doesn't fit this helper's contract.
|
|
90
38
|
*/
|
|
91
39
|
const getCategoryValueForTransaction = (key, transaction) => {
|
|
92
40
|
switch (key) {
|
|
93
41
|
case 'amount': {
|
|
94
|
-
//
|
|
95
|
-
//
|
|
96
|
-
|
|
42
|
+
// Prefer transactionLocalData line items (sum). Fall back to lines on
|
|
43
|
+
// the transaction itself. Final fallback: transaction-level amount.
|
|
44
|
+
const localDataForAmount = transaction.transactionLocalData?.transactionReviewLocalData;
|
|
45
|
+
if (localDataForAmount?.lineItemById) {
|
|
46
|
+
const lineItems = Object.values(localDataForAmount.lineItemById);
|
|
47
|
+
if (lineItems.length > 0) {
|
|
48
|
+
return lineItems.reduce((sum, lineItem) => sum + (lineItem.amount?.amount ?? 0), 0);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (transaction.transaction.lines &&
|
|
52
|
+
transaction.transaction.lines.length > 0) {
|
|
53
|
+
return transaction.transaction.lines.reduce((sum, line) => sum + (line.amount?.amount ?? 0), 0);
|
|
54
|
+
}
|
|
55
|
+
return transaction.amount.amount;
|
|
97
56
|
}
|
|
98
57
|
case 'payee': {
|
|
99
58
|
if (isNonEmptyString(transaction.vendorName)) {
|
|
@@ -231,27 +190,6 @@ const matchAmount = (amount, category) => {
|
|
|
231
190
|
return op === 'not_equal' ? !matched : matched;
|
|
232
191
|
};
|
|
233
192
|
const transactionMatchesCategory = (transaction, category) => {
|
|
234
|
-
if (category.field === 'amount') {
|
|
235
|
-
// Per-line matching: the transaction is included if ANY of its lines
|
|
236
|
-
// satisfies the operator. This is what the user expects when a
|
|
237
|
-
// multi-line transaction contains lines at different amounts — they
|
|
238
|
-
// want the row to surface if even one line falls in the filter's
|
|
239
|
-
// range. The full row (with non-matching lines too) renders
|
|
240
|
-
// downstream; this matcher only decides row inclusion. Same
|
|
241
|
-
// operator + sign semantics as the aggregate version, just applied
|
|
242
|
-
// per line.
|
|
243
|
-
//
|
|
244
|
-
// `not_equal` deserves a sanity-check: `matchAmount` already inverts
|
|
245
|
-
// internally for that operator, so for a line whose amount is NOT
|
|
246
|
-
// in the filter's `values`, matchAmount returns true; for a line
|
|
247
|
-
// whose amount IS in the values, it returns false. `.some()` over
|
|
248
|
-
// lines therefore means "the transaction has at least one line that
|
|
249
|
-
// is not equal to any of the filter values" — which is the right
|
|
250
|
-
// match-any-line interpretation of `not_equal` (a transaction
|
|
251
|
-
// matches if it has a line that satisfies the negation).
|
|
252
|
-
const lineAmounts = getLineAmountsForTransaction(transaction);
|
|
253
|
-
return lineAmounts.some((lineAmount) => matchAmount(lineAmount, category));
|
|
254
|
-
}
|
|
255
193
|
const value = getCategoryValueForTransaction(category.field, transaction);
|
|
256
194
|
if (value == null) {
|
|
257
195
|
// Absent-value semantics — pinning these down explicitly so the
|
|
@@ -271,10 +209,12 @@ const transactionMatchesCategory = (transaction, category) => {
|
|
|
271
209
|
// are filtered out.
|
|
272
210
|
//
|
|
273
211
|
// Only the `not_equal` branch returns `true` here; everything else
|
|
274
|
-
// falls through to the `false` below.
|
|
275
|
-
// because it short-circuits to the per-line path above.
|
|
212
|
+
// falls through to the `false` below.
|
|
276
213
|
return category.matchingOperator === 'not_equal';
|
|
277
214
|
}
|
|
215
|
+
if (category.field === 'amount') {
|
|
216
|
+
return matchAmount(Number(value), category);
|
|
217
|
+
}
|
|
278
218
|
const valueStr = value.toString();
|
|
279
219
|
const valueInList = category.values.some((v) => v.toString() === valueStr);
|
|
280
220
|
return category.matchingOperator === 'not_equal' ? !valueInList : valueInList;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { updateTreasuryPromoIntroClosedByOutsideClickForLoggedInUser } from '../../../../../entity/tenant/tenantReducer';
|
|
4
|
+
import { RootState } from '../../../../../reducer';
|
|
5
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
6
|
+
import { updateTreasuryPromoIntroClosedByOutsideClick, updateTreasuryPromoIntroClosedByOutsideClickFailure, updateTreasuryPromoIntroClosedByOutsideClickSuccess } from '../treasurySetupViewReducer';
|
|
7
|
+
export type ActionType = ReturnType<typeof updateTreasuryPromoIntroClosedByOutsideClick> | ReturnType<typeof updateTreasuryPromoIntroClosedByOutsideClickForLoggedInUser> | ReturnType<typeof updateTreasuryPromoIntroClosedByOutsideClickSuccess> | ReturnType<typeof updateTreasuryPromoIntroClosedByOutsideClickFailure>;
|
|
8
|
+
export declare const updateTreasuryPromoIntroClosedByOutsideClickEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateTreasuryPromoIntroClosedByOutsideClickEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const tenantReducer_1 = require("../../../../../entity/tenant/tenantReducer");
|
|
7
|
+
const responsePayload_1 = require("../../../../../responsePayload");
|
|
8
|
+
const treasurySetupViewReducer_1 = require("../treasurySetupViewReducer");
|
|
9
|
+
const updateTreasuryPromoIntroClosedByOutsideClickEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(treasurySetupViewReducer_1.updateTreasuryPromoIntroClosedByOutsideClick.match), (0, operators_1.switchMap)(() => {
|
|
10
|
+
return zeniAPI
|
|
11
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/user/self`, { is_treasury_promo_intro_closed_by_outside_click: true })
|
|
12
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
13
|
+
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
14
|
+
return (0, rxjs_1.of)((0, tenantReducer_1.updateTreasuryPromoIntroClosedByOutsideClickForLoggedInUser)(), (0, treasurySetupViewReducer_1.updateTreasuryPromoIntroClosedByOutsideClickSuccess)());
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
return (0, rxjs_1.of)((0, treasurySetupViewReducer_1.updateTreasuryPromoIntroClosedByOutsideClickFailure)(response.status));
|
|
18
|
+
}
|
|
19
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, treasurySetupViewReducer_1.updateTreasuryPromoIntroClosedByOutsideClickFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Update treasury promo intro closed by outside click REST API call errored out' +
|
|
20
|
+
(error?.message ?? JSON.stringify(error)))))));
|
|
21
|
+
}));
|
|
22
|
+
exports.updateTreasuryPromoIntroClosedByOutsideClickEpic = updateTreasuryPromoIntroClosedByOutsideClickEpic;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { updateTreasuryPromoRemindMeLaterClickedForLoggedInUser } from '../../../../../entity/tenant/tenantReducer';
|
|
4
|
+
import { RootState } from '../../../../../reducer';
|
|
5
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
6
|
+
import { updateTreasuryPromoRemindMeLaterClicked, updateTreasuryPromoRemindMeLaterClickedFailure, updateTreasuryPromoRemindMeLaterClickedSuccess } from '../treasurySetupViewReducer';
|
|
7
|
+
export type ActionType = ReturnType<typeof updateTreasuryPromoRemindMeLaterClicked> | ReturnType<typeof updateTreasuryPromoRemindMeLaterClickedForLoggedInUser> | ReturnType<typeof updateTreasuryPromoRemindMeLaterClickedSuccess> | ReturnType<typeof updateTreasuryPromoRemindMeLaterClickedFailure>;
|
|
8
|
+
export declare const updateTreasuryPromoRemindMeLaterClickedEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateTreasuryPromoRemindMeLaterClickedEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const tenantReducer_1 = require("../../../../../entity/tenant/tenantReducer");
|
|
7
|
+
const responsePayload_1 = require("../../../../../responsePayload");
|
|
8
|
+
const treasurySetupViewReducer_1 = require("../treasurySetupViewReducer");
|
|
9
|
+
const updateTreasuryPromoRemindMeLaterClickedEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(treasurySetupViewReducer_1.updateTreasuryPromoRemindMeLaterClicked.match), (0, operators_1.switchMap)(() => {
|
|
10
|
+
return zeniAPI
|
|
11
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/user/self`, { is_treasury_promo_video_remind_me_later_clicked: true })
|
|
12
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
13
|
+
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
14
|
+
return (0, rxjs_1.of)((0, tenantReducer_1.updateTreasuryPromoRemindMeLaterClickedForLoggedInUser)(), (0, treasurySetupViewReducer_1.updateTreasuryPromoRemindMeLaterClickedSuccess)());
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
return (0, rxjs_1.of)((0, treasurySetupViewReducer_1.updateTreasuryPromoRemindMeLaterClickedFailure)(response.status));
|
|
18
|
+
}
|
|
19
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, treasurySetupViewReducer_1.updateTreasuryPromoRemindMeLaterClickedFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Update treasury promo remind me later REST API call errored out' +
|
|
20
|
+
(error?.message ?? JSON.stringify(error)))))));
|
|
21
|
+
}));
|
|
22
|
+
exports.updateTreasuryPromoRemindMeLaterClickedEpic = updateTreasuryPromoRemindMeLaterClickedEpic;
|
package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js
CHANGED
|
@@ -17,6 +17,6 @@ const updateTreasuryVideoViewedEpic = (actions$, _state$, zeniAPI) => actions$.p
|
|
|
17
17
|
return (0, rxjs_1.of)((0, treasurySetupViewReducer_1.updateTreasuryVideoViewedFailure)(response.status));
|
|
18
18
|
}
|
|
19
19
|
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, treasurySetupViewReducer_1.updateTreasuryVideoViewedFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Update treasury video viewed REST API call errored out' +
|
|
20
|
-
JSON.stringify(error))))));
|
|
20
|
+
(error?.message ?? JSON.stringify(error)))))));
|
|
21
21
|
}));
|
|
22
22
|
exports.updateTreasuryVideoViewedEpic = updateTreasuryVideoViewedEpic;
|
|
@@ -15,6 +15,6 @@ export declare const fetchTreasuryFunds: import("@reduxjs/toolkit").ActionCreato
|
|
|
15
15
|
}, "treasurySetupView/updatePortfolioAllocation", never, never>, updatePortfolioAllocationSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<UpdatePortfolioAllocationPayload, "treasurySetupView/updatePortfolioAllocationSuccess">, updatePortfolioAllocationFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/updatePortfolioAllocationFailure", never, never>, fetchPortfolioAllocation: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/fetchPortfolioAllocation">, fetchPortfolioAllocationSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
16
16
|
allocation_percentages: Record<string, number>;
|
|
17
17
|
custom_corporate_id: string | null;
|
|
18
|
-
}, "treasurySetupView/fetchPortfolioAllocationSuccess">, fetchPortfolioAllocationFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/fetchPortfolioAllocationFailure">, updateFundAllocationLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<FundAllocationOption, "treasurySetupView/updateFundAllocationLocalData">,
|
|
18
|
+
}, "treasurySetupView/fetchPortfolioAllocationSuccess">, fetchPortfolioAllocationFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/fetchPortfolioAllocationFailure">, updateFundAllocationLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<FundAllocationOption, "treasurySetupView/updateFundAllocationLocalData">, updateTreasuryPromoIntroClosedByOutsideClick: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/updateTreasuryPromoIntroClosedByOutsideClick">, updateTreasuryPromoIntroClosedByOutsideClickFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/updateTreasuryPromoIntroClosedByOutsideClickFailure">, updateTreasuryPromoIntroClosedByOutsideClickSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/updateTreasuryPromoIntroClosedByOutsideClickSuccess">, updateTreasuryPromoRemindMeLaterClicked: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/updateTreasuryPromoRemindMeLaterClicked">, updateTreasuryPromoRemindMeLaterClickedFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/updateTreasuryPromoRemindMeLaterClickedFailure">, updateTreasuryPromoRemindMeLaterClickedSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/updateTreasuryPromoRemindMeLaterClickedSuccess">, updateTreasuryVideoViewed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/updateTreasuryVideoViewed">, updateTreasuryVideoViewedFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/updateTreasuryVideoViewedFailure">, updateTreasuryVideoViewedSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/updateTreasuryVideoViewedSuccess">;
|
|
19
19
|
declare const _default: import("redux").Reducer<TreasurySetupViewState>;
|
|
20
20
|
export default _default;
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
var _a;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
7
|
+
exports.updateTreasuryVideoViewedSuccess = exports.updateTreasuryVideoViewedFailure = exports.updateTreasuryVideoViewed = exports.updateTreasuryPromoRemindMeLaterClickedSuccess = exports.updateTreasuryPromoRemindMeLaterClickedFailure = exports.updateTreasuryPromoRemindMeLaterClicked = exports.updateTreasuryPromoIntroClosedByOutsideClickSuccess = exports.updateTreasuryPromoIntroClosedByOutsideClickFailure = exports.updateTreasuryPromoIntroClosedByOutsideClick = exports.updateFundAllocationLocalData = exports.fetchPortfolioAllocationFailure = exports.fetchPortfolioAllocationSuccess = exports.fetchPortfolioAllocation = exports.updatePortfolioAllocationFailure = exports.updatePortfolioAllocationSuccess = exports.updatePortfolioAllocation = exports.updateTreasuryFundsFailure = exports.updateTreasuryFundsSuccess = exports.clearTreasurySetupView = exports.acceptTreasuryTermsFailure = exports.acceptTreasuryTermsSuccess = exports.acceptTreasuryTerms = exports.fetchTreasurySetupViewFailure = exports.fetchTreasurySetupViewSuccess = exports.fetchTreasurySetupView = exports.fetchTreasuryFunds = exports.initialState = void 0;
|
|
8
8
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
9
9
|
const isEqual_1 = __importDefault(require("lodash/isEqual"));
|
|
10
10
|
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
@@ -40,6 +40,14 @@ exports.initialState = {
|
|
|
40
40
|
fetchState: 'Not-Started',
|
|
41
41
|
error: undefined,
|
|
42
42
|
},
|
|
43
|
+
updateTreasuryPromoIntroClosedByOutsideClickStatus: {
|
|
44
|
+
fetchState: 'Not-Started',
|
|
45
|
+
error: undefined,
|
|
46
|
+
},
|
|
47
|
+
updateTreasuryPromoRemindMeLaterClickedStatus: {
|
|
48
|
+
fetchState: 'Not-Started',
|
|
49
|
+
error: undefined,
|
|
50
|
+
},
|
|
43
51
|
updateTreasuryVideoViewedStatus: {
|
|
44
52
|
fetchState: 'Not-Started',
|
|
45
53
|
error: undefined,
|
|
@@ -297,12 +305,48 @@ const treasurySetupView = (0, toolkit_1.createSlice)({
|
|
|
297
305
|
error: action.payload,
|
|
298
306
|
};
|
|
299
307
|
},
|
|
308
|
+
updateTreasuryPromoRemindMeLaterClicked(draft) {
|
|
309
|
+
draft.updateTreasuryPromoRemindMeLaterClickedStatus = {
|
|
310
|
+
fetchState: 'In-Progress',
|
|
311
|
+
error: undefined,
|
|
312
|
+
};
|
|
313
|
+
},
|
|
314
|
+
updateTreasuryPromoRemindMeLaterClickedSuccess(draft) {
|
|
315
|
+
draft.updateTreasuryPromoRemindMeLaterClickedStatus = {
|
|
316
|
+
fetchState: 'Completed',
|
|
317
|
+
error: undefined,
|
|
318
|
+
};
|
|
319
|
+
},
|
|
320
|
+
updateTreasuryPromoRemindMeLaterClickedFailure(draft, action) {
|
|
321
|
+
draft.updateTreasuryPromoRemindMeLaterClickedStatus = {
|
|
322
|
+
fetchState: 'Error',
|
|
323
|
+
error: action.payload,
|
|
324
|
+
};
|
|
325
|
+
},
|
|
326
|
+
updateTreasuryPromoIntroClosedByOutsideClick(draft) {
|
|
327
|
+
draft.updateTreasuryPromoIntroClosedByOutsideClickStatus = {
|
|
328
|
+
fetchState: 'In-Progress',
|
|
329
|
+
error: undefined,
|
|
330
|
+
};
|
|
331
|
+
},
|
|
332
|
+
updateTreasuryPromoIntroClosedByOutsideClickSuccess(draft) {
|
|
333
|
+
draft.updateTreasuryPromoIntroClosedByOutsideClickStatus = {
|
|
334
|
+
fetchState: 'Completed',
|
|
335
|
+
error: undefined,
|
|
336
|
+
};
|
|
337
|
+
},
|
|
338
|
+
updateTreasuryPromoIntroClosedByOutsideClickFailure(draft, action) {
|
|
339
|
+
draft.updateTreasuryPromoIntroClosedByOutsideClickStatus = {
|
|
340
|
+
fetchState: 'Error',
|
|
341
|
+
error: action.payload,
|
|
342
|
+
};
|
|
343
|
+
},
|
|
300
344
|
clearTreasurySetupView(draft) {
|
|
301
345
|
Object.assign(draft, exports.initialState);
|
|
302
346
|
},
|
|
303
347
|
},
|
|
304
348
|
});
|
|
305
|
-
_a = treasurySetupView.actions, exports.fetchTreasuryFunds = _a.fetchTreasuryFunds, exports.fetchTreasurySetupView = _a.fetchTreasurySetupView, exports.fetchTreasurySetupViewSuccess = _a.fetchTreasurySetupViewSuccess, exports.fetchTreasurySetupViewFailure = _a.fetchTreasurySetupViewFailure, exports.acceptTreasuryTerms = _a.acceptTreasuryTerms, exports.acceptTreasuryTermsSuccess = _a.acceptTreasuryTermsSuccess, exports.acceptTreasuryTermsFailure = _a.acceptTreasuryTermsFailure, exports.clearTreasurySetupView = _a.clearTreasurySetupView, exports.updateTreasuryFundsSuccess = _a.updateTreasuryFundsSuccess, exports.updateTreasuryFundsFailure = _a.updateTreasuryFundsFailure, exports.updatePortfolioAllocation = _a.updatePortfolioAllocation, exports.updatePortfolioAllocationSuccess = _a.updatePortfolioAllocationSuccess, exports.updatePortfolioAllocationFailure = _a.updatePortfolioAllocationFailure, exports.fetchPortfolioAllocation = _a.fetchPortfolioAllocation, exports.fetchPortfolioAllocationSuccess = _a.fetchPortfolioAllocationSuccess, exports.fetchPortfolioAllocationFailure = _a.fetchPortfolioAllocationFailure, exports.updateFundAllocationLocalData = _a.updateFundAllocationLocalData, exports.updateTreasuryVideoViewed = _a.updateTreasuryVideoViewed, exports.
|
|
349
|
+
_a = treasurySetupView.actions, exports.fetchTreasuryFunds = _a.fetchTreasuryFunds, exports.fetchTreasurySetupView = _a.fetchTreasurySetupView, exports.fetchTreasurySetupViewSuccess = _a.fetchTreasurySetupViewSuccess, exports.fetchTreasurySetupViewFailure = _a.fetchTreasurySetupViewFailure, exports.acceptTreasuryTerms = _a.acceptTreasuryTerms, exports.acceptTreasuryTermsSuccess = _a.acceptTreasuryTermsSuccess, exports.acceptTreasuryTermsFailure = _a.acceptTreasuryTermsFailure, exports.clearTreasurySetupView = _a.clearTreasurySetupView, exports.updateTreasuryFundsSuccess = _a.updateTreasuryFundsSuccess, exports.updateTreasuryFundsFailure = _a.updateTreasuryFundsFailure, exports.updatePortfolioAllocation = _a.updatePortfolioAllocation, exports.updatePortfolioAllocationSuccess = _a.updatePortfolioAllocationSuccess, exports.updatePortfolioAllocationFailure = _a.updatePortfolioAllocationFailure, exports.fetchPortfolioAllocation = _a.fetchPortfolioAllocation, exports.fetchPortfolioAllocationSuccess = _a.fetchPortfolioAllocationSuccess, exports.fetchPortfolioAllocationFailure = _a.fetchPortfolioAllocationFailure, exports.updateFundAllocationLocalData = _a.updateFundAllocationLocalData, exports.updateTreasuryPromoIntroClosedByOutsideClick = _a.updateTreasuryPromoIntroClosedByOutsideClick, exports.updateTreasuryPromoIntroClosedByOutsideClickFailure = _a.updateTreasuryPromoIntroClosedByOutsideClickFailure, exports.updateTreasuryPromoIntroClosedByOutsideClickSuccess = _a.updateTreasuryPromoIntroClosedByOutsideClickSuccess, exports.updateTreasuryPromoRemindMeLaterClicked = _a.updateTreasuryPromoRemindMeLaterClicked, exports.updateTreasuryPromoRemindMeLaterClickedFailure = _a.updateTreasuryPromoRemindMeLaterClickedFailure, exports.updateTreasuryPromoRemindMeLaterClickedSuccess = _a.updateTreasuryPromoRemindMeLaterClickedSuccess, exports.updateTreasuryVideoViewed = _a.updateTreasuryVideoViewed, exports.updateTreasuryVideoViewedFailure = _a.updateTreasuryVideoViewedFailure, exports.updateTreasuryVideoViewedSuccess = _a.updateTreasuryVideoViewedSuccess;
|
|
306
350
|
exports.default = treasurySetupView.reducer;
|
|
307
351
|
function mapTreasuryFundsPayloadToFundData(fundsPayload) {
|
|
308
352
|
return fundsPayload.funds.map((fund) => ({
|
|
@@ -16,6 +16,8 @@ export interface TreasurySetupViewState extends FetchedState {
|
|
|
16
16
|
fundAllocationOptions: FundAllocationOption[];
|
|
17
17
|
fundsDetails: FundData[];
|
|
18
18
|
};
|
|
19
|
+
updateTreasuryPromoIntroClosedByOutsideClickStatus: FetchStateAndError;
|
|
20
|
+
updateTreasuryPromoRemindMeLaterClickedStatus: FetchStateAndError;
|
|
19
21
|
updateTreasuryVideoViewedStatus: FetchStateAndError;
|
|
20
22
|
treasuryTermsDetails?: {
|
|
21
23
|
fetchStatus: FetchStateAndError;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.88-
|
|
3
|
+
"version": "5.0.88-betaAS1",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|