@zeniai/client-epic-state 5.2.11-beta0ND → 5.2.11-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.
- package/lib/entity/invoicing/invoicingCommonPayload.d.ts +29 -27
- package/lib/entity/invoicing/invoicingCommonPayload.js +75 -37
- package/lib/entity/invoicing/product/productPayload.d.ts +0 -10
- package/lib/entity/invoicing/product/productPayload.js +2 -14
- package/lib/entity/jeSchedules/jeScheduleHelper.d.ts +1 -0
- package/lib/entity/jeSchedules/jeScheduleHelper.js +7 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +97 -1
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +209 -0
- package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +4 -2
- package/lib/entity/jeSchedules/jeSchedulesReducer.js +30 -2
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +11 -2
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +38 -3
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +140 -1
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +24 -1
- package/lib/entity/jeSchedules/jeSchedulesTypes.js +88 -1
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +3 -0
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +2 -0
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
- package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +2 -0
- package/lib/epic.d.ts +15 -3
- package/lib/epic.js +31 -12
- package/lib/esm/entity/invoicing/invoicingCommonPayload.js +73 -33
- package/lib/esm/entity/invoicing/product/productPayload.js +2 -14
- package/lib/esm/entity/jeSchedules/jeScheduleHelper.js +6 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +209 -1
- package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +30 -2
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +36 -2
- package/lib/esm/entity/jeSchedules/jeSchedulesTypes.js +78 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +3 -0
- package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
- package/lib/esm/epic.js +27 -8
- package/lib/esm/index.js +23 -14
- package/lib/esm/reducer.js +3 -0
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +46 -0
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.js +7 -0
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +50 -0
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +44 -0
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +44 -0
- package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +30 -10
- package/lib/esm/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +9 -1
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +9 -1
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +41 -5
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +45 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +14 -2
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +104 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +25 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +136 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +79 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +180 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +111 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +33 -0
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +22 -7
- package/lib/esm/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +140 -0
- package/lib/esm/view/expenseAutomationView/payload/actualMatchingPayload.js +35 -0
- package/lib/esm/view/expenseAutomationView/payload/jeSchedulesPayload.js +55 -0
- package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +260 -0
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +319 -29
- package/lib/esm/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +1 -0
- package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +162 -0
- package/lib/esm/view/expenseAutomationView/selectors/jeAccountSettingsViewSelector.js +1 -0
- package/lib/esm/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +106 -0
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +297 -22
- package/lib/esm/view/expenseAutomationView/types/actualMatchingViewState.js +22 -0
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -5
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +9 -25
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +1 -6
- package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +0 -40
- package/lib/esm/view/invoicing/settingsView/settingsViewEpics.js +92 -0
- package/lib/esm/view/invoicing/settingsView/settingsViewReducer.js +1 -25
- package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +0 -41
- package/lib/esm/view/recommendation/recommendationReducer.js +1 -16
- package/lib/esm/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
- package/lib/esm/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +7 -2
- package/lib/esm/view/scheduleView/scheduleListView/scheduleListReducer.js +5 -3
- package/lib/index.d.ts +29 -22
- package/lib/index.js +116 -56
- package/lib/reducer.d.ts +1 -0
- package/lib/reducer.js +3 -0
- package/lib/rootStateTypes.d.ts +2 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +50 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.d.ts +5 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.js +11 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +54 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +48 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +48 -0
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.d.ts +2 -1
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +30 -10
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.d.ts +2 -1
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +9 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +9 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +3 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +39 -3
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.d.ts +21 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +49 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +14 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +108 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +29 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +140 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +83 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.d.ts +13 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +187 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.d.ts +65 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +115 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +7 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +37 -0
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +22 -7
- package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.d.ts +36 -0
- package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +145 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/actualMatchingPayload.d.ts +66 -0
- package/lib/view/expenseAutomationView/payload/actualMatchingPayload.js +40 -0
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +86 -3
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.js +58 -1
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +53 -0
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +264 -0
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +93 -12
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +321 -29
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +58 -0
- package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +2 -0
- package/lib/view/expenseAutomationView/selectorTypes/jeAccountSettingsViewSelectorTypes.d.ts +1 -0
- package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.d.ts +42 -0
- package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +2 -0
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +36 -7
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +9 -0
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +172 -0
- package/lib/view/expenseAutomationView/selectors/jeAccountSettingsViewSelector.js +1 -0
- package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.d.ts +21 -0
- package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +112 -0
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +34 -0
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +305 -21
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +76 -0
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.js +27 -0
- package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +83 -8
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +11 -7
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +2 -2
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.d.ts +1 -12
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +9 -25
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +1 -6
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.d.ts +1 -10
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +1 -43
- package/lib/view/invoicing/settingsView/settingsViewEpics.d.ts +12 -0
- package/lib/view/invoicing/settingsView/settingsViewEpics.js +99 -0
- package/lib/view/invoicing/settingsView/settingsViewReducer.d.ts +1 -4
- package/lib/view/invoicing/settingsView/settingsViewReducer.js +2 -26
- package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +0 -35
- package/lib/view/invoicing/settingsView/settingsViewSelector.js +1 -43
- package/lib/view/invoicing/settingsView/settingsViewState.d.ts +0 -8
- package/lib/view/recommendation/recommendationPayload.d.ts +0 -34
- package/lib/view/recommendation/recommendationReducer.d.ts +1 -2
- package/lib/view/recommendation/recommendationReducer.js +2 -17
- package/lib/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
- package/lib/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +7 -2
- package/lib/view/scheduleView/scheduleListView/scheduleListReducer.d.ts +4 -2
- package/lib/view/scheduleView/scheduleListView/scheduleListReducer.js +5 -3
- package/package.json +1 -1
- package/lib/esm/view/invoicing/settingsView/epics/connectInvoicingStripeEpic.js +0 -27
- package/lib/esm/view/invoicing/settingsView/epics/disconnectInvoicingStripeEpic.js +0 -19
- package/lib/esm/view/invoicing/settingsView/epics/fetchInvoicingSettingsEpic.js +0 -19
- package/lib/esm/view/invoicing/settingsView/epics/saveInvoicingSettingsEpic.js +0 -39
- package/lib/esm/view/invoicing/settingsView/epics/submitInvoicingQboSettingsEpic.js +0 -25
- package/lib/esm/view/invoicing/settingsView/invoicingQboSettingsFormConfig.js +0 -48
- package/lib/esm/view/recommendation/submitRecommendationFeedbackEpic.js +0 -52
- package/lib/view/invoicing/settingsView/epics/connectInvoicingStripeEpic.d.ts +0 -6
- package/lib/view/invoicing/settingsView/epics/connectInvoicingStripeEpic.js +0 -31
- package/lib/view/invoicing/settingsView/epics/disconnectInvoicingStripeEpic.d.ts +0 -6
- package/lib/view/invoicing/settingsView/epics/disconnectInvoicingStripeEpic.js +0 -23
- package/lib/view/invoicing/settingsView/epics/fetchInvoicingSettingsEpic.d.ts +0 -6
- package/lib/view/invoicing/settingsView/epics/fetchInvoicingSettingsEpic.js +0 -23
- package/lib/view/invoicing/settingsView/epics/saveInvoicingSettingsEpic.d.ts +0 -6
- package/lib/view/invoicing/settingsView/epics/saveInvoicingSettingsEpic.js +0 -43
- package/lib/view/invoicing/settingsView/epics/settingsViewActionType.d.ts +0 -5
- package/lib/view/invoicing/settingsView/epics/submitInvoicingQboSettingsEpic.d.ts +0 -11
- package/lib/view/invoicing/settingsView/epics/submitInvoicingQboSettingsEpic.js +0 -29
- package/lib/view/invoicing/settingsView/invoicingQboSettingsFormConfig.d.ts +0 -34
- package/lib/view/invoicing/settingsView/invoicingQboSettingsFormConfig.js +0 -53
- package/lib/view/recommendation/submitRecommendationFeedbackEpic.d.ts +0 -7
- package/lib/view/recommendation/submitRecommendationFeedbackEpic.js +0 -56
- /package/lib/esm/view/{invoicing/settingsView/epics/settingsViewActionType.js → expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js} +0 -0
- /package/lib/view/{invoicing/settingsView/epics/settingsViewActionType.js → expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js} +0 -0
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,
|
package/lib/rootStateTypes.d.ts
CHANGED
|
@@ -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;
|
|
@@ -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,11 +6,13 @@ 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");
|
|
12
13
|
const reconciliationViewReducer_1 = require("../../reducers/reconciliationViewReducer");
|
|
13
14
|
const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
|
|
15
|
+
const jeSchedulesViewState_1 = require("../../types/jeSchedulesViewState");
|
|
14
16
|
const fetchAllExpenseAutomationTabsEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(expenseAutomationViewReducer_1.fetchAllExpenseAutomationTabs.match), (0, operators_1.switchMap)((action) => {
|
|
15
17
|
const { cacheOverride, refreshViewInBackground } = action.payload;
|
|
16
18
|
const state = state$.value;
|
|
@@ -33,11 +35,14 @@ const fetchAllExpenseAutomationTabsEpic = (actions$, state$) => actions$.pipe((0
|
|
|
33
35
|
}
|
|
34
36
|
if (cacheOverride === true) {
|
|
35
37
|
const actions = [];
|
|
38
|
+
const selectedPageTab = state.expenseAutomationJESchedulesViewState.uiState.selectedPageTab;
|
|
36
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 }, {
|
|
37
40
|
amount: 75.0,
|
|
38
41
|
currencyCode: 'USD',
|
|
39
42
|
currencySymbol: '$',
|
|
40
|
-
}, cacheOverride, refreshViewInBackground), (0, fluxAnalysisViewReducer_1.fetchFluxAnalysisView)(selectedPeriod, cacheOverride, refreshViewInBackground, null),
|
|
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));
|
|
41
46
|
if (reconciliationEnabled) {
|
|
42
47
|
actions.push((0, reconciliationViewReducer_1.fetchReconciliation)(selectedPeriod, undefined, cacheOverride, refreshViewInBackground));
|
|
43
48
|
}
|
|
@@ -62,15 +67,30 @@ const fetchAllExpenseAutomationTabsEpic = (actions$, state$) => actions$.pipe((0
|
|
|
62
67
|
state.expenseAutomationFluxAnalysisViewState.groupsBySelectedPeriod[monthYearPeriodId] == null)) {
|
|
63
68
|
fetchActions.push((0, fluxAnalysisViewReducer_1.fetchFluxAnalysisView)(selectedPeriod, cacheOverride, refreshViewInBackground, null));
|
|
64
69
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
// The two JE tabs cache separately, so only the tab actually being shown decides whether a
|
|
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
|
+
}
|
|
74
94
|
}
|
|
75
95
|
if (state.expenseAutomationReconciliationViewState.fetchState !==
|
|
76
96
|
'In-Progress' &&
|
package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.d.ts
CHANGED
|
@@ -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>;
|
package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js
CHANGED
|
@@ -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),
|
|
@@ -17,7 +17,15 @@ const fetchJeSchedulesPageEpic = (actions$, state$) => actions$.pipe((0, operato
|
|
|
17
17
|
jeSchedulePageActions.push((0, accountListReducer_1.fetchAccountList)(accountType.accountListKey, true, false, false, false, accountType.allowedAccountList));
|
|
18
18
|
}
|
|
19
19
|
jeSchedulePageActions.push((0, jeSchedulesViewReducer_1.fetchJeSchedules)(period, refreshViewInBackground));
|
|
20
|
-
|
|
20
|
+
// Only on the first page load. Account settings cannot change from a tab switch or a
|
|
21
|
+
// refresh, and re-initializing puts accountSettingsView back to 'In-Progress' -- which the
|
|
22
|
+
// page reads as "still loading" and answers with a full skeleton over rows it already has.
|
|
23
|
+
// The action also resets localData, so re-dispatching it blindly would empty the settings
|
|
24
|
+
// form until the refetch lands. Saving account settings still re-initializes explicitly.
|
|
25
|
+
if (!state$.value.expenseAutomationJESchedulesViewState.accountSettings
|
|
26
|
+
.hasLoadedAccountSettings) {
|
|
27
|
+
jeSchedulePageActions.push((0, jeSchedulesViewReducer_1.initializeAccountSettingsView)());
|
|
28
|
+
}
|
|
21
29
|
return (0, rxjs_1.concat)((0, rxjs_1.from)(jeSchedulePageActions));
|
|
22
30
|
}));
|
|
23
31
|
exports.fetchJeSchedulesPageEpic = fetchJeSchedulesPageEpic;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { updateJESchedules, updateJESchedulesDetails } from '../../../../entity/jeSchedules/jeSchedulesReducer';
|
|
3
|
+
import { updateAccruedJESchedules, updateAccruedJESchedulesDetails, updateJEOneTimeAccruals, updateJESchedules, updateJESchedulesDetails } from '../../../../entity/jeSchedules/jeSchedulesReducer';
|
|
4
4
|
import { RootState } from '../../../../rootStateTypes';
|
|
5
|
+
import { clearAll } from '../../../../rootActions';
|
|
5
6
|
import { ZeniAPI } from '../../../../zeniAPI';
|
|
6
7
|
import { fetchJeSchedules, fetchJeSchedulesFailure, fetchJeSchedulesSuccess, initializeJeScheduleLocalData } from '../../reducers/jeSchedulesViewReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof fetchJeSchedules> | ReturnType<typeof fetchJeSchedulesFailure> | ReturnType<typeof fetchJeSchedulesSuccess> | ReturnType<typeof initializeJeScheduleLocalData> | ReturnType<typeof updateJESchedules> | ReturnType<typeof updateJESchedulesDetails>;
|
|
8
|
+
export type ActionType = ReturnType<typeof clearAll> | ReturnType<typeof fetchJeSchedules> | ReturnType<typeof fetchJeSchedulesFailure> | ReturnType<typeof fetchJeSchedulesSuccess> | ReturnType<typeof initializeJeScheduleLocalData> | ReturnType<typeof updateAccruedJESchedules> | ReturnType<typeof updateAccruedJESchedulesDetails> | ReturnType<typeof updateJEOneTimeAccruals> | ReturnType<typeof updateJESchedules> | ReturnType<typeof updateJESchedulesDetails>;
|
|
8
9
|
export declare const fetchJeSchedulesEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -4,9 +4,12 @@ exports.fetchJeSchedulesEpic = void 0;
|
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
|
|
7
|
+
const timePeriod_2 = require("../../../../commonStateTypes/timePeriod");
|
|
7
8
|
const jeSchedulesReducer_1 = require("../../../../entity/jeSchedules/jeSchedulesReducer");
|
|
8
9
|
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
9
10
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
11
|
+
const rootActions_1 = require("../../../../rootActions");
|
|
12
|
+
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
10
13
|
const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
|
|
11
14
|
const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.fetchJeSchedules.match), (0, operators_1.mergeMap)((action) => {
|
|
12
15
|
const state = state$.value;
|
|
@@ -14,27 +17,54 @@ const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
|
|
|
14
17
|
const { period, refreshViewInBackground } = action.payload;
|
|
15
18
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
16
19
|
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
20
|
+
const { selectedPageTab } = state.expenseAutomationJESchedulesViewState.uiState;
|
|
21
|
+
const isClosePeriodTab = selectedPageTab === 'schedules';
|
|
22
|
+
const existingEndDate = (0, timePeriod_2.toAbsoluteDay)((0, zeniDayJS_1.date)((0, timePeriod_2.toString)(period.start))
|
|
23
|
+
.subtract(1, 'month')
|
|
24
|
+
.endOf('month')
|
|
25
|
+
.format(timePeriod_1.DEFAULT_DATE_FORMAT));
|
|
17
26
|
const queryParam = {
|
|
18
|
-
start_date: (0,
|
|
19
|
-
end_date:
|
|
27
|
+
start_date: (0, timePeriod_2.toString)(period.start),
|
|
28
|
+
end_date: isClosePeriodTab || existingEndDate == null
|
|
29
|
+
? (0, timePeriod_2.toString)(period.end)
|
|
30
|
+
: (0, timePeriod_2.toString)(existingEndDate),
|
|
31
|
+
include_accrued: true,
|
|
32
|
+
...(isClosePeriodTab
|
|
33
|
+
? { close_period_start_date: (0, timePeriod_2.toString)(period.start) }
|
|
34
|
+
: {}),
|
|
20
35
|
};
|
|
21
36
|
return zeniAPI
|
|
22
37
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/expenses_automation/je_schedules?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
23
38
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
24
39
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
25
40
|
const updateActions = [];
|
|
41
|
+
const accruedJeSchedules = response.data.accrued_je_schedules?.je_schedules ?? [];
|
|
42
|
+
const oneTimeAccruals = response.data.one_time_accruals ?? [];
|
|
26
43
|
updateActions.push((0, jeSchedulesReducer_1.updateJESchedules)([
|
|
27
44
|
...response.data.je_schedules,
|
|
28
45
|
...response.data.failed_je_postings.je_schedules,
|
|
29
46
|
]), (0, jeSchedulesReducer_1.updateJESchedulesDetails)([...response.data.failed_je_postings.je_schedules], response.data.failed_je_postings.scheduled_journal_entries), (0, jeSchedulesViewReducer_1.initializeJeScheduleLocalData)([
|
|
30
47
|
...response.data.failed_je_postings.je_schedules,
|
|
31
48
|
]));
|
|
49
|
+
if (accruedJeSchedules.length > 0) {
|
|
50
|
+
updateActions.push((0, jeSchedulesReducer_1.updateAccruedJESchedules)(accruedJeSchedules), (0, jeSchedulesReducer_1.updateAccruedJESchedulesDetails)(accruedJeSchedules, response.data.accrued_je_schedules
|
|
51
|
+
?.scheduled_journal_entries));
|
|
52
|
+
}
|
|
53
|
+
if (oneTimeAccruals.length > 0) {
|
|
54
|
+
// Single action, unlike the accrued pair above: this one writes the entity
|
|
55
|
+
// directly because an accrual denormalizes its vendor, accounts and classes, so
|
|
56
|
+
// there is no fan-out fetch to trigger.
|
|
57
|
+
updateActions.push((0, jeSchedulesReducer_1.updateJEOneTimeAccruals)(oneTimeAccruals));
|
|
58
|
+
}
|
|
32
59
|
updateActions.push((0, jeSchedulesViewReducer_1.fetchJeSchedulesSuccess)({
|
|
33
60
|
jeSchedules: [...response.data.je_schedules],
|
|
34
61
|
failedJeSchedules: [
|
|
35
62
|
...response.data.failed_je_postings.je_schedules,
|
|
36
63
|
],
|
|
64
|
+
accruedJeSchedules: accruedJeSchedules,
|
|
65
|
+
oneTimeAccruals: oneTimeAccruals,
|
|
37
66
|
selectedPeriod: selectedPeriod,
|
|
67
|
+
selectedPageTab: selectedPageTab,
|
|
38
68
|
refreshViewInBackground: refreshViewInBackground,
|
|
39
69
|
}));
|
|
40
70
|
return (0, rxjs_1.from)(updateActions);
|
|
@@ -43,12 +73,18 @@ const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
|
|
|
43
73
|
return (0, rxjs_1.of)((0, jeSchedulesViewReducer_1.fetchJeSchedulesFailure)({
|
|
44
74
|
status: response.status,
|
|
45
75
|
selectedPeriod,
|
|
76
|
+
selectedPageTab,
|
|
46
77
|
}));
|
|
47
78
|
}
|
|
48
79
|
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, jeSchedulesViewReducer_1.fetchJeSchedulesFailure)({
|
|
49
80
|
status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'fetch JE schedules REST API call errored out' +
|
|
50
81
|
JSON.stringify(error)),
|
|
51
82
|
selectedPeriod,
|
|
52
|
-
|
|
83
|
+
selectedPageTab,
|
|
84
|
+
}))),
|
|
85
|
+
// A tenant switch clears the store while this request is still in flight. Without this
|
|
86
|
+
// the old tenant's rows are written back into the freshly cleared store and stay on
|
|
87
|
+
// screen under the new tenant until a manual refresh.
|
|
88
|
+
(0, operators_1.takeUntil)(actions$.pipe((0, operators_1.filter)(rootActions_1.clearAll.match))));
|
|
53
89
|
}));
|
|
54
90
|
exports.fetchJeSchedulesEpic = fetchJeSchedulesEpic;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { updateJEOneTimeAccruals } from '../../../../entity/jeSchedules/jeSchedulesReducer';
|
|
4
|
+
import { RootState } from '../../../../reducer';
|
|
5
|
+
import { clearAll } from '../../../../rootActions';
|
|
6
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
7
|
+
import { fetchOneTimeAccrual, fetchOneTimeAccrualFailure, fetchOneTimeAccrualSuccess } from '../../reducers/jeSchedulesViewReducer';
|
|
8
|
+
export type ActionType = ReturnType<typeof clearAll> | ReturnType<typeof fetchOneTimeAccrual> | ReturnType<typeof fetchOneTimeAccrualFailure> | ReturnType<typeof fetchOneTimeAccrualSuccess> | ReturnType<typeof updateJEOneTimeAccruals>;
|
|
9
|
+
/**
|
|
10
|
+
* Read one accrual by id so its detail page can render from a URL alone.
|
|
11
|
+
*
|
|
12
|
+
* Every other row on this page arrives with the JE Schedules list, and the accrual detail page used
|
|
13
|
+
* to render only from what that list had already put in the store -- so opening its URL directly, on
|
|
14
|
+
* a refresh or a shared link, had nothing to render and showed not-found. This is the read that
|
|
15
|
+
* makes the URL self-sufficient.
|
|
16
|
+
*
|
|
17
|
+
* The response is the same `{accrual}` envelope promote / ignore / revert return, and it goes through
|
|
18
|
+
* the same `updateJEOneTimeAccruals`, so a page loaded cold holds exactly the entity a page reached
|
|
19
|
+
* through the list holds.
|
|
20
|
+
*/
|
|
21
|
+
export declare const fetchOneTimeAccrualEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|