@zeniai/client-epic-state 5.2.22-betaAK1 → 5.2.22-betaAM2

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 (120) hide show
  1. package/lib/entity/invoicing/creditNote/creditNotePayload.d.ts +1 -0
  2. package/lib/entity/invoicing/creditNote/creditNotePayload.js +1 -0
  3. package/lib/entity/invoicing/creditNote/creditNoteState.d.ts +1 -0
  4. package/lib/entity/invoicing/invoice/invoicePayload.d.ts +1 -0
  5. package/lib/entity/invoicing/invoice/invoicePayload.js +1 -0
  6. package/lib/entity/invoicing/invoice/invoiceState.d.ts +1 -0
  7. package/lib/entity/invoicing/invoicingCommonPayload.d.ts +0 -2
  8. package/lib/entity/invoicing/invoicingCustomer/invoicingCustomerPayload.d.ts +1 -0
  9. package/lib/entity/invoicing/invoicingCustomer/invoicingCustomerPayload.js +1 -0
  10. package/lib/entity/invoicing/invoicingCustomer/invoicingCustomerState.d.ts +1 -0
  11. package/lib/entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload.d.ts +2 -1
  12. package/lib/entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload.js +2 -1
  13. package/lib/entity/invoicing/invoicingSubscription/invoicingSubscriptionState.d.ts +2 -1
  14. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +24 -0
  15. package/lib/entity/jeSchedules/jeSchedulesPayload.js +40 -0
  16. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +26 -0
  17. package/lib/epic.d.ts +6 -1
  18. package/lib/epic.js +10 -0
  19. package/lib/esm/entity/invoicing/creditNote/creditNotePayload.js +1 -0
  20. package/lib/esm/entity/invoicing/invoice/invoicePayload.js +1 -0
  21. package/lib/esm/entity/invoicing/invoicingCustomer/invoicingCustomerPayload.js +1 -0
  22. package/lib/esm/entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload.js +2 -1
  23. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +40 -0
  24. package/lib/esm/epic.js +10 -0
  25. package/lib/esm/index.js +6 -2
  26. package/lib/esm/reducer.js +3 -0
  27. package/lib/esm/view/expenseAutomationView/epics/accountRecon/deleteAccountStatementEpic.js +1 -3
  28. package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +46 -0
  29. package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.js +7 -0
  30. package/lib/esm/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +50 -0
  31. package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +44 -0
  32. package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +44 -0
  33. package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +28 -11
  34. package/lib/esm/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +9 -1
  35. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +5 -0
  36. package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +22 -7
  37. package/lib/esm/view/expenseAutomationView/payload/actualMatchingPayload.js +60 -0
  38. package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +260 -0
  39. package/lib/esm/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js +1 -0
  40. package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +196 -0
  41. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +3 -0
  42. package/lib/esm/view/expenseAutomationView/types/actualMatchingViewState.js +22 -0
  43. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +5 -1
  44. package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +0 -2
  45. package/lib/esm/view/invoicing/invoicingOverview/invoicingOverviewPayload.js +1 -0
  46. package/lib/esm/view/invoicing/invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.js +1 -2
  47. package/lib/esm/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.js +0 -1
  48. package/lib/esm/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js +2 -0
  49. package/lib/esm/view/invoicing/settingsView/invoicingBrandingFormConfig.js +0 -5
  50. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +18 -2
  51. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +0 -1
  52. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +0 -3
  53. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +18 -2
  54. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +0 -1
  55. package/lib/index.d.ts +9 -5
  56. package/lib/index.js +73 -47
  57. package/lib/reducer.d.ts +1 -0
  58. package/lib/reducer.js +3 -0
  59. package/lib/rootStateTypes.d.ts +2 -0
  60. package/lib/view/expenseAutomationView/epics/accountRecon/deleteAccountStatementEpic.d.ts +1 -2
  61. package/lib/view/expenseAutomationView/epics/accountRecon/deleteAccountStatementEpic.js +1 -3
  62. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.d.ts +9 -0
  63. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +50 -0
  64. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.d.ts +5 -0
  65. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.js +11 -0
  66. package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.d.ts +8 -0
  67. package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +54 -0
  68. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.d.ts +8 -0
  69. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +48 -0
  70. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.d.ts +8 -0
  71. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +48 -0
  72. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.d.ts +2 -1
  73. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +28 -11
  74. package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.d.ts +2 -1
  75. package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +9 -1
  76. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +2 -1
  77. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +5 -0
  78. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +22 -7
  79. package/lib/view/expenseAutomationView/payload/actualMatchingPayload.d.ts +72 -0
  80. package/lib/view/expenseAutomationView/payload/actualMatchingPayload.js +65 -0
  81. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +53 -0
  82. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +264 -0
  83. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
  84. package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +59 -0
  85. package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js +2 -0
  86. package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +2 -0
  87. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +11 -0
  88. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +208 -0
  89. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +3 -0
  90. package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +81 -0
  91. package/lib/view/expenseAutomationView/types/actualMatchingViewState.js +27 -0
  92. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +1 -1
  93. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +5 -1
  94. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewPayload.d.ts +0 -1
  95. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.d.ts +1 -1
  96. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +0 -2
  97. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewState.d.ts +0 -1
  98. package/lib/view/invoicing/invoicingOverview/invoicingOverviewPayload.d.ts +1 -0
  99. package/lib/view/invoicing/invoicingOverview/invoicingOverviewPayload.js +1 -0
  100. package/lib/view/invoicing/invoicingOverview/invoicingOverviewState.d.ts +1 -0
  101. package/lib/view/invoicing/invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.d.ts +1 -3
  102. package/lib/view/invoicing/invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.js +0 -1
  103. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.d.ts +0 -2
  104. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.js +0 -1
  105. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts +2 -2
  106. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js +2 -0
  107. package/lib/view/invoicing/issueCreditNote/issueCreditNotePayload.d.ts +1 -0
  108. package/lib/view/invoicing/settingsView/invoicingBrandingFormConfig.d.ts +0 -1
  109. package/lib/view/invoicing/settingsView/invoicingBrandingFormConfig.js +0 -5
  110. package/lib/view/invoicing/subscriptionAction/subscriptionActionRequestPayload.d.ts +0 -8
  111. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.d.ts +2 -1
  112. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +18 -2
  113. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +0 -1
  114. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.d.ts +0 -1
  115. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +0 -3
  116. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonState.d.ts +0 -1
  117. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.d.ts +2 -1
  118. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +18 -2
  119. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +0 -1
  120. package/package.json +38 -71
package/lib/reducer.d.ts CHANGED
@@ -65,6 +65,7 @@ declare const reducers: import("redux").Reducer<import("redux").CombinedState<{
65
65
  entityAutoCompleteState: import("./view/autoComplete/entityAutoCompleteState").EntityAutoCompleteState;
66
66
  entityRecommendationState: import("./view/recommendation/recommendationState").EntityRecommendationState;
67
67
  expenseAutomationFluxAnalysisViewState: import("./view/expenseAutomationView/types/fluxAnalysisViewState").FluxAnalysisViewState;
68
+ expenseAutomationActualMatchingViewState: import("./view/expenseAutomationView/types/actualMatchingViewState").ActualMatchingViewState;
68
69
  expenseAutomationJESchedulesViewState: import("./view/expenseAutomationView/types/jeSchedulesViewState").JESchedulesViewState;
69
70
  expenseAutomationMissingReceiptsViewState: import(".").ExpenseAutomationMissingReceiptsViewState;
70
71
  expenseAutomationReconciliationViewState: import("./view/expenseAutomationView/types/reconciliationViewState").ReconciliationViewState;
package/lib/reducer.js CHANGED
@@ -155,6 +155,7 @@ const creditAgentViewReducer_1 = __importStar(require("./view/creditAgentView/cr
155
155
  const dashboardReducer_1 = __importStar(require("./view/dashboard/dashboardReducer"));
156
156
  const dashboardLayoutReducer_1 = __importStar(require("./view/dashboardLayout/dashboardLayoutReducer"));
157
157
  const expenseAutomationViewReducer_1 = __importStar(require("./view/expenseAutomationView/expenseAutomationViewReducer"));
158
+ const actualMatchingViewReducer_1 = __importStar(require("./view/expenseAutomationView/reducers/actualMatchingViewReducer"));
158
159
  const fluxAnalysisViewReducer_1 = __importStar(require("./view/expenseAutomationView/reducers/fluxAnalysisViewReducer"));
159
160
  const jeSchedulesViewReducer_1 = __importStar(require("./view/expenseAutomationView/reducers/jeSchedulesViewReducer"));
160
161
  const missingReceiptsViewReducer_1 = __importStar(require("./view/expenseAutomationView/reducers/missingReceiptsViewReducer"));
@@ -468,6 +469,7 @@ const initialViewsState = {
468
469
  entityAutoCompleteState: entityAutoCompleteReducer_1.initialState,
469
470
  entityRecommendationState: recommendationReducer_1.initialState,
470
471
  expenseAutomationFluxAnalysisViewState: fluxAnalysisViewReducer_1.initialState,
472
+ expenseAutomationActualMatchingViewState: actualMatchingViewReducer_1.initialState,
471
473
  expenseAutomationJESchedulesViewState: jeSchedulesViewReducer_1.initialState,
472
474
  expenseAutomationMissingReceiptsViewState: missingReceiptsViewReducer_1.initialState,
473
475
  expenseAutomationReconciliationViewState: reconciliationViewReducer_1.initialState,
@@ -762,6 +764,7 @@ const viewReducers = {
762
764
  entityAutoCompleteState: entityAutoCompleteReducer_1.default,
763
765
  entityRecommendationState: recommendationReducer_1.default,
764
766
  expenseAutomationFluxAnalysisViewState: fluxAnalysisViewReducer_1.default,
767
+ expenseAutomationActualMatchingViewState: actualMatchingViewReducer_1.default,
765
768
  expenseAutomationJESchedulesViewState: jeSchedulesViewReducer_1.default,
766
769
  expenseAutomationMissingReceiptsViewState: missingReceiptsViewReducer_1.default,
767
770
  expenseAutomationReconciliationViewState: reconciliationViewReducer_1.default,
@@ -114,6 +114,7 @@ import { CreditAgentViewState } from './view/creditAgentView/creditAgentViewStat
114
114
  import { DashboardState } from './view/dashboard/dashboardState';
115
115
  import { DashboardLayoutState } from './view/dashboardLayout/dashboardLayoutState';
116
116
  import { ExpenseAutomationViewState } from './view/expenseAutomationView/expenseAutomationViewState';
117
+ import { ActualMatchingViewState as ExpenseAutomationActualMatchingViewState } from './view/expenseAutomationView/types/actualMatchingViewState';
117
118
  import { FluxAnalysisViewState as ExpenseAutomationFluxAnalysisViewState } from './view/expenseAutomationView/types/fluxAnalysisViewState';
118
119
  import { JESchedulesViewState as ExpenseAutomationJESchedulesViewState } from './view/expenseAutomationView/types/jeSchedulesViewState';
119
120
  import { MissingReceiptsViewState as ExpenseAutomationMissingReceiptsViewState } from './view/expenseAutomationView/types/missingReceiptsViewState';
@@ -429,6 +430,7 @@ export type ViewsState = {
429
430
  editRemiDetailViewState: EditRemiDetailViewState;
430
431
  entityAutoCompleteState: EntityAutoCompleteState;
431
432
  entityRecommendationState: EntityRecommendationState;
433
+ expenseAutomationActualMatchingViewState: ExpenseAutomationActualMatchingViewState;
432
434
  expenseAutomationFluxAnalysisViewState: ExpenseAutomationFluxAnalysisViewState;
433
435
  expenseAutomationJESchedulesViewState: ExpenseAutomationJESchedulesViewState;
434
436
  expenseAutomationMissingReceiptsViewState: ExpenseAutomationMissingReceiptsViewState;
@@ -1,9 +1,8 @@
1
1
  import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { Observable } from 'rxjs';
3
3
  import { updateAccountReconDeleteStatement } from '../../../../entity/accountRecon/accountReconReducer';
4
- import { removeFiles } from '../../../../entity/file/fileReducer';
5
4
  import { RootState } from '../../../../rootStateTypes';
6
5
  import { ZeniAPI } from '../../../../zeniAPI';
7
6
  import { deleteAccountStatement, deleteAccountStatementFailure, deleteAccountStatementSuccess } from '../../reducers/reconciliationViewReducer';
8
- export type ActionType = ReturnType<typeof deleteAccountStatement> | ReturnType<typeof removeFiles> | ReturnType<typeof updateAccountReconDeleteStatement> | ReturnType<typeof deleteAccountStatementFailure> | ReturnType<typeof deleteAccountStatementSuccess>;
7
+ export type ActionType = ReturnType<typeof deleteAccountStatement> | ReturnType<typeof updateAccountReconDeleteStatement> | ReturnType<typeof deleteAccountStatementFailure> | ReturnType<typeof deleteAccountStatementSuccess>;
9
8
  export declare const deleteAccountStatementEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -5,17 +5,15 @@ const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
6
  const accountReconReducer_1 = require("../../../../entity/accountRecon/accountReconReducer");
7
7
  const accountReconState_1 = require("../../../../entity/accountRecon/accountReconState");
8
- const fileReducer_1 = require("../../../../entity/file/fileReducer");
9
8
  const responsePayload_1 = require("../../../../responsePayload");
10
9
  const reconciliationViewReducer_1 = require("../../reducers/reconciliationViewReducer");
11
10
  const deleteAccountStatementEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(reconciliationViewReducer_1.deleteAccountStatement.match), (0, operators_1.switchMap)((action) => {
12
- const { accountId, selectedPeriod, statementUploadId, fileId } = action.payload;
11
+ const { accountId, selectedPeriod, statementUploadId } = action.payload;
13
12
  const request = zeniAPI.deleteAndGetJSON(`${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/1.0/reconciliation/statements/${statementUploadId}`);
14
13
  return request.pipe((0, operators_1.mergeMap)((response) => {
15
14
  if ((0, responsePayload_1.isSuccessResponse)(response)) {
16
15
  const actions = [];
17
16
  const accountReconKey = (0, accountReconState_1.toAccountReconKey)(accountId, selectedPeriod);
18
- actions.push((0, fileReducer_1.removeFiles)([fileId]));
19
17
  if (response.data != null) {
20
18
  actions.push((0, accountReconReducer_1.updateAccountReconDeleteStatement)(accountReconKey, response.data));
21
19
  }
@@ -0,0 +1,9 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { updateJEOneTimeAccruals } from '../../../../entity/jeSchedules/jeSchedulesReducer';
4
+ import { clearAll } from '../../../../rootActions';
5
+ import { RootState } from '../../../../rootStateTypes';
6
+ import { ZeniAPI } from '../../../../zeniAPI';
7
+ import { fetchActualMatching, fetchActualMatchingFailure, fetchActualMatchingSuccess } from '../../reducers/actualMatchingViewReducer';
8
+ export type ActionType = ReturnType<typeof clearAll> | ReturnType<typeof fetchActualMatching> | ReturnType<typeof fetchActualMatchingFailure> | ReturnType<typeof fetchActualMatchingSuccess> | ReturnType<typeof updateJEOneTimeAccruals>;
9
+ export declare const fetchActualMatchingEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchActualMatchingEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const jeSchedulesReducer_1 = require("../../../../entity/jeSchedules/jeSchedulesReducer");
7
+ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
+ const responsePayload_1 = require("../../../../responsePayload");
9
+ const rootActions_1 = require("../../../../rootActions");
10
+ const actualMatchingPayload_1 = require("../../payload/actualMatchingPayload");
11
+ const actualMatchingViewReducer_1 = require("../../reducers/actualMatchingViewReducer");
12
+ const fetchActualMatchingEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(actualMatchingViewReducer_1.fetchActualMatching.match), (0, operators_1.mergeMap)((action) => {
13
+ const state = state$.value;
14
+ const { period, refreshViewInBackground } = action.payload;
15
+ const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
16
+ const selectedPeriod = state.expenseAutomationViewState
17
+ .selectedPeriodByTenantId[currentTenant.tenantId] ?? {
18
+ month: period.start.month,
19
+ year: period.start.year,
20
+ };
21
+ const serviceMonth = (0, actualMatchingPayload_1.toServiceMonthFromPeriod)(period);
22
+ return zeniAPI
23
+ .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals?service_month=${encodeURIComponent(serviceMonth)}&view=actual_matching`)
24
+ .pipe((0, operators_1.mergeMap)((response) => {
25
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
26
+ const accruals = response.data.accruals ?? [];
27
+ const updateActions = [];
28
+ if (accruals.length > 0) {
29
+ updateActions.push((0, jeSchedulesReducer_1.updateJEOneTimeAccruals)(accruals));
30
+ }
31
+ updateActions.push((0, actualMatchingViewReducer_1.fetchActualMatchingSuccess)({
32
+ accruals,
33
+ selectedPeriod,
34
+ refreshViewInBackground,
35
+ }));
36
+ return (0, rxjs_1.from)(updateActions);
37
+ }
38
+ return (0, rxjs_1.of)((0, actualMatchingViewReducer_1.fetchActualMatchingFailure)({
39
+ status: response.status,
40
+ selectedPeriod,
41
+ refreshViewInBackground,
42
+ }));
43
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, actualMatchingViewReducer_1.fetchActualMatchingFailure)({
44
+ status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'fetch actual matching REST API call errored out' +
45
+ JSON.stringify(error)),
46
+ selectedPeriod,
47
+ refreshViewInBackground,
48
+ }))), (0, operators_1.takeUntil)(actions$.pipe((0, operators_1.filter)(rootActions_1.clearAll.match))));
49
+ }));
50
+ exports.fetchActualMatchingEpic = fetchActualMatchingEpic;
@@ -0,0 +1,5 @@
1
+ import { ActionsObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { fetchActualMatching, fetchActualMatchingPage } from '../../reducers/actualMatchingViewReducer';
4
+ export type ActionType = ReturnType<typeof fetchActualMatching> | ReturnType<typeof fetchActualMatchingPage>;
5
+ export declare const fetchActualMatchingPageEpic: (actions$: ActionsObservable<ActionType>) => Observable<ActionType>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchActualMatchingPageEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const actualMatchingViewReducer_1 = require("../../reducers/actualMatchingViewReducer");
7
+ const fetchActualMatchingPageEpic = (actions$) => actions$.pipe((0, operators_1.filter)(actualMatchingViewReducer_1.fetchActualMatchingPage.match), (0, operators_1.mergeMap)((action) => {
8
+ const { period, refreshViewInBackground } = action.payload;
9
+ return (0, rxjs_1.of)((0, actualMatchingViewReducer_1.fetchActualMatching)(period, refreshViewInBackground));
10
+ }));
11
+ exports.fetchActualMatchingPageEpic = fetchActualMatchingPageEpic;
@@ -0,0 +1,8 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { clearAll } from '../../../../rootActions';
4
+ import { RootState } from '../../../../rootStateTypes';
5
+ import { ZeniAPI } from '../../../../zeniAPI';
6
+ import { clearMatchNewModal, fetchActualMatching, matchAndReverseAccruals, matchAndReverseAccrualsFailure, matchAndReverseAccrualsSuccess } from '../../reducers/actualMatchingViewReducer';
7
+ export type ActionType = ReturnType<typeof clearAll> | ReturnType<typeof clearMatchNewModal> | ReturnType<typeof fetchActualMatching> | ReturnType<typeof matchAndReverseAccruals> | ReturnType<typeof matchAndReverseAccrualsFailure> | ReturnType<typeof matchAndReverseAccrualsSuccess>;
8
+ export declare const matchAndReverseAccrualsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.matchAndReverseAccrualsEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
+ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
+ const responsePayload_1 = require("../../../../responsePayload");
9
+ const rootActions_1 = require("../../../../rootActions");
10
+ const actualMatchingPayload_1 = require("../../payload/actualMatchingPayload");
11
+ const actualMatchingViewReducer_1 = require("../../reducers/actualMatchingViewReducer");
12
+ function refreshActualMatchingList(state) {
13
+ const selectedMonthYear = state.expenseAutomationViewState.selectedPeriodByTenantId[(0, tenantSelector_1.getCurrentTenant)(state).tenantId];
14
+ if (selectedMonthYear == null) {
15
+ return [];
16
+ }
17
+ const period = (0, timePeriod_1.convertToPeriod)(selectedMonthYear);
18
+ const start = (0, timePeriod_1.toAbsoluteDay)(period.start);
19
+ const end = (0, timePeriod_1.toAbsoluteDay)(period.end);
20
+ if (start == null || end == null) {
21
+ return [];
22
+ }
23
+ return [(0, actualMatchingViewReducer_1.fetchActualMatching)({ start, end }, true)];
24
+ }
25
+ const matchAndReverseAccrualsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(actualMatchingViewReducer_1.matchAndReverseAccruals.match), (0, operators_1.mergeMap)((action) => {
26
+ const { transactionId, transactionIntegrationId, transactionType, lineId, accrualIds, } = action.payload;
27
+ const body = {
28
+ transaction_id: transactionId,
29
+ transaction_integration_id: transactionIntegrationId,
30
+ transaction_type: transactionType,
31
+ line_id: lineId,
32
+ accrual_ids: accrualIds,
33
+ };
34
+ return zeniAPI
35
+ .postAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals/match-and-reverse`, body)
36
+ .pipe((0, operators_1.mergeMap)((response) => {
37
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
38
+ const results = (response.data.results ?? []).map(actualMatchingPayload_1.toMatchAndReverseResult);
39
+ const successActions = [
40
+ (0, actualMatchingViewReducer_1.matchAndReverseAccrualsSuccess)({ results }),
41
+ ];
42
+ const anyReversed = results.some((result) => result.status === 'reversed');
43
+ if (anyReversed) {
44
+ successActions.push(...refreshActualMatchingList(state$.value), (0, actualMatchingViewReducer_1.clearMatchNewModal)());
45
+ }
46
+ return (0, rxjs_1.from)(successActions);
47
+ }
48
+ return (0, rxjs_1.of)((0, actualMatchingViewReducer_1.matchAndReverseAccrualsFailure)({ status: response.status }));
49
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, actualMatchingViewReducer_1.matchAndReverseAccrualsFailure)({
50
+ status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Match and reverse accruals REST API call errored out' +
51
+ JSON.stringify(error)),
52
+ }))), (0, operators_1.takeUntil)(actions$.pipe((0, operators_1.filter)(rootActions_1.clearAll.match))));
53
+ }));
54
+ exports.matchAndReverseAccrualsEpic = matchAndReverseAccrualsEpic;
@@ -0,0 +1,8 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { updateJEOneTimeAccruals } from '../../../../entity/jeSchedules/jeSchedulesReducer';
4
+ import { RootState } from '../../../../rootStateTypes';
5
+ import { ZeniAPI } from '../../../../zeniAPI';
6
+ import { searchMatchAccruals, searchMatchAccrualsFailure, searchMatchAccrualsSuccess } from '../../reducers/actualMatchingViewReducer';
7
+ export type ActionType = ReturnType<typeof searchMatchAccruals> | ReturnType<typeof searchMatchAccrualsFailure> | ReturnType<typeof searchMatchAccrualsSuccess> | ReturnType<typeof updateJEOneTimeAccruals>;
8
+ export declare const searchMatchAccrualsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.searchMatchAccrualsEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const jeSchedulesReducer_1 = require("../../../../entity/jeSchedules/jeSchedulesReducer");
7
+ const responsePayload_1 = require("../../../../responsePayload");
8
+ const actualMatchingViewReducer_1 = require("../../reducers/actualMatchingViewReducer");
9
+ const actualMatchingViewState_1 = require("../../types/actualMatchingViewState");
10
+ const searchMatchAccrualsEpic = (actions$, _state$, zeniAPI) => {
11
+ const searchActions$ = actions$.pipe((0, operators_1.filter)(actualMatchingViewReducer_1.searchMatchAccruals.match));
12
+ const pagination$ = searchActions$.pipe((0, operators_1.filter)((action) => action.payload.pageToken != null));
13
+ const newSearchDebounced$ = searchActions$.pipe((0, operators_1.filter)((action) => action.payload.pageToken == null), (0, operators_1.debounceTime)(actualMatchingViewState_1.MATCH_SEARCH_DEBOUNCE_MS));
14
+ return (0, rxjs_1.merge)(pagination$, newSearchDebounced$).pipe((0, operators_1.switchMap)((action) => {
15
+ const { query, pageToken } = action.payload;
16
+ const offset = pageToken != null && pageToken.length > 0 ? Number(pageToken) : 0;
17
+ const searchText = encodeURIComponent(query);
18
+ const limit = actualMatchingViewState_1.MATCH_ACCRUAL_SEARCH_LIMIT;
19
+ return zeniAPI
20
+ .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals?status=posted&reversal_policy=on_bill_match&search_text=${searchText}&limit=${limit}&offset=${offset}`)
21
+ .pipe((0, operators_1.mergeMap)((response) => {
22
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
23
+ const accruals = response.data.accruals ?? [];
24
+ const append = pageToken != null;
25
+ const nextOffset = offset + accruals.length;
26
+ const total = response.data.total ?? nextOffset;
27
+ const nextPageToken = nextOffset < total ? String(nextOffset) : null;
28
+ const actionsOut = [];
29
+ if (accruals.length > 0) {
30
+ actionsOut.push((0, jeSchedulesReducer_1.updateJEOneTimeAccruals)(accruals));
31
+ }
32
+ actionsOut.push((0, actualMatchingViewReducer_1.searchMatchAccrualsSuccess)({
33
+ append,
34
+ nextPageToken,
35
+ results: accruals,
36
+ }));
37
+ return (0, rxjs_1.from)(actionsOut);
38
+ }
39
+ return (0, rxjs_1.of)((0, actualMatchingViewReducer_1.searchMatchAccrualsFailure)({
40
+ error: response.status,
41
+ }));
42
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, actualMatchingViewReducer_1.searchMatchAccrualsFailure)({
43
+ error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Search match accruals REST API call errored out' +
44
+ JSON.stringify(error)),
45
+ }))));
46
+ }));
47
+ };
48
+ exports.searchMatchAccrualsEpic = searchMatchAccrualsEpic;
@@ -0,0 +1,8 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { clearAll } from '../../../../rootActions';
4
+ import { RootState } from '../../../../rootStateTypes';
5
+ import { ZeniAPI } from '../../../../zeniAPI';
6
+ import { openMatchNewModal, searchMatchAccruals, searchMatchTransactions, searchMatchTransactionsFailure, searchMatchTransactionsSuccess } from '../../reducers/actualMatchingViewReducer';
7
+ export type ActionType = ReturnType<typeof clearAll> | ReturnType<typeof openMatchNewModal> | ReturnType<typeof searchMatchAccruals> | ReturnType<typeof searchMatchTransactions> | ReturnType<typeof searchMatchTransactionsFailure> | ReturnType<typeof searchMatchTransactionsSuccess>;
8
+ export declare const searchMatchTransactionsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.searchMatchTransactionsEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const responsePayload_1 = require("../../../../responsePayload");
7
+ const actualMatchingPayload_1 = require("../../payload/actualMatchingPayload");
8
+ const actualMatchingViewReducer_1 = require("../../reducers/actualMatchingViewReducer");
9
+ const actualMatchingViewState_1 = require("../../types/actualMatchingViewState");
10
+ const searchMatchTransactionsEpic = (actions$, _state$, zeniAPI) => {
11
+ const openModal$ = actions$.pipe((0, operators_1.filter)(actualMatchingViewReducer_1.openMatchNewModal.match), (0, operators_1.mergeMap)(() => (0, rxjs_1.from)([
12
+ (0, actualMatchingViewReducer_1.searchMatchTransactions)({ query: '' }),
13
+ (0, actualMatchingViewReducer_1.searchMatchAccruals)({ query: '' }),
14
+ ])));
15
+ const searchActions$ = actions$.pipe((0, operators_1.filter)(actualMatchingViewReducer_1.searchMatchTransactions.match));
16
+ const pagination$ = searchActions$.pipe((0, operators_1.filter)((action) => action.payload.pageToken != null));
17
+ const newSearchDebounced$ = searchActions$.pipe((0, operators_1.filter)((action) => action.payload.pageToken == null), (0, operators_1.debounceTime)(actualMatchingViewState_1.MATCH_SEARCH_DEBOUNCE_MS));
18
+ const search$ = (0, rxjs_1.merge)(pagination$, newSearchDebounced$).pipe((0, operators_1.switchMap)((action) => {
19
+ const { query, pageToken } = action.payload;
20
+ const queryParam = {
21
+ search_text: query,
22
+ page_size: actualMatchingViewState_1.MATCH_TRANSACTION_SEARCH_PAGE_SIZE,
23
+ ...(pageToken != null ? { page_token: pageToken } : {}),
24
+ };
25
+ return zeniAPI
26
+ .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals/match-transaction-search?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
27
+ .pipe((0, operators_1.mergeMap)((response) => {
28
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
29
+ const { transactions, next_page_token } = response.data;
30
+ const append = pageToken != null;
31
+ const results = (transactions ?? []).map(actualMatchingPayload_1.toActualMatchingTransactionSearchResult);
32
+ return (0, rxjs_1.of)((0, actualMatchingViewReducer_1.searchMatchTransactionsSuccess)({
33
+ append,
34
+ nextPageToken: next_page_token ?? null,
35
+ results,
36
+ }));
37
+ }
38
+ return (0, rxjs_1.of)((0, actualMatchingViewReducer_1.searchMatchTransactionsFailure)({
39
+ error: response.status,
40
+ }));
41
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, actualMatchingViewReducer_1.searchMatchTransactionsFailure)({
42
+ error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Search match transactions REST API call errored out' +
43
+ JSON.stringify(error)),
44
+ }))));
45
+ }));
46
+ return (0, rxjs_1.merge)(openModal$, search$);
47
+ };
48
+ exports.searchMatchTransactionsEpic = searchMatchTransactionsEpic;
@@ -3,10 +3,11 @@ import { Observable } from 'rxjs';
3
3
  import { RootState } from '../../../../rootStateTypes';
4
4
  import { fetchMonthEndCloseChecks } from '../../../monthEndCloseChecksView/monthEndCloseChecksViewReducer';
5
5
  import { fetchAllExpenseAutomationTabs } from '../../expenseAutomationViewReducer';
6
+ import { fetchActualMatchingPage } from '../../reducers/actualMatchingViewReducer';
6
7
  import { fetchFluxAnalysisView } from '../../reducers/fluxAnalysisViewReducer';
7
8
  import { fetchJeSchedulesPage } from '../../reducers/jeSchedulesViewReducer';
8
9
  import { fetchMissingReceipts } from '../../reducers/missingReceiptsViewReducer';
9
10
  import { fetchReconciliation } from '../../reducers/reconciliationViewReducer';
10
11
  import { fetchTransactionCategorizationView } from '../../reducers/transactionsViewReducer';
11
- export type ActionType = ReturnType<typeof fetchAllExpenseAutomationTabs> | ReturnType<typeof fetchMissingReceipts> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof fetchFluxAnalysisView> | ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof fetchReconciliation> | ReturnType<typeof fetchTransactionCategorizationView>;
12
+ export type ActionType = ReturnType<typeof fetchAllExpenseAutomationTabs> | ReturnType<typeof fetchActualMatchingPage> | ReturnType<typeof fetchMissingReceipts> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof fetchFluxAnalysisView> | ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof fetchReconciliation> | ReturnType<typeof fetchTransactionCategorizationView>;
12
13
  export declare const fetchAllExpenseAutomationTabsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
@@ -6,6 +6,7 @@ const operators_1 = require("rxjs/operators");
6
6
  const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
7
  const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
8
  const expenseAutomationViewReducer_1 = require("../../expenseAutomationViewReducer");
9
+ const actualMatchingViewReducer_1 = require("../../reducers/actualMatchingViewReducer");
9
10
  const fluxAnalysisViewReducer_1 = require("../../reducers/fluxAnalysisViewReducer");
10
11
  const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
11
12
  const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
@@ -34,11 +35,14 @@ const fetchAllExpenseAutomationTabsEpic = (actions$, state$) => actions$.pipe((0
34
35
  }
35
36
  if (cacheOverride === true) {
36
37
  const actions = [];
38
+ const selectedPageTab = state.expenseAutomationJESchedulesViewState.uiState.selectedPageTab;
37
39
  actions.push((0, transactionsViewReducer_1.fetchTransactionCategorizationView)(selectedTransactionCategorizationTab, { start: timePeriodStart, end: timePeriodEnd }, cacheOverride, false, undefined, undefined, refreshViewInBackground, false), (0, missingReceiptsViewReducer_1.fetchMissingReceipts)({ start: timePeriodStart, end: timePeriodEnd }, {
38
40
  amount: 75.0,
39
41
  currencyCode: 'USD',
40
42
  currencySymbol: '$',
41
- }, cacheOverride, refreshViewInBackground), (0, fluxAnalysisViewReducer_1.fetchFluxAnalysisView)(selectedPeriod, cacheOverride, refreshViewInBackground, null), (0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride));
43
+ }, cacheOverride, refreshViewInBackground), (0, fluxAnalysisViewReducer_1.fetchFluxAnalysisView)(selectedPeriod, cacheOverride, refreshViewInBackground, null), selectedPageTab === 'actual_matching'
44
+ ? (0, actualMatchingViewReducer_1.fetchActualMatchingPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride)
45
+ : (0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride));
42
46
  if (reconciliationEnabled) {
43
47
  actions.push((0, reconciliationViewReducer_1.fetchReconciliation)(selectedPeriod, undefined, cacheOverride, refreshViewInBackground));
44
48
  }
@@ -64,16 +68,29 @@ const fetchAllExpenseAutomationTabsEpic = (actions$, state$) => actions$.pipe((0
64
68
  fetchActions.push((0, fluxAnalysisViewReducer_1.fetchFluxAnalysisView)(selectedPeriod, cacheOverride, refreshViewInBackground, null));
65
69
  }
66
70
  // The two JE tabs cache separately, so only the tab actually being shown decides whether a
67
- // fetch is still needed.
68
- const jeSchedulesPeriodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(state.expenseAutomationJESchedulesViewState.uiState.selectedPageTab, monthYearPeriodId);
69
- if (state.expenseAutomationJESchedulesViewState.fetchState !==
70
- 'In-Progress' &&
71
- (!state.expenseAutomationJESchedulesViewState.hasValidState() ||
72
- state.expenseAutomationJESchedulesViewState
73
- .jeScheduleTransactionKeysByPeriodAndTab[jeSchedulesPeriodTabKey] == null ||
74
- state.expenseAutomationJESchedulesViewState
75
- .failedJeScheduleTransactionKeysByPeriodAndTab[jeSchedulesPeriodTabKey] == null)) {
76
- fetchActions.push((0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride));
71
+ // fetch is still needed. Actual Matching is a third tab on the same page with its own
72
+ // endpoint and cache slot.
73
+ const selectedPageTab = state.expenseAutomationJESchedulesViewState.uiState.selectedPageTab;
74
+ if (selectedPageTab === 'actual_matching') {
75
+ const actualMatchingPeriodKeys = state.expenseAutomationActualMatchingViewState.accrualKeysByPeriod[monthYearPeriodId];
76
+ if (state.expenseAutomationActualMatchingViewState.fetchState !==
77
+ 'In-Progress' &&
78
+ (!state.expenseAutomationActualMatchingViewState.hasValidState() ||
79
+ actualMatchingPeriodKeys == null)) {
80
+ fetchActions.push((0, actualMatchingViewReducer_1.fetchActualMatchingPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride));
81
+ }
82
+ }
83
+ else {
84
+ const jeSchedulesPeriodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, monthYearPeriodId);
85
+ if (state.expenseAutomationJESchedulesViewState.fetchState !==
86
+ 'In-Progress' &&
87
+ (!state.expenseAutomationJESchedulesViewState.hasValidState() ||
88
+ state.expenseAutomationJESchedulesViewState
89
+ .jeScheduleTransactionKeysByPeriodAndTab[jeSchedulesPeriodTabKey] == null ||
90
+ state.expenseAutomationJESchedulesViewState
91
+ .failedJeScheduleTransactionKeysByPeriodAndTab[jeSchedulesPeriodTabKey] == null)) {
92
+ fetchActions.push((0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride));
93
+ }
77
94
  }
78
95
  if (state.expenseAutomationReconciliationViewState.fetchState !==
79
96
  'In-Progress' &&
@@ -4,10 +4,11 @@ import { RootState } from '../../../../rootStateTypes';
4
4
  import { fetchCompanyMonthEndReportTemplates, fetchCompanyMonthEndReportView } from '../../../companyMonthEndReportView/companyMonthEndReportViewReducer';
5
5
  import { fetchMonthEndCloseChecks } from '../../../monthEndCloseChecksView/monthEndCloseChecksViewReducer';
6
6
  import { refreshExpenseAutomationCurrentTab } from '../../expenseAutomationViewReducer';
7
+ import { fetchActualMatchingPage } from '../../reducers/actualMatchingViewReducer';
7
8
  import { fetchFluxAnalysisView } from '../../reducers/fluxAnalysisViewReducer';
8
9
  import { fetchJeSchedulesPage } from '../../reducers/jeSchedulesViewReducer';
9
10
  import { fetchMissingReceipts } from '../../reducers/missingReceiptsViewReducer';
10
11
  import { fetchReconciliation } from '../../reducers/reconciliationViewReducer';
11
12
  import { fetchTransactionCategorizationView } from '../../reducers/transactionsViewReducer';
12
- export type ActionType = ReturnType<typeof refreshExpenseAutomationCurrentTab> | ReturnType<typeof fetchCompanyMonthEndReportView> | ReturnType<typeof fetchCompanyMonthEndReportTemplates> | ReturnType<typeof fetchMissingReceipts> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof fetchFluxAnalysisView> | ReturnType<typeof fetchReconciliation> | ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof fetchTransactionCategorizationView>;
13
+ export type ActionType = ReturnType<typeof refreshExpenseAutomationCurrentTab> | ReturnType<typeof fetchActualMatchingPage> | ReturnType<typeof fetchCompanyMonthEndReportView> | ReturnType<typeof fetchCompanyMonthEndReportTemplates> | ReturnType<typeof fetchMissingReceipts> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof fetchFluxAnalysisView> | ReturnType<typeof fetchReconciliation> | ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof fetchTransactionCategorizationView>;
13
14
  export declare const refreshExpenseAutomationCurrentTabEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
@@ -7,6 +7,7 @@ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
7
  const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
8
  const companyMonthEndReportViewReducer_1 = require("../../../companyMonthEndReportView/companyMonthEndReportViewReducer");
9
9
  const expenseAutomationViewReducer_1 = require("../../expenseAutomationViewReducer");
10
+ const actualMatchingViewReducer_1 = require("../../reducers/actualMatchingViewReducer");
10
11
  const fluxAnalysisViewReducer_1 = require("../../reducers/fluxAnalysisViewReducer");
11
12
  const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
12
13
  const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
@@ -41,10 +42,17 @@ const refreshExpenseAutomationCurrentTabEpic = (actions$, state$) => actions$.pi
41
42
  return (0, rxjs_1.from)([
42
43
  (0, fluxAnalysisViewReducer_1.fetchFluxAnalysisView)(selectedPeriod, true, true, null),
43
44
  ]);
44
- case 'je_schedules':
45
+ case 'je_schedules': {
46
+ const selectedPageTab = state.expenseAutomationJESchedulesViewState.uiState.selectedPageTab;
47
+ if (selectedPageTab === 'actual_matching') {
48
+ return (0, rxjs_1.from)([
49
+ (0, actualMatchingViewReducer_1.fetchActualMatchingPage)({ start: timePeriodStart, end: timePeriodEnd }, true),
50
+ ]);
51
+ }
45
52
  return (0, rxjs_1.from)([
46
53
  (0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, true),
47
54
  ]);
55
+ }
48
56
  case 'month_end_insights':
49
57
  return (0, rxjs_1.from)([
50
58
  (0, companyMonthEndReportViewReducer_1.fetchCompanyMonthEndReportView)(true, companyId, currentTenant.tenantId, period.end, true),
@@ -1,6 +1,7 @@
1
1
  import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { Observable } from 'rxjs';
3
3
  import { RootState } from '../../../../reducer';
4
+ import { fetchActualMatchingPage } from '../../reducers/actualMatchingViewReducer';
4
5
  import { fetchJeSchedulesPage, updateJESchedulesUIState } from '../../reducers/jeSchedulesViewReducer';
5
- export type ActionType = ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof updateJESchedulesUIState>;
6
+ export type ActionType = ReturnType<typeof fetchActualMatchingPage> | ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof updateJESchedulesUIState>;
6
7
  export declare const switchJESchedulesTabEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
@@ -5,6 +5,7 @@ const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
6
  const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
7
  const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
+ const actualMatchingViewReducer_1 = require("../../reducers/actualMatchingViewReducer");
8
9
  const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
9
10
  const switchJESchedulesTabEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.updateJESchedulesUIState.match), (0, operators_1.filter)((action) => action.payload.selectedPageTab != null), (0, operators_1.mergeMap)(() => {
10
11
  const state = state$.value;
@@ -27,6 +28,10 @@ const switchJESchedulesTabEpic = (actions$, state$) => actions$.pipe((0, operato
27
28
  if (timePeriodStart == null || timePeriodEnd == null) {
28
29
  return rxjs_1.EMPTY;
29
30
  }
31
+ const { selectedPageTab } = state.expenseAutomationJESchedulesViewState.uiState;
32
+ if (selectedPageTab === 'actual_matching') {
33
+ return (0, rxjs_1.of)((0, actualMatchingViewReducer_1.fetchActualMatchingPage)({ start: timePeriodStart, end: timePeriodEnd }, true));
34
+ }
30
35
  return (0, rxjs_1.of)((0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, true));
31
36
  }));
32
37
  exports.switchJESchedulesTabEpic = switchJESchedulesTabEpic;
@@ -7,6 +7,7 @@ const monthEndCloseChecksSelector_1 = require("../../entity/monthEndCloseChecks/
7
7
  const tenantSelector_1 = require("../../entity/tenant/tenantSelector");
8
8
  const companyMonthEndReportViewSelector_1 = require("../companyMonthEndReportView/companyMonthEndReportViewSelector");
9
9
  const monthEndCloseChecksViewSelector_1 = require("../monthEndCloseChecksView/monthEndCloseChecksViewSelector");
10
+ const actualMatchingViewSelector_1 = require("./selectors/actualMatchingViewSelector");
10
11
  const fluxAnalysisViewSelector_1 = require("./selectors/fluxAnalysisViewSelector");
11
12
  const getAllStepsHelper_1 = require("./selectors/getAllStepsHelper");
12
13
  const jeSchedulesViewSelector_1 = require("./selectors/jeSchedulesViewSelector");
@@ -24,7 +25,7 @@ const isPreviousStepDisabled = (selectedTransactionCategorizationTab, allSteps,
24
25
  return allSteps[stepIndex - 1].isDisabled;
25
26
  };
26
27
  function getExpenseAutomationView(state) {
27
- const { expenseAutomationViewState, tenantState, expenseAutomationMissingReceiptsViewState, expenseAutomationJESchedulesViewState, expenseAutomationTransactionsViewState, expenseAutomationReconciliationViewState, monthEndCloseChecksState, companyState, } = state;
28
+ const { expenseAutomationViewState, tenantState, expenseAutomationMissingReceiptsViewState, expenseAutomationJESchedulesViewState, expenseAutomationActualMatchingViewState, expenseAutomationTransactionsViewState, expenseAutomationReconciliationViewState, monthEndCloseChecksState, companyState, } = state;
28
29
  const { loggedInUser, currentTenantId } = tenantState;
29
30
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
30
31
  const { currentSelectedView, selectedPeriodByTenantId } = expenseAutomationViewState;
@@ -45,6 +46,7 @@ function getExpenseAutomationView(state) {
45
46
  const reconciliation = (0, reconciliationViewSelector_1.getExpenseAutomationReconciliationView)(state);
46
47
  const expenseAutomationTransactionsView = (0, transactionCategorizationSelector_1.getExpenseAutomationTransactionView)(state);
47
48
  const jeSchedules = (0, jeSchedulesViewSelector_1.getExpenseAutomationJESchedulesView)(state);
49
+ const actualMatching = (0, actualMatchingViewSelector_1.getExpenseAutomationActualMatchingView)(state);
48
50
  switch (currentSelectedView) {
49
51
  case 'reconciliation':
50
52
  currentSelectedViewFetchState = reconciliation.fetchStatus;
@@ -57,12 +59,23 @@ function getExpenseAutomationView(state) {
57
59
  fluxAnalysis.refreshStatus;
58
60
  break;
59
61
  case 'je_schedules':
60
- currentSelectedViewFetchState = {
61
- fetchState: jeSchedules.fetchState,
62
- error: jeSchedules.error,
63
- };
64
- currentSelectedViewBackgroundRefreshFetchState =
65
- jeSchedules.refreshStatus;
62
+ if (expenseAutomationJESchedulesViewState.uiState.selectedPageTab ===
63
+ 'actual_matching') {
64
+ currentSelectedViewFetchState = {
65
+ fetchState: actualMatching.fetchState,
66
+ error: actualMatching.error,
67
+ };
68
+ currentSelectedViewBackgroundRefreshFetchState =
69
+ actualMatching.refreshStatus;
70
+ }
71
+ else {
72
+ currentSelectedViewFetchState = {
73
+ fetchState: jeSchedules.fetchState,
74
+ error: jeSchedules.error,
75
+ };
76
+ currentSelectedViewBackgroundRefreshFetchState =
77
+ jeSchedules.refreshStatus;
78
+ }
66
79
  break;
67
80
  case 'missing_receipts':
68
81
  currentSelectedViewFetchState = {
@@ -94,6 +107,7 @@ function getExpenseAutomationView(state) {
94
107
  const fetchStateVariables = [
95
108
  expenseAutomationMissingReceiptsViewState,
96
109
  expenseAutomationJESchedulesViewState,
110
+ expenseAutomationActualMatchingViewState,
97
111
  expenseAutomationTransactionsView,
98
112
  expenseAutomationReconciliationViewState,
99
113
  ];
@@ -179,6 +193,7 @@ function getExpenseAutomationView(state) {
179
193
  ]);
180
194
  return {
181
195
  jeSchedules,
196
+ actualMatching,
182
197
  transactionView: expenseAutomationTransactionsView,
183
198
  missingReceipts,
184
199
  reconciliation,