@zeniai/client-epic-state 5.0.85-betaAR3 → 5.0.85-betaAS2

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.
Files changed (26) hide show
  1. package/lib/entity/tenant/tenantPayload.d.ts +3 -0
  2. package/lib/entity/tenant/tenantReducer.d.ts +2 -2
  3. package/lib/entity/tenant/tenantReducer.js +33 -9
  4. package/lib/entity/tenant/tenantState.d.ts +4 -1
  5. package/lib/epic.d.ts +3 -1
  6. package/lib/epic.js +3 -1
  7. package/lib/esm/entity/tenant/tenantReducer.js +32 -8
  8. package/lib/esm/epic.js +3 -1
  9. package/lib/esm/index.js +4 -4
  10. package/lib/esm/view/dashboard/dashboardReducer.js +11 -1
  11. package/lib/esm/view/expenseAutomationView/transactionFilterHelpers.js +18 -66
  12. package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +18 -0
  13. package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +18 -0
  14. package/lib/esm/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +45 -1
  15. package/lib/index.d.ts +4 -4
  16. package/lib/index.js +9 -7
  17. package/lib/view/dashboard/dashboardReducer.js +11 -1
  18. package/lib/view/expenseAutomationView/transactionFilterHelpers.js +18 -66
  19. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.d.ts +8 -0
  20. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +22 -0
  21. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.d.ts +8 -0
  22. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +22 -0
  23. package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.d.ts +1 -1
  24. package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +46 -2
  25. package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewState.d.ts +2 -0
  26. package/package.json +1 -1
@@ -31,57 +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
- const getLineAmountsForTransaction = (transaction) => {
56
- const localData = transaction.transactionLocalData?.transactionReviewLocalData;
57
- if (localData?.lineItemById != null) {
58
- const lineItems = Object.values(localData.lineItemById);
59
- if (lineItems.length > 0) {
60
- return lineItems.map((lineItem) => lineItem.amount?.amount ?? 0);
61
- }
62
- }
63
- if (transaction.transaction.lines != null &&
64
- transaction.transaction.lines.length > 0) {
65
- return transaction.transaction.lines.map((line) => line.amount?.amount ?? 0);
66
- }
67
- return [transaction.amount.amount];
68
- };
69
34
  /**
70
35
  * Resolve the comparable value for a transaction against a given filter field.
71
36
  * Returns undefined when the transaction doesn't carry the field — callers
72
37
  * decide whether absence counts as a match (for 'not_equal' it does).
73
- *
74
- * NOTE: the `'amount'` field is NOT handled here. Amount matching is
75
- * per-line (see `getLineAmountsForTransaction` + the early-return in
76
- * `transactionMatchesCategory`) and would otherwise need to return a
77
- * non-scalar value that doesn't fit this helper's contract.
78
38
  */
79
39
  const getCategoryValueForTransaction = (key, transaction) => {
80
40
  switch (key) {
81
41
  case 'amount': {
82
- // Handled per-line in `transactionMatchesCategory` see the note on
83
- // this function's JSDoc and `getLineAmountsForTransaction` above.
84
- return undefined;
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;
85
56
  }
86
57
  case 'payee': {
87
58
  if (isNonEmptyString(transaction.vendorName)) {
@@ -219,27 +190,6 @@ const matchAmount = (amount, category) => {
219
190
  return op === 'not_equal' ? !matched : matched;
220
191
  };
221
192
  const transactionMatchesCategory = (transaction, category) => {
222
- if (category.field === 'amount') {
223
- // Per-line matching: the transaction is included if ANY of its lines
224
- // satisfies the operator. This is what the user expects when a
225
- // multi-line transaction contains lines at different amounts — they
226
- // want the row to surface if even one line falls in the filter's
227
- // range. The full row (with non-matching lines too) renders
228
- // downstream; this matcher only decides row inclusion. Same
229
- // operator + sign semantics as the aggregate version, just applied
230
- // per line.
231
- //
232
- // `not_equal` deserves a sanity-check: `matchAmount` already inverts
233
- // internally for that operator, so for a line whose amount is NOT
234
- // in the filter's `values`, matchAmount returns true; for a line
235
- // whose amount IS in the values, it returns false. `.some()` over
236
- // lines therefore means "the transaction has at least one line that
237
- // is not equal to any of the filter values" — which is the right
238
- // match-any-line interpretation of `not_equal` (a transaction
239
- // matches if it has a line that satisfies the negation).
240
- const lineAmounts = getLineAmountsForTransaction(transaction);
241
- return lineAmounts.some((lineAmount) => matchAmount(lineAmount, category));
242
- }
243
193
  const value = getCategoryValueForTransaction(category.field, transaction);
244
194
  if (value == null) {
245
195
  // Absent-value semantics — pinning these down explicitly so the
@@ -259,10 +209,12 @@ const transactionMatchesCategory = (transaction, category) => {
259
209
  // are filtered out.
260
210
  //
261
211
  // Only the `not_equal` branch returns `true` here; everything else
262
- // falls through to the `false` below. Note: 'amount' never lands here
263
- // because it short-circuits to the per-line path above.
212
+ // falls through to the `false` below.
264
213
  return category.matchingOperator === 'not_equal';
265
214
  }
215
+ if (category.field === 'amount') {
216
+ return matchAmount(Number(value), category);
217
+ }
266
218
  const valueStr = value.toString();
267
219
  const valueInList = category.values.some((v) => v.toString() === valueStr);
268
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;
@@ -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">, updateTreasuryVideoViewed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/updateTreasuryVideoViewed">, updateTreasuryVideoViewedSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/updateTreasuryVideoViewedSuccess">, updateTreasuryVideoViewedFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/updateTreasuryVideoViewedFailure">;
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.updateTreasuryVideoViewedFailure = exports.updateTreasuryVideoViewedSuccess = exports.updateTreasuryVideoViewed = 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;
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.updateTreasuryVideoViewedSuccess = _a.updateTreasuryVideoViewedSuccess, exports.updateTreasuryVideoViewedFailure = _a.updateTreasuryVideoViewedFailure;
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.85-betaAR3",
3
+ "version": "5.0.85-betaAS2",
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",