@zeniai/client-epic-state 4.18.68 → 4.18.69
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/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +3 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -1
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/initializeTransactionCategorizationLocalDataEpic.js +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscatgorizedEpic.js +20 -9
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +3 -1
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.js +9 -3
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +12 -6
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +9 -5
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +12 -8
- package/lib/view/transactionDetail/epics/markTransactionAsNotMiscategorizedEpic.js +1 -1
- package/package.json +1 -1
package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js
CHANGED
|
@@ -12,7 +12,8 @@ const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer"
|
|
|
12
12
|
const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
|
|
13
13
|
const reconciliationViewReducer_1 = require("../../reducers/reconciliationViewReducer");
|
|
14
14
|
const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
|
|
15
|
-
const refreshExpenseAutomationCurrentTabEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(expenseAutomationViewReducer_1.refreshExpenseAutomationCurrentTab.match), (0, operators_1.switchMap)(() => {
|
|
15
|
+
const refreshExpenseAutomationCurrentTabEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(expenseAutomationViewReducer_1.refreshExpenseAutomationCurrentTab.match), (0, operators_1.switchMap)((action) => {
|
|
16
|
+
const { isUncategorizedExpenseCategoryEnabled } = action.payload;
|
|
16
17
|
const state = state$.value;
|
|
17
18
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
18
19
|
const companyId = currentTenant.companyId;
|
|
@@ -65,7 +66,7 @@ const refreshExpenseAutomationCurrentTabEpic = (actions$, state$) => actions$.pi
|
|
|
65
66
|
case 'transaction_categorization':
|
|
66
67
|
default:
|
|
67
68
|
return (0, rxjs_1.from)([
|
|
68
|
-
(0, transactionsViewReducer_1.fetchTransactionCategorizationView)(selectedTransactionCategorizationTab, { start: timePeriodStart, end: timePeriodEnd }, true, false, undefined, undefined, true),
|
|
69
|
+
(0, transactionsViewReducer_1.fetchTransactionCategorizationView)(selectedTransactionCategorizationTab, { start: timePeriodStart, end: timePeriodEnd }, true, false, undefined, undefined, true, undefined, isUncategorizedExpenseCategoryEnabled),
|
|
69
70
|
]);
|
|
70
71
|
}
|
|
71
72
|
}));
|
|
@@ -40,7 +40,7 @@ const fetchTransactionCategorizationEpic = (actions$, state$, zeniAPI) => action
|
|
|
40
40
|
selectedTab,
|
|
41
41
|
uiState: Object.assign(Object.assign({}, uiState), { pageToken: (_a = response.data.next_page_token) !== null && _a !== void 0 ? _a : null }),
|
|
42
42
|
}));
|
|
43
|
-
updateActions.push((0, transactionsViewReducer_1.initializeTransactionCategorizationViewLocalData)(selectedTab, transactionIds, selectedPeriod, keepExistingListItems, (_b = response.data.next_page_token) !== null && _b !== void 0 ? _b : null, response.data.total_count, lineItemsByTransactionIds, refreshViewInBackground));
|
|
43
|
+
updateActions.push((0, transactionsViewReducer_1.initializeTransactionCategorizationViewLocalData)(selectedTab, transactionIds, selectedPeriod, keepExistingListItems, (_b = response.data.next_page_token) !== null && _b !== void 0 ? _b : null, response.data.total_count, lineItemsByTransactionIds, refreshViewInBackground, action.payload.isUncategorizedExpenseCategoryEnabled));
|
|
44
44
|
updateActions.push((0, transactionsViewReducer_1.updateTotalCountForTransactionCategorization)({
|
|
45
45
|
selectedPeriod,
|
|
46
46
|
selectedTab,
|
|
@@ -10,7 +10,7 @@ const ownerListReducer_1 = require("../../../ownerList/ownerListReducer");
|
|
|
10
10
|
const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
|
|
11
11
|
const fetchTransactionCategorizationViewEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(transactionsViewReducer_1.fetchTransactionCategorizationView.match), (0, operators_1.mergeMap)((action) => {
|
|
12
12
|
var _a;
|
|
13
|
-
const { selectedTab, cacheOverride, keepExistingListItems, pageToken, period, refreshViewInBackground, searchString, resetListItems, } = action.payload;
|
|
13
|
+
const { selectedTab, cacheOverride, keepExistingListItems, pageToken, period, refreshViewInBackground, searchString, resetListItems, isUncategorizedExpenseCategoryEnabled, } = action.payload;
|
|
14
14
|
const updateActions = [];
|
|
15
15
|
const { expenseAutomationTransactionsViewState } = state$.value;
|
|
16
16
|
const { fetchState, transactionIdsBySelectedPeriod } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTab];
|
|
@@ -37,7 +37,7 @@ const fetchTransactionCategorizationViewEpic = (actions$, state$) => actions$.pi
|
|
|
37
37
|
if (cacheOverride === true ||
|
|
38
38
|
fetchState === 'Not-Started' ||
|
|
39
39
|
transactionIds.length === 0) {
|
|
40
|
-
updateActions.push((0, transactionsViewReducer_1.fetchTransactionCategorization)(selectedTab, period, cacheOverride, keepExistingListItems, searchString, pageToken, refreshViewInBackground, resetListItems));
|
|
40
|
+
updateActions.push((0, transactionsViewReducer_1.fetchTransactionCategorization)(selectedTab, period, cacheOverride, keepExistingListItems, searchString, pageToken, refreshViewInBackground, resetListItems, isUncategorizedExpenseCategoryEnabled));
|
|
41
41
|
}
|
|
42
42
|
return (0, rxjs_1.from)(updateActions);
|
|
43
43
|
}));
|
|
@@ -10,7 +10,7 @@ const transactionCategorizationLocalDataHelper_1 = require("../../helpers/transa
|
|
|
10
10
|
const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
|
|
11
11
|
const transactionsViewState_1 = require("../../types/transactionsViewState");
|
|
12
12
|
const initializeTransactionCategorizationViewLocalDataEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(transactionsViewReducer_1.initializeTransactionCategorizationViewLocalData.match), (0, operators_1.mergeMap)((action) => {
|
|
13
|
-
const { transactionIds, selectedPeriod, keepExistingListItems, selectedTab, pageToken, totalCount, lineItemsByTransactionIds, refreshViewInBackground, } = action.payload;
|
|
13
|
+
const { transactionIds, selectedPeriod, keepExistingListItems, selectedTab, pageToken, totalCount, lineItemsByTransactionIds, refreshViewInBackground, isUncategorizedExpenseCategoryEnabled, } = action.payload;
|
|
14
14
|
const fetchActions = [];
|
|
15
15
|
const { transactionState, expenseAutomationTransactionsViewState } = state$.value;
|
|
16
16
|
const { transactionReviewLocalDataById } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTab];
|
|
@@ -21,7 +21,7 @@ const initializeTransactionCategorizationViewLocalDataEpic = (actions$, state$)
|
|
|
21
21
|
transactions.forEach((transaction) => {
|
|
22
22
|
var _a, _b;
|
|
23
23
|
const transactionWithCOT = (0, transactionHelper_1.getTransactionWithCOT)(transaction);
|
|
24
|
-
const newTransactionsLocalData = (0, transactionCategorizationLocalDataHelper_1.toTransactionDetailLocalData)(transactionWithCOT, selectedTab, lineItemsByTransactionIds[transaction.id], uncategorizedIncomeExpense);
|
|
24
|
+
const newTransactionsLocalData = (0, transactionCategorizationLocalDataHelper_1.toTransactionDetailLocalData)(transactionWithCOT, selectedTab, lineItemsByTransactionIds[transaction.id], uncategorizedIncomeExpense, isUncategorizedExpenseCategoryEnabled);
|
|
25
25
|
if (transactionLocalData[transaction.id] == null) {
|
|
26
26
|
transactionLocalData[transaction.id] = Object.assign(Object.assign({}, transactionsViewState_1.initialSupportedTransactionCategorization), { transactionId: transaction.id, transactionReviewLocalData: Object.assign(Object.assign({}, newTransactionsLocalData), { sortedLineItems: (_b = (_a = transaction.lines) === null || _a === void 0 ? void 0 : _a.map((line) => line.id)) !== null && _b !== void 0 ? _b : [] }) });
|
|
27
27
|
}
|
|
@@ -44,18 +44,29 @@ const markTransactionAsNotMiscategorizedEpic = (actions$, state$, zeniAPI) => ac
|
|
|
44
44
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
45
45
|
const reviewedSuccess = response.data.transactions_reviewed_success;
|
|
46
46
|
const reviewedFailed = response.data.transactions_reviewed_failed;
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
const transactionIdsReviewSuccess = reviewedSuccess.map((transaction) => transaction.transaction_id);
|
|
48
|
+
const transactionIdsReviewFailed = reviewedFailed.map((transaction) => transaction.transaction_id);
|
|
49
|
+
const transactionIdsSuccess = selectedTab === 'review'
|
|
50
|
+
? transactionIdsReviewSuccess
|
|
51
|
+
: [
|
|
52
|
+
...new Set([
|
|
53
|
+
...transactionIdsReviewSuccess,
|
|
54
|
+
...transactionIdsReviewFailed,
|
|
55
|
+
]),
|
|
56
|
+
];
|
|
57
|
+
const uncheckTransactionIds = [
|
|
58
|
+
...new Set([
|
|
59
|
+
...transactionIdsReviewSuccess,
|
|
60
|
+
...transactionIdsReviewFailed,
|
|
61
|
+
]),
|
|
53
62
|
];
|
|
63
|
+
//considering only failed categorization transactions
|
|
64
|
+
const allFailedIds = [...transactionsIdsFailed];
|
|
54
65
|
const totalCountByPeriod = uiState.totalCount[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)];
|
|
55
66
|
const updatedTotalCount = transactionIdsSuccess.length === 0
|
|
56
67
|
? totalCountByPeriod
|
|
57
68
|
: totalCountByPeriod - transactionIdsSuccess.length;
|
|
58
|
-
actions.push((0, transactionsViewReducer_1.updateStatusForTransactionNotMiscategorizedUpdateForCategorization)(action.payload.selectedTab, transactionIdsSuccess, selectedPeriod, 'Completed'), (0, transactionReducer_1.removeTransactionCategorization)({
|
|
69
|
+
actions.push((0, transactionsViewReducer_1.updateStatusForTransactionNotMiscategorizedUpdateForCategorization)(action.payload.selectedTab, uncheckTransactionIds, transactionIdsSuccess, selectedPeriod, 'Completed'), (0, transactionReducer_1.removeTransactionCategorization)({
|
|
59
70
|
transactionIds: transactionIdsSuccess,
|
|
60
71
|
}), (0, transactionsViewReducer_1.updateTotalCountForTransactionCategorization)({
|
|
61
72
|
selectedPeriod,
|
|
@@ -122,9 +133,9 @@ const markTransactionAsNotMiscategorizedEpic = (actions$, state$, zeniAPI) => ac
|
|
|
122
133
|
return (0, rxjs_1.from)(actions);
|
|
123
134
|
}
|
|
124
135
|
else {
|
|
125
|
-
return (0, rxjs_1.of)((0, transactionsViewReducer_1.updateStatusForTransactionNotMiscategorizedUpdateForCategorization)(action.payload.selectedTab, [], selectedPeriod, 'Error', response.status));
|
|
136
|
+
return (0, rxjs_1.of)((0, transactionsViewReducer_1.updateStatusForTransactionNotMiscategorizedUpdateForCategorization)(action.payload.selectedTab, [], [], selectedPeriod, 'Error', response.status));
|
|
126
137
|
}
|
|
127
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, transactionsViewReducer_1.updateStatusForTransactionNotMiscategorizedUpdateForCategorization)(action.payload.selectedTab, [], selectedPeriod, 'Error', (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Transaction mark miscategorized as correct REST API call errored out ${JSON.stringify(error)}`)))));
|
|
138
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, transactionsViewReducer_1.updateStatusForTransactionNotMiscategorizedUpdateForCategorization)(action.payload.selectedTab, [], [], selectedPeriod, 'Error', (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Transaction mark miscategorized as correct REST API call errored out ${JSON.stringify(error)}`)))));
|
|
128
139
|
}
|
|
129
140
|
else {
|
|
130
141
|
return (0, rxjs_1.from)(actions);
|
|
@@ -12,6 +12,8 @@ export declare const fetchAllExpenseAutomationTabs: import("@reduxjs/toolkit").A
|
|
|
12
12
|
newSelectedView: "transaction_categorization" | "je_schedules" | "reconciliation" | "missing_receipts" | "flux_analysis" | "month_end_insights";
|
|
13
13
|
}, "expenseAutomationView/updateCurrentSelectedView", never, never>, clearExpenseAutomationView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationView/clearExpenseAutomationView">, initializeSelectedPeriodForTenants: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
14
14
|
selectedPeriodByTenantId: Record<ID, MonthYearPeriod>;
|
|
15
|
-
}, "expenseAutomationView/initializeSelectedPeriodForTenants">, refreshExpenseAutomationCurrentTab: import("@reduxjs/toolkit").
|
|
15
|
+
}, "expenseAutomationView/initializeSelectedPeriodForTenants">, refreshExpenseAutomationCurrentTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
|
|
16
|
+
isUncategorizedExpenseCategoryEnabled: boolean | undefined;
|
|
17
|
+
}, "expenseAutomationView/refreshExpenseAutomationCurrentTab", never, never>;
|
|
16
18
|
declare const _default: import("redux").Reducer<ExpenseAutomationViewState>;
|
|
17
19
|
export default _default;
|
|
@@ -28,9 +28,15 @@ const expenseAutomationView = (0, toolkit_1.createSlice)({
|
|
|
28
28
|
};
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
refreshExpenseAutomationCurrentTab: {
|
|
32
|
+
prepare(isUncategorizedExpenseCategoryEnabled) {
|
|
33
|
+
return {
|
|
34
|
+
payload: { isUncategorizedExpenseCategoryEnabled },
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
reducer() {
|
|
38
|
+
// Do nothing
|
|
39
|
+
},
|
|
34
40
|
},
|
|
35
41
|
updateCurrentSelectedView: {
|
|
36
42
|
reducer(draft, action) {
|
package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { UncategorizedAccounts } from '../../accountList/accountListSelector';
|
|
|
8
8
|
import { TransactionReviewLocalDataSelectorView } from '../selectorTypes/transactionsViewSelectorTypes';
|
|
9
9
|
import { TabSpecificLineItems, TransactionReviewLocalData, TransactionsTab, TransactionsTabViewState } from '../types/transactionsViewState';
|
|
10
10
|
export declare const MAX_SELECTION_LIMIT = 5;
|
|
11
|
-
export declare const toTransactionDetailLocalData: (transaction: SupportedTransactionWithCOT, selectedTab: TransactionsTab, lineItemsByTransactionIds: string[], uncategorizedIncomeExpense: UncategorizedAccounts) => TransactionReviewLocalData;
|
|
11
|
+
export declare const toTransactionDetailLocalData: (transaction: SupportedTransactionWithCOT, selectedTab: TransactionsTab, lineItemsByTransactionIds: string[], uncategorizedIncomeExpense: UncategorizedAccounts, isUncategorizedExpenseCategoryEnabled?: boolean) => TransactionReviewLocalData;
|
|
12
12
|
export declare const toSetAllLineItemsToCategoryClass: (draft: TransactionsTabViewState, transaction: SupportedTransactionWithCOT, transactionId: ID, transactionLineId: ID, transactionDetailLocalData: TransactionReviewLocalData, updatedItem: "category" | "class", uncategorizedAccounts: UncategorizedAccounts, selectedTab: TransactionsTab, vendorId?: ID, customerId?: ID, selectedAccount?: AccountBase, selectedClassBase?: ClassBase, isUncategorizedExpenseCategoryEnabled?: boolean) => TransactionReviewLocalData;
|
|
13
13
|
export declare const setEntityRecommendationForLineIdInLocalData: (draft: TransactionsTabViewState, transaction: SupportedTransactionWithCOT, transactionDetailLocalData: TransactionReviewLocalData, entity: Entity, recommendationLineIds: ID[], uncategorizedAccounts: UncategorizedAccounts, recommendationWithCOTByLineId?: RecommendationWithCOTByLineId, isUncategorizedExpenseCategoryEnabled?: boolean) => TransactionReviewLocalData;
|
|
14
14
|
export declare const checkIfAllLineItemsAreCategoryClassFilled: (transaction: SupportedTransactionWithCOT, transactionDetailLocalData: TransactionReviewLocalData, uncategorizedAccounts: UncategorizedAccounts, isUncategorizedExpenseCategoryEnabled?: boolean) => boolean;
|
|
@@ -6,7 +6,7 @@ const transactionDetailLocalDataHelper_1 = require("../../transactionDetail/tran
|
|
|
6
6
|
const transactionDetailLocalDataHelper_2 = require("../../transactionDetail/transactionDetailLocalDataHelper");
|
|
7
7
|
const transactionsViewState_1 = require("../types/transactionsViewState");
|
|
8
8
|
exports.MAX_SELECTION_LIMIT = 5;
|
|
9
|
-
const toTransactionDetailLocalData = (transaction, selectedTab, lineItemsByTransactionIds, uncategorizedIncomeExpense) => {
|
|
9
|
+
const toTransactionDetailLocalData = (transaction, selectedTab, lineItemsByTransactionIds, uncategorizedIncomeExpense, isUncategorizedExpenseCategoryEnabled) => {
|
|
10
10
|
var _a, _b, _c;
|
|
11
11
|
const transactionLocal = Object.assign({}, transactionsViewState_1.initialSupportedTransactionCategorization.transactionReviewLocalData);
|
|
12
12
|
transactionLocal.memo = transaction.memo;
|
|
@@ -91,7 +91,7 @@ const toTransactionDetailLocalData = (transaction, selectedTab, lineItemsByTrans
|
|
|
91
91
|
}
|
|
92
92
|
transactionLocal.lineItemById =
|
|
93
93
|
transaction.lines != null && transaction.lines.length > 0
|
|
94
|
-
? buildLineItemById(transaction, uncategorizedIncomeExpense, transaction.recommendationsWithCOT)
|
|
94
|
+
? buildLineItemById(transaction, uncategorizedIncomeExpense, transaction.recommendationsWithCOT, isUncategorizedExpenseCategoryEnabled)
|
|
95
95
|
: {};
|
|
96
96
|
transactionLocal.sortedLineItems =
|
|
97
97
|
transaction.lines != null && transaction.lines.length > 0
|
|
@@ -104,7 +104,7 @@ const toTransactionDetailLocalData = (transaction, selectedTab, lineItemsByTrans
|
|
|
104
104
|
return transactionLocal;
|
|
105
105
|
};
|
|
106
106
|
exports.toTransactionDetailLocalData = toTransactionDetailLocalData;
|
|
107
|
-
const buildLineItemById = (transaction, uncategorizedIncomeExpense, recommendations) => {
|
|
107
|
+
const buildLineItemById = (transaction, uncategorizedIncomeExpense, recommendations, isUncategorizedExpenseCategoryEnabled) => {
|
|
108
108
|
const lineItemData = {};
|
|
109
109
|
const { lines } = transaction;
|
|
110
110
|
lines === null || lines === void 0 ? void 0 : lines.forEach((line) => {
|
|
@@ -160,7 +160,9 @@ const buildLineItemById = (transaction, uncategorizedIncomeExpense, recommendati
|
|
|
160
160
|
record.recommendationsWithCOT = recommendations[lineId];
|
|
161
161
|
const higherPreferenceRecommendation = (_c = recommendations[lineId]) === null || _c === void 0 ? void 0 : _c[0];
|
|
162
162
|
if ((Boolean(accountLine.account.accountId) === false ||
|
|
163
|
-
(0, transactionDetailLocalDataHelper_2.isAccountUncategorized)(uncategorizedIncomeExpense, accountLine.account.qboId
|
|
163
|
+
(0, transactionDetailLocalDataHelper_2.isAccountUncategorized)(uncategorizedIncomeExpense, accountLine.account.qboId, isUncategorizedExpenseCategoryEnabled === true
|
|
164
|
+
? ['income']
|
|
165
|
+
: undefined)) &&
|
|
164
166
|
(higherPreferenceRecommendation === null || higherPreferenceRecommendation === void 0 ? void 0 : higherPreferenceRecommendation.account) != null) {
|
|
165
167
|
record.account = Object.assign(Object.assign({}, higherPreferenceRecommendation.account), { isPreFilled: true });
|
|
166
168
|
}
|
|
@@ -265,7 +267,9 @@ const toSetAllLineItemsToCategoryClass = (draft, transaction, transactionId, tra
|
|
|
265
267
|
if (selectedAccount != null &&
|
|
266
268
|
updatedItem === 'category' &&
|
|
267
269
|
(((_a = record.account) === null || _a === void 0 ? void 0 : _a.qboId) == null ||
|
|
268
|
-
(0, transactionDetailLocalDataHelper_2.isAccountUncategorized)(uncategorizedAccounts, (_b = record.account) === null || _b === void 0 ? void 0 : _b.qboId
|
|
270
|
+
(0, transactionDetailLocalDataHelper_2.isAccountUncategorized)(uncategorizedAccounts, (_b = record.account) === null || _b === void 0 ? void 0 : _b.qboId, isUncategorizedExpenseCategoryEnabled === true
|
|
271
|
+
? ['income']
|
|
272
|
+
: undefined) === true)) {
|
|
269
273
|
record.account = selectedAccount;
|
|
270
274
|
if (record.class != null &&
|
|
271
275
|
selectedCheckBoxTransactionIds.length < exports.MAX_SELECTION_LIMIT &&
|
|
@@ -333,7 +337,9 @@ const setEntityRecommendationForLineIdInLocalData = (draft, transaction, transac
|
|
|
333
337
|
const record = Object.assign({}, oldRecord);
|
|
334
338
|
const recommendations = (0, transactionDetailLocalDataHelper_1.mergeTransactionAndEntityRecommendationsWithCOT)(oldRecord.recommendationsWithCOT, recommendationWithCOTByLineId === null || recommendationWithCOTByLineId === void 0 ? void 0 : recommendationWithCOTByLineId[lineId]);
|
|
335
339
|
const accountLine = line;
|
|
336
|
-
const isUncategorizedAccount = (0, transactionDetailLocalDataHelper_2.isAccountUncategorized)(uncategorizedAccounts, accountLine.account.qboId
|
|
340
|
+
const isUncategorizedAccount = (0, transactionDetailLocalDataHelper_2.isAccountUncategorized)(uncategorizedAccounts, accountLine.account.qboId, isUncategorizedExpenseCategoryEnabled === true
|
|
341
|
+
? ['income']
|
|
342
|
+
: undefined);
|
|
337
343
|
record.account =
|
|
338
344
|
isUncategorizedAccount === false && accountLine.account.qboId !== ''
|
|
339
345
|
? accountLine.account
|
|
@@ -15,7 +15,7 @@ import { UpdateTransactionCategorizationResponsePayload } from '../payload/trans
|
|
|
15
15
|
import { SupportedTransactionCategorization, TransactionSaveUpdates, TransactionsTab, TransactionsTabViewState, TransactionsViewState, TransactionsViewUIState } from '../types/transactionsViewState';
|
|
16
16
|
export declare const initialTransactionTabViewState: TransactionsTabViewState;
|
|
17
17
|
export declare const initialState: TransactionsViewState;
|
|
18
|
-
export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", period: TimePeriod, cacheOverride?: any, keepExistingListItems?: any, searchString?: string | undefined, pageToken?: PageToken | undefined, refreshViewInBackground?: any, resetListItems?: boolean | undefined], {
|
|
18
|
+
export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", period: TimePeriod, cacheOverride?: any, keepExistingListItems?: any, searchString?: string | undefined, pageToken?: PageToken | undefined, refreshViewInBackground?: any, resetListItems?: boolean | undefined, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
|
|
19
19
|
selectedTab: "review" | "autoCategorized";
|
|
20
20
|
period: TimePeriod;
|
|
21
21
|
searchString: string | undefined;
|
|
@@ -24,10 +24,11 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
24
24
|
cacheOverride: any;
|
|
25
25
|
refreshViewInBackground: any;
|
|
26
26
|
resetListItems: boolean | undefined;
|
|
27
|
+
isUncategorizedExpenseCategoryEnabled: boolean | undefined;
|
|
27
28
|
}, "expenseAutomationTransactionsView/fetchTransactionCategorization", never, never>, updateTransactionCategorizationUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
28
29
|
selectedTab: TransactionsTab;
|
|
29
30
|
uiState: Partial<TransactionsViewUIState>;
|
|
30
|
-
}, "expenseAutomationTransactionsView/updateTransactionCategorizationUIState">, initializeTransactionCategorizationViewLocalData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionIds: string[], selectedPeriod: MonthYearPeriod, keepExistingListItems: any, pageToken: PageToken, totalCount: number, lineItemsByTransactionIds: Record<string, string[]>, refreshViewInBackground?: any], {
|
|
31
|
+
}, "expenseAutomationTransactionsView/updateTransactionCategorizationUIState">, initializeTransactionCategorizationViewLocalData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionIds: string[], selectedPeriod: MonthYearPeriod, keepExistingListItems: any, pageToken: PageToken, totalCount: number, lineItemsByTransactionIds: Record<string, string[]>, refreshViewInBackground?: any, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
|
|
31
32
|
selectedTab: "review" | "autoCategorized";
|
|
32
33
|
transactionIds: string[];
|
|
33
34
|
selectedPeriod: MonthYearPeriod;
|
|
@@ -36,6 +37,7 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
36
37
|
totalCount: number;
|
|
37
38
|
lineItemsByTransactionIds: Record<string, string[]>;
|
|
38
39
|
refreshViewInBackground: any;
|
|
40
|
+
isUncategorizedExpenseCategoryEnabled: boolean | undefined;
|
|
39
41
|
}, "expenseAutomationTransactionsView/initializeTransactionCategorizationViewLocalData", never, never>, saveTransactionCategorizationLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
40
42
|
keepExistingListItems: boolean;
|
|
41
43
|
pageToken: PageToken;
|
|
@@ -67,9 +69,10 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
67
69
|
}, "expenseAutomationTransactionsView/updateTransactionCategorizationSaveStatus", never, never>, markTransactionAsNotMiscategorized: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionsInReview: UpdateTransactionCategorizationResponsePayload], {
|
|
68
70
|
selectedTab: "review" | "autoCategorized";
|
|
69
71
|
transactionsInReview: UpdateTransactionCategorizationResponsePayload;
|
|
70
|
-
}, "expenseAutomationTransactionsView/markTransactionAsNotMiscategorized", never, never>, updateStatusForTransactionNotMiscategorizedUpdateForCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized",
|
|
72
|
+
}, "expenseAutomationTransactionsView/markTransactionAsNotMiscategorized", never, never>, updateStatusForTransactionNotMiscategorizedUpdateForCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", uncheckTransactionIds: string[], removeTransactionIdsFromSelectedPeriod: string[], selectedPeriod: MonthYearPeriod, fetchState: FetchState, error?: ZeniAPIStatus<Record<string, unknown>> | undefined], {
|
|
73
|
+
removeTransactionIdsFromSelectedPeriod: string[];
|
|
71
74
|
selectedPeriod: MonthYearPeriod;
|
|
72
|
-
|
|
75
|
+
uncheckTransactionIds: string[];
|
|
73
76
|
selectedTab: "review" | "autoCategorized";
|
|
74
77
|
fetchState: FetchState;
|
|
75
78
|
error: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
@@ -115,7 +118,7 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
115
118
|
}, "expenseAutomationTransactionsView/fetchTransactionCategorizationSuccess">, resetOtherTabsFetchState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
116
119
|
tabs: TransactionsTab[];
|
|
117
120
|
refreshViewInBackground?: boolean;
|
|
118
|
-
}, "expenseAutomationTransactionsView/resetOtherTabsFetchState">, fetchTransactionCategorizationView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", period: TimePeriod, cacheOverride?: any, keepExistingListItems?: any, searchString?: string | undefined, pageToken?: PageToken | undefined, refreshViewInBackground?: any, resetListItems?: any], {
|
|
121
|
+
}, "expenseAutomationTransactionsView/resetOtherTabsFetchState">, fetchTransactionCategorizationView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", period: TimePeriod, cacheOverride?: any, keepExistingListItems?: any, searchString?: string | undefined, pageToken?: PageToken | undefined, refreshViewInBackground?: any, resetListItems?: any, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
|
|
119
122
|
selectedTab: "review" | "autoCategorized";
|
|
120
123
|
period: TimePeriod;
|
|
121
124
|
searchString: string | undefined;
|
|
@@ -124,6 +127,7 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
124
127
|
cacheOverride: any;
|
|
125
128
|
refreshViewInBackground: any;
|
|
126
129
|
resetListItems: any;
|
|
130
|
+
isUncategorizedExpenseCategoryEnabled: boolean | undefined;
|
|
127
131
|
}, "expenseAutomationTransactionsView/fetchTransactionCategorizationView", never, never>, updateSelectedCheckboxTransactionIds: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
128
132
|
selectedTab: TransactionsTab;
|
|
129
133
|
transactionIds: ID[];
|
|
@@ -58,7 +58,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
58
58
|
reducers: {
|
|
59
59
|
fetchTransactionCategorizationView: {
|
|
60
60
|
prepare(selectedTab, period, cacheOverride = false, keepExistingListItems = false, searchString, // when this is defined the output should go to search result IDs
|
|
61
|
-
pageToken, refreshViewInBackground = false, resetListItems = false) {
|
|
61
|
+
pageToken, refreshViewInBackground = false, resetListItems = false, isUncategorizedExpenseCategoryEnabled) {
|
|
62
62
|
return {
|
|
63
63
|
payload: {
|
|
64
64
|
selectedTab,
|
|
@@ -69,6 +69,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
69
69
|
cacheOverride,
|
|
70
70
|
refreshViewInBackground,
|
|
71
71
|
resetListItems,
|
|
72
|
+
isUncategorizedExpenseCategoryEnabled,
|
|
72
73
|
},
|
|
73
74
|
};
|
|
74
75
|
},
|
|
@@ -117,7 +118,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
117
118
|
}
|
|
118
119
|
},
|
|
119
120
|
prepare(selectedTab, period, cacheOverride = false, keepExistingListItems = false, searchString, // when this is defined the output should go to search result IDs
|
|
120
|
-
pageToken, refreshViewInBackground = false, resetListItems) {
|
|
121
|
+
pageToken, refreshViewInBackground = false, resetListItems, isUncategorizedExpenseCategoryEnabled) {
|
|
121
122
|
return {
|
|
122
123
|
payload: {
|
|
123
124
|
selectedTab,
|
|
@@ -128,12 +129,13 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
128
129
|
cacheOverride,
|
|
129
130
|
refreshViewInBackground,
|
|
130
131
|
resetListItems,
|
|
132
|
+
isUncategorizedExpenseCategoryEnabled,
|
|
131
133
|
},
|
|
132
134
|
};
|
|
133
135
|
},
|
|
134
136
|
},
|
|
135
137
|
initializeTransactionCategorizationViewLocalData: {
|
|
136
|
-
prepare(selectedTab, transactionIds, selectedPeriod, keepExistingListItems = false, pageToken, totalCount, lineItemsByTransactionIds, refreshViewInBackground = false) {
|
|
138
|
+
prepare(selectedTab, transactionIds, selectedPeriod, keepExistingListItems = false, pageToken, totalCount, lineItemsByTransactionIds, refreshViewInBackground = false, isUncategorizedExpenseCategoryEnabled) {
|
|
137
139
|
return {
|
|
138
140
|
payload: {
|
|
139
141
|
selectedTab,
|
|
@@ -144,6 +146,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
144
146
|
totalCount,
|
|
145
147
|
lineItemsByTransactionIds,
|
|
146
148
|
refreshViewInBackground,
|
|
149
|
+
isUncategorizedExpenseCategoryEnabled,
|
|
147
150
|
},
|
|
148
151
|
};
|
|
149
152
|
},
|
|
@@ -543,16 +546,16 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
543
546
|
},
|
|
544
547
|
updateStatusForTransactionNotMiscategorizedUpdateForCategorization: {
|
|
545
548
|
reducer(draft, action) {
|
|
546
|
-
const { selectedTab, selectedPeriod,
|
|
549
|
+
const { selectedTab, selectedPeriod, uncheckTransactionIds, removeTransactionIdsFromSelectedPeriod, } = action.payload;
|
|
547
550
|
if (action.payload.fetchState === 'Completed') {
|
|
548
|
-
const selectedCheckBoxTransactionIds = draft.transactionCategorizationView[selectedTab].selectedCheckBoxTransactionIds.filter((id) => !
|
|
551
|
+
const selectedCheckBoxTransactionIds = draft.transactionCategorizationView[selectedTab].selectedCheckBoxTransactionIds.filter((id) => !uncheckTransactionIds.includes(id));
|
|
549
552
|
draft.transactionCategorizationView[selectedTab].selectedCheckBoxTransactionIds = [
|
|
550
553
|
...selectedCheckBoxTransactionIds,
|
|
551
554
|
];
|
|
552
555
|
const transactionIdsBySelectedPeriod = draft.transactionCategorizationView[selectedTab]
|
|
553
556
|
.transactionIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)];
|
|
554
557
|
if (transactionIdsBySelectedPeriod != null) {
|
|
555
|
-
draft.transactionCategorizationView[selectedTab].transactionIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = transactionIdsBySelectedPeriod.filter((id) => !
|
|
558
|
+
draft.transactionCategorizationView[selectedTab].transactionIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = transactionIdsBySelectedPeriod.filter((id) => !removeTransactionIdsFromSelectedPeriod.includes(id));
|
|
556
559
|
}
|
|
557
560
|
}
|
|
558
561
|
draft.transactionCategorizationView[selectedTab].markAsNotMiscategorizedStatus = {
|
|
@@ -560,11 +563,12 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
560
563
|
error: action.payload.error,
|
|
561
564
|
};
|
|
562
565
|
},
|
|
563
|
-
prepare(selectedTab,
|
|
566
|
+
prepare(selectedTab, uncheckTransactionIds, removeTransactionIdsFromSelectedPeriod, selectedPeriod, fetchState, error) {
|
|
564
567
|
return {
|
|
565
568
|
payload: {
|
|
569
|
+
removeTransactionIdsFromSelectedPeriod,
|
|
566
570
|
selectedPeriod,
|
|
567
|
-
|
|
571
|
+
uncheckTransactionIds,
|
|
568
572
|
selectedTab,
|
|
569
573
|
fetchState,
|
|
570
574
|
error,
|
|
@@ -32,7 +32,7 @@ const markTransactionAsNotMiscategorizedEpic = (actions$, state$, zeniAPI) => ac
|
|
|
32
32
|
const updatedTotalCount = totalCountByPeriod === 0
|
|
33
33
|
? totalCountByPeriod
|
|
34
34
|
: totalCountByPeriod - 1;
|
|
35
|
-
actions.push((0, transactionsViewReducer_1.updateStatusForTransactionNotMiscategorizedUpdateForCategorization)(selectedTransactionCategorizationTab, [action.payload.transactionId.id], selectedPeriod, 'Completed'));
|
|
35
|
+
actions.push((0, transactionsViewReducer_1.updateStatusForTransactionNotMiscategorizedUpdateForCategorization)(selectedTransactionCategorizationTab, [action.payload.transactionId.id], [action.payload.transactionId.id], selectedPeriod, 'Completed'));
|
|
36
36
|
actions.push((0, transactionReducer_1.removeTransactionCategorization)({
|
|
37
37
|
transactionIds: [action.payload.transactionId.id],
|
|
38
38
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.18.
|
|
3
|
+
"version": "4.18.69",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|