@zeniai/client-epic-state 5.2.7-betaRD1 → 5.2.8
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 +22 -0
- package/lib/entity/invoicing/invoicingCommonPayload.js +51 -10
- package/lib/entity/jeSchedules/jeScheduleHelper.d.ts +0 -1
- package/lib/entity/jeSchedules/jeScheduleHelper.js +0 -7
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +1 -66
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +0 -135
- package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +2 -4
- package/lib/entity/jeSchedules/jeSchedulesReducer.js +2 -30
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +2 -11
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +3 -38
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +1 -79
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +1 -24
- package/lib/entity/jeSchedules/jeSchedulesTypes.js +1 -88
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -3
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +0 -2
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +0 -2
- package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +0 -2
- package/lib/epic.d.ts +1 -9
- package/lib/epic.js +0 -16
- package/lib/esm/entity/invoicing/invoicingCommonPayload.js +51 -10
- package/lib/esm/entity/jeSchedules/jeScheduleHelper.js +0 -6
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +1 -135
- package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +2 -30
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +2 -36
- package/lib/esm/entity/jeSchedules/jeSchedulesTypes.js +0 -78
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -3
- package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +0 -2
- package/lib/esm/epic.js +0 -16
- package/lib/esm/index.js +8 -14
- package/lib/esm/view/accountList/accountListReducer.js +0 -1
- package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +3 -6
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +5 -41
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +2 -14
- package/lib/esm/view/expenseAutomationView/payload/jeSchedulesPayload.js +0 -55
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +29 -306
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +22 -294
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +6 -5
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +2 -1
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +2 -0
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingAccountingPickersEpic.js +10 -5
- package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +27 -3
- package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +7 -3
- package/lib/esm/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
- package/lib/esm/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +2 -7
- package/lib/esm/view/scheduleView/scheduleListView/scheduleListReducer.js +3 -5
- package/lib/index.d.ts +12 -17
- package/lib/index.js +47 -91
- package/lib/view/accountList/accountListReducer.js +0 -1
- package/lib/view/accountList/accountListState.d.ts +1 -1
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +3 -6
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +2 -3
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +3 -39
- package/lib/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +2 -14
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +3 -72
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.js +1 -58
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +12 -91
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +29 -308
- 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/jeSchedulesSelectorTypes.d.ts +7 -36
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +0 -34
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +21 -302
- package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +8 -82
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -8
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +1 -1
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.d.ts +5 -0
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +1 -0
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.d.ts +1 -0
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +2 -0
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingAccountingPickersEpic.js +10 -5
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.d.ts +9 -1
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +30 -4
- package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +11 -4
- package/lib/view/invoicing/settingsView/settingsViewSelector.js +7 -3
- package/lib/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
- package/lib/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +2 -7
- package/lib/view/scheduleView/scheduleListView/scheduleListReducer.d.ts +2 -4
- package/lib/view/scheduleView/scheduleListView/scheduleListReducer.js +3 -5
- package/package.json +1 -1
- package/lib/commonStateTypes/selectorTypes/pickAndMergeForecastSection.d.ts +0 -0
- package/lib/commonStateTypes/selectorTypes/pickAndMergeForecastSection.js +0 -1
- package/lib/entity/invoicing/coupon/couponConstants.d.ts +0 -11
- package/lib/entity/invoicing/coupon/couponConstants.js +0 -29
- package/lib/esm/commonStateTypes/selectorTypes/pickAndMergeForecastSection.js +0 -1
- package/lib/esm/entity/invoicing/coupon/couponConstants.js +0 -26
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +0 -45
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +0 -81
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +0 -25
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +0 -110
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +0 -79
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +0 -139
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +0 -106
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +0 -22
- package/lib/esm/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +0 -140
- package/lib/esm/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +0 -1
- package/lib/esm/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +0 -106
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.js +0 -25
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.js +0 -15
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +0 -18
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +0 -18
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +0 -18
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.js +0 -16
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.js +0 -1
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +0 -60
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.js +0 -12
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.js +0 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.d.ts +0 -20
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +0 -49
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +0 -85
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +0 -29
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.d.ts +0 -45
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +0 -114
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +0 -83
- package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.d.ts +0 -12
- package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +0 -146
- package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.d.ts +0 -64
- package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +0 -110
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +0 -6
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +0 -26
- package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.d.ts +0 -36
- package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +0 -145
- package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.d.ts +0 -42
- package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +0 -2
- package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.d.ts +0 -21
- package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +0 -112
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.d.ts +0 -6
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.js +0 -29
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.d.ts +0 -6
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.js +0 -19
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.d.ts +0 -8
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +0 -22
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.d.ts +0 -8
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +0 -22
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.d.ts +0 -8
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +0 -22
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.d.ts +0 -13
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.js +0 -20
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.d.ts +0 -11
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.js +0 -2
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.d.ts +0 -7
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +0 -64
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.d.ts +0 -12
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.js +0 -15
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.d.ts +0 -9
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.js +0 -2
|
@@ -2,16 +2,9 @@ import { createSlice } from '@reduxjs/toolkit';
|
|
|
2
2
|
import { geNestedAccountIDHierarchyForReport } from '../../../commonStateTypes/accountView/getNestedAccountIDHierarchyForReport';
|
|
3
3
|
import { toMonthYearPeriodId, } from '../../../commonStateTypes/timePeriod';
|
|
4
4
|
import { mapAccountBasePayloadToAccountBase, mapAccountMetadataPayloadToAccountMetadata, } from '../../../entity/account/accountPayload';
|
|
5
|
-
import {
|
|
6
|
-
import { getJEScheduleKey, getJEScheduleTransactionDetailKeyPayload, } from '../../../entity/jeSchedules/jeSchedulesPayload';
|
|
5
|
+
import { getJEScheduleTransactionDetailKeyPayload, } from '../../../entity/jeSchedules/jeSchedulesPayload';
|
|
7
6
|
import { clearAll } from '../../../rootActions';
|
|
8
7
|
import { mapAccountTypeRecommendationPayloadToAccountRecommendationByType, } from '../../accountMappingView/accountTypeRecommendation/accountTypeRecommendationPayload';
|
|
9
|
-
import { MIN_NEW_SCHEDULE_SEARCH_LENGTH, getJESchedulePeriodTabKey, } from '../types/jeSchedulesViewState';
|
|
10
|
-
function removeKeyFromEveryTabSlot(keysByPeriodAndTab, keyToRemove) {
|
|
11
|
-
for (const periodTabKey of Object.keys(keysByPeriodAndTab)) {
|
|
12
|
-
keysByPeriodAndTab[periodTabKey] = keysByPeriodAndTab[periodTabKey].filter((jeScheduleKey) => jeScheduleKey !== keyToRemove);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
8
|
export const accountSettingsInitialState = {
|
|
16
9
|
localData: {
|
|
17
10
|
selectedPrepaidExpensesAccountIds: [],
|
|
@@ -43,37 +36,16 @@ export const accountSettingsInitialState = {
|
|
|
43
36
|
accruedExpensesNestedAccountListHierarchy: [],
|
|
44
37
|
accruedExpensesRecommendations: [],
|
|
45
38
|
};
|
|
46
|
-
export const getBaseNewScheduleLocalData = (scheduleType) => ({
|
|
47
|
-
scheduleType,
|
|
48
|
-
jeScheduleDetails: [],
|
|
49
|
-
});
|
|
50
|
-
export const newScheduleInitialState = {
|
|
51
|
-
fixed_assets: getBaseNewScheduleLocalData('fixed_assets'),
|
|
52
|
-
prepaid_expenses: getBaseNewScheduleLocalData('prepaid_expenses'),
|
|
53
|
-
};
|
|
54
|
-
export const searchTransactionsInitialState = {
|
|
55
|
-
searchResults: [],
|
|
56
|
-
fetchState: 'Not-Started',
|
|
57
|
-
error: undefined,
|
|
58
|
-
};
|
|
59
39
|
export const initialState = {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
jeScheduleOneTimeAccrualKeysByPeriodAndTab: {},
|
|
63
|
-
failedJeScheduleTransactionKeysByPeriodAndTab: {},
|
|
40
|
+
jeScheduleTransactionKeysByPeriod: {},
|
|
41
|
+
failedJeScheduleTransactionKeysByPeriod: {},
|
|
64
42
|
postStatusById: {},
|
|
65
43
|
ignoreStatusById: {},
|
|
66
|
-
revertStatusById: {},
|
|
67
44
|
jeScheduleLocalDataById: {},
|
|
68
|
-
oneTimeAccrualActionStatusById: {},
|
|
69
|
-
oneTimeAccrualFetchStatusById: {},
|
|
70
45
|
uiState: {
|
|
71
|
-
createdGroupCollapsed: false,
|
|
72
|
-
pendingGroupCollapsed: false,
|
|
73
|
-
scrollPosition: { scrollTop: 0, scrollLeft: undefined },
|
|
74
46
|
searchString: '',
|
|
75
|
-
|
|
76
|
-
|
|
47
|
+
scrollPosition: { scrollTop: 0, scrollLeft: undefined },
|
|
48
|
+
selectedMainTab: 'pending_review',
|
|
77
49
|
sortKey: 'transactionDate',
|
|
78
50
|
sortOrder: 'descending',
|
|
79
51
|
totalCount: 0,
|
|
@@ -84,14 +56,6 @@ export const initialState = {
|
|
|
84
56
|
error: undefined,
|
|
85
57
|
},
|
|
86
58
|
accountSettings: accountSettingsInitialState,
|
|
87
|
-
newSchedule: {
|
|
88
|
-
createOneTimeAccrualStatus: { fetchState: 'Not-Started', error: undefined },
|
|
89
|
-
newScheduleState: newScheduleInitialState,
|
|
90
|
-
saveStatus: { fetchState: 'Not-Started', error: undefined },
|
|
91
|
-
searchTransactions: searchTransactionsInitialState,
|
|
92
|
-
fetchState: 'Not-Started',
|
|
93
|
-
error: undefined,
|
|
94
|
-
},
|
|
95
59
|
fetchState: 'Not-Started',
|
|
96
60
|
error: undefined,
|
|
97
61
|
hasValidState() {
|
|
@@ -136,12 +100,9 @@ const expenseAutomationJESchedulesView = createSlice({
|
|
|
136
100
|
},
|
|
137
101
|
},
|
|
138
102
|
fetchJeSchedulesSuccess(draft, action) {
|
|
139
|
-
const { jeSchedules, selectedPeriod,
|
|
140
|
-
const periodTabKey = getJESchedulePeriodTabKey(selectedPageTab, toMonthYearPeriodId(selectedPeriod));
|
|
103
|
+
const { jeSchedules, selectedPeriod, failedJeSchedules, refreshViewInBackground, } = action.payload;
|
|
141
104
|
const jeScheduleTransactionKeys = jeSchedules.map((schedules) => getJEScheduleTransactionDetailKeyPayload(schedules.base_transaction));
|
|
142
105
|
const failedJeScheduleTransactionKeys = failedJeSchedules.map((schedules) => getJEScheduleTransactionDetailKeyPayload(schedules.base_transaction));
|
|
143
|
-
const jeScheduleAccruedKeys = accruedJeSchedules.map((schedule) => getJEScheduleKey(schedule));
|
|
144
|
-
const jeScheduleOneTimeAccrualKeys = oneTimeAccruals.map((accrual) => generateJEOneTimeAccrualKey(accrual._id));
|
|
145
106
|
if (refreshViewInBackground === true &&
|
|
146
107
|
draft.refreshStatus.fetchState === 'In-Progress') {
|
|
147
108
|
draft.refreshStatus = { fetchState: 'Completed', error: undefined };
|
|
@@ -150,28 +111,19 @@ const expenseAutomationJESchedulesView = createSlice({
|
|
|
150
111
|
draft.fetchState = 'Completed';
|
|
151
112
|
draft.error = undefined;
|
|
152
113
|
}
|
|
153
|
-
draft.
|
|
154
|
-
|
|
155
|
-
draft.jeScheduleAccruedKeysByPeriodAndTab[periodTabKey] =
|
|
156
|
-
jeScheduleAccruedKeys;
|
|
157
|
-
draft.jeScheduleOneTimeAccrualKeysByPeriodAndTab[periodTabKey] =
|
|
158
|
-
jeScheduleOneTimeAccrualKeys;
|
|
159
|
-
draft.failedJeScheduleTransactionKeysByPeriodAndTab[periodTabKey] =
|
|
160
|
-
failedJeScheduleTransactionKeys;
|
|
114
|
+
draft.jeScheduleTransactionKeysByPeriod[toMonthYearPeriodId(selectedPeriod)] = jeScheduleTransactionKeys;
|
|
115
|
+
draft.failedJeScheduleTransactionKeysByPeriod[toMonthYearPeriodId(selectedPeriod)] = failedJeScheduleTransactionKeys;
|
|
161
116
|
},
|
|
162
117
|
fetchJeSchedulesFailure(draft, action) {
|
|
163
|
-
const { status, selectedPeriod
|
|
164
|
-
const periodTabKey = getJESchedulePeriodTabKey(selectedPageTab, toMonthYearPeriodId(selectedPeriod));
|
|
118
|
+
const { status, selectedPeriod } = action.payload;
|
|
165
119
|
if (draft.refreshStatus.fetchState === 'In-Progress') {
|
|
166
120
|
draft.refreshStatus = { fetchState: 'Error', error: status };
|
|
167
121
|
}
|
|
168
122
|
else {
|
|
169
123
|
draft.fetchState = 'Error';
|
|
170
124
|
draft.error = status;
|
|
171
|
-
draft.jeScheduleTransactionKeysByPeriodAndTab[periodTabKey] = [];
|
|
172
|
-
draft.jeScheduleAccruedKeysByPeriodAndTab[periodTabKey] = [];
|
|
173
|
-
draft.jeScheduleOneTimeAccrualKeysByPeriodAndTab[periodTabKey] = [];
|
|
174
125
|
}
|
|
126
|
+
draft.jeScheduleTransactionKeysByPeriod[toMonthYearPeriodId(selectedPeriod)] = [];
|
|
175
127
|
},
|
|
176
128
|
retryJeSchedule(draft, action) {
|
|
177
129
|
const { scheduledJournalEntryID } = action.payload;
|
|
@@ -207,13 +159,11 @@ const expenseAutomationJESchedulesView = createSlice({
|
|
|
207
159
|
};
|
|
208
160
|
},
|
|
209
161
|
ignoreRecommendedJeSchedule: {
|
|
210
|
-
prepare(jeScheduleTransactionKey, scheduleType
|
|
162
|
+
prepare(jeScheduleTransactionKey, scheduleType) {
|
|
211
163
|
return {
|
|
212
164
|
payload: {
|
|
213
165
|
jeScheduleTransactionKey,
|
|
214
166
|
scheduleType,
|
|
215
|
-
reason,
|
|
216
|
-
note,
|
|
217
167
|
},
|
|
218
168
|
};
|
|
219
169
|
},
|
|
@@ -229,41 +179,6 @@ const expenseAutomationJESchedulesView = createSlice({
|
|
|
229
179
|
};
|
|
230
180
|
},
|
|
231
181
|
},
|
|
232
|
-
revertJeSchedule: {
|
|
233
|
-
// jeScheduleTransactionKey is a JEScheduleKey for an accrued schedule, which has no base
|
|
234
|
-
// transaction to derive a transaction key from. It is only ever used as an opaque row
|
|
235
|
-
// identifier here -- for the row's spinner and for dropping the row from the list -- so one
|
|
236
|
-
// action serves both shapes rather than two near-identical ones.
|
|
237
|
-
prepare(jeScheduleId, jeScheduleTransactionKey, scheduleType, reason, note) {
|
|
238
|
-
return {
|
|
239
|
-
payload: {
|
|
240
|
-
jeScheduleId,
|
|
241
|
-
jeScheduleTransactionKey,
|
|
242
|
-
scheduleType,
|
|
243
|
-
reason,
|
|
244
|
-
note,
|
|
245
|
-
},
|
|
246
|
-
};
|
|
247
|
-
},
|
|
248
|
-
reducer(draft, action) {
|
|
249
|
-
draft.revertStatusById[action.payload.jeScheduleTransactionKey] = {
|
|
250
|
-
fetchState: 'In-Progress',
|
|
251
|
-
error: undefined,
|
|
252
|
-
};
|
|
253
|
-
},
|
|
254
|
-
},
|
|
255
|
-
revertJeScheduleSuccess(draft, action) {
|
|
256
|
-
draft.revertStatusById[action.payload.jeScheduleTransactionKey] = {
|
|
257
|
-
fetchState: 'Completed',
|
|
258
|
-
error: undefined,
|
|
259
|
-
};
|
|
260
|
-
},
|
|
261
|
-
revertJeScheduleFailure(draft, action) {
|
|
262
|
-
draft.revertStatusById[action.payload.jeScheduleTransactionKey] = {
|
|
263
|
-
fetchState: 'Error',
|
|
264
|
-
error: action.payload.status,
|
|
265
|
-
};
|
|
266
|
-
},
|
|
267
182
|
ignoreRecommendedJeScheduleSuccess: {
|
|
268
183
|
reducer(draft, action) {
|
|
269
184
|
const { jeScheduleTransactionKey } = action.payload;
|
|
@@ -296,18 +211,17 @@ const expenseAutomationJESchedulesView = createSlice({
|
|
|
296
211
|
};
|
|
297
212
|
},
|
|
298
213
|
updateJeScheduleTransactionKeys: {
|
|
299
|
-
prepare(jeScheduleKeys, selectedPeriod
|
|
214
|
+
prepare(jeScheduleKeys, selectedPeriod) {
|
|
300
215
|
return {
|
|
301
216
|
payload: {
|
|
302
217
|
jeScheduleKeys: jeScheduleKeys,
|
|
303
218
|
selectedPeriod: selectedPeriod,
|
|
304
|
-
selectedPageTab: selectedPageTab,
|
|
305
219
|
},
|
|
306
220
|
};
|
|
307
221
|
},
|
|
308
222
|
reducer(draft, action) {
|
|
309
|
-
const { selectedPeriod,
|
|
310
|
-
draft.
|
|
223
|
+
const { selectedPeriod, jeScheduleKeys } = action.payload;
|
|
224
|
+
draft.jeScheduleTransactionKeysByPeriod[toMonthYearPeriodId(selectedPeriod)] = jeScheduleKeys;
|
|
311
225
|
},
|
|
312
226
|
},
|
|
313
227
|
removeJeScheduleTransactionKey: {
|
|
@@ -320,20 +234,12 @@ const expenseAutomationJESchedulesView = createSlice({
|
|
|
320
234
|
};
|
|
321
235
|
},
|
|
322
236
|
reducer(draft, action) {
|
|
323
|
-
const { jeScheduleKey } = action.payload;
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
removeJeAccruedScheduleKey: {
|
|
330
|
-
prepare(jeAccruedScheduleKey) {
|
|
331
|
-
return { payload: { jeAccruedScheduleKey } };
|
|
332
|
-
},
|
|
333
|
-
reducer(draft, action) {
|
|
334
|
-
// Accrued keys live in their own per-tab map, so removeJeScheduleTransactionKey cannot drop
|
|
335
|
-
// them -- a reverted accrued schedule stayed on the list until the next fetch.
|
|
336
|
-
removeKeyFromEveryTabSlot(draft.jeScheduleAccruedKeysByPeriodAndTab, action.payload.jeAccruedScheduleKey);
|
|
237
|
+
const { selectedPeriod, jeScheduleKey } = action.payload;
|
|
238
|
+
const prevData = [
|
|
239
|
+
...(draft.jeScheduleTransactionKeysByPeriod[toMonthYearPeriodId(selectedPeriod)] ?? []),
|
|
240
|
+
];
|
|
241
|
+
const filteredKeys = prevData.filter((jeKey) => jeKey !== jeScheduleKey);
|
|
242
|
+
draft.jeScheduleTransactionKeysByPeriod[toMonthYearPeriodId(selectedPeriod)] = filteredKeys;
|
|
337
243
|
},
|
|
338
244
|
},
|
|
339
245
|
removeFailedJeScheduleTransactionKey: {
|
|
@@ -346,8 +252,12 @@ const expenseAutomationJESchedulesView = createSlice({
|
|
|
346
252
|
};
|
|
347
253
|
},
|
|
348
254
|
reducer(draft, action) {
|
|
349
|
-
const { failedJeScheduleKey } = action.payload;
|
|
350
|
-
|
|
255
|
+
const { selectedPeriod, failedJeScheduleKey } = action.payload;
|
|
256
|
+
const prevData = [
|
|
257
|
+
...(draft.failedJeScheduleTransactionKeysByPeriod[toMonthYearPeriodId(selectedPeriod)] ?? []),
|
|
258
|
+
];
|
|
259
|
+
const filteredKeys = prevData.filter((jeKey) => jeKey !== failedJeScheduleKey);
|
|
260
|
+
draft.failedJeScheduleTransactionKeysByPeriod[toMonthYearPeriodId(selectedPeriod)] = filteredKeys;
|
|
351
261
|
},
|
|
352
262
|
},
|
|
353
263
|
initializeJeScheduleLocalData: {
|
|
@@ -459,182 +369,6 @@ const expenseAutomationJESchedulesView = createSlice({
|
|
|
459
369
|
clearJeAccountSettingsLocalData(draft) {
|
|
460
370
|
draft.accountSettings.localData = accountSettingsInitialState.localData;
|
|
461
371
|
},
|
|
462
|
-
initializeNewSchedule: {
|
|
463
|
-
prepare({ scheduleType, shouldResetEnteredData = true, }) {
|
|
464
|
-
return { payload: { scheduleType, shouldResetEnteredData } };
|
|
465
|
-
},
|
|
466
|
-
reducer() {
|
|
467
|
-
// Purely an epic-trigger action — the epic fans out the account/class
|
|
468
|
-
// list fetches, and clears entered data only when asked to.
|
|
469
|
-
},
|
|
470
|
-
},
|
|
471
|
-
resetNewScheduleLocalData: {
|
|
472
|
-
prepare({ scheduleType, }) {
|
|
473
|
-
return { payload: { scheduleType } };
|
|
474
|
-
},
|
|
475
|
-
reducer(draft, action) {
|
|
476
|
-
const { scheduleType } = action.payload;
|
|
477
|
-
draft.newSchedule.newScheduleState[scheduleType] =
|
|
478
|
-
getBaseNewScheduleLocalData(scheduleType);
|
|
479
|
-
},
|
|
480
|
-
},
|
|
481
|
-
updateNewScheduleLocalData(draft, action) {
|
|
482
|
-
const { scheduleType, localData } = action.payload;
|
|
483
|
-
draft.newSchedule.newScheduleState[scheduleType] = {
|
|
484
|
-
...draft.newSchedule.newScheduleState[scheduleType],
|
|
485
|
-
...localData,
|
|
486
|
-
};
|
|
487
|
-
},
|
|
488
|
-
searchTransactionsForNewSchedule: {
|
|
489
|
-
prepare({ query, scheduleType, }) {
|
|
490
|
-
return { payload: { query, scheduleType } };
|
|
491
|
-
},
|
|
492
|
-
reducer(draft, action) {
|
|
493
|
-
const trimmed = action.payload.query.trim();
|
|
494
|
-
// Cleared or too-short query: no API (see epic) — reset immediately.
|
|
495
|
-
if (trimmed.length < MIN_NEW_SCHEDULE_SEARCH_LENGTH) {
|
|
496
|
-
draft.newSchedule.searchTransactions = searchTransactionsInitialState;
|
|
497
|
-
return;
|
|
498
|
-
}
|
|
499
|
-
draft.newSchedule.searchTransactions = {
|
|
500
|
-
...draft.newSchedule.searchTransactions,
|
|
501
|
-
searchString: action.payload.query,
|
|
502
|
-
fetchState: 'In-Progress',
|
|
503
|
-
};
|
|
504
|
-
},
|
|
505
|
-
},
|
|
506
|
-
searchTransactionsForNewScheduleSuccess(draft, action) {
|
|
507
|
-
draft.newSchedule.searchTransactions = {
|
|
508
|
-
...draft.newSchedule.searchTransactions,
|
|
509
|
-
searchResults: action.payload.searchResults,
|
|
510
|
-
fetchState: 'Completed',
|
|
511
|
-
error: undefined,
|
|
512
|
-
};
|
|
513
|
-
},
|
|
514
|
-
searchTransactionsForNewScheduleFailure(draft, action) {
|
|
515
|
-
draft.newSchedule.searchTransactions = {
|
|
516
|
-
...draft.newSchedule.searchTransactions,
|
|
517
|
-
fetchState: 'Error',
|
|
518
|
-
error: action.payload.status,
|
|
519
|
-
};
|
|
520
|
-
},
|
|
521
|
-
clearSearchTransactionsForNewSchedule(draft) {
|
|
522
|
-
draft.newSchedule.searchTransactions = searchTransactionsInitialState;
|
|
523
|
-
},
|
|
524
|
-
saveNewSchedule: {
|
|
525
|
-
prepare({ scheduleType, }) {
|
|
526
|
-
return { payload: { scheduleType } };
|
|
527
|
-
},
|
|
528
|
-
reducer(draft) {
|
|
529
|
-
draft.newSchedule.saveStatus = {
|
|
530
|
-
fetchState: 'In-Progress',
|
|
531
|
-
error: undefined,
|
|
532
|
-
};
|
|
533
|
-
},
|
|
534
|
-
},
|
|
535
|
-
saveNewScheduleSuccess(draft) {
|
|
536
|
-
draft.newSchedule.saveStatus = {
|
|
537
|
-
fetchState: 'Completed',
|
|
538
|
-
error: undefined,
|
|
539
|
-
};
|
|
540
|
-
},
|
|
541
|
-
saveNewScheduleFailure(draft, action) {
|
|
542
|
-
draft.newSchedule.saveStatus = {
|
|
543
|
-
fetchState: 'Error',
|
|
544
|
-
error: action.payload.status,
|
|
545
|
-
};
|
|
546
|
-
},
|
|
547
|
-
createOneTimeAccrual: {
|
|
548
|
-
prepare(localData) {
|
|
549
|
-
return { payload: { localData } };
|
|
550
|
-
},
|
|
551
|
-
reducer(draft) {
|
|
552
|
-
draft.newSchedule.createOneTimeAccrualStatus = {
|
|
553
|
-
fetchState: 'In-Progress',
|
|
554
|
-
error: undefined,
|
|
555
|
-
};
|
|
556
|
-
},
|
|
557
|
-
},
|
|
558
|
-
createOneTimeAccrualSuccess(draft) {
|
|
559
|
-
draft.newSchedule.createOneTimeAccrualStatus = {
|
|
560
|
-
fetchState: 'Completed',
|
|
561
|
-
error: undefined,
|
|
562
|
-
};
|
|
563
|
-
},
|
|
564
|
-
createOneTimeAccrualFailure(draft, action) {
|
|
565
|
-
draft.newSchedule.createOneTimeAccrualStatus = {
|
|
566
|
-
fetchState: 'Error',
|
|
567
|
-
error: action.payload.status,
|
|
568
|
-
};
|
|
569
|
-
},
|
|
570
|
-
promoteOneTimeAccrual: {
|
|
571
|
-
prepare(accrualId, amount) {
|
|
572
|
-
return { payload: { accrualId, amount } };
|
|
573
|
-
},
|
|
574
|
-
reducer(draft, action) {
|
|
575
|
-
draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
|
|
576
|
-
fetchState: 'In-Progress',
|
|
577
|
-
error: undefined,
|
|
578
|
-
};
|
|
579
|
-
},
|
|
580
|
-
},
|
|
581
|
-
revertOneTimeAccrual: {
|
|
582
|
-
prepare(accrualId, reason, note) {
|
|
583
|
-
return { payload: { accrualId, reason, note } };
|
|
584
|
-
},
|
|
585
|
-
reducer(draft, action) {
|
|
586
|
-
draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
|
|
587
|
-
fetchState: 'In-Progress',
|
|
588
|
-
error: undefined,
|
|
589
|
-
};
|
|
590
|
-
},
|
|
591
|
-
},
|
|
592
|
-
ignoreOneTimeAccrual: {
|
|
593
|
-
prepare(accrualId, reason, note) {
|
|
594
|
-
return { payload: { accrualId, reason, note } };
|
|
595
|
-
},
|
|
596
|
-
reducer(draft, action) {
|
|
597
|
-
draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
|
|
598
|
-
fetchState: 'In-Progress',
|
|
599
|
-
error: undefined,
|
|
600
|
-
};
|
|
601
|
-
},
|
|
602
|
-
},
|
|
603
|
-
fetchOneTimeAccrual: {
|
|
604
|
-
prepare(accrualId) {
|
|
605
|
-
return { payload: { accrualId } };
|
|
606
|
-
},
|
|
607
|
-
reducer(draft, action) {
|
|
608
|
-
draft.oneTimeAccrualFetchStatusById[action.payload.accrualId] = {
|
|
609
|
-
fetchState: 'In-Progress',
|
|
610
|
-
error: undefined,
|
|
611
|
-
};
|
|
612
|
-
},
|
|
613
|
-
},
|
|
614
|
-
fetchOneTimeAccrualSuccess(draft, action) {
|
|
615
|
-
draft.oneTimeAccrualFetchStatusById[action.payload.accrualId] = {
|
|
616
|
-
fetchState: 'Completed',
|
|
617
|
-
error: undefined,
|
|
618
|
-
};
|
|
619
|
-
},
|
|
620
|
-
fetchOneTimeAccrualFailure(draft, action) {
|
|
621
|
-
draft.oneTimeAccrualFetchStatusById[action.payload.accrualId] = {
|
|
622
|
-
fetchState: 'Error',
|
|
623
|
-
error: action.payload.status,
|
|
624
|
-
};
|
|
625
|
-
},
|
|
626
|
-
oneTimeAccrualActionSuccess(draft, action) {
|
|
627
|
-
draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
|
|
628
|
-
fetchState: 'Completed',
|
|
629
|
-
error: undefined,
|
|
630
|
-
};
|
|
631
|
-
},
|
|
632
|
-
oneTimeAccrualActionFailure(draft, action) {
|
|
633
|
-
draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
|
|
634
|
-
fetchState: 'Error',
|
|
635
|
-
error: action.payload.status,
|
|
636
|
-
};
|
|
637
|
-
},
|
|
638
372
|
updateJESchedulesUIState(draft, action) {
|
|
639
373
|
if (action.payload.sortKey != null) {
|
|
640
374
|
draft.uiState.sortKey = action.payload.sortKey;
|
|
@@ -648,21 +382,10 @@ const expenseAutomationJESchedulesView = createSlice({
|
|
|
648
382
|
if (action.payload.scrollPosition != null) {
|
|
649
383
|
draft.uiState.scrollPosition = action.payload.scrollPosition;
|
|
650
384
|
}
|
|
651
|
-
if (action.payload.
|
|
652
|
-
draft.uiState.
|
|
385
|
+
if (action.payload.selectedMainTab != null) {
|
|
386
|
+
draft.uiState.selectedMainTab = action.payload.selectedMainTab;
|
|
653
387
|
}
|
|
654
388
|
},
|
|
655
|
-
updateJEScheduleTypeFilter(draft, action) {
|
|
656
|
-
draft.uiState.selectedJETypeFilter = action.payload;
|
|
657
|
-
},
|
|
658
|
-
toggleJEPendingGroupCollapsed(draft) {
|
|
659
|
-
draft.uiState.pendingGroupCollapsed =
|
|
660
|
-
!draft.uiState.pendingGroupCollapsed;
|
|
661
|
-
},
|
|
662
|
-
toggleJECreatedGroupCollapsed(draft) {
|
|
663
|
-
draft.uiState.createdGroupCollapsed =
|
|
664
|
-
!draft.uiState.createdGroupCollapsed;
|
|
665
|
-
},
|
|
666
389
|
clearExpenseAutomationJESchedulesView(draft) {
|
|
667
390
|
Object.assign(draft, initialState);
|
|
668
391
|
},
|
|
@@ -673,7 +396,7 @@ const expenseAutomationJESchedulesView = createSlice({
|
|
|
673
396
|
});
|
|
674
397
|
},
|
|
675
398
|
});
|
|
676
|
-
export const { clearExpenseAutomationJESchedulesView, clearJeAccountSettingsLocalData, clearJeScheduleLocalData,
|
|
399
|
+
export const { clearExpenseAutomationJESchedulesView, clearJeAccountSettingsLocalData, clearJeScheduleLocalData, fetchAccountSettingsListForAccountTypes, fetchJeSchedules, fetchJeSchedulesFailure, fetchJeSchedulesPage, fetchJeSchedulesSuccess, fetchRecommendationForAccountSettings, ignoreRecommendedJeSchedule, ignoreRecommendedJeScheduleFailure, ignoreRecommendedJeScheduleSuccess, initializeAccountSettingsView, initializeJeScheduleLocalData, removeFailedJeScheduleTransactionKey, removeJeScheduleLocalDataById, removeJeScheduleTransactionKey, retryJeSchedule, retryJeScheduleFailure, retryJeScheduleSuccess, saveAccountSettings, saveAccountSettingsFailure, saveAccountSettingsLocalData, saveAccountSettingsSuccess, updateAccountSettingsListForAccountTypes, updateAccountSettingsListForAccountTypesFailure, updateJESchedulesUIState, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, updateRecommendationForAccountSettings, updateRecommendationForAccountSettingsFailure, } = expenseAutomationJESchedulesView.actions;
|
|
677
400
|
export default expenseAutomationJESchedulesView.reducer;
|
|
678
401
|
const doUpdateRecommendationForAccountSettings = (draft, payload) => {
|
|
679
402
|
const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = mapAccountTypeRecommendationPayloadToAccountRecommendationByType(payload);
|