@zeniai/client-epic-state 5.2.10 → 5.2.11-betaRD1
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/commonStateTypes/selectorTypes/pickAndMergeForecastSection.d.ts +0 -0
- package/lib/commonStateTypes/selectorTypes/pickAndMergeForecastSection.js +1 -0
- package/lib/entity/invoicing/coupon/couponConstants.d.ts +11 -0
- package/lib/entity/invoicing/coupon/couponConstants.js +29 -0
- package/lib/entity/jeSchedules/jeScheduleHelper.d.ts +1 -0
- package/lib/entity/jeSchedules/jeScheduleHelper.js +7 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +66 -1
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +135 -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 +79 -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 +9 -1
- package/lib/epic.js +16 -0
- package/lib/esm/commonStateTypes/selectorTypes/pickAndMergeForecastSection.js +1 -0
- package/lib/esm/entity/invoicing/coupon/couponConstants.js +26 -0
- package/lib/esm/entity/jeSchedules/jeScheduleHelper.js +6 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +135 -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 +16 -0
- package/lib/esm/index.js +14 -8
- package/lib/esm/view/companyMonthEndReportView/companyMonthEndReportViewReducer.js +6 -2
- package/lib/esm/view/companyMonthEndReportView/companyMonthEndReportViewState.js +4 -0
- package/lib/esm/view/companyMonthEndReportView/epics/saveCompanyMonthEndReportEpic.js +10 -6
- package/lib/esm/view/companyMonthEndReportView/epics/sendCompanyMonthEndReportEpic.js +9 -5
- package/lib/esm/view/companyMonthEndReportView/monthEndTemplateData.js +32 -0
- package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +6 -3
- 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 +99 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +25 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +110 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +79 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +139 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +106 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +22 -0
- package/lib/esm/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +140 -0
- package/lib/esm/view/expenseAutomationView/payload/jeSchedulesPayload.js +55 -0
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +306 -29
- package/lib/esm/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +1 -0
- package/lib/esm/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +106 -0
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +294 -22
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +5 -6
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.js +25 -0
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.js +15 -0
- 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/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +18 -0
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +18 -0
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +18 -0
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.js +16 -0
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.js +1 -0
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +60 -0
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.js +12 -0
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.js +1 -0
- package/lib/index.d.ts +19 -13
- package/lib/index.js +91 -47
- package/lib/view/companyMonthEndReportView/companyMonthEndReportViewPayload.d.ts +8 -0
- package/lib/view/companyMonthEndReportView/companyMonthEndReportViewReducer.d.ts +6 -2
- package/lib/view/companyMonthEndReportView/companyMonthEndReportViewReducer.js +6 -2
- package/lib/view/companyMonthEndReportView/companyMonthEndReportViewState.d.ts +2 -0
- package/lib/view/companyMonthEndReportView/companyMonthEndReportViewState.js +4 -0
- package/lib/view/companyMonthEndReportView/epics/saveCompanyMonthEndReportEpic.js +10 -6
- package/lib/view/companyMonthEndReportView/epics/sendCompanyMonthEndReportEpic.js +9 -5
- package/lib/view/companyMonthEndReportView/monthEndTemplateData.d.ts +16 -0
- package/lib/view/companyMonthEndReportView/monthEndTemplateData.js +36 -0
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +6 -3
- 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 +20 -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 +8 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +103 -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 +45 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +114 -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 +12 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +146 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.d.ts +64 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +110 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +6 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +26 -0
- 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/jeSchedulesPayload.d.ts +72 -3
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.js +58 -1
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +91 -12
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +308 -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/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/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 +302 -21
- package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +82 -8
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -8
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +1 -1
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.d.ts +6 -0
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.js +29 -0
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.d.ts +6 -0
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.js +19 -0
- 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/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.d.ts +8 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +22 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.d.ts +8 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +22 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.d.ts +8 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +22 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.d.ts +13 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.js +20 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.d.ts +11 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.js +2 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.d.ts +7 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +64 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.d.ts +12 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.js +15 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.d.ts +9 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.js +2 -0
- package/package.json +1 -1
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.saveNewScheduleSuccess = exports.saveNewScheduleFailure = exports.saveNewSchedule = exports.saveAccountSettingsSuccess = exports.saveAccountSettingsLocalData = exports.saveAccountSettingsFailure = exports.saveAccountSettings = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.resetNewScheduleLocalData = exports.removeJeScheduleTransactionKey = exports.removeJeAccruedScheduleKey = exports.removeJeScheduleLocalDataById = exports.removeFailedJeScheduleTransactionKey = exports.initializeNewSchedule = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = exports.fetchOneTimeAccrualSuccess = exports.fetchOneTimeAccrualFailure = exports.fetchOneTimeAccrual = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchJeSchedules = exports.fetchAccountSettingsListForAccountTypes = exports.revertOneTimeAccrual = exports.revertJeScheduleSuccess = exports.revertJeScheduleFailure = exports.revertJeSchedule = exports.promoteOneTimeAccrual = exports.oneTimeAccrualActionSuccess = exports.oneTimeAccrualActionFailure = exports.ignoreOneTimeAccrual = exports.createOneTimeAccrualSuccess = exports.createOneTimeAccrualFailure = exports.createOneTimeAccrual = exports.clearSearchTransactionsForNewSchedule = exports.clearJeScheduleLocalData = exports.clearJeAccountSettingsLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = exports.searchTransactionsInitialState = exports.newScheduleInitialState = exports.getBaseNewScheduleLocalData = exports.accountSettingsInitialState = void 0;
|
|
5
|
+
exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateNewScheduleLocalData = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateJEScheduleTypeFilter = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.toggleJEPendingGroupCollapsed = exports.toggleJECreatedGroupCollapsed = exports.searchTransactionsForNewScheduleSuccess = exports.searchTransactionsForNewScheduleFailure = exports.searchTransactionsForNewSchedule = void 0;
|
|
5
6
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
7
|
const getNestedAccountIDHierarchyForReport_1 = require("../../../commonStateTypes/accountView/getNestedAccountIDHierarchyForReport");
|
|
7
8
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
8
9
|
const accountPayload_1 = require("../../../entity/account/accountPayload");
|
|
10
|
+
const jeScheduleHelper_1 = require("../../../entity/jeSchedules/jeScheduleHelper");
|
|
9
11
|
const jeSchedulesPayload_1 = require("../../../entity/jeSchedules/jeSchedulesPayload");
|
|
10
12
|
const rootActions_1 = require("../../../rootActions");
|
|
11
13
|
const accountTypeRecommendationPayload_1 = require("../../accountMappingView/accountTypeRecommendation/accountTypeRecommendationPayload");
|
|
14
|
+
const jeSchedulesViewState_1 = require("../types/jeSchedulesViewState");
|
|
15
|
+
function removeKeyFromEveryTabSlot(keysByPeriodAndTab, keyToRemove) {
|
|
16
|
+
for (const periodTabKey of Object.keys(keysByPeriodAndTab)) {
|
|
17
|
+
keysByPeriodAndTab[periodTabKey] = keysByPeriodAndTab[periodTabKey].filter((jeScheduleKey) => jeScheduleKey !== keyToRemove);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
12
20
|
exports.accountSettingsInitialState = {
|
|
13
21
|
localData: {
|
|
14
22
|
selectedPrepaidExpensesAccountIds: [],
|
|
@@ -40,16 +48,38 @@ exports.accountSettingsInitialState = {
|
|
|
40
48
|
accruedExpensesNestedAccountListHierarchy: [],
|
|
41
49
|
accruedExpensesRecommendations: [],
|
|
42
50
|
};
|
|
51
|
+
const getBaseNewScheduleLocalData = (scheduleType) => ({
|
|
52
|
+
scheduleType,
|
|
53
|
+
jeScheduleDetails: [],
|
|
54
|
+
});
|
|
55
|
+
exports.getBaseNewScheduleLocalData = getBaseNewScheduleLocalData;
|
|
56
|
+
exports.newScheduleInitialState = {
|
|
57
|
+
fixed_assets: (0, exports.getBaseNewScheduleLocalData)('fixed_assets'),
|
|
58
|
+
prepaid_expenses: (0, exports.getBaseNewScheduleLocalData)('prepaid_expenses'),
|
|
59
|
+
};
|
|
60
|
+
exports.searchTransactionsInitialState = {
|
|
61
|
+
searchResults: [],
|
|
62
|
+
fetchState: 'Not-Started',
|
|
63
|
+
error: undefined,
|
|
64
|
+
};
|
|
43
65
|
exports.initialState = {
|
|
44
|
-
|
|
45
|
-
|
|
66
|
+
jeScheduleTransactionKeysByPeriodAndTab: {},
|
|
67
|
+
jeScheduleAccruedKeysByPeriodAndTab: {},
|
|
68
|
+
jeScheduleOneTimeAccrualKeysByPeriodAndTab: {},
|
|
69
|
+
failedJeScheduleTransactionKeysByPeriodAndTab: {},
|
|
46
70
|
postStatusById: {},
|
|
47
71
|
ignoreStatusById: {},
|
|
72
|
+
revertStatusById: {},
|
|
48
73
|
jeScheduleLocalDataById: {},
|
|
74
|
+
oneTimeAccrualActionStatusById: {},
|
|
75
|
+
oneTimeAccrualFetchStatusById: {},
|
|
49
76
|
uiState: {
|
|
50
|
-
|
|
77
|
+
createdGroupCollapsed: false,
|
|
78
|
+
pendingGroupCollapsed: false,
|
|
51
79
|
scrollPosition: { scrollTop: 0, scrollLeft: undefined },
|
|
52
|
-
|
|
80
|
+
searchString: '',
|
|
81
|
+
selectedJETypeFilter: null,
|
|
82
|
+
selectedPageTab: 'schedules',
|
|
53
83
|
sortKey: 'transactionDate',
|
|
54
84
|
sortOrder: 'descending',
|
|
55
85
|
totalCount: 0,
|
|
@@ -60,6 +90,14 @@ exports.initialState = {
|
|
|
60
90
|
error: undefined,
|
|
61
91
|
},
|
|
62
92
|
accountSettings: exports.accountSettingsInitialState,
|
|
93
|
+
newSchedule: {
|
|
94
|
+
createOneTimeAccrualStatus: { fetchState: 'Not-Started', error: undefined },
|
|
95
|
+
newScheduleState: exports.newScheduleInitialState,
|
|
96
|
+
saveStatus: { fetchState: 'Not-Started', error: undefined },
|
|
97
|
+
searchTransactions: exports.searchTransactionsInitialState,
|
|
98
|
+
fetchState: 'Not-Started',
|
|
99
|
+
error: undefined,
|
|
100
|
+
},
|
|
63
101
|
fetchState: 'Not-Started',
|
|
64
102
|
error: undefined,
|
|
65
103
|
hasValidState() {
|
|
@@ -104,9 +142,12 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
104
142
|
},
|
|
105
143
|
},
|
|
106
144
|
fetchJeSchedulesSuccess(draft, action) {
|
|
107
|
-
const { jeSchedules, selectedPeriod, failedJeSchedules, refreshViewInBackground, } = action.payload;
|
|
145
|
+
const { jeSchedules, selectedPeriod, selectedPageTab, failedJeSchedules, accruedJeSchedules, oneTimeAccruals, refreshViewInBackground, } = action.payload;
|
|
146
|
+
const periodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod));
|
|
108
147
|
const jeScheduleTransactionKeys = jeSchedules.map((schedules) => (0, jeSchedulesPayload_1.getJEScheduleTransactionDetailKeyPayload)(schedules.base_transaction));
|
|
109
148
|
const failedJeScheduleTransactionKeys = failedJeSchedules.map((schedules) => (0, jeSchedulesPayload_1.getJEScheduleTransactionDetailKeyPayload)(schedules.base_transaction));
|
|
149
|
+
const jeScheduleAccruedKeys = accruedJeSchedules.map((schedule) => (0, jeSchedulesPayload_1.getJEScheduleKey)(schedule));
|
|
150
|
+
const jeScheduleOneTimeAccrualKeys = oneTimeAccruals.map((accrual) => (0, jeScheduleHelper_1.generateJEOneTimeAccrualKey)(accrual._id));
|
|
110
151
|
if (refreshViewInBackground === true &&
|
|
111
152
|
draft.refreshStatus.fetchState === 'In-Progress') {
|
|
112
153
|
draft.refreshStatus = { fetchState: 'Completed', error: undefined };
|
|
@@ -115,19 +156,28 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
115
156
|
draft.fetchState = 'Completed';
|
|
116
157
|
draft.error = undefined;
|
|
117
158
|
}
|
|
118
|
-
draft.
|
|
119
|
-
|
|
159
|
+
draft.jeScheduleTransactionKeysByPeriodAndTab[periodTabKey] =
|
|
160
|
+
jeScheduleTransactionKeys;
|
|
161
|
+
draft.jeScheduleAccruedKeysByPeriodAndTab[periodTabKey] =
|
|
162
|
+
jeScheduleAccruedKeys;
|
|
163
|
+
draft.jeScheduleOneTimeAccrualKeysByPeriodAndTab[periodTabKey] =
|
|
164
|
+
jeScheduleOneTimeAccrualKeys;
|
|
165
|
+
draft.failedJeScheduleTransactionKeysByPeriodAndTab[periodTabKey] =
|
|
166
|
+
failedJeScheduleTransactionKeys;
|
|
120
167
|
},
|
|
121
168
|
fetchJeSchedulesFailure(draft, action) {
|
|
122
|
-
const { status, selectedPeriod } = action.payload;
|
|
169
|
+
const { status, selectedPeriod, selectedPageTab } = action.payload;
|
|
170
|
+
const periodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod));
|
|
123
171
|
if (draft.refreshStatus.fetchState === 'In-Progress') {
|
|
124
172
|
draft.refreshStatus = { fetchState: 'Error', error: status };
|
|
125
173
|
}
|
|
126
174
|
else {
|
|
127
175
|
draft.fetchState = 'Error';
|
|
128
176
|
draft.error = status;
|
|
177
|
+
draft.jeScheduleTransactionKeysByPeriodAndTab[periodTabKey] = [];
|
|
178
|
+
draft.jeScheduleAccruedKeysByPeriodAndTab[periodTabKey] = [];
|
|
179
|
+
draft.jeScheduleOneTimeAccrualKeysByPeriodAndTab[periodTabKey] = [];
|
|
129
180
|
}
|
|
130
|
-
draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = [];
|
|
131
181
|
},
|
|
132
182
|
retryJeSchedule(draft, action) {
|
|
133
183
|
const { scheduledJournalEntryID } = action.payload;
|
|
@@ -163,11 +213,13 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
163
213
|
};
|
|
164
214
|
},
|
|
165
215
|
ignoreRecommendedJeSchedule: {
|
|
166
|
-
prepare(jeScheduleTransactionKey, scheduleType) {
|
|
216
|
+
prepare(jeScheduleTransactionKey, scheduleType, reason, note) {
|
|
167
217
|
return {
|
|
168
218
|
payload: {
|
|
169
219
|
jeScheduleTransactionKey,
|
|
170
220
|
scheduleType,
|
|
221
|
+
reason,
|
|
222
|
+
note,
|
|
171
223
|
},
|
|
172
224
|
};
|
|
173
225
|
},
|
|
@@ -183,6 +235,41 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
183
235
|
};
|
|
184
236
|
},
|
|
185
237
|
},
|
|
238
|
+
revertJeSchedule: {
|
|
239
|
+
// jeScheduleTransactionKey is a JEScheduleKey for an accrued schedule, which has no base
|
|
240
|
+
// transaction to derive a transaction key from. It is only ever used as an opaque row
|
|
241
|
+
// identifier here -- for the row's spinner and for dropping the row from the list -- so one
|
|
242
|
+
// action serves both shapes rather than two near-identical ones.
|
|
243
|
+
prepare(jeScheduleId, jeScheduleTransactionKey, scheduleType, reason, note) {
|
|
244
|
+
return {
|
|
245
|
+
payload: {
|
|
246
|
+
jeScheduleId,
|
|
247
|
+
jeScheduleTransactionKey,
|
|
248
|
+
scheduleType,
|
|
249
|
+
reason,
|
|
250
|
+
note,
|
|
251
|
+
},
|
|
252
|
+
};
|
|
253
|
+
},
|
|
254
|
+
reducer(draft, action) {
|
|
255
|
+
draft.revertStatusById[action.payload.jeScheduleTransactionKey] = {
|
|
256
|
+
fetchState: 'In-Progress',
|
|
257
|
+
error: undefined,
|
|
258
|
+
};
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
revertJeScheduleSuccess(draft, action) {
|
|
262
|
+
draft.revertStatusById[action.payload.jeScheduleTransactionKey] = {
|
|
263
|
+
fetchState: 'Completed',
|
|
264
|
+
error: undefined,
|
|
265
|
+
};
|
|
266
|
+
},
|
|
267
|
+
revertJeScheduleFailure(draft, action) {
|
|
268
|
+
draft.revertStatusById[action.payload.jeScheduleTransactionKey] = {
|
|
269
|
+
fetchState: 'Error',
|
|
270
|
+
error: action.payload.status,
|
|
271
|
+
};
|
|
272
|
+
},
|
|
186
273
|
ignoreRecommendedJeScheduleSuccess: {
|
|
187
274
|
reducer(draft, action) {
|
|
188
275
|
const { jeScheduleTransactionKey } = action.payload;
|
|
@@ -215,17 +302,18 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
215
302
|
};
|
|
216
303
|
},
|
|
217
304
|
updateJeScheduleTransactionKeys: {
|
|
218
|
-
prepare(jeScheduleKeys, selectedPeriod) {
|
|
305
|
+
prepare(jeScheduleKeys, selectedPeriod, selectedPageTab) {
|
|
219
306
|
return {
|
|
220
307
|
payload: {
|
|
221
308
|
jeScheduleKeys: jeScheduleKeys,
|
|
222
309
|
selectedPeriod: selectedPeriod,
|
|
310
|
+
selectedPageTab: selectedPageTab,
|
|
223
311
|
},
|
|
224
312
|
};
|
|
225
313
|
},
|
|
226
314
|
reducer(draft, action) {
|
|
227
|
-
const { selectedPeriod, jeScheduleKeys } = action.payload;
|
|
228
|
-
draft.
|
|
315
|
+
const { selectedPeriod, selectedPageTab, jeScheduleKeys } = action.payload;
|
|
316
|
+
draft.jeScheduleTransactionKeysByPeriodAndTab[(0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod))] = jeScheduleKeys;
|
|
229
317
|
},
|
|
230
318
|
},
|
|
231
319
|
removeJeScheduleTransactionKey: {
|
|
@@ -238,12 +326,20 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
238
326
|
};
|
|
239
327
|
},
|
|
240
328
|
reducer(draft, action) {
|
|
241
|
-
const {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
329
|
+
const { jeScheduleKey } = action.payload;
|
|
330
|
+
// Dropped from every tab's slot, not just the visible one: once a schedule is ignored or
|
|
331
|
+
// resolved it must not reappear when the user switches tabs and hits a cached list.
|
|
332
|
+
removeKeyFromEveryTabSlot(draft.jeScheduleTransactionKeysByPeriodAndTab, jeScheduleKey);
|
|
333
|
+
},
|
|
334
|
+
},
|
|
335
|
+
removeJeAccruedScheduleKey: {
|
|
336
|
+
prepare(jeAccruedScheduleKey) {
|
|
337
|
+
return { payload: { jeAccruedScheduleKey } };
|
|
338
|
+
},
|
|
339
|
+
reducer(draft, action) {
|
|
340
|
+
// Accrued keys live in their own per-tab map, so removeJeScheduleTransactionKey cannot drop
|
|
341
|
+
// them -- a reverted accrued schedule stayed on the list until the next fetch.
|
|
342
|
+
removeKeyFromEveryTabSlot(draft.jeScheduleAccruedKeysByPeriodAndTab, action.payload.jeAccruedScheduleKey);
|
|
247
343
|
},
|
|
248
344
|
},
|
|
249
345
|
removeFailedJeScheduleTransactionKey: {
|
|
@@ -256,12 +352,8 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
256
352
|
};
|
|
257
353
|
},
|
|
258
354
|
reducer(draft, action) {
|
|
259
|
-
const {
|
|
260
|
-
|
|
261
|
-
...(draft.failedJeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] ?? []),
|
|
262
|
-
];
|
|
263
|
-
const filteredKeys = prevData.filter((jeKey) => jeKey !== failedJeScheduleKey);
|
|
264
|
-
draft.failedJeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = filteredKeys;
|
|
355
|
+
const { failedJeScheduleKey } = action.payload;
|
|
356
|
+
removeKeyFromEveryTabSlot(draft.failedJeScheduleTransactionKeysByPeriodAndTab, failedJeScheduleKey);
|
|
265
357
|
},
|
|
266
358
|
},
|
|
267
359
|
initializeJeScheduleLocalData: {
|
|
@@ -373,6 +465,182 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
373
465
|
clearJeAccountSettingsLocalData(draft) {
|
|
374
466
|
draft.accountSettings.localData = exports.accountSettingsInitialState.localData;
|
|
375
467
|
},
|
|
468
|
+
initializeNewSchedule: {
|
|
469
|
+
prepare({ scheduleType, shouldResetEnteredData = true, }) {
|
|
470
|
+
return { payload: { scheduleType, shouldResetEnteredData } };
|
|
471
|
+
},
|
|
472
|
+
reducer() {
|
|
473
|
+
// Purely an epic-trigger action — the epic fans out the account/class
|
|
474
|
+
// list fetches, and clears entered data only when asked to.
|
|
475
|
+
},
|
|
476
|
+
},
|
|
477
|
+
resetNewScheduleLocalData: {
|
|
478
|
+
prepare({ scheduleType, }) {
|
|
479
|
+
return { payload: { scheduleType } };
|
|
480
|
+
},
|
|
481
|
+
reducer(draft, action) {
|
|
482
|
+
const { scheduleType } = action.payload;
|
|
483
|
+
draft.newSchedule.newScheduleState[scheduleType] =
|
|
484
|
+
(0, exports.getBaseNewScheduleLocalData)(scheduleType);
|
|
485
|
+
},
|
|
486
|
+
},
|
|
487
|
+
updateNewScheduleLocalData(draft, action) {
|
|
488
|
+
const { scheduleType, localData } = action.payload;
|
|
489
|
+
draft.newSchedule.newScheduleState[scheduleType] = {
|
|
490
|
+
...draft.newSchedule.newScheduleState[scheduleType],
|
|
491
|
+
...localData,
|
|
492
|
+
};
|
|
493
|
+
},
|
|
494
|
+
searchTransactionsForNewSchedule: {
|
|
495
|
+
prepare({ query, scheduleType, }) {
|
|
496
|
+
return { payload: { query, scheduleType } };
|
|
497
|
+
},
|
|
498
|
+
reducer(draft, action) {
|
|
499
|
+
const trimmed = action.payload.query.trim();
|
|
500
|
+
// Cleared or too-short query: no API (see epic) — reset immediately.
|
|
501
|
+
if (trimmed.length < jeSchedulesViewState_1.MIN_NEW_SCHEDULE_SEARCH_LENGTH) {
|
|
502
|
+
draft.newSchedule.searchTransactions = exports.searchTransactionsInitialState;
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
draft.newSchedule.searchTransactions = {
|
|
506
|
+
...draft.newSchedule.searchTransactions,
|
|
507
|
+
searchString: action.payload.query,
|
|
508
|
+
fetchState: 'In-Progress',
|
|
509
|
+
};
|
|
510
|
+
},
|
|
511
|
+
},
|
|
512
|
+
searchTransactionsForNewScheduleSuccess(draft, action) {
|
|
513
|
+
draft.newSchedule.searchTransactions = {
|
|
514
|
+
...draft.newSchedule.searchTransactions,
|
|
515
|
+
searchResults: action.payload.searchResults,
|
|
516
|
+
fetchState: 'Completed',
|
|
517
|
+
error: undefined,
|
|
518
|
+
};
|
|
519
|
+
},
|
|
520
|
+
searchTransactionsForNewScheduleFailure(draft, action) {
|
|
521
|
+
draft.newSchedule.searchTransactions = {
|
|
522
|
+
...draft.newSchedule.searchTransactions,
|
|
523
|
+
fetchState: 'Error',
|
|
524
|
+
error: action.payload.status,
|
|
525
|
+
};
|
|
526
|
+
},
|
|
527
|
+
clearSearchTransactionsForNewSchedule(draft) {
|
|
528
|
+
draft.newSchedule.searchTransactions = exports.searchTransactionsInitialState;
|
|
529
|
+
},
|
|
530
|
+
saveNewSchedule: {
|
|
531
|
+
prepare({ scheduleType, }) {
|
|
532
|
+
return { payload: { scheduleType } };
|
|
533
|
+
},
|
|
534
|
+
reducer(draft) {
|
|
535
|
+
draft.newSchedule.saveStatus = {
|
|
536
|
+
fetchState: 'In-Progress',
|
|
537
|
+
error: undefined,
|
|
538
|
+
};
|
|
539
|
+
},
|
|
540
|
+
},
|
|
541
|
+
saveNewScheduleSuccess(draft) {
|
|
542
|
+
draft.newSchedule.saveStatus = {
|
|
543
|
+
fetchState: 'Completed',
|
|
544
|
+
error: undefined,
|
|
545
|
+
};
|
|
546
|
+
},
|
|
547
|
+
saveNewScheduleFailure(draft, action) {
|
|
548
|
+
draft.newSchedule.saveStatus = {
|
|
549
|
+
fetchState: 'Error',
|
|
550
|
+
error: action.payload.status,
|
|
551
|
+
};
|
|
552
|
+
},
|
|
553
|
+
createOneTimeAccrual: {
|
|
554
|
+
prepare(localData) {
|
|
555
|
+
return { payload: { localData } };
|
|
556
|
+
},
|
|
557
|
+
reducer(draft) {
|
|
558
|
+
draft.newSchedule.createOneTimeAccrualStatus = {
|
|
559
|
+
fetchState: 'In-Progress',
|
|
560
|
+
error: undefined,
|
|
561
|
+
};
|
|
562
|
+
},
|
|
563
|
+
},
|
|
564
|
+
createOneTimeAccrualSuccess(draft) {
|
|
565
|
+
draft.newSchedule.createOneTimeAccrualStatus = {
|
|
566
|
+
fetchState: 'Completed',
|
|
567
|
+
error: undefined,
|
|
568
|
+
};
|
|
569
|
+
},
|
|
570
|
+
createOneTimeAccrualFailure(draft, action) {
|
|
571
|
+
draft.newSchedule.createOneTimeAccrualStatus = {
|
|
572
|
+
fetchState: 'Error',
|
|
573
|
+
error: action.payload.status,
|
|
574
|
+
};
|
|
575
|
+
},
|
|
576
|
+
promoteOneTimeAccrual: {
|
|
577
|
+
prepare(accrualId, amount) {
|
|
578
|
+
return { payload: { accrualId, amount } };
|
|
579
|
+
},
|
|
580
|
+
reducer(draft, action) {
|
|
581
|
+
draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
|
|
582
|
+
fetchState: 'In-Progress',
|
|
583
|
+
error: undefined,
|
|
584
|
+
};
|
|
585
|
+
},
|
|
586
|
+
},
|
|
587
|
+
revertOneTimeAccrual: {
|
|
588
|
+
prepare(accrualId, reason, note) {
|
|
589
|
+
return { payload: { accrualId, reason, note } };
|
|
590
|
+
},
|
|
591
|
+
reducer(draft, action) {
|
|
592
|
+
draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
|
|
593
|
+
fetchState: 'In-Progress',
|
|
594
|
+
error: undefined,
|
|
595
|
+
};
|
|
596
|
+
},
|
|
597
|
+
},
|
|
598
|
+
ignoreOneTimeAccrual: {
|
|
599
|
+
prepare(accrualId, reason, note) {
|
|
600
|
+
return { payload: { accrualId, reason, note } };
|
|
601
|
+
},
|
|
602
|
+
reducer(draft, action) {
|
|
603
|
+
draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
|
|
604
|
+
fetchState: 'In-Progress',
|
|
605
|
+
error: undefined,
|
|
606
|
+
};
|
|
607
|
+
},
|
|
608
|
+
},
|
|
609
|
+
fetchOneTimeAccrual: {
|
|
610
|
+
prepare(accrualId) {
|
|
611
|
+
return { payload: { accrualId } };
|
|
612
|
+
},
|
|
613
|
+
reducer(draft, action) {
|
|
614
|
+
draft.oneTimeAccrualFetchStatusById[action.payload.accrualId] = {
|
|
615
|
+
fetchState: 'In-Progress',
|
|
616
|
+
error: undefined,
|
|
617
|
+
};
|
|
618
|
+
},
|
|
619
|
+
},
|
|
620
|
+
fetchOneTimeAccrualSuccess(draft, action) {
|
|
621
|
+
draft.oneTimeAccrualFetchStatusById[action.payload.accrualId] = {
|
|
622
|
+
fetchState: 'Completed',
|
|
623
|
+
error: undefined,
|
|
624
|
+
};
|
|
625
|
+
},
|
|
626
|
+
fetchOneTimeAccrualFailure(draft, action) {
|
|
627
|
+
draft.oneTimeAccrualFetchStatusById[action.payload.accrualId] = {
|
|
628
|
+
fetchState: 'Error',
|
|
629
|
+
error: action.payload.status,
|
|
630
|
+
};
|
|
631
|
+
},
|
|
632
|
+
oneTimeAccrualActionSuccess(draft, action) {
|
|
633
|
+
draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
|
|
634
|
+
fetchState: 'Completed',
|
|
635
|
+
error: undefined,
|
|
636
|
+
};
|
|
637
|
+
},
|
|
638
|
+
oneTimeAccrualActionFailure(draft, action) {
|
|
639
|
+
draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
|
|
640
|
+
fetchState: 'Error',
|
|
641
|
+
error: action.payload.status,
|
|
642
|
+
};
|
|
643
|
+
},
|
|
376
644
|
updateJESchedulesUIState(draft, action) {
|
|
377
645
|
if (action.payload.sortKey != null) {
|
|
378
646
|
draft.uiState.sortKey = action.payload.sortKey;
|
|
@@ -386,10 +654,21 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
386
654
|
if (action.payload.scrollPosition != null) {
|
|
387
655
|
draft.uiState.scrollPosition = action.payload.scrollPosition;
|
|
388
656
|
}
|
|
389
|
-
if (action.payload.
|
|
390
|
-
draft.uiState.
|
|
657
|
+
if (action.payload.selectedPageTab != null) {
|
|
658
|
+
draft.uiState.selectedPageTab = action.payload.selectedPageTab;
|
|
391
659
|
}
|
|
392
660
|
},
|
|
661
|
+
updateJEScheduleTypeFilter(draft, action) {
|
|
662
|
+
draft.uiState.selectedJETypeFilter = action.payload;
|
|
663
|
+
},
|
|
664
|
+
toggleJEPendingGroupCollapsed(draft) {
|
|
665
|
+
draft.uiState.pendingGroupCollapsed =
|
|
666
|
+
!draft.uiState.pendingGroupCollapsed;
|
|
667
|
+
},
|
|
668
|
+
toggleJECreatedGroupCollapsed(draft) {
|
|
669
|
+
draft.uiState.createdGroupCollapsed =
|
|
670
|
+
!draft.uiState.createdGroupCollapsed;
|
|
671
|
+
},
|
|
393
672
|
clearExpenseAutomationJESchedulesView(draft) {
|
|
394
673
|
Object.assign(draft, exports.initialState);
|
|
395
674
|
},
|
|
@@ -400,7 +679,7 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
400
679
|
});
|
|
401
680
|
},
|
|
402
681
|
});
|
|
403
|
-
_a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchRecommendationForAccountSettings = _a.fetchRecommendationForAccountSettings, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeAccountSettingsView = _a.initializeAccountSettingsView, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.saveAccountSettings = _a.saveAccountSettings, exports.saveAccountSettingsFailure = _a.saveAccountSettingsFailure, exports.saveAccountSettingsLocalData = _a.saveAccountSettingsLocalData, exports.saveAccountSettingsSuccess = _a.saveAccountSettingsSuccess, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJESchedulesUIState = _a.updateJESchedulesUIState, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
|
|
682
|
+
_a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.clearSearchTransactionsForNewSchedule = _a.clearSearchTransactionsForNewSchedule, exports.createOneTimeAccrual = _a.createOneTimeAccrual, exports.createOneTimeAccrualFailure = _a.createOneTimeAccrualFailure, exports.createOneTimeAccrualSuccess = _a.createOneTimeAccrualSuccess, exports.ignoreOneTimeAccrual = _a.ignoreOneTimeAccrual, exports.oneTimeAccrualActionFailure = _a.oneTimeAccrualActionFailure, exports.oneTimeAccrualActionSuccess = _a.oneTimeAccrualActionSuccess, exports.promoteOneTimeAccrual = _a.promoteOneTimeAccrual, exports.revertJeSchedule = _a.revertJeSchedule, exports.revertJeScheduleFailure = _a.revertJeScheduleFailure, exports.revertJeScheduleSuccess = _a.revertJeScheduleSuccess, exports.revertOneTimeAccrual = _a.revertOneTimeAccrual, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchOneTimeAccrual = _a.fetchOneTimeAccrual, exports.fetchOneTimeAccrualFailure = _a.fetchOneTimeAccrualFailure, exports.fetchOneTimeAccrualSuccess = _a.fetchOneTimeAccrualSuccess, exports.fetchRecommendationForAccountSettings = _a.fetchRecommendationForAccountSettings, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeAccountSettingsView = _a.initializeAccountSettingsView, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.initializeNewSchedule = _a.initializeNewSchedule, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeAccruedScheduleKey = _a.removeJeAccruedScheduleKey, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.resetNewScheduleLocalData = _a.resetNewScheduleLocalData, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.saveAccountSettings = _a.saveAccountSettings, exports.saveAccountSettingsFailure = _a.saveAccountSettingsFailure, exports.saveAccountSettingsLocalData = _a.saveAccountSettingsLocalData, exports.saveAccountSettingsSuccess = _a.saveAccountSettingsSuccess, exports.saveNewSchedule = _a.saveNewSchedule, exports.saveNewScheduleFailure = _a.saveNewScheduleFailure, exports.saveNewScheduleSuccess = _a.saveNewScheduleSuccess, exports.searchTransactionsForNewSchedule = _a.searchTransactionsForNewSchedule, exports.searchTransactionsForNewScheduleFailure = _a.searchTransactionsForNewScheduleFailure, exports.searchTransactionsForNewScheduleSuccess = _a.searchTransactionsForNewScheduleSuccess, exports.toggleJECreatedGroupCollapsed = _a.toggleJECreatedGroupCollapsed, exports.toggleJEPendingGroupCollapsed = _a.toggleJEPendingGroupCollapsed, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJESchedulesUIState = _a.updateJESchedulesUIState, exports.updateJEScheduleTypeFilter = _a.updateJEScheduleTypeFilter, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateNewScheduleLocalData = _a.updateNewScheduleLocalData, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
|
|
404
683
|
exports.default = expenseAutomationJESchedulesView.reducer;
|
|
405
684
|
const doUpdateRecommendationForAccountSettings = (draft, payload) => {
|
|
406
685
|
const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = (0, accountTypeRecommendationPayload_1.mapAccountTypeRecommendationPayloadToAccountRecommendationByType)(payload);
|
|
@@ -97,7 +97,7 @@ export declare const fetchMissingReceipts: import("@reduxjs/toolkit").ActionCrea
|
|
|
97
97
|
transactionId: ID;
|
|
98
98
|
}, "expenseAutomationMissingReceiptsView/confirmBulkUploadMatchSuccess">, confirmBulkUploadMatchFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
99
99
|
error: ZeniAPIStatus;
|
|
100
|
-
}, "expenseAutomationMissingReceiptsView/confirmBulkUploadMatchFailure">, setBulkUploadResultsTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"completed" | "unmatched", "expenseAutomationMissingReceiptsView/setBulkUploadResultsTab">, setBulkUploadCompletedSubTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"
|
|
100
|
+
}, "expenseAutomationMissingReceiptsView/confirmBulkUploadMatchFailure">, setBulkUploadResultsTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"completed" | "unmatched", "expenseAutomationMissingReceiptsView/setBulkUploadResultsTab">, setBulkUploadCompletedSubTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"manual" | "all" | "ai_accountant", "expenseAutomationMissingReceiptsView/setBulkUploadCompletedSubTab">, setBulkUploadSortConfig: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
101
101
|
sortKey: BulkUploadSortKey | undefined;
|
|
102
102
|
sortOrder: SortOrder | undefined;
|
|
103
103
|
}, "expenseAutomationMissingReceiptsView/setBulkUploadSortConfig">, clearBulkUpload: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationMissingReceiptsView/clearBulkUpload">, searchTransactionsForManualMatch: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[query: string, pageToken?: string | null | undefined], {
|
|
@@ -68,8 +68,8 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
68
68
|
cotTrackingByTransactionId: COTTransactionTrackingByTransactionId;
|
|
69
69
|
}, "expenseAutomationTransactionsView/updateTransactionCategorization", never, never>, updateCurrentSelectedTransactionCategorizationTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSelectedTab: "review" | "autoCategorized"], {
|
|
70
70
|
newSelectedTab: "review" | "autoCategorized";
|
|
71
|
-
}, "expenseAutomationTransactionsView/updateCurrentSelectedTransactionCategorizationTab", never, never>, updateTransactionCategorizationCompletedSubTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSubTab: "
|
|
72
|
-
newSubTab: "
|
|
71
|
+
}, "expenseAutomationTransactionsView/updateCurrentSelectedTransactionCategorizationTab", never, never>, updateTransactionCategorizationCompletedSubTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSubTab: "manual" | "all" | "ai_accountant"], {
|
|
72
|
+
newSubTab: "manual" | "all" | "ai_accountant";
|
|
73
73
|
}, "expenseAutomationTransactionsView/updateTransactionCategorizationCompletedSubTab", never, never>, updateTransactionGroup: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newGroup: "income" | "expense" | "all"], {
|
|
74
74
|
newGroup: "income" | "expense" | "all";
|
|
75
75
|
}, "expenseAutomationTransactionsView/updateTransactionGroup", never, never>, updateTransactionCategorizationSaveStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", fetchState: FetchState, error?: ZeniAPIStatus<Record<string, unknown>> | undefined], {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { NestedAccountHierarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID';
|
|
2
|
+
import { NestedClassHierarchyForReport } from '../../../commonStateTypes/classesView/nestedClassID';
|
|
3
|
+
import { FetchStateAndError } from '../../../commonStateTypes/common';
|
|
4
|
+
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
5
|
+
import { AccountBase } from '../../../entity/account/accountState';
|
|
6
|
+
import { ClassBase } from '../../../entity/class/classState';
|
|
7
|
+
import { ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
8
|
+
import { ScheduleTransaction } from '../../../entity/transaction/stateTypes/scheduleTransaction';
|
|
9
|
+
import { NewScheduleLocalData, NewScheduleLocalDataFixedAssets } from '../types/jeSchedulesViewState';
|
|
10
|
+
export interface NewScheduleSearchTransactionsView {
|
|
11
|
+
searchTransactionsFetchState: FetchStateAndError;
|
|
12
|
+
searchTransactionsResults: ScheduleTransaction[];
|
|
13
|
+
searchTransactionsString?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Accounts and request status for both accrual creation forms — the one-time accrual and the
|
|
17
|
+
* recurring accrued schedule. Deliberately not NewScheduleView: neither has a base transaction to
|
|
18
|
+
* search, and both need a second account hierarchy (the accrued liability) that no schedule type
|
|
19
|
+
* has. A one-time accrual additionally has no local-data slot in newScheduleState, since it is not
|
|
20
|
+
* a schedule type at all.
|
|
21
|
+
*/
|
|
22
|
+
export interface NewAccrualAccountsView {
|
|
23
|
+
accountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
24
|
+
accruedAccountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
25
|
+
accruedScheduleSaveStatus: FetchStateAndError;
|
|
26
|
+
allAccountList: AccountBase[];
|
|
27
|
+
allAccruedExpenseList: AccountBase[];
|
|
28
|
+
allClassList: ClassBase[];
|
|
29
|
+
classListNestedAccountHierarchy: NestedClassHierarchyForReport[];
|
|
30
|
+
createStatus: FetchStateAndError;
|
|
31
|
+
}
|
|
32
|
+
export interface NewScheduleView extends SelectorView, NewScheduleSearchTransactionsView {
|
|
33
|
+
accountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
34
|
+
allAccountList: AccountBase[];
|
|
35
|
+
allClassList: ClassBase[];
|
|
36
|
+
classListNestedAccountHierarchy: NestedClassHierarchyForReport[];
|
|
37
|
+
newScheduleLocalData: NewScheduleLocalData | NewScheduleLocalDataFixedAssets;
|
|
38
|
+
saveStatus: FetchStateAndError;
|
|
39
|
+
scheduleType: ScheduleTypes;
|
|
40
|
+
allDepreciationAccountList?: AccountBase[];
|
|
41
|
+
allDepreciationAccountListNestedAccountHierarchy?: NestedAccountHierarchyForReport[];
|
|
42
|
+
}
|
|
@@ -4,12 +4,31 @@ import { CompletionStatusType, FetchStateAndError, ID } from '../../../commonSta
|
|
|
4
4
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
5
5
|
import { AccountBase } from '../../../entity/account/accountState';
|
|
6
6
|
import { ClassBase } from '../../../entity/class/classState';
|
|
7
|
-
import {
|
|
8
|
-
import { JEScheduleTransactionKey } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
7
|
+
import { JEScheduleKey, JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
9
8
|
import { UncategorizedAccounts } from '../../accountList/accountListSelector';
|
|
10
9
|
import { JEAccountSettingsView } from '../selectorTypes/jeAccountSettingsViewSelectorTypes';
|
|
11
10
|
import { JEScheduledTransactionWithFailedEntries } from '../selectors/jeScheduledTransactionWithFailedEntries';
|
|
12
|
-
import {
|
|
11
|
+
import { NewScheduleView } from '../selectorTypes/jeNewScheduleViewSelectorTypes';
|
|
12
|
+
import { JEScheduleRow } from '../selectors/jeSchedulesViewSelector';
|
|
13
|
+
import { JEPageTab, JEScheduleLocalData, JESchedulesViewUIState } from '../types/jeSchedulesViewState';
|
|
14
|
+
export interface JEKpiSummary {
|
|
15
|
+
aiAccountant: {
|
|
16
|
+
amount: number;
|
|
17
|
+
count: number;
|
|
18
|
+
};
|
|
19
|
+
manual: {
|
|
20
|
+
amount: number;
|
|
21
|
+
count: number;
|
|
22
|
+
};
|
|
23
|
+
needsReview: {
|
|
24
|
+
amount: number;
|
|
25
|
+
count: number;
|
|
26
|
+
};
|
|
27
|
+
total: {
|
|
28
|
+
amount: number;
|
|
29
|
+
count: number;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
13
32
|
export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
|
|
14
33
|
accountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
15
34
|
accountSettingsView: JEAccountSettingsView;
|
|
@@ -18,16 +37,26 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
|
|
|
18
37
|
allDepreciationAccountList: AccountBase[];
|
|
19
38
|
allDepreciationAccountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
20
39
|
classListNestedAccountHierarchy: NestedClassHierarchyForReport[];
|
|
21
|
-
completedSchedules: JEScheduledTransaction[];
|
|
22
40
|
completionStatus: CompletionStatusType;
|
|
23
|
-
|
|
41
|
+
createdSchedules: JEScheduleRow[];
|
|
42
|
+
createdTotal: number;
|
|
43
|
+
hasLoadedForSelectedTab: boolean;
|
|
24
44
|
ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
|
|
25
45
|
jeScheduleLocalDataById: Record<ID, JEScheduleLocalData>;
|
|
26
|
-
|
|
27
|
-
|
|
46
|
+
jeScheduleTypeCounts: {
|
|
47
|
+
active: Record<ScheduleTypes, number>;
|
|
48
|
+
ongoing: Record<ScheduleTypes, number>;
|
|
49
|
+
};
|
|
50
|
+
kpiSummary: JEKpiSummary;
|
|
51
|
+
newScheduleView: NewScheduleView | undefined;
|
|
52
|
+
oneTimeAccrualActionStatusById: Record<ID, FetchStateAndError>;
|
|
53
|
+
pendingReviewSchedules: JEScheduleRow[];
|
|
54
|
+
pendingReviewTotal: number;
|
|
28
55
|
postStatusById: Record<ID, FetchStateAndError>;
|
|
29
56
|
refreshStatus: FetchStateAndError;
|
|
30
57
|
resolveSchedules: JEScheduledTransactionWithFailedEntries[];
|
|
58
|
+
revertStatusById: Record<JEScheduleKey | JEScheduleTransactionKey, FetchStateAndError>;
|
|
59
|
+
scheduleCountsByTab: Partial<Record<JEPageTab, number>>;
|
|
31
60
|
uiState: JESchedulesViewUIState;
|
|
32
61
|
uncategorizedAccounts: UncategorizedAccounts;
|
|
33
62
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RootState } from '../../../reducer';
|
|
2
|
+
import { NewAccrualAccountsView, NewScheduleSearchTransactionsView, NewScheduleView } from '../selectorTypes/jeNewScheduleViewSelectorTypes';
|
|
3
|
+
/**
|
|
4
|
+
* The Base Transaction search is shared across schedule types (one search
|
|
5
|
+
* box, not one per prepaid_expenses/fixed_assets) — split out from
|
|
6
|
+
* getNewScheduleView so a consumer can read it without supplying an
|
|
7
|
+
* otherwise-irrelevant scheduleType.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getNewScheduleSearchTransactionsView: (state: RootState) => NewScheduleSearchTransactionsView;
|
|
10
|
+
/**
|
|
11
|
+
* Account + class options and request status shared by both accrual creation forms — the one-time
|
|
12
|
+
* accrual and the recurring accrued schedule.
|
|
13
|
+
*
|
|
14
|
+
* getAccountsTypesForScheduleDetails('accrued_expenses') deliberately includes
|
|
15
|
+
* other_current_liabilities, because the accrued liability accounts live there —
|
|
16
|
+
* so the debit list has to subtract them back out, and the credit list keeps only
|
|
17
|
+
* them. Mirrors getScheduleAccruedDetailView, which is the form this one is
|
|
18
|
+
* modelled on.
|
|
19
|
+
*/
|
|
20
|
+
export declare const getNewAccrualAccountsView: (state: RootState) => NewAccrualAccountsView;
|
|
21
|
+
export declare const getNewScheduleView: (state: RootState, scheduleType: "fixed_assets" | "prepaid_expenses") => NewScheduleView;
|