@zeniai/client-epic-state 4.19.86-beta0AD → 4.19.86-betaNB2

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 (84) hide show
  1. package/lib/commonStateTypes/animations.d.ts +1 -1
  2. package/lib/commonStateTypes/animations.js +3 -0
  3. package/lib/entity/aiCfo/aiCfoSelector.d.ts +2 -1
  4. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  5. package/lib/entity/snackbar/snackbarTypes.js +5 -0
  6. package/lib/epic.d.ts +7 -2
  7. package/lib/epic.js +7 -2
  8. package/lib/esm/commonStateTypes/animations.js +3 -0
  9. package/lib/esm/entity/snackbar/snackbarTypes.js +5 -0
  10. package/lib/esm/epic.js +7 -2
  11. package/lib/esm/index.js +4 -2
  12. package/lib/esm/reducer.js +3 -0
  13. package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +1 -34
  14. package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +1 -5
  15. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesPayload.js +26 -0
  16. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesReducer.js +199 -0
  17. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +52 -0
  18. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesState.js +1 -0
  19. package/lib/esm/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.js +91 -0
  20. package/lib/esm/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.js +48 -0
  21. package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.js +30 -0
  22. package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.js +45 -0
  23. package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.js +52 -0
  24. package/lib/esm/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.js +69 -0
  25. package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +0 -10
  26. package/lib/esm/view/spendManagement/billPay/billList/billListState.js +0 -1
  27. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +0 -1
  28. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +0 -2
  29. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +0 -12
  30. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +0 -1
  31. package/lib/esm/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryDetailEpic.js +2 -2
  32. package/lib/esm/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.js +2 -1
  33. package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  34. package/lib/index.d.ts +9 -7
  35. package/lib/index.js +14 -6
  36. package/lib/reducer.d.ts +3 -0
  37. package/lib/reducer.js +3 -0
  38. package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +0 -11
  39. package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +1 -11
  40. package/lib/view/aiCfoView/aiCfoViewReducer.js +2 -35
  41. package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +1 -4
  42. package/lib/view/aiCfoView/aiCfoViewSelector.js +1 -6
  43. package/lib/view/aiCfoView/aiCfoViewState.d.ts +0 -15
  44. package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
  45. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  46. package/lib/view/spendManagement/autotransferRules/autoTransferRulesPayload.d.ts +75 -0
  47. package/lib/view/spendManagement/autotransferRules/autoTransferRulesPayload.js +30 -0
  48. package/lib/view/spendManagement/autotransferRules/autoTransferRulesReducer.d.ts +50 -0
  49. package/lib/view/spendManagement/autotransferRules/autoTransferRulesReducer.js +206 -0
  50. package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.d.ts +24 -0
  51. package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +61 -0
  52. package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.d.ts +38 -0
  53. package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.js +2 -0
  54. package/lib/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.d.ts +12 -0
  55. package/lib/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.js +97 -0
  56. package/lib/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.d.ts +8 -0
  57. package/lib/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.js +52 -0
  58. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.d.ts +7 -0
  59. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.js +34 -0
  60. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.d.ts +7 -0
  61. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.js +52 -0
  62. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.d.ts +10 -0
  63. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.js +56 -0
  64. package/lib/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.d.ts +8 -0
  65. package/lib/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.js +73 -0
  66. package/lib/view/spendManagement/billPay/billList/billListSelector.js +0 -10
  67. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  68. package/lib/view/spendManagement/billPay/billList/billListState.js +0 -1
  69. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
  70. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +0 -1
  71. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +0 -2
  72. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +0 -1
  73. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +0 -12
  74. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
  75. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +0 -1
  76. package/lib/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryDetailEpic.js +2 -2
  77. package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.d.ts +2 -1
  78. package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.js +2 -1
  79. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  80. package/package.json +1 -1
  81. package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +0 -26
  82. package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
  83. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +0 -8
  84. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +0 -30
@@ -0,0 +1,8 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
4
+ import { RootState } from '../../../../reducer';
5
+ import { ZeniAPI } from '../../../../zeniAPI';
6
+ import { deleteAutoTransferRule, deleteAutoTransferRuleFailure, deleteAutoTransferRuleSuccess } from '../autoTransferRulesReducer';
7
+ export type ActionType = ReturnType<typeof deleteAutoTransferRule> | ReturnType<typeof deleteAutoTransferRuleSuccess> | ReturnType<typeof deleteAutoTransferRuleFailure> | ReturnType<typeof openSnackbar>;
8
+ export declare const deleteAutoTransferRuleEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteAutoTransferRuleEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
7
+ const responsePayload_1 = require("../../../../responsePayload");
8
+ const autoTransferRulesReducer_1 = require("../autoTransferRulesReducer");
9
+ const deleteAutoTransferRuleEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(autoTransferRulesReducer_1.deleteAutoTransferRule.match), (0, operators_1.switchMap)((action) => {
10
+ const { ruleId } = action.payload;
11
+ return zeniAPI
12
+ .deleteAndGetJSON(`${zeniAPI.apiEndPoints.bankingMicroServiceBaseUrl}/1.0/rules/transfer/auto/${ruleId}`)
13
+ .pipe((0, operators_1.mergeMap)((response) => {
14
+ if ((0, responsePayload_1.isSuccessResponse)(response)) {
15
+ const actions = [
16
+ (0, autoTransferRulesReducer_1.deleteAutoTransferRuleSuccess)({ ruleId }),
17
+ (0, snackbarReducer_1.openSnackbar)({
18
+ messageSection: 'auto_transfer_rule_delete',
19
+ messageText: 'success',
20
+ type: 'success',
21
+ }),
22
+ ];
23
+ return (0, rxjs_1.from)(actions);
24
+ }
25
+ else {
26
+ return (0, rxjs_1.from)([
27
+ (0, autoTransferRulesReducer_1.deleteAutoTransferRuleFailure)({
28
+ ruleId,
29
+ fetchState: 'Error',
30
+ error: response.status,
31
+ }),
32
+ (0, snackbarReducer_1.openSnackbar)({
33
+ messageSection: 'auto_transfer_rule_delete',
34
+ messageText: 'failed',
35
+ type: 'error',
36
+ variables: [
37
+ {
38
+ variableName: '_api-error_',
39
+ variableValue: response.status.message,
40
+ },
41
+ ],
42
+ }),
43
+ ]);
44
+ }
45
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, autoTransferRulesReducer_1.deleteAutoTransferRuleFailure)({
46
+ ruleId,
47
+ fetchState: 'Error',
48
+ error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Delete auto transfer rule REST API call errored out ' +
49
+ JSON.stringify(error)),
50
+ }))));
51
+ }));
52
+ exports.deleteAutoTransferRuleEpic = deleteAutoTransferRuleEpic;
@@ -0,0 +1,7 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { RootState } from '../../../../reducer';
4
+ import { ZeniAPI } from '../../../../zeniAPI';
5
+ import { fetchAutoTransferReviewDetail, updateAutoTransferReviewDetail, updateAutoTransferReviewDetailFailure } from '../autoTransferRulesReducer';
6
+ export type ActionType = ReturnType<typeof fetchAutoTransferReviewDetail> | ReturnType<typeof updateAutoTransferReviewDetail> | ReturnType<typeof updateAutoTransferReviewDetailFailure>;
7
+ export declare const fetchAutoTransferReviewDetailEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchAutoTransferReviewDetailEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const responsePayload_1 = require("../../../../responsePayload");
7
+ const autoTransferRulesReducer_1 = require("../autoTransferRulesReducer");
8
+ const createAutoTransferRuleEpic_1 = require("./createAutoTransferRuleEpic");
9
+ const fetchAutoTransferReviewDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(autoTransferRulesReducer_1.fetchAutoTransferReviewDetail.match), (0, operators_1.switchMap)(() => {
10
+ const localData = state$.value.autotransferRulesState.ruleUpdateLocalData;
11
+ const payload = {
12
+ from_account: {
13
+ account_id: localData.sourceAccount?.id,
14
+ account_type: (0, createAutoTransferRuleEpic_1.accountTypeSubConfigCodeToAccType)(localData.sourceAccount?.accType) ?? '',
15
+ },
16
+ to_account: {
17
+ account_id: localData.destinationAccount?.id,
18
+ account_type: (0, createAutoTransferRuleEpic_1.accountTypeSubConfigCodeToAccType)(localData.destinationAccount?.accType) ?? '',
19
+ },
20
+ amount: localData.amount?.amount ?? 0,
21
+ currency_code: localData.amount?.currencyCode ?? 'USD',
22
+ currency_symbol: localData.amount?.currencySymbol ?? '$',
23
+ };
24
+ return zeniAPI
25
+ .postAndGetJSON(`${zeniAPI.apiEndPoints.bankingMicroServiceBaseUrl}/1.0/rules/transfer/auto/review`, payload)
26
+ .pipe((0, operators_1.mergeMap)((response) => {
27
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
28
+ return (0, rxjs_1.of)((0, autoTransferRulesReducer_1.updateAutoTransferReviewDetail)(response.data));
29
+ }
30
+ return (0, rxjs_1.of)((0, autoTransferRulesReducer_1.updateAutoTransferReviewDetailFailure)(response.status));
31
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, autoTransferRulesReducer_1.updateAutoTransferReviewDetailFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch auto transfer review detail REST API call errored out ' +
32
+ JSON.stringify(error))))));
33
+ }));
34
+ exports.fetchAutoTransferReviewDetailEpic = fetchAutoTransferReviewDetailEpic;
@@ -0,0 +1,7 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { RootState } from '../../../../reducer';
4
+ import { ZeniAPI } from '../../../../zeniAPI';
5
+ import { fetchAutoTransferRuleHistory, updateAutoTransferRuleHistory, updateAutoTransferRuleHistoryFetchStatus } from '../autoTransferRulesReducer';
6
+ export type ActionType = ReturnType<typeof fetchAutoTransferRuleHistory> | ReturnType<typeof updateAutoTransferRuleHistory> | ReturnType<typeof updateAutoTransferRuleHistoryFetchStatus>;
7
+ export declare const fetchAutoTransferRuleHistoryEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fetchAutoTransferRuleHistoryEpic = void 0;
7
+ const get_1 = __importDefault(require("lodash/get"));
8
+ const rxjs_1 = require("rxjs");
9
+ const operators_1 = require("rxjs/operators");
10
+ const responsePayload_1 = require("../../../../responsePayload");
11
+ const autoTransferRulesReducer_1 = require("../autoTransferRulesReducer");
12
+ const fetchAutoTransferRuleHistoryEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(autoTransferRulesReducer_1.fetchAutoTransferRuleHistory.match), (0, operators_1.mergeMap)((action) => {
13
+ const { ruleId, cacheOverride } = action.payload;
14
+ const historyActions = [];
15
+ const state = state$.value;
16
+ const historyDetail = (0, get_1.default)(state.autotransferRulesState.historyByRuleId, ruleId, undefined);
17
+ if (cacheOverride === true ||
18
+ historyDetail == null ||
19
+ historyDetail.fetchState !== 'In-Progress') {
20
+ historyActions.push((0, autoTransferRulesReducer_1.updateAutoTransferRuleHistoryFetchStatus)({
21
+ ruleId,
22
+ fetchState: 'In-Progress',
23
+ }));
24
+ const getHistoryDetail$ = zeniAPI
25
+ .getJSON(`${zeniAPI.apiEndPoints.bankingMicroServiceBaseUrl}/1.0/rules/transfer/auto/${ruleId}/history`)
26
+ .pipe((0, operators_1.mergeMap)((response) => {
27
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
28
+ return (0, rxjs_1.of)((0, autoTransferRulesReducer_1.updateAutoTransferRuleHistory)({
29
+ ruleId,
30
+ historicEventsPayload: response.data.activities,
31
+ }));
32
+ }
33
+ else {
34
+ return (0, rxjs_1.of)((0, autoTransferRulesReducer_1.updateAutoTransferRuleHistoryFetchStatus)({
35
+ ruleId,
36
+ fetchState: 'Error',
37
+ error: response.status,
38
+ }));
39
+ }
40
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, autoTransferRulesReducer_1.updateAutoTransferRuleHistoryFetchStatus)({
41
+ ruleId,
42
+ fetchState: 'Error',
43
+ error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch auto transfer rule history REST API call errored out ' +
44
+ JSON.stringify(error)),
45
+ }))));
46
+ return (0, rxjs_1.concat)((0, rxjs_1.from)(historyActions), getHistoryDetail$);
47
+ }
48
+ else {
49
+ return (0, rxjs_1.from)(historyActions);
50
+ }
51
+ }));
52
+ exports.fetchAutoTransferRuleHistoryEpic = fetchAutoTransferRuleHistoryEpic;
@@ -0,0 +1,10 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { RootState } from '../../../../reducer';
4
+ import { ZeniAPI } from '../../../../zeniAPI';
5
+ import { fetchTreasuryOverviewDetail } from '../../treasury/treasuryList/treasuryDetailReducer';
6
+ import { fetchDepositAccountList } from '../../zeniAccounts/depositAccountList/depositAccountListReducer';
7
+ import { fetchPaymentAccountList } from '../../zeniAccounts/paymentAccountList/paymentAccountListReducer';
8
+ import { fetchAutoTransferRules, updateAutoTransferRules, updateAutoTransferRulesFailure } from '../autoTransferRulesReducer';
9
+ export type ActionType = ReturnType<typeof fetchAutoTransferRules> | ReturnType<typeof updateAutoTransferRules> | ReturnType<typeof updateAutoTransferRulesFailure> | ReturnType<typeof fetchDepositAccountList> | ReturnType<typeof fetchPaymentAccountList> | ReturnType<typeof fetchTreasuryOverviewDetail>;
10
+ export declare const fetchAutoTransferRulesEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchAutoTransferRulesEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const responsePayload_1 = require("../../../../responsePayload");
7
+ const treasuryDetailReducer_1 = require("../../treasury/treasuryList/treasuryDetailReducer");
8
+ const depositAccountListReducer_1 = require("../../zeniAccounts/depositAccountList/depositAccountListReducer");
9
+ const paymentAccountListReducer_1 = require("../../zeniAccounts/paymentAccountList/paymentAccountListReducer");
10
+ const autoTransferRulesPayload_1 = require("../autoTransferRulesPayload");
11
+ const autoTransferRulesReducer_1 = require("../autoTransferRulesReducer");
12
+ const fetchAutoTransferRulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(autoTransferRulesReducer_1.fetchAutoTransferRules.match), (0, operators_1.switchMap)((action) => {
13
+ const state = state$.value;
14
+ const { cacheOverride } = action.payload;
15
+ const { autotransferRulesState, depositAccountListState, paymentAccountListState, } = state;
16
+ if (cacheOverride === true ||
17
+ (autotransferRulesState.hasValidState() === false &&
18
+ autotransferRulesState.fetchState !== 'In-Progress')) {
19
+ return zeniAPI
20
+ .getJSON(`${zeniAPI.apiEndPoints.bankingMicroServiceBaseUrl}/1.0/rules/transfer/auto/list`)
21
+ .pipe((0, operators_1.mergeMap)((response) => {
22
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
23
+ const rules = response.data.auto_transfer_rules.map(autoTransferRulesPayload_1.mapPayloadToAutoTransferRule);
24
+ const actions = [
25
+ (0, autoTransferRulesReducer_1.updateAutoTransferRules)({ rules }),
26
+ ];
27
+ if (depositAccountListState.fetchState !== 'In-Progress' &&
28
+ depositAccountListState.fetchState !== 'Completed') {
29
+ actions.push((0, depositAccountListReducer_1.fetchDepositAccountList)());
30
+ }
31
+ if (paymentAccountListState.fetchState !== 'In-Progress' &&
32
+ paymentAccountListState.fetchState !== 'Completed') {
33
+ actions.push((0, paymentAccountListReducer_1.fetchPaymentAccountList)());
34
+ }
35
+ actions.push((0, treasuryDetailReducer_1.fetchTreasuryOverviewDetail)(false, true));
36
+ return (0, rxjs_1.from)(actions);
37
+ }
38
+ else {
39
+ return (0, rxjs_1.of)((0, autoTransferRulesReducer_1.updateAutoTransferRulesFailure)({
40
+ fetchState: 'Error',
41
+ error: response.status,
42
+ }));
43
+ }
44
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, autoTransferRulesReducer_1.updateAutoTransferRulesFailure)({
45
+ fetchState: 'Error',
46
+ error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch auto transfer rules REST API call errored out ' +
47
+ JSON.stringify(error)),
48
+ }))));
49
+ }
50
+ else {
51
+ return (0, rxjs_1.of)((0, autoTransferRulesReducer_1.updateAutoTransferRules)({
52
+ rules: autotransferRulesState.rules,
53
+ }));
54
+ }
55
+ }));
56
+ exports.fetchAutoTransferRulesEpic = fetchAutoTransferRulesEpic;
@@ -0,0 +1,8 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
4
+ import { RootState } from '../../../../reducer';
5
+ import { ZeniAPI } from '../../../../zeniAPI';
6
+ import { updateAutoTransferRule, updateAutoTransferRuleFailure, updateAutoTransferRuleSuccess } from '../autoTransferRulesReducer';
7
+ export type ActionType = ReturnType<typeof updateAutoTransferRule> | ReturnType<typeof updateAutoTransferRuleSuccess> | ReturnType<typeof updateAutoTransferRuleFailure> | ReturnType<typeof openSnackbar>;
8
+ export declare const updateAutoTransferRuleEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateAutoTransferRuleEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
7
+ const responsePayload_1 = require("../../../../responsePayload");
8
+ const autoTransferRulesPayload_1 = require("../autoTransferRulesPayload");
9
+ const autoTransferRulesReducer_1 = require("../autoTransferRulesReducer");
10
+ const createAutoTransferRuleEpic_1 = require("./createAutoTransferRuleEpic");
11
+ const updateAutoTransferRuleEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(autoTransferRulesReducer_1.updateAutoTransferRule.match), (0, operators_1.switchMap)((action) => {
12
+ const { ruleId, pauseRule, resumeRule } = action.payload;
13
+ const requestBody = (0, createAutoTransferRuleEpic_1.mapAutoTransferRuleLocalDataToPayload)(state$.value.autotransferRulesState.ruleUpdateLocalData, pauseRule, resumeRule);
14
+ return zeniAPI
15
+ .putAndGetJSON(`${zeniAPI.apiEndPoints.bankingMicroServiceBaseUrl}/1.0/rules/transfer/auto/${ruleId}`, requestBody)
16
+ .pipe((0, operators_1.mergeMap)((response) => {
17
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
18
+ const rule = (0, autoTransferRulesPayload_1.mapPayloadToAutoTransferRule)(response.data.auto_transfer_rule);
19
+ const isPauseOrResumeOnly = Object.keys(requestBody).length === 1 &&
20
+ 'is_active' in requestBody;
21
+ const messageSection = isPauseOrResumeOnly
22
+ ? requestBody.is_active === false
23
+ ? 'auto_transfer_rule_pause'
24
+ : 'auto_transfer_rule_resume'
25
+ : 'auto_transfer_rule_update';
26
+ const actions = [
27
+ (0, autoTransferRulesReducer_1.updateAutoTransferRuleSuccess)({ rule }),
28
+ (0, snackbarReducer_1.openSnackbar)({
29
+ messageSection,
30
+ messageText: 'success',
31
+ type: 'success',
32
+ variables: [
33
+ {
34
+ variableName: '__ruleName__',
35
+ variableValue: rule.ruleType === 'minimum_balance'
36
+ ? 'Maintain a Minimum Balance'
37
+ : rule.ruleType === 'recurring'
38
+ ? 'Make a Recurring Transfer'
39
+ : 'Distribute Balance by Percentage',
40
+ },
41
+ ],
42
+ }),
43
+ ];
44
+ return (0, rxjs_1.from)(actions);
45
+ }
46
+ else {
47
+ return (0, rxjs_1.from)([
48
+ (0, autoTransferRulesReducer_1.updateAutoTransferRuleFailure)({
49
+ ruleId,
50
+ fetchState: 'Error',
51
+ error: response.status,
52
+ }),
53
+ (0, snackbarReducer_1.openSnackbar)({
54
+ messageSection: 'auto_transfer_rule_update',
55
+ messageText: 'failed',
56
+ type: 'error',
57
+ variables: [
58
+ {
59
+ variableName: '_api-error_',
60
+ variableValue: response.status.message,
61
+ },
62
+ ],
63
+ }),
64
+ ]);
65
+ }
66
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, autoTransferRulesReducer_1.updateAutoTransferRuleFailure)({
67
+ ruleId,
68
+ fetchState: 'Error',
69
+ error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Update auto transfer rule REST API call errored out ' +
70
+ JSON.stringify(error)),
71
+ }))));
72
+ }));
73
+ exports.updateAutoTransferRuleEpic = updateAutoTransferRuleEpic;
@@ -424,14 +424,6 @@ const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions) => {
424
424
  transactionsWithNoSortKeyValue.push(transaction);
425
425
  }
426
426
  break;
427
- case 'invoiceNumber':
428
- if (transaction.documentId != null) {
429
- transactionsWithSortKeyValue.push(transaction);
430
- }
431
- else {
432
- transactionsWithNoSortKeyValue.push(transaction);
433
- }
434
- break;
435
427
  case 'dueDate':
436
428
  if (currentTab === 'draft') {
437
429
  if (Boolean(transaction.dueDate) === true) {
@@ -534,8 +526,6 @@ const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions) => {
534
526
  return transaction.totalAmountInUSD?.amount ?? 0;
535
527
  case 'paymentMethod':
536
528
  return transaction.billPayInfo.billPaymentMethodType.name;
537
- case 'invoiceNumber':
538
- return transaction.documentId;
539
529
  }
540
530
  }, getColumnWiseSortOrder(sortOrder));
541
531
  return [
@@ -37,7 +37,7 @@ declare const toBillTabType: (v: string) => "paid" | "pending_approval" | "sched
37
37
  export type BillTab = ReturnType<typeof toBillTabType>;
38
38
  declare const toBillsSubTabType: (v: string) => "rejected" | "failed" | "ach" | "wire" | "cancelled" | "deleted" | "overdue" | "all" | "awaiting_approval" | "awaiting_my_approval" | "offline";
39
39
  export type BillsSubTabType = ReturnType<typeof toBillsSubTabType>;
40
- declare const toBillPaySortKeyType: (v: string) => "amount" | "status" | "name" | "dueDate" | "paymentMethod" | "invoiceNumber" | "invoiceDate";
40
+ declare const toBillPaySortKeyType: (v: string) => "amount" | "status" | "name" | "dueDate" | "paymentMethod" | "invoiceDate";
41
41
  export declare type BillPayViewSortKey = ReturnType<typeof toBillPaySortKeyType>;
42
42
  export interface BillPayFilters {
43
43
  categories: BillPayFilterCategory[];
@@ -47,7 +47,6 @@ const ALL_BILL_PAY_SORT_KEYS = [
47
47
  'invoiceDate',
48
48
  'name',
49
49
  'paymentMethod',
50
- 'invoiceNumber',
51
50
  ];
52
51
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
53
52
  const toBillPaySortKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_BILL_PAY_SORT_KEYS);
@@ -61,7 +61,7 @@ export declare const initialCreditAcc: CreditAccount;
61
61
  export declare const initialDebitCardSummaries: DebitCardSummaries;
62
62
  export declare const initialResendRevokeCardInvite: ResendRevokeCardInvite;
63
63
  export declare const initialCreditAccountRepayment: CreditAccountRepayment;
64
- export declare const toChargeCardSortKeyType: (v: string) => "status" | "accountType" | "owner" | "cardName" | "limit" | "department" | "cardType" | "utilisation";
64
+ export declare const toChargeCardSortKeyType: (v: string) => "status" | "owner" | "cardName" | "limit" | "department" | "cardType" | "utilisation";
65
65
  export declare type ChargeCardViewSortKey = ReturnType<typeof toChargeCardSortKeyType>;
66
66
  export declare const ALL_CASHBACK_SORT_KEYS: readonly ["month", "cashback"];
67
67
  export declare const toCashbackSortKeyType: (v: string) => "month" | "cashback";
@@ -78,7 +78,6 @@ const ALL_CHARGE_CARD_SORT_KEYS = [
78
78
  'cardName',
79
79
  'department',
80
80
  'cardType',
81
- 'accountType',
82
81
  'status',
83
82
  'utilisation',
84
83
  'limit',
@@ -233,8 +233,6 @@ const getCardsBySortKey = (card, sortKey) => {
233
233
  return card.cardName.toLowerCase();
234
234
  case 'cardType':
235
235
  return card.type.code;
236
- case 'accountType':
237
- return card.type.code.includes('credit') ? 'credit' : 'debit';
238
236
  case 'status':
239
237
  return card.status.code;
240
238
  case 'utilisation':
@@ -42,7 +42,6 @@ export interface ReimbursementView extends Reimbursement {
42
42
  approvers: Approvers;
43
43
  submittedBy: User | undefined;
44
44
  bulkSelectInfo?: RemiBulkSelectInfo;
45
- createdByUser?: User;
46
45
  }
47
46
  export declare const getRemiList: (state: RootState, currentTimePeriod: TimePeriod, isBulkActionFeatureEnabled: boolean) => RemiListReport;
48
47
  export declare const getApproversOrRejectors: (reimbursement: Reimbursement, entityApprovalStatusState: EntityApprovalStatusState, userState: UserState) => Approvers;
@@ -51,7 +51,6 @@ const getRemiList = (state, currentTimePeriod, isBulkActionFeatureEnabled) => {
51
51
  return {
52
52
  ...reimbursement,
53
53
  submittedBy: (0, userSelector_1.getUserByUserId)(userState, reimbursement.reimburseeUserId),
54
- createdByUser: (0, userSelector_1.getUserByUserId)(userState, reimbursement.createdBy),
55
54
  approvers: approvers,
56
55
  };
57
56
  });
@@ -424,14 +423,6 @@ const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements) => {
424
423
  reimbursementsWithNoSortKeyValue.push(reimbursement);
425
424
  }
426
425
  break;
427
- case 'createdBy':
428
- if (reimbursement.createdByUser != null) {
429
- reimbursementsWithSortKeyValue.push(reimbursement);
430
- }
431
- else {
432
- reimbursementsWithNoSortKeyValue.push(reimbursement);
433
- }
434
- break;
435
426
  }
436
427
  });
437
428
  const getColumnWiseSortOrder = (sortOrder) => {
@@ -439,7 +430,6 @@ const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements) => {
439
430
  case 'reportName':
440
431
  case 'type':
441
432
  case 'status':
442
- case 'createdBy':
443
433
  return sortOrder === 'ascending' ? 'asc' : 'desc';
444
434
  default:
445
435
  return sortOrder === 'ascending' ? 'desc' : 'asc';
@@ -459,8 +449,6 @@ const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements) => {
459
449
  return getStatusPerTab(reimbursement);
460
450
  case 'amount':
461
451
  return reimbursement.amount.amount ?? 0;
462
- case 'createdBy':
463
- return `${reimbursement.createdByUser?.firstName ?? ''} ${reimbursement.createdByUser?.lastName ?? ''}`.toLowerCase();
464
452
  }
465
453
  }, getColumnWiseSortOrder(sortOrder));
466
454
  return [
@@ -38,7 +38,7 @@ export declare const toRemiSubTabTypeStrict: (v: string) => "rejected" | "failed
38
38
  export type RemiSubTabType = ReturnType<typeof toRemiSubTabType>;
39
39
  export declare const toRemiSubTabUnderScoreType: (v: string) => "rejected" | "failed" | "ach" | "wire" | "cancelled" | "deleted" | "overdue" | "all" | "awaiting_approval" | "awaiting_my_approval" | "my_drafts" | "awaiting_all_approval";
40
40
  export type RemiSubTabUnderScoreType = ReturnType<typeof toRemiSubTabUnderScoreType>;
41
- declare const toReimbursementSortKeyType: (v: string) => "amount" | "status" | "type" | "createdBy" | "submittedOn" | "reportName";
41
+ declare const toReimbursementSortKeyType: (v: string) => "amount" | "status" | "type" | "submittedOn" | "reportName";
42
42
  export type ReimbursementViewSortKey = ReturnType<typeof toReimbursementSortKeyType>;
43
43
  export interface ReimbursementFilters {
44
44
  categories: ReimbursementFilterCategory[];
@@ -64,7 +64,6 @@ exports.toRemiSubTabUnderScoreType = toRemiSubTabUnderScoreType;
64
64
  const ALL_REIMBURSEMENT_SORT_KEYS = [
65
65
  'reportName',
66
66
  'submittedOn',
67
- 'createdBy',
68
67
  'type',
69
68
  'status',
70
69
  'amount',
@@ -9,7 +9,7 @@ const treasuryStatementListReducer_1 = require("../../treasuryStatementList/trea
9
9
  const treasuryTaxLetterListReducer_1 = require("../../treasuryTaxLetterList/treasuryTaxLetterListReducer");
10
10
  const treasuryDetailReducer_1 = require("../treasuryDetailReducer");
11
11
  const fetchTreasuryDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(treasuryDetailReducer_1.fetchTreasuryOverviewDetail.match), (0, operators_1.switchMap)((action) => {
12
- const { cacheOverride } = action.payload;
12
+ const { cacheOverride, fetchOnlySummary } = action.payload;
13
13
  const state = state$.value;
14
14
  const treasuryActions = [];
15
15
  if (cacheOverride === true) {
@@ -20,7 +20,7 @@ const fetchTreasuryDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
20
20
  treasuryActions.push((0, treasuryDetailReducer_1.fetchTreasuryHistory)());
21
21
  treasuryActions.push((0, treasuryDetailReducer_1.fetchTreasuryTransactionList)(true));
22
22
  }
23
- else {
23
+ else if (fetchOnlySummary !== true) {
24
24
  // Check treasury statement list state
25
25
  const treasuryStatementListState = state.treasuryStatementListState;
26
26
  if (treasuryStatementListState.hasValidState() === false &&
@@ -4,8 +4,9 @@ import { TreasuryTransferMoneyResponsePayload } from '../treasuryTransferMoney/t
4
4
  import { FetchTreasuryAccountHistoryResponse, FetchTreasuryDetailResponse, TreasuryTransactionPayload } from './treasuryDetailPayload';
5
5
  import { TreasuryDetailState, TreasuryListUIState } from './treasuryDetailState';
6
6
  export declare const initialState: TreasuryDetailState;
7
- export declare const fetchTreasuryOverviewDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride: boolean], {
7
+ export declare const fetchTreasuryOverviewDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride: boolean, fetchOnlySummary?: boolean | undefined], {
8
8
  cacheOverride: boolean;
9
+ fetchOnlySummary: boolean | undefined;
9
10
  }, "treasuryDetail/fetchTreasuryOverviewDetail", never, never>, fetchTreasuryHistory: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasuryDetail/fetchTreasuryHistory">, fetchTreasuryHistorySuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
10
11
  data: FetchTreasuryAccountHistoryResponse;
11
12
  }, "treasuryDetail/fetchTreasuryHistorySuccess">, fetchTreasuryHistoryFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
@@ -34,10 +34,11 @@ const treasuryDetail = (0, toolkit_1.createSlice)({
34
34
  reducer(draft) {
35
35
  draft.fetchState = 'In-Progress';
36
36
  },
37
- prepare(cacheOverride) {
37
+ prepare(cacheOverride, fetchOnlySummary) {
38
38
  return {
39
39
  payload: {
40
40
  cacheOverride,
41
+ fetchOnlySummary,
41
42
  },
42
43
  };
43
44
  },
@@ -98,11 +98,11 @@ exports.allTaskStatus = [
98
98
  },
99
99
  {
100
100
  code: 'done',
101
- name: 'In Review',
101
+ name: 'Done',
102
102
  },
103
103
  {
104
104
  code: 'resolved',
105
- name: 'Complete',
105
+ name: 'Resolved',
106
106
  },
107
107
  ];
108
108
  exports.allTaskPriority = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.19.86-beta0AD",
3
+ "version": "4.19.86-betaNB2",
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,26 +0,0 @@
1
- import { of } from 'rxjs';
2
- import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
- import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
4
- import { fetchSuggestedQuestions, fetchSuggestedQuestionsFailure, fetchSuggestedQuestionsSuccess, } from '../aiCfoViewReducer';
5
- /** GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=... */
6
- export const fetchSuggestedQuestionsEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchSuggestedQuestions.match), switchMap((action) => {
7
- const { pageContext } = action.payload;
8
- const query = new URLSearchParams({ page_context: pageContext });
9
- const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?${query.toString()}`;
10
- return zeniAPI.getJSON(url).pipe(mergeMap((response) => {
11
- if (isSuccessResponse(response) && response.data != null) {
12
- return of(fetchSuggestedQuestionsSuccess({
13
- pageContext: response.data.page_context,
14
- generatedAt: response.data.generated_at,
15
- suggestedQuestions: response.data.suggested_questions,
16
- }));
17
- }
18
- return of(fetchSuggestedQuestionsFailure({
19
- pageContext,
20
- error: response.status,
21
- }));
22
- }), catchError((error) => of(fetchSuggestedQuestionsFailure({
23
- pageContext,
24
- error: createZeniAPIStatus('Unexpected Error', 'Fetch suggested questions REST API call failed', error instanceof Error ? { message: error.message } : undefined),
25
- }))));
26
- }));