@zeniai/client-epic-state 4.8.26 → 4.8.28

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 (46) hide show
  1. package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +1 -1
  2. package/lib/commonStateTypes/viewAndReport/viewAndReport.js +1 -0
  3. package/lib/entity/account/accountState.d.ts +1 -1
  4. package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
  5. package/lib/entity/class/classReducer.d.ts +4 -4
  6. package/lib/entity/class/classState.d.ts +1 -1
  7. package/lib/entity/forecast/forecastState.d.ts +1 -1
  8. package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
  9. package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
  10. package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
  11. package/lib/entity/tenant/clearAllEpic.d.ts +2 -1
  12. package/lib/entity/tenant/clearAllEpic.js +2 -0
  13. package/lib/epic.d.ts +2 -1
  14. package/lib/epic.js +2 -1
  15. package/lib/index.d.ts +4 -0
  16. package/lib/index.js +5 -1
  17. package/lib/reducer.d.ts +3 -0
  18. package/lib/reducer.js +3 -0
  19. package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
  20. package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
  21. package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
  22. package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
  23. package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
  24. package/lib/view/dashboard/dashboardEpic.d.ts +2 -1
  25. package/lib/view/dashboard/dashboardEpic.js +10 -0
  26. package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
  27. package/lib/view/dashboard/dashboardSelector.d.ts +2 -0
  28. package/lib/view/dashboard/dashboardSelector.js +7 -2
  29. package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
  30. package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
  31. package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
  32. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +2 -1
  33. package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailReducer.js +10 -0
  34. package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
  35. package/lib/view/topEx/topExSelector.d.ts +1 -1
  36. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.d.ts +13 -0
  37. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.js +20 -0
  38. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.d.ts +10 -0
  39. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.js +2 -0
  40. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.d.ts +7 -0
  41. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +56 -0
  42. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.d.ts +14 -0
  43. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.js +18 -0
  44. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.d.ts +9 -0
  45. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.js +2 -0
  46. package/package.json +1 -1
@@ -5,7 +5,7 @@ import { AccountState } from '../../entity/account/accountState';
5
5
  import { EntityOrder } from '../../commonStateTypes/selectorTypes/selectorTypes';
6
6
  import { TopExReport, TopExTimePeriodWithMetaData } from './topExSelectorTypes';
7
7
  export declare const getTopExpenses: (accountState: AccountState, topExState: TopExState, numberOfExpenses?: number | undefined) => {
8
- reportId: "cash_balance" | "card_balance" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses";
8
+ reportId: "cash_balance" | "card_balance" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses";
9
9
  reportTitle: string;
10
10
  version: string | number | undefined;
11
11
  status: import("../..").Status | undefined;
@@ -0,0 +1,13 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { fetchZeniAccountsPromoCard, updateZeniAccountsPromoCard, updateZeniAccountsPromoCardFailure } from './zeniAccountsPromoCardReducer';
3
+ import { updateAccounts } from '../../entity/account/accountReducer';
4
+ import { ZeniAPI } from '../../zeniAPI';
5
+ import { RootState } from '../../reducer';
6
+ export declare 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("../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
9
+ type: string;
10
+ } | {
11
+ payload: import("./zeniAccountsPromoCardPayload").ZeniAccountsPromoCardPayload;
12
+ type: string;
13
+ }>;
@@ -0,0 +1,20 @@
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 zeniAccountsPromoCardReducer_1 = require("./zeniAccountsPromoCardReducer");
7
+ const responsePayload_1 = require("../../responsePayload");
8
+ const fetchZeniAccountsPromoCardEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(zeniAccountsPromoCardReducer_1.fetchZeniAccountsPromoCard.match), (0, operators_1.switchMap)(() => zeniAPI
9
+ .getJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/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;
@@ -0,0 +1,10 @@
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_insured_amount: number;
7
+ max_possible_interest: number | null;
8
+ primary_deposit_account_id: ID | null;
9
+ }
10
+ export declare type ZeniAccountsPromoCardResponse = ZeniAPIResponse<ZeniAccountsPromoCardPayload>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ import { ZeniAccountsPromoCardPayload } from './zeniAccountsPromoCardPayload';
2
+ import { ZeniAccountsPromoCardState } from './zeniAccountsPromoCardState';
3
+ import { ZeniAPIStatus } from '../../responsePayload';
4
+ export declare const initialState: ZeniAccountsPromoCardState;
5
+ export declare const fetchZeniAccountsPromoCard: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateZeniAccountsPromoCard: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAccountsPromoCardPayload, string>, updateZeniAccountsPromoCardFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, clearZeniAccountsPromoCard: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
6
+ declare const _default: import("@reduxjs/toolkit").Reducer<ZeniAccountsPromoCardState, import("@reduxjs/toolkit").AnyAction>;
7
+ export default _default;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.clearZeniAccountsPromoCard = exports.updateZeniAccountsPromoCardFailure = exports.updateZeniAccountsPromoCard = exports.fetchZeniAccountsPromoCard = exports.initialState = void 0;
5
+ const toolkit_1 = require("@reduxjs/toolkit");
6
+ exports.initialState = {
7
+ fetchState: 'Not-Started',
8
+ error: undefined,
9
+ depositAccountId: undefined,
10
+ maxInsuredAmount: 0,
11
+ maxAnnualPercentageYield: 0,
12
+ maxPossibleInterest: 0,
13
+ isShowDepositAccountsPromo: false,
14
+ firstMonthOfFY: 1,
15
+ reportId: 'zeni_accounts_promo_card',
16
+ reportTitle: '',
17
+ hasValidState() {
18
+ return this.fetchState == 'Completed';
19
+ },
20
+ };
21
+ const zeniAccountsPromoCard = (0, toolkit_1.createSlice)({
22
+ name: 'zeniAccountsPromoCard',
23
+ initialState: exports.initialState,
24
+ reducers: {
25
+ fetchZeniAccountsPromoCard(draft) {
26
+ draft.fetchState = 'In-Progress';
27
+ draft.error = undefined;
28
+ },
29
+ updateZeniAccountsPromoCard(draft, action) {
30
+ draft.fetchState = 'Completed';
31
+ draft.error = undefined;
32
+ const promoPayload = action.payload;
33
+ draft.isShowDepositAccountsPromo =
34
+ promoPayload.is_show_deposit_accounts_promo_card;
35
+ draft.maxAnnualPercentageYield = promoPayload.max_apy;
36
+ draft.maxPossibleInterest =
37
+ promoPayload.max_possible_interest != null
38
+ ? promoPayload.max_possible_interest
39
+ : undefined;
40
+ draft.maxInsuredAmount = promoPayload.max_insured_amount;
41
+ draft.depositAccountId =
42
+ promoPayload.primary_deposit_account_id != null
43
+ ? promoPayload.primary_deposit_account_id
44
+ : undefined;
45
+ },
46
+ updateZeniAccountsPromoCardFailure(draft, action) {
47
+ draft.fetchState = 'Error';
48
+ draft.error = action.payload;
49
+ },
50
+ clearZeniAccountsPromoCard(draft) {
51
+ Object.assign(draft, exports.initialState);
52
+ },
53
+ },
54
+ });
55
+ _a = zeniAccountsPromoCard.actions, exports.fetchZeniAccountsPromoCard = _a.fetchZeniAccountsPromoCard, exports.updateZeniAccountsPromoCard = _a.updateZeniAccountsPromoCard, exports.updateZeniAccountsPromoCardFailure = _a.updateZeniAccountsPromoCardFailure, exports.clearZeniAccountsPromoCard = _a.clearZeniAccountsPromoCard;
56
+ exports.default = zeniAccountsPromoCard.reducer;
@@ -0,0 +1,14 @@
1
+ import { RootState } from '../../reducer';
2
+ export declare const getZeniAccountsPromoCard: (state: RootState) => {
3
+ isShowDepositAccountsPromo: boolean;
4
+ maxAnnualPercentageYield: number;
5
+ maxPossibleInterest: number | undefined;
6
+ maxInsuredAmount: number;
7
+ depositAccountId: string | undefined;
8
+ reportId: "cash_balance" | "card_balance" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses";
9
+ reportTitle: string;
10
+ firstMonthOfFY: 2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
11
+ fetchState: import("../..").FetchState;
12
+ error: import("../..").ZeniAPIStatus<Record<string, unknown>> | undefined;
13
+ };
14
+ export declare type ZeniAccountsPromoCardReport = ReturnType<typeof getZeniAccountsPromoCard>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getZeniAccountsPromoCard = void 0;
4
+ const toolkit_1 = require("@reduxjs/toolkit");
5
+ const getZeniAccountsPromoCardSelector = (0, toolkit_1.createSelector)((state) => state.zeniAccountsPromoCardState, (zeniAccountsPromoCardState) => ({
6
+ isShowDepositAccountsPromo: zeniAccountsPromoCardState.isShowDepositAccountsPromo,
7
+ maxAnnualPercentageYield: zeniAccountsPromoCardState.maxAnnualPercentageYield,
8
+ maxPossibleInterest: zeniAccountsPromoCardState.maxPossibleInterest,
9
+ maxInsuredAmount: zeniAccountsPromoCardState.maxInsuredAmount,
10
+ depositAccountId: zeniAccountsPromoCardState.depositAccountId,
11
+ reportId: zeniAccountsPromoCardState.reportId,
12
+ reportTitle: 'Business Banking',
13
+ firstMonthOfFY: zeniAccountsPromoCardState.firstMonthOfFY,
14
+ fetchState: zeniAccountsPromoCardState.fetchState,
15
+ error: zeniAccountsPromoCardState.error,
16
+ }));
17
+ const getZeniAccountsPromoCard = (state) => getZeniAccountsPromoCardSelector(state);
18
+ exports.getZeniAccountsPromoCard = getZeniAccountsPromoCard;
@@ -0,0 +1,9 @@
1
+ import { ID, FetchedState } from '../../commonStateTypes/common';
2
+ import { Report } from '../../commonStateTypes/viewAndReport/viewAndReport';
3
+ export interface ZeniAccountsPromoCardState extends FetchedState, Report {
4
+ isShowDepositAccountsPromo: boolean;
5
+ maxAnnualPercentageYield: number;
6
+ maxPossibleInterest?: number;
7
+ maxInsuredAmount: number;
8
+ depositAccountId?: ID;
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.8.26",
3
+ "version": "4.8.28",
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
  "types": "lib/index.d.ts",