@zeniai/client-epic-state 5.1.97 → 5.1.98

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 (51) hide show
  1. package/lib/epic.d.ts +1 -5
  2. package/lib/epic.js +1 -5
  3. package/lib/esm/epic.js +1 -5
  4. package/lib/esm/index.js +4 -7
  5. package/lib/esm/reducer.js +0 -3
  6. package/lib/esm/view/dashboard/dashboardEpic.js +0 -20
  7. package/lib/esm/view/dashboard/dashboardReducer.js +1 -13
  8. package/lib/esm/view/dashboard/dashboardSelector.js +2 -7
  9. package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +1 -0
  10. package/lib/esm/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +1 -67
  11. package/lib/index.d.ts +4 -8
  12. package/lib/index.js +39 -48
  13. package/lib/reducer.d.ts +0 -3
  14. package/lib/reducer.js +0 -3
  15. package/lib/view/dashboard/dashboardEpic.d.ts +1 -3
  16. package/lib/view/dashboard/dashboardEpic.js +0 -20
  17. package/lib/view/dashboard/dashboardReducer.d.ts +1 -1
  18. package/lib/view/dashboard/dashboardReducer.js +2 -14
  19. package/lib/view/dashboard/dashboardSelector.d.ts +0 -1
  20. package/lib/view/dashboard/dashboardSelector.js +2 -7
  21. package/lib/view/dashboard/dashboardState.d.ts +0 -1
  22. package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +1 -0
  23. package/lib/view/invoicing/settingsView/settingsViewSelector.js +1 -0
  24. package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.d.ts +1 -1
  25. package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +2 -68
  26. package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewState.d.ts +0 -3
  27. package/package.json +1 -1
  28. package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +0 -18
  29. package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +0 -18
  30. package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +0 -18
  31. package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.js +0 -16
  32. package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.js +0 -1
  33. package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +0 -60
  34. package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.js +0 -12
  35. package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.js +0 -1
  36. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.d.ts +0 -8
  37. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +0 -22
  38. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.d.ts +0 -8
  39. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +0 -22
  40. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.d.ts +0 -8
  41. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +0 -22
  42. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.d.ts +0 -13
  43. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.js +0 -20
  44. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.d.ts +0 -11
  45. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.js +0 -2
  46. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.d.ts +0 -7
  47. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +0 -64
  48. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.d.ts +0 -12
  49. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.js +0 -15
  50. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.d.ts +0 -9
  51. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.js +0 -2
@@ -1,13 +1,11 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.clearDashboard = exports.updateTreasuryVideoClosed = exports.fetchDashboard = exports.initialState = void 0;
4
+ exports.clearDashboard = exports.fetchDashboard = exports.initialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const rootActions_1 = require("../../rootActions");
7
7
  const zeniDayJS_1 = require("../../zeniDayJS");
8
- const treasurySetupViewReducer_1 = require("../spendManagement/treasury/treasurySetUp/treasurySetupViewReducer");
9
8
  exports.initialState = {
10
- isTreasuryVideoClosed: false,
11
9
  lastFetchRequestTime: undefined,
12
10
  };
13
11
  const dashboard = (0, toolkit_1.createSlice)({
@@ -31,25 +29,15 @@ const dashboard = (0, toolkit_1.createSlice)({
31
29
  };
32
30
  },
33
31
  },
34
- updateTreasuryVideoClosed(draft) {
35
- draft.isTreasuryVideoClosed = true;
36
- },
37
32
  clearDashboard(draft) {
38
33
  Object.assign(draft, exports.initialState);
39
34
  },
40
35
  },
41
36
  extraReducers: (builder) => {
42
- builder
43
- .addCase(treasurySetupViewReducer_1.updateTreasuryPromoRemindMeLaterClicked, (draft) => {
44
- draft.isTreasuryVideoClosed = true;
45
- })
46
- .addCase(treasurySetupViewReducer_1.updateTreasuryPromoIntroClosedByOutsideClick, (draft) => {
47
- draft.isTreasuryVideoClosed = true;
48
- });
49
37
  builder.addCase(rootActions_1.clearAll, (draft) => {
50
38
  Object.assign(draft, exports.initialState);
51
39
  });
52
40
  },
53
41
  });
54
- _a = dashboard.actions, exports.fetchDashboard = _a.fetchDashboard, exports.updateTreasuryVideoClosed = _a.updateTreasuryVideoClosed, exports.clearDashboard = _a.clearDashboard;
42
+ _a = dashboard.actions, exports.fetchDashboard = _a.fetchDashboard, exports.clearDashboard = _a.clearDashboard;
55
43
  exports.default = dashboard.reducer;
@@ -6,7 +6,6 @@ import { CardType } from './dashboardState';
6
6
  export interface DashboardReport extends SelectorReport {
7
7
  cardsForDashboardUI: CardType[];
8
8
  cardsOrdered: CardType[];
9
- isTreasuryVideoClosed: boolean;
10
9
  reportsInOrder: (SelectorReport | SelectorView)[];
11
10
  tenantsOrdered: TenantsOrdered;
12
11
  currentTenant?: Tenant;
@@ -25,7 +25,6 @@ const reimbursementCardSelector_1 = require("../reimbursementCard/reimbursementC
25
25
  const revenueSelector_1 = require("../revenue/revenueSelector");
26
26
  const tasksCardSelector_1 = require("../tasksCard/tasksCardSelector");
27
27
  const topExSelector_1 = require("../topEx/topExSelector");
28
- const zeniAccountsPromoCardSelector_1 = require("../zeniAccountsPromoCard/zeniAccountsPromoCardSelector");
29
28
  const getNetBurnOrIncomeForLast4Periods = (state) => {
30
29
  return (0, netBurnOrIncomeSelector_1.getNetBurnOrIncomeReport)(state.accountState, state.accountGroupState, state.sectionAccountsViewState, state.netBurnOrIncomeState, state.forecastState, state.forecastListState, (0, coaBalancesFilter_1.newBalancesFilter)(state.netBurnOrIncomeState.netBurnOrIncome.firstMonthOfFY, state.netBurnOrIncomeState.uiState.timeframe, 4, undefined, 'ascending_date', state.netBurnOrIncomeState.uiState.selectedAdditionalBalances));
31
30
  };
@@ -42,10 +41,10 @@ const tenantSelector = (0, toolkit_1.createSelector)(tenantSelector_1.getTenants
42
41
  tenantsOrdered,
43
42
  currentTenant,
44
43
  }));
45
- exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalanceSelector_1.getCardBalance, cashBalanceSelector_1.getCashBalance, getOperatingExpensesForLast5Periods, getRevenueForLast4Periods, topExSelector_1.getTop6Expenses, getNetBurnOrIncomeForLast4Periods, getNetBurnOrIncomeStoryCard, getCashPositionLast5Periods, getCashInCashOutLast4Periods, insightsCardSelector_1.getInsights, companyPassportViewSelector_1.getCompanyPassportView, tasksCardSelector_1.getTasksCardReport, billPayCardSelector_1.getBillPayCardReport, reimbursementCardSelector_1.getReimbursementCardReport, apAgingSelector, arAgingSelector, zeniAccountsPromoCardSelector_1.getZeniAccountsPromoCard, referralSelector_1.getRewardsPlanCard, dashboardLayoutSelector_1.getDashboardCardsOrdered, (state) => {
44
+ exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalanceSelector_1.getCardBalance, cashBalanceSelector_1.getCashBalance, getOperatingExpensesForLast5Periods, getRevenueForLast4Periods, topExSelector_1.getTop6Expenses, getNetBurnOrIncomeForLast4Periods, getNetBurnOrIncomeStoryCard, getCashPositionLast5Periods, getCashInCashOutLast4Periods, insightsCardSelector_1.getInsights, companyPassportViewSelector_1.getCompanyPassportView, tasksCardSelector_1.getTasksCardReport, billPayCardSelector_1.getBillPayCardReport, reimbursementCardSelector_1.getReimbursementCardReport, apAgingSelector, arAgingSelector, referralSelector_1.getRewardsPlanCard, dashboardLayoutSelector_1.getDashboardCardsOrdered, (state) => {
46
45
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
47
46
  return (0, monthEndCloseChecksViewSelector_1.getMonthEndCloseChecksViewByTenantId)(state, currentTenant.tenantId);
48
- }, (state) => state.tenantState, (_state, additionalExcludedReports) => additionalExcludedReports, (state) => state.dashboardState.isTreasuryVideoClosed, (tenants, cardBalance, cashBalance, opEx, revenue, topEx, netBurnOrIncome, netBurnOrIncomeStoryCard, cashPosition, cashInCashOut, insightsView, companyPassportView, tasksCard, billPayCard, reimbursementCard, apAgingReport, arAgingReport, zeniAccountsPromoCard, rewardsPlanCard, cards, monthEndCloseChecksView, tenantState, additionalExcludedReports, isTreasuryVideoClosed) => {
47
+ }, (state) => state.tenantState, (_state, additionalExcludedReports) => additionalExcludedReports, (tenants, cardBalance, cashBalance, opEx, revenue, topEx, netBurnOrIncome, netBurnOrIncomeStoryCard, cashPosition, cashInCashOut, insightsView, companyPassportView, tasksCard, billPayCard, reimbursementCard, apAgingReport, arAgingReport, rewardsPlanCard, cards, monthEndCloseChecksView, tenantState, additionalExcludedReports) => {
49
48
  const isReimbursementFeatureEnabled = tenants.currentTenant.company?.featuresActivationInfo
50
49
  .isReimbursementFeatureEnabled;
51
50
  const isBillPayFeatureEnabled = tenants.currentTenant.company?.featuresActivationInfo
@@ -214,9 +213,6 @@ exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalance
214
213
  if (isReimbursementFeatureEnabled === true && isAdmin) {
215
214
  reportsInOrder.push(reimbursementCard);
216
215
  }
217
- if (additionalExcludedReports.includes('zeni_accounts_promo_card') === false) {
218
- reportsInOrder.push(zeniAccountsPromoCard);
219
- }
220
216
  if (additionalExcludedReports.includes('rewards_card') === false) {
221
217
  reportsInOrder.push(rewardsPlanCard);
222
218
  }
@@ -232,6 +228,5 @@ exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalance
232
228
  ...tenants,
233
229
  reportsInOrder,
234
230
  cardsForDashboardUI: cardsCopy,
235
- isTreasuryVideoClosed,
236
231
  };
237
232
  });
@@ -2,6 +2,5 @@ import { ReportID } from '../../commonStateTypes/viewAndReport/viewAndReport';
2
2
  import { ZeniDate } from '../../zeniDayJS';
3
3
  export type CardType = ReportID | 'information_card' | 'zeni_promo_card' | 'expense_automation_card' | 'rewards_card';
4
4
  export interface DashboardState {
5
- isTreasuryVideoClosed: boolean;
6
5
  lastFetchRequestTime?: ZeniDate;
7
6
  }
@@ -49,6 +49,7 @@ export interface InvoicingSettingsHubView {
49
49
  isEnablingInvoicing: boolean;
50
50
  isQboConfigured: boolean;
51
51
  isStripeConnected: boolean;
52
+ status: string | undefined;
52
53
  }
53
54
  /**
54
55
  * The settings hub's composite of everything it derives from the store: whether
@@ -86,6 +86,7 @@ const getInvoicingSettingsHubView = (state) => {
86
86
  isEnablingInvoicing: enableState.fetchState === 'In-Progress',
87
87
  isQboConfigured,
88
88
  isStripeConnected,
89
+ status,
89
90
  };
90
91
  };
91
92
  exports.getInvoicingSettingsHubView = getInvoicingSettingsHubView;
@@ -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">, 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">;
18
+ }, "treasurySetupView/fetchPortfolioAllocationSuccess">, fetchPortfolioAllocationFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/fetchPortfolioAllocationFailure">, updateFundAllocationLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<FundAllocationOption, "treasurySetupView/updateFundAllocationLocalData">;
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.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;
7
+ 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 rootActions_1 = require("../../../../rootActions");
@@ -41,18 +41,6 @@ exports.initialState = {
41
41
  fetchState: 'Not-Started',
42
42
  error: undefined,
43
43
  },
44
- updateTreasuryPromoIntroClosedByOutsideClickStatus: {
45
- fetchState: 'Not-Started',
46
- error: undefined,
47
- },
48
- updateTreasuryPromoRemindMeLaterClickedStatus: {
49
- fetchState: 'Not-Started',
50
- error: undefined,
51
- },
52
- updateTreasuryVideoViewedStatus: {
53
- fetchState: 'Not-Started',
54
- error: undefined,
55
- },
56
44
  hasValidState() {
57
45
  return this.fetchState === 'Completed';
58
46
  },
@@ -288,60 +276,6 @@ const treasurySetupView = (0, toolkit_1.createSlice)({
288
276
  updateFundAllocationLocalData(draft, action) {
289
277
  draft.fundAllocationLocalData = action.payload;
290
278
  },
291
- updateTreasuryVideoViewed(draft) {
292
- draft.updateTreasuryVideoViewedStatus = {
293
- fetchState: 'In-Progress',
294
- error: undefined,
295
- };
296
- },
297
- updateTreasuryVideoViewedSuccess(draft) {
298
- draft.updateTreasuryVideoViewedStatus = {
299
- fetchState: 'Completed',
300
- error: undefined,
301
- };
302
- },
303
- updateTreasuryVideoViewedFailure(draft, action) {
304
- draft.updateTreasuryVideoViewedStatus = {
305
- fetchState: 'Error',
306
- error: action.payload,
307
- };
308
- },
309
- updateTreasuryPromoRemindMeLaterClicked(draft) {
310
- draft.updateTreasuryPromoRemindMeLaterClickedStatus = {
311
- fetchState: 'In-Progress',
312
- error: undefined,
313
- };
314
- },
315
- updateTreasuryPromoRemindMeLaterClickedSuccess(draft) {
316
- draft.updateTreasuryPromoRemindMeLaterClickedStatus = {
317
- fetchState: 'Completed',
318
- error: undefined,
319
- };
320
- },
321
- updateTreasuryPromoRemindMeLaterClickedFailure(draft, action) {
322
- draft.updateTreasuryPromoRemindMeLaterClickedStatus = {
323
- fetchState: 'Error',
324
- error: action.payload,
325
- };
326
- },
327
- updateTreasuryPromoIntroClosedByOutsideClick(draft) {
328
- draft.updateTreasuryPromoIntroClosedByOutsideClickStatus = {
329
- fetchState: 'In-Progress',
330
- error: undefined,
331
- };
332
- },
333
- updateTreasuryPromoIntroClosedByOutsideClickSuccess(draft) {
334
- draft.updateTreasuryPromoIntroClosedByOutsideClickStatus = {
335
- fetchState: 'Completed',
336
- error: undefined,
337
- };
338
- },
339
- updateTreasuryPromoIntroClosedByOutsideClickFailure(draft, action) {
340
- draft.updateTreasuryPromoIntroClosedByOutsideClickStatus = {
341
- fetchState: 'Error',
342
- error: action.payload,
343
- };
344
- },
345
279
  clearTreasurySetupView(draft) {
346
280
  Object.assign(draft, exports.initialState);
347
281
  },
@@ -352,7 +286,7 @@ const treasurySetupView = (0, toolkit_1.createSlice)({
352
286
  });
353
287
  },
354
288
  });
355
- _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;
289
+ _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;
356
290
  exports.default = treasurySetupView.reducer;
357
291
  function mapTreasuryFundsPayloadToFundData(fundsPayload) {
358
292
  return fundsPayload.funds.map((fund) => ({
@@ -16,9 +16,6 @@ export interface TreasurySetupViewState extends FetchedState {
16
16
  fundAllocationOptions: FundAllocationOption[];
17
17
  fundsDetails: FundData[];
18
18
  };
19
- updateTreasuryPromoIntroClosedByOutsideClickStatus: FetchStateAndError;
20
- updateTreasuryPromoRemindMeLaterClickedStatus: FetchStateAndError;
21
- updateTreasuryVideoViewedStatus: FetchStateAndError;
22
19
  treasuryTermsDetails?: {
23
20
  fetchStatus: FetchStateAndError;
24
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.1.97",
3
+ "version": "5.1.98",
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",
@@ -1,18 +0,0 @@
1
- import { of } from 'rxjs';
2
- import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
- import { updateTreasuryPromoIntroClosedByOutsideClickForLoggedInUser } from '../../../../../entity/tenant/tenantReducer';
4
- import { createZeniAPIStatus, isSuccessStatus, } from '../../../../../responsePayload';
5
- import { updateTreasuryPromoIntroClosedByOutsideClick, updateTreasuryPromoIntroClosedByOutsideClickFailure, updateTreasuryPromoIntroClosedByOutsideClickSuccess, } from '../treasurySetupViewReducer';
6
- export const updateTreasuryPromoIntroClosedByOutsideClickEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(updateTreasuryPromoIntroClosedByOutsideClick.match), switchMap(() => {
7
- return zeniAPI
8
- .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/user/self`, { is_treasury_promo_intro_closed_by_outside_click: true })
9
- .pipe(mergeMap((response) => {
10
- if (isSuccessStatus(response)) {
11
- return of(updateTreasuryPromoIntroClosedByOutsideClickForLoggedInUser(), updateTreasuryPromoIntroClosedByOutsideClickSuccess());
12
- }
13
- else {
14
- return of(updateTreasuryPromoIntroClosedByOutsideClickFailure(response.status));
15
- }
16
- }), catchError((error) => of(updateTreasuryPromoIntroClosedByOutsideClickFailure(createZeniAPIStatus('Unexpected error', 'Update treasury promo intro closed by outside click REST API call errored out' +
17
- (error?.message ?? JSON.stringify(error)))))));
18
- }));
@@ -1,18 +0,0 @@
1
- import { of } from 'rxjs';
2
- import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
- import { updateTreasuryPromoRemindMeLaterClickedForLoggedInUser } from '../../../../../entity/tenant/tenantReducer';
4
- import { createZeniAPIStatus, isSuccessStatus, } from '../../../../../responsePayload';
5
- import { updateTreasuryPromoRemindMeLaterClicked, updateTreasuryPromoRemindMeLaterClickedFailure, updateTreasuryPromoRemindMeLaterClickedSuccess, } from '../treasurySetupViewReducer';
6
- export const updateTreasuryPromoRemindMeLaterClickedEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(updateTreasuryPromoRemindMeLaterClicked.match), switchMap(() => {
7
- return zeniAPI
8
- .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/user/self`, { is_treasury_promo_video_remind_me_later_clicked: true })
9
- .pipe(mergeMap((response) => {
10
- if (isSuccessStatus(response)) {
11
- return of(updateTreasuryPromoRemindMeLaterClickedForLoggedInUser(), updateTreasuryPromoRemindMeLaterClickedSuccess());
12
- }
13
- else {
14
- return of(updateTreasuryPromoRemindMeLaterClickedFailure(response.status));
15
- }
16
- }), catchError((error) => of(updateTreasuryPromoRemindMeLaterClickedFailure(createZeniAPIStatus('Unexpected error', 'Update treasury promo remind me later REST API call errored out' +
17
- (error?.message ?? JSON.stringify(error)))))));
18
- }));
@@ -1,18 +0,0 @@
1
- import { of } from 'rxjs';
2
- import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
- import { updateTreasuryVideoViewedForLoggedInUser } from '../../../../../entity/tenant/tenantReducer';
4
- import { createZeniAPIStatus, isSuccessStatus, } from '../../../../../responsePayload';
5
- import { updateTreasuryVideoViewed, updateTreasuryVideoViewedFailure, updateTreasuryVideoViewedSuccess, } from '../treasurySetupViewReducer';
6
- export const updateTreasuryVideoViewedEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(updateTreasuryVideoViewed.match), switchMap(() => {
7
- return zeniAPI
8
- .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/user/self`, { is_treasury_promo_video_played: true })
9
- .pipe(mergeMap((response) => {
10
- if (isSuccessStatus(response)) {
11
- return of(updateTreasuryVideoViewedForLoggedInUser(), updateTreasuryVideoViewedSuccess());
12
- }
13
- else {
14
- return of(updateTreasuryVideoViewedFailure(response.status));
15
- }
16
- }), catchError((error) => of(updateTreasuryVideoViewedFailure(createZeniAPIStatus('Unexpected error', 'Update treasury video viewed REST API call errored out' +
17
- (error?.message ?? JSON.stringify(error)))))));
18
- }));
@@ -1,16 +0,0 @@
1
- import { of } from 'rxjs';
2
- import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
- import { createZeniAPIStatus, isSuccessResponse } from '../../responsePayload';
4
- import { fetchZeniAccountsPromoCard, updateZeniAccountsPromoCard, updateZeniAccountsPromoCardFailure, } from './zeniAccountsPromoCardReducer';
5
- export const fetchZeniAccountsPromoCardEpic = (actions$, _, zeniAPI) => actions$.pipe(filter(fetchZeniAccountsPromoCard.match), switchMap(() => zeniAPI
6
- .getJSON(`${zeniAPI.apiEndPoints.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/promo-card`)
7
- .pipe(mergeMap((response) => {
8
- if (isSuccessResponse(response)) {
9
- return of(updateZeniAccountsPromoCard(response.data) // eslint-disable-line @typescript-eslint/no-non-null-assertion
10
- );
11
- }
12
- else {
13
- return of(updateZeniAccountsPromoCardFailure(response.status));
14
- }
15
- }), catchError((error) => of(updateZeniAccountsPromoCardFailure(createZeniAPIStatus('Unexpected error', 'Zeni Accounts Promo Card REST API call errored out' +
16
- JSON.stringify(error))))))));
@@ -1,60 +0,0 @@
1
- import { createSlice } from '@reduxjs/toolkit';
2
- import { clearAll } from '../../rootActions';
3
- export const initialState = {
4
- fetchState: 'Not-Started',
5
- error: undefined,
6
- depositAccountId: undefined,
7
- maxInsuredAmount: 0,
8
- maxAnnualPercentageYield: 0,
9
- maxPossibleInterest: 0,
10
- maxCashBalanceAvailable: 0,
11
- isShowDepositAccountsPromo: false,
12
- hasValidState() {
13
- return this.fetchState == 'Completed';
14
- },
15
- };
16
- const zeniAccountsPromoCard = createSlice({
17
- name: 'zeniAccountsPromoCard',
18
- initialState,
19
- reducers: {
20
- fetchZeniAccountsPromoCard(draft) {
21
- draft.fetchState = 'In-Progress';
22
- draft.error = undefined;
23
- },
24
- updateZeniAccountsPromoCard(draft, action) {
25
- draft.fetchState = 'Completed';
26
- draft.error = undefined;
27
- const promoPayload = action.payload;
28
- draft.isShowDepositAccountsPromo =
29
- promoPayload.is_show_deposit_accounts_promo_card;
30
- draft.maxAnnualPercentageYield = promoPayload.max_apy;
31
- draft.maxPossibleInterest =
32
- promoPayload.max_possible_interest != null
33
- ? promoPayload.max_possible_interest
34
- : undefined;
35
- draft.maxCashBalanceAvailable =
36
- promoPayload.max_cash_balance_available != null
37
- ? promoPayload.max_cash_balance_available
38
- : undefined;
39
- draft.maxInsuredAmount = promoPayload.max_insured_amount;
40
- draft.depositAccountId =
41
- promoPayload.primary_deposit_account_id != null
42
- ? promoPayload.primary_deposit_account_id
43
- : undefined;
44
- },
45
- updateZeniAccountsPromoCardFailure(draft, action) {
46
- draft.fetchState = 'Error';
47
- draft.error = action.payload;
48
- },
49
- clearZeniAccountsPromoCard(draft) {
50
- Object.assign(draft, initialState);
51
- },
52
- },
53
- extraReducers: (builder) => {
54
- builder.addCase(clearAll, (draft) => {
55
- Object.assign(draft, initialState);
56
- });
57
- },
58
- });
59
- export const { fetchZeniAccountsPromoCard, updateZeniAccountsPromoCard, updateZeniAccountsPromoCardFailure, clearZeniAccountsPromoCard, } = zeniAccountsPromoCard.actions;
60
- export default zeniAccountsPromoCard.reducer;
@@ -1,12 +0,0 @@
1
- import { createSelector } from '@reduxjs/toolkit';
2
- export const getZeniAccountsPromoCard = createSelector((state) => state.zeniAccountsPromoCardState, (zeniAccountsPromoCardState) => ({
3
- isShowDepositAccountsPromo: zeniAccountsPromoCardState.isShowDepositAccountsPromo,
4
- maxAnnualPercentageYield: zeniAccountsPromoCardState.maxAnnualPercentageYield,
5
- maxPossibleInterest: zeniAccountsPromoCardState.maxPossibleInterest,
6
- maxCashBalanceAvailable: zeniAccountsPromoCardState.maxCashBalanceAvailable,
7
- maxInsuredAmount: zeniAccountsPromoCardState.maxInsuredAmount,
8
- depositAccountId: zeniAccountsPromoCardState.depositAccountId,
9
- reportId: 'zeni_accounts_promo_card',
10
- fetchState: zeniAccountsPromoCardState.fetchState,
11
- error: zeniAccountsPromoCardState.error,
12
- }));
@@ -1,8 +0,0 @@
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>;
@@ -1,22 +0,0 @@
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;
@@ -1,8 +0,0 @@
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>;
@@ -1,22 +0,0 @@
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;
@@ -1,8 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { updateTreasuryVideoViewedForLoggedInUser } from '../../../../../entity/tenant/tenantReducer';
4
- import { RootState } from '../../../../../reducer';
5
- import { ZeniAPI } from '../../../../../zeniAPI';
6
- import { updateTreasuryVideoViewed, updateTreasuryVideoViewedFailure, updateTreasuryVideoViewedSuccess } from '../treasurySetupViewReducer';
7
- export type ActionType = ReturnType<typeof updateTreasuryVideoViewed> | ReturnType<typeof updateTreasuryVideoViewedForLoggedInUser> | ReturnType<typeof updateTreasuryVideoViewedSuccess> | ReturnType<typeof updateTreasuryVideoViewedFailure>;
8
- export declare const updateTreasuryVideoViewedEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateTreasuryVideoViewedEpic = 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 updateTreasuryVideoViewedEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(treasurySetupViewReducer_1.updateTreasuryVideoViewed.match), (0, operators_1.switchMap)(() => {
10
- return zeniAPI
11
- .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/user/self`, { is_treasury_promo_video_played: true })
12
- .pipe((0, operators_1.mergeMap)((response) => {
13
- if ((0, responsePayload_1.isSuccessStatus)(response)) {
14
- return (0, rxjs_1.of)((0, tenantReducer_1.updateTreasuryVideoViewedForLoggedInUser)(), (0, treasurySetupViewReducer_1.updateTreasuryVideoViewedSuccess)());
15
- }
16
- else {
17
- return (0, rxjs_1.of)((0, treasurySetupViewReducer_1.updateTreasuryVideoViewedFailure)(response.status));
18
- }
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
- (error?.message ?? JSON.stringify(error)))))));
21
- }));
22
- exports.updateTreasuryVideoViewedEpic = updateTreasuryVideoViewedEpic;
@@ -1,13 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { updateAccounts } from '../../entity/account/accountReducer';
3
- import { RootState } from '../../reducer';
4
- import { ZeniAPI } from '../../zeniAPI';
5
- import { fetchZeniAccountsPromoCard, updateZeniAccountsPromoCard, updateZeniAccountsPromoCardFailure } from './zeniAccountsPromoCardReducer';
6
- export type ActionType = ReturnType<typeof fetchZeniAccountsPromoCard> | ReturnType<typeof updateZeniAccountsPromoCard> | ReturnType<typeof updateZeniAccountsPromoCardFailure> | ReturnType<typeof updateAccounts>;
7
- export declare const fetchZeniAccountsPromoCardEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
8
- payload: import("./zeniAccountsPromoCardPayload").ZeniAccountsPromoCardPayload;
9
- type: "zeniAccountsPromoCard/updateZeniAccountsPromoCard";
10
- } | {
11
- payload: import("../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
12
- type: "zeniAccountsPromoCard/updateZeniAccountsPromoCardFailure";
13
- }>;
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchZeniAccountsPromoCardEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const responsePayload_1 = require("../../responsePayload");
7
- const zeniAccountsPromoCardReducer_1 = require("./zeniAccountsPromoCardReducer");
8
- const fetchZeniAccountsPromoCardEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(zeniAccountsPromoCardReducer_1.fetchZeniAccountsPromoCard.match), (0, operators_1.switchMap)(() => zeniAPI
9
- .getJSON(`${zeniAPI.apiEndPoints.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/promo-card`)
10
- .pipe((0, operators_1.mergeMap)((response) => {
11
- if ((0, responsePayload_1.isSuccessResponse)(response)) {
12
- return (0, rxjs_1.of)((0, zeniAccountsPromoCardReducer_1.updateZeniAccountsPromoCard)(response.data) // eslint-disable-line @typescript-eslint/no-non-null-assertion
13
- );
14
- }
15
- else {
16
- return (0, rxjs_1.of)((0, zeniAccountsPromoCardReducer_1.updateZeniAccountsPromoCardFailure)(response.status));
17
- }
18
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, zeniAccountsPromoCardReducer_1.updateZeniAccountsPromoCardFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Zeni Accounts Promo Card REST API call errored out' +
19
- JSON.stringify(error))))))));
20
- exports.fetchZeniAccountsPromoCardEpic = fetchZeniAccountsPromoCardEpic;
@@ -1,11 +0,0 @@
1
- import { ID } from '../../commonStateTypes/common';
2
- import { ZeniAPIResponse } from '../../responsePayload';
3
- export interface ZeniAccountsPromoCardPayload {
4
- is_show_deposit_accounts_promo_card: boolean;
5
- max_apy: number;
6
- max_cash_balance_available: number | null;
7
- max_insured_amount: number;
8
- max_possible_interest: number | null;
9
- primary_deposit_account_id: ID | null;
10
- }
11
- export type ZeniAccountsPromoCardResponse = ZeniAPIResponse<ZeniAccountsPromoCardPayload>;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +0,0 @@
1
- import { ZeniAPIStatus } from '../../responsePayload';
2
- import { ZeniAccountsPromoCardPayload } from './zeniAccountsPromoCardPayload';
3
- import { ZeniAccountsPromoCardState } from './zeniAccountsPromoCardState';
4
- export declare const initialState: ZeniAccountsPromoCardState;
5
- export declare const fetchZeniAccountsPromoCard: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"zeniAccountsPromoCard/fetchZeniAccountsPromoCard">, updateZeniAccountsPromoCard: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAccountsPromoCardPayload, "zeniAccountsPromoCard/updateZeniAccountsPromoCard">, updateZeniAccountsPromoCardFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "zeniAccountsPromoCard/updateZeniAccountsPromoCardFailure">, clearZeniAccountsPromoCard: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"zeniAccountsPromoCard/clearZeniAccountsPromoCard">;
6
- declare const _default: import("redux").Reducer<ZeniAccountsPromoCardState>;
7
- export default _default;