@zeniai/client-epic-state 4.14.12 → 4.14.14
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/billPay/billTransaction/billTransactionPayload.d.ts +0 -1
- package/lib/entity/billPay/billTransaction/billTransactionPayload.js +0 -3
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +3 -6
- package/lib/entity/billPay/billTransaction/billTransactionState.js +1 -18
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/entity/tenant/epic/signInUserEpic.js +7 -13
- package/lib/entity/tenant/tenantReducer.d.ts +0 -1
- package/lib/entity/toastNotification/epic/pushToastNotificationEpic.d.ts +1 -1
- package/lib/index.d.ts +13 -14
- package/lib/index.js +15 -26
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/bankAccountView/bankAccountViewReducer.d.ts +2 -2
- package/lib/view/billPayCard/fetchBillPayCardEpic.js +0 -1
- package/lib/view/cardPayment/epic/addCardPaymentSourceEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/confirmCardSetupIntentEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/createCardSetupIntentEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/fetchPaymentSourcesEpic.d.ts +1 -1
- package/lib/view/companyView/types/cockpitTypes.d.ts +1 -1
- package/lib/view/dashboard/dashboardEpic.js +8 -7
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +4 -7
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +1 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.js +1 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -1
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +1 -1
- package/lib/view/expenseAutomationView/epics/transactionCategorization/initializeTransactionCategorizationLocalDataEpic.js +3 -3
- package/lib/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscatgorizedEpic.js +1 -1
- package/lib/view/expenseAutomationView/epics/transactionCategorization/saveTransactionCategorizationEpic.js +2 -1
- package/lib/view/expenseAutomationView/epics/transactionCategorization/updateTransactionCategorizationEpic.js +1 -2
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +3 -1
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.js +12 -2
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +12 -13
- package/lib/view/expenseAutomationView/expenseAutomationViewState.d.ts +2 -0
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +10 -12
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +2 -6
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +0 -2
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +65 -102
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +2 -1
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +11 -20
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +1 -4
- package/lib/view/financeStatement/financeStatementEpic.d.ts +4 -4
- package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewSelector.js +5 -4
- package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
- package/lib/view/people/deletePersonEpic.d.ts +1 -1
- package/lib/view/people/invitePeopleEpic.d.ts +1 -1
- package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
- package/lib/view/people/resendInviteEpic.d.ts +1 -1
- package/lib/view/recommendation/fetchEntityRecommendationsByTransactionIdEpic.js +1 -1
- package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.d.ts +2 -9
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.js +8 -35
- package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListSelector.d.ts +2 -3
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +18 -55
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListState.js +0 -1
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.d.ts +2 -7
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.js +6 -18
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigReducer.js +0 -6
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.d.ts +4 -9
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.js +4 -18
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.d.ts +1 -2
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +0 -2
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +4 -8
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.js +5 -27
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +2 -4
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +2 -33
- package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +1 -6
- package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.js +5 -16
- package/lib/view/spendManagement/billPay/editBillView/epics/parseInvoiceToBillEpic.js +13 -27
- package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.d.ts +3 -7
- package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.js +28 -48
- package/lib/view/spendManagement/billPay/magicLinkView/magicLinkViewReducer.d.ts +2 -2
- package/lib/view/spendManagement/helpers.d.ts +0 -2
- package/lib/view/spendManagement/helpers.js +1 -9
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewReducer.d.ts +1 -6
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewReducer.js +2 -12
- package/lib/view/tagView/epics/createTagEpic.d.ts +1 -1
- package/lib/view/tagView/epics/deleteTagEpic.d.ts +1 -1
- package/lib/view/transactionDetail/epics/uploadMissingReceiptSuccessEpic.d.ts +1 -1
- package/package.json +1 -1
- package/lib/commonStateTypes/reimbursementTypeCode.d.ts +0 -2
- package/lib/commonStateTypes/reimbursementTypeCode.js +0 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.
|
|
4
|
+
exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.removeFailedJeScheduleTransactionKey = exports.removeJeScheduleTransactionKey = exports.initializeJeScheduleLocalData = exports.ignoreRecommendedJeScheduleSuccess = exports.clearJeScheduleLocalData = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesFailure = exports.fetchJeSchedules = exports.clearExpenseAutomationJESchedulesView = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
7
7
|
const jeSchedulesPayload_1 = require("../../../entity/jeSchedules/jeSchedulesPayload");
|
|
@@ -252,14 +252,10 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
252
252
|
const prevLocalDataById = draft.jeScheduleLocalDataById[scheduledJournalEntryID];
|
|
253
253
|
draft.jeScheduleLocalDataById = Object.assign(Object.assign({}, prevData), { [scheduledJournalEntryID]: Object.assign(Object.assign({}, prevLocalDataById), localData) });
|
|
254
254
|
},
|
|
255
|
-
removeJeScheduleLocalDataById(draft, action) {
|
|
256
|
-
const { scheduledJournalEntryID } = action.payload;
|
|
257
|
-
delete draft.jeScheduleLocalDataById[scheduledJournalEntryID];
|
|
258
|
-
},
|
|
259
255
|
clearExpenseAutomationJESchedulesView(draft) {
|
|
260
256
|
Object.assign(draft, exports.initialState);
|
|
261
257
|
},
|
|
262
258
|
},
|
|
263
259
|
});
|
|
264
|
-
_a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.
|
|
260
|
+
_a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys;
|
|
265
261
|
exports.default = expenseAutomationJESchedulesView.reducer;
|
|
@@ -53,8 +53,6 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
53
53
|
selectedTab: "review" | "autoCategorized";
|
|
54
54
|
transactionIds: string[];
|
|
55
55
|
transactionSaveUpdates: TransactionSaveUpdates[];
|
|
56
|
-
}, string, never, never>, updateCurrentSelectedTransactionCategorizationTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSelectedTab: "review" | "autoCategorized"], {
|
|
57
|
-
newSelectedTab: "review" | "autoCategorized";
|
|
58
56
|
}, string, never, never>, updateTransactionCategorizationSaveStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", fetchState: FetchState, error?: ZeniAPIStatus<Record<string, unknown>> | undefined], {
|
|
59
57
|
selectedTab: "review" | "autoCategorized";
|
|
60
58
|
fetchState: FetchState;
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
var _a;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.setEntityRecommendationForLineIdsForCategorization = exports.clearExpenseAutomationTransactionsView = exports.clearExpenseAutomationTransactionsViewPerTabView = exports.updateSelectedCheckboxTransactionIds = exports.fetchTransactionCategorizationView = exports.fetchTransactionCategorizationSuccess = exports.updateTotalCountForTransactionCategorization = exports.setAllItemsToCategoryClassInLocalDataForCategorization = exports.updateSelectedVendorForTransaction = exports.updateStatusForTransactionNotMiscategorizedUpdate = exports.markTransactionAsNotMiscategorized = exports.updateTransactionCategorizationSaveStatus = exports.
|
|
7
|
+
exports.setEntityRecommendationForLineIdsForCategorization = exports.clearExpenseAutomationTransactionsView = exports.clearExpenseAutomationTransactionsViewPerTabView = exports.updateSelectedCheckboxTransactionIds = exports.fetchTransactionCategorizationView = exports.fetchTransactionCategorizationSuccess = exports.updateTotalCountForTransactionCategorization = exports.setAllItemsToCategoryClassInLocalDataForCategorization = exports.updateSelectedVendorForTransaction = exports.updateStatusForTransactionNotMiscategorizedUpdate = exports.markTransactionAsNotMiscategorized = exports.updateTransactionCategorizationSaveStatus = exports.updateTransactionCategorization = exports.saveTransactionCategorization = exports.fetchTransactionCategorizationFailure = exports.saveTransactionCategorizationLocalData = exports.initializeTransactionCategorizationViewLocalData = exports.updateTransactionCategorizationUIState = exports.fetchTransactionCategorization = exports.initialState = exports.initialTransactionTabViewState = void 0;
|
|
8
8
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
9
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
10
10
|
const uniq_1 = __importDefault(require("lodash/uniq"));
|
|
@@ -44,11 +44,8 @@ exports.initialTransactionTabViewState = {
|
|
|
44
44
|
selectedCheckBoxTransactionIds: [],
|
|
45
45
|
};
|
|
46
46
|
exports.initialState = {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
review: Object.assign({}, exports.initialTransactionTabViewState),
|
|
50
|
-
autoCategorized: Object.assign({}, exports.initialTransactionTabViewState),
|
|
51
|
-
},
|
|
47
|
+
review: Object.assign({}, exports.initialTransactionTabViewState),
|
|
48
|
+
autoCategorized: Object.assign({}, exports.initialTransactionTabViewState),
|
|
52
49
|
};
|
|
53
50
|
const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
54
51
|
name: 'expenseAutomationTransactionsView',
|
|
@@ -78,44 +75,39 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
78
75
|
reducer(draft, action) {
|
|
79
76
|
const { refreshViewInBackground, resetListItems, selectedTab, pageToken, searchString, period, } = action.payload;
|
|
80
77
|
if (refreshViewInBackground === true) {
|
|
81
|
-
draft
|
|
78
|
+
draft[selectedTab].refreshStatus = {
|
|
82
79
|
fetchState: 'In-Progress',
|
|
83
80
|
error: undefined,
|
|
84
81
|
};
|
|
85
82
|
}
|
|
86
83
|
else {
|
|
87
|
-
draft
|
|
88
|
-
|
|
89
|
-
draft.transactionCategorizationView[selectedTab].error = undefined;
|
|
84
|
+
draft[selectedTab].fetchState = 'In-Progress';
|
|
85
|
+
draft[selectedTab].error = undefined;
|
|
90
86
|
}
|
|
91
87
|
// Note: Need to reset scroll position whenever a new fetch happens, except when fetching through scroll
|
|
92
88
|
if (pageToken == null) {
|
|
93
89
|
// Page Token is null in each fetch except when fetching through scroll
|
|
94
|
-
draft
|
|
90
|
+
draft[selectedTab].uiState.scrollPosition = {
|
|
95
91
|
scrollTop: 0,
|
|
96
92
|
scrollLeft: undefined,
|
|
97
93
|
};
|
|
98
94
|
}
|
|
99
|
-
draft
|
|
100
|
-
|
|
101
|
-
draft
|
|
102
|
-
searchString !== null && searchString !== void 0 ? searchString : '';
|
|
103
|
-
draft.transactionCategorizationView[selectedTab].error = undefined;
|
|
95
|
+
draft[selectedTab].uiState.pageToken = pageToken !== null && pageToken !== void 0 ? pageToken : null;
|
|
96
|
+
draft[selectedTab].uiState.searchString = searchString !== null && searchString !== void 0 ? searchString : '';
|
|
97
|
+
draft[selectedTab].error = undefined;
|
|
104
98
|
// Reset list when we change the sort order and fetch list again
|
|
105
99
|
if (resetListItems === true) {
|
|
106
100
|
const monthYearPeriod = {
|
|
107
101
|
month: period.start.month,
|
|
108
102
|
year: period.start.year,
|
|
109
103
|
};
|
|
110
|
-
const transactionIdsBySelectedPeriod = draft
|
|
111
|
-
.transactionIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(monthYearPeriod)];
|
|
104
|
+
const transactionIdsBySelectedPeriod = draft[selectedTab].transactionIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(monthYearPeriod)];
|
|
112
105
|
transactionIdsBySelectedPeriod.forEach((transactionId) => {
|
|
113
|
-
delete draft
|
|
114
|
-
.transactionReviewLocalDataById[transactionId];
|
|
106
|
+
delete draft[selectedTab].transactionReviewLocalDataById[transactionId];
|
|
115
107
|
});
|
|
116
|
-
draft
|
|
117
|
-
draft
|
|
118
|
-
draft
|
|
108
|
+
draft[selectedTab].selectedCheckBoxTransactionIds = draft[selectedTab].selectedCheckBoxTransactionIds.filter((selectedCheckBoxTransactionId) => transactionIdsBySelectedPeriod.includes(selectedCheckBoxTransactionId));
|
|
109
|
+
draft[selectedTab].transactionIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(monthYearPeriod)] = [];
|
|
110
|
+
draft[selectedTab].refreshStatus = {
|
|
119
111
|
fetchState: 'Not-Started',
|
|
120
112
|
error: undefined,
|
|
121
113
|
};
|
|
@@ -158,62 +150,53 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
158
150
|
saveTransactionCategorizationLocalData(draft, action) {
|
|
159
151
|
const { keepExistingListItems, transactionIds, transactionLocalData, selectedPeriod, selectedTab, pageToken, totalCount, } = action.payload;
|
|
160
152
|
if (keepExistingListItems === false) {
|
|
161
|
-
draft
|
|
162
|
-
|
|
163
|
-
draft.transactionCategorizationView[selectedTab].selectedCheckBoxTransactionIds = [];
|
|
153
|
+
draft[selectedTab].transactionIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = transactionIds;
|
|
154
|
+
draft[selectedTab].selectedCheckBoxTransactionIds = [];
|
|
164
155
|
}
|
|
165
156
|
else {
|
|
166
|
-
const previousData = draft
|
|
167
|
-
.transactionIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)];
|
|
157
|
+
const previousData = draft[selectedTab].transactionIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)];
|
|
168
158
|
if (previousData == null) {
|
|
169
|
-
draft
|
|
159
|
+
draft[selectedTab].transactionIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = transactionIds;
|
|
170
160
|
}
|
|
171
161
|
else {
|
|
172
162
|
const combinedData = (0, uniq_1.default)([...previousData, ...transactionIds]);
|
|
173
|
-
draft
|
|
163
|
+
draft[selectedTab].transactionIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = [...combinedData];
|
|
174
164
|
}
|
|
175
165
|
}
|
|
176
|
-
draft
|
|
177
|
-
.transactionReviewLocalDataById), transactionLocalData);
|
|
166
|
+
draft[selectedTab].transactionReviewLocalDataById = Object.assign(Object.assign({}, draft[selectedTab].transactionReviewLocalDataById), transactionLocalData);
|
|
178
167
|
if (action.payload.refreshViewInBackground === true) {
|
|
179
|
-
draft
|
|
168
|
+
draft[selectedTab].refreshStatus = {
|
|
180
169
|
fetchState: 'Completed',
|
|
181
170
|
error: undefined,
|
|
182
171
|
};
|
|
183
172
|
}
|
|
184
173
|
else {
|
|
185
|
-
draft
|
|
186
|
-
|
|
187
|
-
draft.transactionCategorizationView[selectedTab].error = undefined;
|
|
174
|
+
draft[selectedTab].fetchState = 'Completed';
|
|
175
|
+
draft[selectedTab].error = undefined;
|
|
188
176
|
}
|
|
189
|
-
draft
|
|
190
|
-
draft
|
|
177
|
+
draft[selectedTab].uiState = Object.assign(Object.assign({}, draft[selectedTab].uiState), { pageToken: pageToken !== null && pageToken !== void 0 ? pageToken : null });
|
|
178
|
+
draft[selectedTab].uiState.totalCount[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = totalCount;
|
|
191
179
|
},
|
|
192
180
|
updateTransactionCategorizationUIState(draft, action) {
|
|
193
181
|
const selectedTab = action.payload.selectedTab;
|
|
194
182
|
const uiState = action.payload.uiState;
|
|
195
183
|
if (uiState.sortKey != null) {
|
|
196
|
-
draft
|
|
197
|
-
uiState.sortKey;
|
|
184
|
+
draft[selectedTab].uiState.sortKey = uiState.sortKey;
|
|
198
185
|
}
|
|
199
186
|
if (uiState.sortOrder != null) {
|
|
200
|
-
draft
|
|
201
|
-
uiState.sortOrder;
|
|
187
|
+
draft[selectedTab].uiState.sortOrder = uiState.sortOrder;
|
|
202
188
|
}
|
|
203
189
|
if (uiState.searchString != null) {
|
|
204
|
-
draft
|
|
205
|
-
uiState.searchString;
|
|
190
|
+
draft[selectedTab].uiState.searchString = uiState.searchString;
|
|
206
191
|
}
|
|
207
192
|
if (uiState.scrollPosition != null) {
|
|
208
|
-
draft
|
|
193
|
+
draft[selectedTab].uiState.scrollPosition = uiState.scrollPosition;
|
|
209
194
|
}
|
|
210
195
|
if (uiState.pageToken != null) {
|
|
211
|
-
draft
|
|
212
|
-
uiState.pageToken;
|
|
196
|
+
draft[selectedTab].uiState.pageToken = uiState.pageToken;
|
|
213
197
|
}
|
|
214
198
|
if (uiState.totalCount != null) {
|
|
215
|
-
draft
|
|
216
|
-
uiState.totalCount;
|
|
199
|
+
draft[selectedTab].uiState.totalCount = uiState.totalCount;
|
|
217
200
|
}
|
|
218
201
|
},
|
|
219
202
|
saveTransactionCategorization: {
|
|
@@ -229,19 +212,10 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
229
212
|
// do nothing
|
|
230
213
|
},
|
|
231
214
|
},
|
|
232
|
-
updateCurrentSelectedTransactionCategorizationTab: {
|
|
233
|
-
reducer(draft, action) {
|
|
234
|
-
draft.selectedTransactionCategorizationTab =
|
|
235
|
-
action.payload.newSelectedTab;
|
|
236
|
-
},
|
|
237
|
-
prepare(newSelectedTab) {
|
|
238
|
-
return { payload: { newSelectedTab } };
|
|
239
|
-
},
|
|
240
|
-
},
|
|
241
215
|
updateTransactionCategorization: {
|
|
242
216
|
reducer(draft, action) {
|
|
243
217
|
const selectedTab = action.payload.selectedTab;
|
|
244
|
-
draft
|
|
218
|
+
draft[selectedTab].saveStatus = {
|
|
245
219
|
error: undefined,
|
|
246
220
|
fetchState: 'In-Progress',
|
|
247
221
|
};
|
|
@@ -259,37 +233,33 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
259
233
|
setAllItemsToCategoryClassInLocalDataForCategorization: {
|
|
260
234
|
reducer(draft, action) {
|
|
261
235
|
const { vendorId, selectedAccount, selectedClassBase, transactions, transactionId, lineId, selectedTab, } = action.payload;
|
|
262
|
-
const transactionLocalData = (0, get_1.default)(draft
|
|
263
|
-
.transactionReviewLocalDataById, transactionId, undefined);
|
|
236
|
+
const transactionLocalData = (0, get_1.default)(draft[selectedTab].transactionReviewLocalDataById, transactionId, undefined);
|
|
264
237
|
const existingAccount = transactionLocalData === null || transactionLocalData === void 0 ? void 0 : transactionLocalData.transactionReviewLocalData.lineItemById[lineId].account;
|
|
265
238
|
if (transactionLocalData != null) {
|
|
266
239
|
const newTransactionLocalData = Object.assign(Object.assign({}, transactionLocalData.transactionReviewLocalData), { lineItemById: Object.assign(Object.assign({}, transactionLocalData.transactionReviewLocalData.lineItemById), { [lineId]: Object.assign(Object.assign({}, transactionLocalData.transactionReviewLocalData.lineItemById[lineId]), { account: selectedAccount, class: selectedClassBase }) }) });
|
|
267
|
-
draft
|
|
240
|
+
draft[selectedTab].transactionReviewLocalDataById[transactionId] = {
|
|
268
241
|
transactionReviewLocalData: newTransactionLocalData,
|
|
269
242
|
transactionId,
|
|
270
243
|
};
|
|
271
244
|
const selectedTransaction = transactions.find((transaction) => transaction.id === transactionId);
|
|
272
|
-
const selectedCheckBoxTransactionIds = draft
|
|
273
|
-
.selectedCheckBoxTransactionIds;
|
|
245
|
+
const selectedCheckBoxTransactionIds = draft[selectedTab].selectedCheckBoxTransactionIds;
|
|
274
246
|
if (selectedTransaction != null &&
|
|
275
247
|
(0, transactionCategorizationLocalDataHelper_1.checkIfAllLineItemsAreCategoryClassFilled)(selectedTransaction, newTransactionLocalData) === true && // check if all line items are filled
|
|
276
248
|
selectedCheckBoxTransactionIds.length < transactionCategorizationLocalDataHelper_1.MAX_SELECTION_LIMIT &&
|
|
277
249
|
selectedCheckBoxTransactionIds.includes(transactionId) === false) {
|
|
278
|
-
draft
|
|
279
|
-
...draft
|
|
280
|
-
.selectedCheckBoxTransactionIds,
|
|
250
|
+
draft[selectedTab].selectedCheckBoxTransactionIds = [
|
|
251
|
+
...draft[selectedTab].selectedCheckBoxTransactionIds,
|
|
281
252
|
transactionId,
|
|
282
253
|
];
|
|
283
254
|
}
|
|
284
255
|
}
|
|
285
256
|
if (vendorId != null) {
|
|
286
257
|
transactions.forEach((transaction) => {
|
|
287
|
-
const transactionLocalData = (0, get_1.default)(draft
|
|
288
|
-
.transactionReviewLocalDataById, transaction.id, undefined);
|
|
258
|
+
const transactionLocalData = (0, get_1.default)(draft[selectedTab].transactionReviewLocalDataById, transaction.id, undefined);
|
|
289
259
|
if (transactionLocalData != null) {
|
|
290
|
-
draft
|
|
260
|
+
draft[selectedTab].transactionReviewLocalDataById[transaction.id] = {
|
|
291
261
|
transactionId: transaction.id,
|
|
292
|
-
transactionReviewLocalData: (0, transactionCategorizationLocalDataHelper_1.toSetAllLineItemsToCategoryClass)(draft
|
|
262
|
+
transactionReviewLocalData: (0, transactionCategorizationLocalDataHelper_1.toSetAllLineItemsToCategoryClass)(draft[selectedTab], transaction, transactionId, lineId, transactionLocalData.transactionReviewLocalData, (existingAccount === null || existingAccount === void 0 ? void 0 : existingAccount.accountId) !== (selectedAccount === null || selectedAccount === void 0 ? void 0 : selectedAccount.accountId)
|
|
293
263
|
? 'category'
|
|
294
264
|
: 'class', vendorId, selectedAccount, selectedClassBase),
|
|
295
265
|
};
|
|
@@ -329,12 +299,11 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
329
299
|
},
|
|
330
300
|
reducer(draft, action) {
|
|
331
301
|
const { entity, transaction, transactionId, selectedTab, lineIds } = action.payload;
|
|
332
|
-
const transactionLocalData = (0, get_1.default)(draft
|
|
333
|
-
.transactionReviewLocalDataById, transactionId.id, undefined);
|
|
302
|
+
const transactionLocalData = (0, get_1.default)(draft[selectedTab].transactionReviewLocalDataById, transactionId.id, undefined);
|
|
334
303
|
if (transactionLocalData != null) {
|
|
335
|
-
draft
|
|
304
|
+
draft[selectedTab].transactionReviewLocalDataById[transaction.id] = {
|
|
336
305
|
transactionId: transaction.id,
|
|
337
|
-
transactionReviewLocalData: (0, transactionCategorizationLocalDataHelper_1.setEntityRecommendationForLineIdInLocalData)(draft
|
|
306
|
+
transactionReviewLocalData: (0, transactionCategorizationLocalDataHelper_1.setEntityRecommendationForLineIdInLocalData)(draft[selectedTab], transaction, transactionLocalData.transactionReviewLocalData, entity, lineIds, action.payload.recommendationByLineId),
|
|
338
307
|
};
|
|
339
308
|
}
|
|
340
309
|
},
|
|
@@ -342,29 +311,25 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
342
311
|
fetchTransactionCategorizationSuccess(draft, action) {
|
|
343
312
|
const { selectedTab } = action.payload;
|
|
344
313
|
if (action.payload.refreshViewInBackground === true) {
|
|
345
|
-
draft
|
|
314
|
+
draft[selectedTab].refreshStatus = {
|
|
346
315
|
fetchState: 'Completed',
|
|
347
316
|
error: undefined,
|
|
348
317
|
};
|
|
349
318
|
}
|
|
350
319
|
else {
|
|
351
|
-
draft
|
|
352
|
-
|
|
353
|
-
draft.transactionCategorizationView[selectedTab].error = undefined;
|
|
320
|
+
draft[selectedTab].fetchState = 'Completed';
|
|
321
|
+
draft[selectedTab].error = undefined;
|
|
354
322
|
}
|
|
355
323
|
},
|
|
356
324
|
fetchTransactionCategorizationFailure(draft, action) {
|
|
357
325
|
const { selectedTab, selectedPeriod } = action.payload;
|
|
358
|
-
draft
|
|
359
|
-
|
|
360
|
-
draft
|
|
361
|
-
draft.transactionCategorizationView[selectedTab].error =
|
|
362
|
-
action.payload.status;
|
|
326
|
+
draft[selectedTab].transactionIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = [];
|
|
327
|
+
draft[selectedTab].fetchState = 'Error';
|
|
328
|
+
draft[selectedTab].error = action.payload.status;
|
|
363
329
|
},
|
|
364
330
|
updateSelectedVendorForTransaction(draft, action) {
|
|
365
331
|
const { transactionId, lineId, updatedVendor, selectedTransaction, selectedTab, } = action.payload;
|
|
366
|
-
const transactionLocalData = (0, get_1.default)(draft
|
|
367
|
-
.transactionReviewLocalDataById, transactionId, undefined);
|
|
332
|
+
const transactionLocalData = (0, get_1.default)(draft[selectedTab].transactionReviewLocalDataById, transactionId, undefined);
|
|
368
333
|
if (transactionLocalData != null) {
|
|
369
334
|
let newTransactionLocalData = Object.assign({}, transactionLocalData.transactionReviewLocalData);
|
|
370
335
|
if (!(0, vendorTransaction_1.isVendorTransaction)(selectedTransaction) &&
|
|
@@ -389,18 +354,17 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
389
354
|
}
|
|
390
355
|
: undefined;
|
|
391
356
|
}
|
|
392
|
-
draft
|
|
357
|
+
draft[selectedTab].transactionReviewLocalDataById[transactionId] = {
|
|
393
358
|
transactionReviewLocalData: newTransactionLocalData,
|
|
394
359
|
transactionId,
|
|
395
360
|
};
|
|
396
|
-
const selectedCheckBoxTransactionIds = draft
|
|
397
|
-
.selectedCheckBoxTransactionIds;
|
|
361
|
+
const selectedCheckBoxTransactionIds = draft[selectedTab].selectedCheckBoxTransactionIds;
|
|
398
362
|
if (newTransactionLocalData.vendor != null &&
|
|
399
363
|
newTransactionLocalData.vendor.id != null &&
|
|
400
364
|
(0, transactionCategorizationLocalDataHelper_1.checkIfAllLineItemsAreCategoryClassFilled)(selectedTransaction, newTransactionLocalData) === true && // check if all line items are filled
|
|
401
365
|
selectedCheckBoxTransactionIds.length < transactionCategorizationLocalDataHelper_1.MAX_SELECTION_LIMIT &&
|
|
402
366
|
selectedCheckBoxTransactionIds.includes(transactionId) === false) {
|
|
403
|
-
draft
|
|
367
|
+
draft[selectedTab].selectedCheckBoxTransactionIds = [
|
|
404
368
|
...selectedCheckBoxTransactionIds,
|
|
405
369
|
transactionId,
|
|
406
370
|
];
|
|
@@ -410,7 +374,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
410
374
|
updateTransactionCategorizationSaveStatus: {
|
|
411
375
|
reducer(draft, action) {
|
|
412
376
|
const selectedTab = action.payload.selectedTab;
|
|
413
|
-
draft
|
|
377
|
+
draft[selectedTab].saveStatus = {
|
|
414
378
|
fetchState: action.payload.fetchState,
|
|
415
379
|
error: action.payload.error,
|
|
416
380
|
};
|
|
@@ -428,7 +392,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
428
392
|
markTransactionAsNotMiscategorized: {
|
|
429
393
|
reducer(draft, action) {
|
|
430
394
|
const selectedTab = action.payload.selectedTab;
|
|
431
|
-
draft
|
|
395
|
+
draft[selectedTab].markAsNotMiscategorizedStatus = {
|
|
432
396
|
fetchState: 'In-Progress',
|
|
433
397
|
error: undefined,
|
|
434
398
|
};
|
|
@@ -446,17 +410,16 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
446
410
|
reducer(draft, action) {
|
|
447
411
|
const { selectedTab, selectedPeriod, transactionIds } = action.payload;
|
|
448
412
|
if (action.payload.fetchState === 'Completed') {
|
|
449
|
-
const selectedCheckBoxTransactionIds = draft
|
|
450
|
-
draft
|
|
413
|
+
const selectedCheckBoxTransactionIds = draft[selectedTab].selectedCheckBoxTransactionIds.filter((id) => !transactionIds.includes(id));
|
|
414
|
+
draft[selectedTab].selectedCheckBoxTransactionIds = [
|
|
451
415
|
...selectedCheckBoxTransactionIds,
|
|
452
416
|
];
|
|
453
|
-
const transactionIdsBySelectedPeriod = draft
|
|
454
|
-
.transactionIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)];
|
|
417
|
+
const transactionIdsBySelectedPeriod = draft[selectedTab].transactionIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)];
|
|
455
418
|
if (transactionIdsBySelectedPeriod != null) {
|
|
456
|
-
draft
|
|
419
|
+
draft[selectedTab].transactionIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = transactionIdsBySelectedPeriod.filter((id) => !transactionIds.includes(id));
|
|
457
420
|
}
|
|
458
421
|
}
|
|
459
|
-
draft
|
|
422
|
+
draft[selectedTab].markAsNotMiscategorizedStatus = {
|
|
460
423
|
fetchState: action.payload.fetchState,
|
|
461
424
|
error: action.payload.error,
|
|
462
425
|
};
|
|
@@ -475,21 +438,21 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
475
438
|
},
|
|
476
439
|
updateTotalCountForTransactionCategorization(draft, action) {
|
|
477
440
|
const { selectedTab, selectedPeriod, totalCount } = action.payload;
|
|
478
|
-
draft
|
|
441
|
+
draft[selectedTab].uiState.totalCount[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = totalCount;
|
|
479
442
|
},
|
|
480
443
|
updateSelectedCheckboxTransactionIds(draft, action) {
|
|
481
444
|
const selectedTab = action.payload.selectedTab;
|
|
482
445
|
const transactionIds = action.payload.transactionIds;
|
|
483
|
-
draft
|
|
446
|
+
draft[selectedTab].selectedCheckBoxTransactionIds = [...transactionIds];
|
|
484
447
|
},
|
|
485
448
|
clearExpenseAutomationTransactionsViewPerTabView(draft, action) {
|
|
486
449
|
const selectedTab = action.payload;
|
|
487
|
-
draft
|
|
450
|
+
draft[selectedTab] = Object.assign({}, exports.initialTransactionTabViewState);
|
|
488
451
|
},
|
|
489
452
|
clearExpenseAutomationTransactionsView(draft) {
|
|
490
453
|
Object.assign(draft, exports.initialState);
|
|
491
454
|
},
|
|
492
455
|
},
|
|
493
456
|
});
|
|
494
|
-
_a = expenseAutomationTransactionsView.actions, exports.fetchTransactionCategorization = _a.fetchTransactionCategorization, exports.updateTransactionCategorizationUIState = _a.updateTransactionCategorizationUIState, exports.initializeTransactionCategorizationViewLocalData = _a.initializeTransactionCategorizationViewLocalData, exports.saveTransactionCategorizationLocalData = _a.saveTransactionCategorizationLocalData, exports.fetchTransactionCategorizationFailure = _a.fetchTransactionCategorizationFailure, exports.saveTransactionCategorization = _a.saveTransactionCategorization, exports.updateTransactionCategorization = _a.updateTransactionCategorization, exports.
|
|
457
|
+
_a = expenseAutomationTransactionsView.actions, exports.fetchTransactionCategorization = _a.fetchTransactionCategorization, exports.updateTransactionCategorizationUIState = _a.updateTransactionCategorizationUIState, exports.initializeTransactionCategorizationViewLocalData = _a.initializeTransactionCategorizationViewLocalData, exports.saveTransactionCategorizationLocalData = _a.saveTransactionCategorizationLocalData, exports.fetchTransactionCategorizationFailure = _a.fetchTransactionCategorizationFailure, exports.saveTransactionCategorization = _a.saveTransactionCategorization, exports.updateTransactionCategorization = _a.updateTransactionCategorization, exports.updateTransactionCategorizationSaveStatus = _a.updateTransactionCategorizationSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.updateStatusForTransactionNotMiscategorizedUpdate = _a.updateStatusForTransactionNotMiscategorizedUpdate, exports.updateSelectedVendorForTransaction = _a.updateSelectedVendorForTransaction, exports.setAllItemsToCategoryClassInLocalDataForCategorization = _a.setAllItemsToCategoryClassInLocalDataForCategorization, exports.updateTotalCountForTransactionCategorization = _a.updateTotalCountForTransactionCategorization, exports.fetchTransactionCategorizationSuccess = _a.fetchTransactionCategorizationSuccess, exports.fetchTransactionCategorizationView = _a.fetchTransactionCategorizationView, exports.updateSelectedCheckboxTransactionIds = _a.updateSelectedCheckboxTransactionIds, exports.clearExpenseAutomationTransactionsViewPerTabView = _a.clearExpenseAutomationTransactionsViewPerTabView, exports.clearExpenseAutomationTransactionsView = _a.clearExpenseAutomationTransactionsView, exports.setEntityRecommendationForLineIdsForCategorization = _a.setEntityRecommendationForLineIdsForCategorization;
|
|
495
458
|
exports.default = expenseAutomationTransactionsView.reducer;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { ExpenseAutomationTransactionViewSelector } from '../selectorTypes/transactionsViewSelectorTypes';
|
|
2
2
|
import { RootState } from '../../../reducer';
|
|
3
|
-
|
|
3
|
+
import { TransactionsTab } from '../types/transactionsViewState';
|
|
4
|
+
export declare function getExpenseAutomationTransactionView(state: RootState, selectedTab: TransactionsTab): ExpenseAutomationTransactionViewSelector;
|
|
@@ -12,11 +12,10 @@ const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
|
12
12
|
const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
|
|
13
13
|
const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
|
|
14
14
|
const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
|
|
15
|
-
function getExpenseAutomationTransactionView(state) {
|
|
15
|
+
function getExpenseAutomationTransactionView(state, selectedTab) {
|
|
16
16
|
var _a;
|
|
17
17
|
const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
|
|
18
|
-
const {
|
|
19
|
-
const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
|
|
18
|
+
const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, } = expenseAutomationTransactionsViewState[selectedTab];
|
|
20
19
|
const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(accountState, accountListState, 'accountList');
|
|
21
20
|
const accountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'accountList');
|
|
22
21
|
const classList = (0, classListSelector_1.getClassList)(classState, classListState);
|
|
@@ -53,29 +52,21 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
53
52
|
fetchStatus = (0, reduceFetchState_1.reduceAllFetchState)([
|
|
54
53
|
accountList,
|
|
55
54
|
classList,
|
|
56
|
-
expenseAutomationTransactionsViewState
|
|
55
|
+
expenseAutomationTransactionsViewState[selectedTab],
|
|
57
56
|
]);
|
|
58
|
-
const totalCountByReview = expenseAutomationTransactionsViewState.
|
|
59
|
-
|
|
60
|
-
const totalCountByAutoCat = expenseAutomationTransactionsViewState.transactionCategorizationView
|
|
61
|
-
.autoCategorized.uiState.totalCount;
|
|
57
|
+
const totalCountByReview = expenseAutomationTransactionsViewState.review.uiState.totalCount;
|
|
58
|
+
const totalCountByAutoCat = expenseAutomationTransactionsViewState.autoCategorized.uiState.totalCount;
|
|
62
59
|
const totalCountByTab = {
|
|
63
60
|
review: monthYearPeriodId != null ? totalCountByReview[monthYearPeriodId] : 0,
|
|
64
61
|
autoCategorized: monthYearPeriodId != null ? totalCountByAutoCat[monthYearPeriodId] : 0,
|
|
65
62
|
};
|
|
66
63
|
const fetchStateByTab = {
|
|
67
|
-
review:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
autoCategorized: {
|
|
74
|
-
fetchState: expenseAutomationTransactionsViewState.transactionCategorizationView
|
|
75
|
-
.autoCategorized.fetchState,
|
|
76
|
-
error: expenseAutomationTransactionsViewState.transactionCategorizationView
|
|
77
|
-
.autoCategorized.error,
|
|
78
|
-
},
|
|
64
|
+
review: (0, reduceFetchState_1.reduceAllFetchState)([
|
|
65
|
+
expenseAutomationTransactionsViewState.review,
|
|
66
|
+
]),
|
|
67
|
+
autoCategorized: (0, reduceFetchState_1.reduceAllFetchState)([
|
|
68
|
+
expenseAutomationTransactionsViewState.autoCategorized,
|
|
69
|
+
]),
|
|
79
70
|
};
|
|
80
71
|
const allSteps = monthYearPeriodId != null
|
|
81
72
|
? (0, expenseAutomationViewSelectorTypes_1.getAllSteps)(monthEndCloseChecksState, monthYearPeriodId, currentTenant.tenantId)
|
|
@@ -85,10 +85,7 @@ export interface TransactionsTabViewState extends FetchedState {
|
|
|
85
85
|
refreshStatus: FetchStateAndError;
|
|
86
86
|
uiState: TransactionsViewUIState;
|
|
87
87
|
}
|
|
88
|
-
export declare type TransactionsViewState =
|
|
89
|
-
selectedTransactionCategorizationTab: TransactionsTab;
|
|
90
|
-
transactionCategorizationView: Record<TransactionsTab, TransactionsTabViewState>;
|
|
91
|
-
};
|
|
88
|
+
export declare type TransactionsViewState = Record<TransactionsTab, TransactionsTabViewState>;
|
|
92
89
|
export interface TransactionLineUpdates {
|
|
93
90
|
class?: ClassBase;
|
|
94
91
|
account?: AccountBase;
|
|
@@ -8,14 +8,14 @@ import { fetchCashFlow } from '../cashFlow/cashFlowReducer';
|
|
|
8
8
|
export declare type ActionType = ReturnType<typeof fetchFinanceStatement> | ReturnType<typeof fetchAllTenants> | ReturnType<typeof fetchProfitAndLoss> | ReturnType<typeof fetchBalanceSheet> | ReturnType<typeof fetchCashFlow>;
|
|
9
9
|
export declare const fetchFinanceStatementEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => import("rxjs").Observable<{
|
|
10
10
|
payload: {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
userId: string;
|
|
12
|
+
zeniSessionId: string | undefined;
|
|
13
13
|
};
|
|
14
14
|
type: string;
|
|
15
15
|
} | {
|
|
16
16
|
payload: {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
timeframe: "month" | "year" | "quarter";
|
|
18
|
+
fetchFullReport: boolean;
|
|
19
19
|
};
|
|
20
20
|
type: string;
|
|
21
21
|
} | {
|
|
@@ -11,6 +11,7 @@ const timePeriod_1 = require("../../commonStateTypes/timePeriod");
|
|
|
11
11
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
12
12
|
const tenantSelector_1 = require("../../entity/tenant/tenantSelector");
|
|
13
13
|
const formatZeniDateFY_1 = require("../../commonStateTypes/fiscalYearHelpers/formatZeniDateFY");
|
|
14
|
+
const fetchAllTenantsEpic_1 = require("../../entity/tenant/epic/fetchAllTenantsEpic");
|
|
14
15
|
const isMonthEndInsightDisabled = (currentTenant, selectedPeriod, userAllowedToAccessMonthEndInsights, auditSummary) => {
|
|
15
16
|
if (auditSummary != null) {
|
|
16
17
|
if (auditSummary.auditScorePercentage < 75 &&
|
|
@@ -39,14 +40,14 @@ const isMonthEndInsightDisabled = (currentTenant, selectedPeriod, userAllowedToA
|
|
|
39
40
|
};
|
|
40
41
|
exports.isMonthEndInsightDisabled = isMonthEndInsightDisabled;
|
|
41
42
|
exports.getMonthEndCloseChecksViewByTenantId = (0, toolkit_1.createSelector)((state) => state.monthEndCloseChecksState, (state) => state.monthEndCloseChecksViewState, (state) => state.expenseAutomationViewState, (state) => (0, tenantSelector_1.getCurrentTenant)(state), (state) => state.companyState, (state) => state.tenantState, (_state, tenantId) => tenantId, (monthEndCloseChecksState, monthEndCloseChecksViewState, expenseAutomationViewState, currentTenant, companyState, tenantState, tenantId) => {
|
|
42
|
-
var _a, _b;
|
|
43
|
+
var _a, _b, _c;
|
|
43
44
|
const { refreshStatus } = monthEndCloseChecksViewState;
|
|
44
45
|
const { loggedInUser } = tenantState;
|
|
45
|
-
const selectedPeriod = expenseAutomationViewState.selectedPeriodByTenantId[tenantId];
|
|
46
|
+
const selectedPeriod = (_a = expenseAutomationViewState.selectedPeriodByTenantId[tenantId]) !== null && _a !== void 0 ? _a : fetchAllTenantsEpic_1.defaultMonthYearPeriod;
|
|
46
47
|
const { monthEndCloseChecksViewByTenantId } = monthEndCloseChecksViewState;
|
|
47
48
|
const monthYearPeriodId = selectedPeriod != null ? (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod) : null;
|
|
48
49
|
const monthEndCloseChecksView = monthYearPeriodId != null
|
|
49
|
-
? (
|
|
50
|
+
? (_b = monthEndCloseChecksViewByTenantId[tenantId]) === null || _b === void 0 ? void 0 : _b[monthYearPeriodId]
|
|
50
51
|
: undefined;
|
|
51
52
|
const monthEndCloseChecks = monthYearPeriodId != null
|
|
52
53
|
? (0, monthEndCloseChecksSelector_1.getMonthEndCloseChecksByTenantId)(monthEndCloseChecksState, tenantId, monthYearPeriodId)
|
|
@@ -58,7 +59,7 @@ exports.getMonthEndCloseChecksViewByTenantId = (0, toolkit_1.createSelector)((st
|
|
|
58
59
|
const currentCompany = companyState.companiesById[currentTenant.companyId];
|
|
59
60
|
const managementInfo = currentCompany === null || currentCompany === void 0 ? void 0 : currentCompany.managementInfo;
|
|
60
61
|
const preparerUserIds = managementInfo != null ? managementInfo.preparerUserIds : [];
|
|
61
|
-
const isZeniUser = Boolean((
|
|
62
|
+
const isZeniUser = Boolean((_c = loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.userEmail) === null || _c === void 0 ? void 0 : _c.includes('zeni.ai'));
|
|
62
63
|
const isPreparer = loggedInUser != null && preparerUserIds.includes(loggedInUser.userId);
|
|
63
64
|
const userAllowedToAccessMonthEndInsights = isZeniUser === false || isPreparer === false;
|
|
64
65
|
const monthEndCloseCheckListWithDisabledState = sortedMonthEndCloseCheckList.map((check) => {
|
|
@@ -26,7 +26,7 @@ export declare const changeZeniPersonRolesEpic: (actions$: ActionsObservable<Act
|
|
|
26
26
|
type: string;
|
|
27
27
|
} | {
|
|
28
28
|
payload: {
|
|
29
|
-
messageSection: "bill_pay_setup" | "reimbursement_setup" | "charge_card_setup" | "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "
|
|
29
|
+
messageSection: "bill_pay_setup" | "reimbursement_setup" | "charge_card_setup" | "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "transactions_reviewed" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipts_upload";
|
|
30
30
|
messageText: "failed" | "success" | "notification";
|
|
31
31
|
type: import("../..").SnackbarMessageType;
|
|
32
32
|
showStatusIcon?: boolean | undefined;
|