@zeniai/client-epic-state 5.1.59 → 5.1.60

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.
Files changed (49) hide show
  1. package/lib/esm/view/commonVendorView/transactionVendorView/epics/saveTransactionVendorEpic.js +0 -1
  2. package/lib/esm/view/commonVendorView/transactionVendorView/transactionVendorViewReducer.js +1 -2
  3. package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +3 -3
  4. package/lib/esm/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +2 -3
  5. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/backgroundRefetchReviewTabEpic.js +2 -2
  6. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -1
  7. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +4 -4
  8. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/initializeTransactionCategorizationLocalDataEpic.js +2 -4
  9. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscategorizedEpic.js +2 -2
  10. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/saveTransactionCategorizationEpic.js +2 -2
  11. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/triggerReviewTabRefetchEpic.js +2 -2
  12. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/updateTransactionCategorizationEpic.js +2 -2
  13. package/lib/esm/view/expenseAutomationView/expenseAutomationViewReducer.js +3 -4
  14. package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +14 -25
  15. package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +21 -32
  16. package/lib/esm/view/recommendation/fetchEntityRecommendationsByTransactionIdEpic.js +2 -2
  17. package/lib/esm/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.js +2 -2
  18. package/lib/esm/view/recommendation/recommendationReducer.js +1 -2
  19. package/lib/esm/view/transactionDetail/epics/saveTransactionDetailEpic.js +2 -2
  20. package/lib/esm/view/transactionDetail/epics/updateTransactionDetailEpic.js +2 -2
  21. package/lib/esm/view/transactionDetail/transactionDetailReducer.js +1 -2
  22. package/lib/view/commonVendorView/transactionVendorView/epics/saveTransactionVendorEpic.js +0 -1
  23. package/lib/view/commonVendorView/transactionVendorView/transactionVendorViewReducer.d.ts +1 -2
  24. package/lib/view/commonVendorView/transactionVendorView/transactionVendorViewReducer.js +1 -2
  25. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +3 -3
  26. package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +2 -3
  27. package/lib/view/expenseAutomationView/epics/transactionCategorization/backgroundRefetchReviewTabEpic.js +2 -2
  28. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -1
  29. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +4 -4
  30. package/lib/view/expenseAutomationView/epics/transactionCategorization/initializeTransactionCategorizationLocalDataEpic.js +2 -4
  31. package/lib/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscategorizedEpic.js +2 -2
  32. package/lib/view/expenseAutomationView/epics/transactionCategorization/saveTransactionCategorizationEpic.js +2 -2
  33. package/lib/view/expenseAutomationView/epics/transactionCategorization/triggerReviewTabRefetchEpic.js +2 -2
  34. package/lib/view/expenseAutomationView/epics/transactionCategorization/updateTransactionCategorizationEpic.js +2 -2
  35. package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +2 -5
  36. package/lib/view/expenseAutomationView/expenseAutomationViewReducer.js +3 -4
  37. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +5 -5
  38. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +14 -25
  39. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +10 -23
  40. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +21 -32
  41. package/lib/view/recommendation/fetchEntityRecommendationsByTransactionIdEpic.js +2 -2
  42. package/lib/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.js +2 -2
  43. package/lib/view/recommendation/recommendationReducer.d.ts +1 -3
  44. package/lib/view/recommendation/recommendationReducer.js +1 -2
  45. package/lib/view/transactionDetail/epics/saveTransactionDetailEpic.js +2 -2
  46. package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +2 -2
  47. package/lib/view/transactionDetail/transactionDetailReducer.d.ts +1 -3
  48. package/lib/view/transactionDetail/transactionDetailReducer.js +1 -2
  49. package/package.json +1 -1
@@ -2,10 +2,9 @@ import { ID } from '../../commonStateTypes/common';
2
2
  import { MonthYearPeriod } from '../../commonStateTypes/timePeriod';
3
3
  import { ExpenseAutomationViewState } from './expenseAutomationViewState';
4
4
  export declare const initialState: ExpenseAutomationViewState;
5
- export declare const fetchAllExpenseAutomationTabs: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined, refreshViewInBackground?: boolean | undefined, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
5
+ export declare const fetchAllExpenseAutomationTabs: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined, refreshViewInBackground?: boolean | undefined], {
6
6
  cacheOverride: boolean;
7
7
  refreshViewInBackground: boolean;
8
- isUncategorizedExpenseCategoryEnabled: boolean;
9
8
  }, "expenseAutomationView/fetchAllExpenseAutomationTabs", never, never>, updateCurrentSelectedPeriod: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, newSelectedPeriod: MonthYearPeriod], {
10
9
  newSelectedPeriod: MonthYearPeriod;
11
10
  tenantId: string;
@@ -13,8 +12,6 @@ export declare const fetchAllExpenseAutomationTabs: import("@reduxjs/toolkit").A
13
12
  newSelectedView: "transaction_categorization" | "je_schedules" | "reconciliation" | "missing_receipts" | "flux_analysis" | "month_end_insights";
14
13
  }, "expenseAutomationView/updateCurrentSelectedView", never, never>, clearExpenseAutomationView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationView/clearExpenseAutomationView">, initializeSelectedPeriodForTenants: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
15
14
  selectedPeriodByTenantId: Record<ID, MonthYearPeriod>;
16
- }, "expenseAutomationView/initializeSelectedPeriodForTenants">, refreshExpenseAutomationCurrentTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
17
- isUncategorizedExpenseCategoryEnabled: boolean | undefined;
18
- }, "expenseAutomationView/refreshExpenseAutomationCurrentTab", never, never>;
15
+ }, "expenseAutomationView/initializeSelectedPeriodForTenants">, refreshExpenseAutomationCurrentTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[], {}, "expenseAutomationView/refreshExpenseAutomationCurrentTab", never, never>;
19
16
  declare const _default: import("redux").Reducer<ExpenseAutomationViewState>;
20
17
  export default _default;
@@ -22,20 +22,19 @@ const expenseAutomationView = (0, toolkit_1.createSlice)({
22
22
  reducer() {
23
23
  //do nothing
24
24
  },
25
- prepare(cacheOverride = false, refreshViewInBackground = false, isUncategorizedExpenseCategoryEnabled = false) {
25
+ prepare(cacheOverride = false, refreshViewInBackground = false) {
26
26
  return {
27
27
  payload: {
28
28
  cacheOverride,
29
29
  refreshViewInBackground,
30
- isUncategorizedExpenseCategoryEnabled,
31
30
  },
32
31
  };
33
32
  },
34
33
  },
35
34
  refreshExpenseAutomationCurrentTab: {
36
- prepare(isUncategorizedExpenseCategoryEnabled) {
35
+ prepare() {
37
36
  return {
38
- payload: { isUncategorizedExpenseCategoryEnabled },
37
+ payload: {},
39
38
  };
40
39
  },
41
40
  reducer() {
@@ -27,14 +27,14 @@ export declare const removeTransactionFromTabView: (tabView: TransactionsTabView
27
27
  */
28
28
  export declare const filterAutoTabLineItems: (tabView: TransactionsTabViewState, transactionId: ID, updatedTransaction: SupportedTransactionWithCOT) => void;
29
29
  export declare const MAX_SELECTION_LIMIT = 5;
30
- export declare const shouldAutoSelectAndAdd: (transaction: SupportedTransactionWithCOT, localData: TransactionReviewLocalData, selectedCheckBoxTransactionIds: ID[], uncategorizedAccounts: UncategorizedAccounts, isUncategorizedExpenseCategoryEnabled?: boolean, isAccountingClassesEnabled?: boolean) => boolean;
31
- export declare const toTransactionDetailLocalData: (transaction: SupportedTransactionWithCOT, selectedTab: TransactionsTab, lineItemsByTransactionIds: string[], uncategorizedIncomeExpense: UncategorizedAccounts, isUncategorizedExpenseCategoryEnabled?: boolean) => TransactionReviewLocalData;
32
- export declare const toSetAllLineItemsToCategoryClass: (draft: TransactionsTabViewState, transaction: SupportedTransactionWithCOT, transactionId: ID, transactionLineId: ID, transactionDetailLocalData: TransactionReviewLocalData, updatedItem: "category" | "class" | "project", uncategorizedAccounts: UncategorizedAccounts, selectedTab: TransactionsTab, vendorId?: ID, customerId?: ID, selectedAccount?: AccountBase, selectedClassBase?: ClassBase, selectedProjectBase?: ProjectBase, isUncategorizedExpenseCategoryEnabled?: boolean, isAccountingClassesEnabled?: boolean) => {
30
+ export declare const shouldAutoSelectAndAdd: (transaction: SupportedTransactionWithCOT, localData: TransactionReviewLocalData, selectedCheckBoxTransactionIds: ID[], isAccountingClassesEnabled?: boolean) => boolean;
31
+ export declare const toTransactionDetailLocalData: (transaction: SupportedTransactionWithCOT, selectedTab: TransactionsTab, lineItemsByTransactionIds: string[]) => TransactionReviewLocalData;
32
+ export declare const toSetAllLineItemsToCategoryClass: (draft: TransactionsTabViewState, transaction: SupportedTransactionWithCOT, transactionId: ID, transactionLineId: ID, transactionDetailLocalData: TransactionReviewLocalData, updatedItem: "category" | "class" | "project", selectedTab: TransactionsTab, vendorId?: ID, customerId?: ID, selectedAccount?: AccountBase, selectedClassBase?: ClassBase, selectedProjectBase?: ProjectBase, isAccountingClassesEnabled?: boolean) => {
33
33
  localData: TransactionReviewLocalData;
34
34
  similarTransactionUpdated: boolean;
35
35
  };
36
- export declare const setEntityRecommendationForLineIdInLocalData: (draft: TransactionsTabViewState, transaction: SupportedTransactionWithCOT, transactionDetailLocalData: TransactionReviewLocalData, entity: Entity, recommendationLineIds: ID[], uncategorizedAccounts: UncategorizedAccounts, recommendationWithCOTByLineId?: RecommendationWithCOTByLineId, isUncategorizedExpenseCategoryEnabled?: boolean, isAccountingClassesEnabled?: boolean) => TransactionReviewLocalData;
37
- export declare const checkIfAllLineItemsAreCategoryClassFilled: (transaction: SupportedTransactionWithCOT, transactionDetailLocalData: TransactionReviewLocalData, uncategorizedAccounts: UncategorizedAccounts, isUncategorizedExpenseCategoryEnabled?: boolean, isAccountingClassesEnabled?: boolean) => boolean;
36
+ export declare const setEntityRecommendationForLineIdInLocalData: (draft: TransactionsTabViewState, transaction: SupportedTransactionWithCOT, transactionDetailLocalData: TransactionReviewLocalData, entity: Entity, recommendationLineIds: ID[], recommendationWithCOTByLineId?: RecommendationWithCOTByLineId, isAccountingClassesEnabled?: boolean) => TransactionReviewLocalData;
37
+ export declare const checkIfAllLineItemsAreCategoryClassFilled: (transaction: SupportedTransactionWithCOT, transactionDetailLocalData: TransactionReviewLocalData, isAccountingClassesEnabled?: boolean) => boolean;
38
38
  export declare const getLineItemsByTransactionsIdsFromResponse: (transactions: SupportedTransactionPayload[]) => Record<string, string[]>;
39
39
  export declare const getLineItemsByTransactionIdsFromLocalData: (transactionLocalData: TransactionReviewLocalDataSelectorView[], selectedTab: TransactionsTab) => Record<ID, string[]>;
40
40
  export declare const mergeTabSpecificLineItems: (currentTabSpecificLineItems: TabSpecificLineItems, selectedTab: TransactionsTab, newLineItems: TabSpecificLineItems) => TabSpecificLineItems;
@@ -72,17 +72,17 @@ exports.MAX_SELECTION_LIMIT = 5;
72
72
  // triplet that was inlined at four sites (updateSelectedCustomer/Vendor,
73
73
  // setAllItemsToCategoryClassInLocalDataForCategorization, and
74
74
  // setEntityRecommendationForLineIdInLocalData below).
75
- const shouldAutoSelectAndAdd = (transaction, localData, selectedCheckBoxTransactionIds, uncategorizedAccounts, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled) => {
75
+ const shouldAutoSelectAndAdd = (transaction, localData, selectedCheckBoxTransactionIds, isAccountingClassesEnabled) => {
76
76
  if (selectedCheckBoxTransactionIds.includes(transaction.id)) {
77
77
  return false;
78
78
  }
79
79
  if (selectedCheckBoxTransactionIds.length >= exports.MAX_SELECTION_LIMIT) {
80
80
  return false;
81
81
  }
82
- return (0, exports.checkIfAllLineItemsAreCategoryClassFilled)(transaction, localData, uncategorizedAccounts, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled);
82
+ return (0, exports.checkIfAllLineItemsAreCategoryClassFilled)(transaction, localData, isAccountingClassesEnabled);
83
83
  };
84
84
  exports.shouldAutoSelectAndAdd = shouldAutoSelectAndAdd;
85
- const toTransactionDetailLocalData = (transaction, selectedTab, lineItemsByTransactionIds, uncategorizedIncomeExpense, isUncategorizedExpenseCategoryEnabled) => {
85
+ const toTransactionDetailLocalData = (transaction, selectedTab, lineItemsByTransactionIds) => {
86
86
  const transactionLocal = {
87
87
  ...transactionsViewState_1.initialSupportedTransactionCategorization.transactionReviewLocalData,
88
88
  };
@@ -169,7 +169,7 @@ const toTransactionDetailLocalData = (transaction, selectedTab, lineItemsByTrans
169
169
  }
170
170
  transactionLocal.lineItemById =
171
171
  transaction.lines != null && transaction.lines.length > 0
172
- ? buildLineItemById(transaction, uncategorizedIncomeExpense, transaction.recommendationsWithCOT, isUncategorizedExpenseCategoryEnabled)
172
+ ? buildLineItemById(transaction, transaction.recommendationsWithCOT)
173
173
  : {};
174
174
  transactionLocal.sortedLineItems =
175
175
  transaction.lines != null && transaction.lines.length > 0
@@ -185,7 +185,7 @@ const toTransactionDetailLocalData = (transaction, selectedTab, lineItemsByTrans
185
185
  return transactionLocal;
186
186
  };
187
187
  exports.toTransactionDetailLocalData = toTransactionDetailLocalData;
188
- const buildLineItemById = (transaction, uncategorizedIncomeExpense, recommendations, isUncategorizedExpenseCategoryEnabled) => {
188
+ const buildLineItemById = (transaction, recommendations) => {
189
189
  const lineItemData = {};
190
190
  const { lines } = transaction;
191
191
  lines?.forEach((line) => {
@@ -249,10 +249,7 @@ const buildLineItemById = (transaction, uncategorizedIncomeExpense, recommendati
249
249
  if (recommendations != null) {
250
250
  record.recommendationsWithCOT = recommendations[lineId];
251
251
  const higherPreferenceRecommendation = recommendations[lineId]?.[0];
252
- if ((Boolean(accountLine.account.accountId) === false ||
253
- (0, transactionDetailLocalDataHelper_2.isAccountUncategorized)(uncategorizedIncomeExpense, accountLine.account.qboId, isUncategorizedExpenseCategoryEnabled === true
254
- ? ['income']
255
- : undefined)) &&
252
+ if (Boolean(accountLine.account.accountId) === false &&
256
253
  higherPreferenceRecommendation?.account != null) {
257
254
  record.account = {
258
255
  ...higherPreferenceRecommendation.account,
@@ -330,7 +327,7 @@ const buildLineItemById = (transaction, uncategorizedIncomeExpense, recommendati
330
327
  });
331
328
  return lineItemData;
332
329
  };
333
- const toSetAllLineItemsToCategoryClass = (draft, transaction, transactionId, transactionLineId, transactionDetailLocalData, updatedItem, uncategorizedAccounts, selectedTab, vendorId, customerId, selectedAccount, selectedClassBase, selectedProjectBase, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled) => {
330
+ const toSetAllLineItemsToCategoryClass = (draft, transaction, transactionId, transactionLineId, transactionDetailLocalData, updatedItem, selectedTab, vendorId, customerId, selectedAccount, selectedClassBase, selectedProjectBase, isAccountingClassesEnabled) => {
334
331
  let newLineItems = {};
335
332
  let selectedCheckBoxTransactionIds = draft.selectedCheckBoxTransactionIds;
336
333
  let similarTransactionUpdated = false;
@@ -387,10 +384,7 @@ const toSetAllLineItemsToCategoryClass = (draft, transaction, transactionId, tra
387
384
  // if the vendor is same, then set the account and class with the selected ones and add the transaction to the selected list
388
385
  if (selectedAccount != null &&
389
386
  updatedItem === 'category' &&
390
- (record.account?.qboId == null ||
391
- (0, transactionDetailLocalDataHelper_2.isAccountUncategorized)(uncategorizedAccounts, record.account?.qboId, isUncategorizedExpenseCategoryEnabled === true
392
- ? ['income']
393
- : undefined) === true)) {
387
+ record.account?.qboId == null) {
394
388
  record.account = selectedAccount;
395
389
  similarTransactionUpdated = true;
396
390
  if ((isAccountingClassesEnabled === false ||
@@ -459,14 +453,14 @@ const toSetAllLineItemsToCategoryClass = (draft, transaction, transactionId, tra
459
453
  selectedEntity: transactionDetailLocalData.selectedEntity,
460
454
  tabSpecificLineItems: transactionDetailLocalData.tabSpecificLineItems,
461
455
  };
462
- if (!(0, exports.checkIfAllLineItemsAreCategoryClassFilled)(transaction, newLocalData, uncategorizedAccounts, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled)) {
456
+ if (!(0, exports.checkIfAllLineItemsAreCategoryClassFilled)(transaction, newLocalData, isAccountingClassesEnabled)) {
463
457
  selectedCheckBoxTransactionIds = selectedCheckBoxTransactionIds.filter((id) => id !== transaction.id);
464
458
  }
465
459
  draft.selectedCheckBoxTransactionIds = selectedCheckBoxTransactionIds;
466
460
  return { localData: newLocalData, similarTransactionUpdated };
467
461
  };
468
462
  exports.toSetAllLineItemsToCategoryClass = toSetAllLineItemsToCategoryClass;
469
- const setEntityRecommendationForLineIdInLocalData = (draft, transaction, transactionDetailLocalData, entity, recommendationLineIds, uncategorizedAccounts, recommendationWithCOTByLineId, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled) => {
463
+ const setEntityRecommendationForLineIdInLocalData = (draft, transaction, transactionDetailLocalData, entity, recommendationLineIds, recommendationWithCOTByLineId, isAccountingClassesEnabled) => {
470
464
  const newLineItems = {};
471
465
  let matchingEntityLineId = undefined;
472
466
  const checkIfNotJEAndDeposit = !(0, vendorTransaction_1.isVendorTransaction)(transaction);
@@ -486,11 +480,8 @@ const setEntityRecommendationForLineIdInLocalData = (draft, transaction, transac
486
480
  };
487
481
  const recommendations = (0, transactionDetailLocalDataHelper_1.mergeTransactionAndEntityRecommendationsWithCOT)(oldRecord.recommendationsWithCOT, recommendationWithCOTByLineId?.[lineId]);
488
482
  const accountLine = line;
489
- const isUncategorizedAccount = (0, transactionDetailLocalDataHelper_2.isAccountUncategorized)(uncategorizedAccounts, accountLine.account.qboId, isUncategorizedExpenseCategoryEnabled === true
490
- ? ['income']
491
- : undefined);
492
483
  record.account =
493
- isUncategorizedAccount === false && accountLine.account.qboId !== ''
484
+ accountLine.account.qboId !== ''
494
485
  ? accountLine.account
495
486
  : recommendations?.[0]?.account
496
487
  ? {
@@ -573,24 +564,22 @@ const setEntityRecommendationForLineIdInLocalData = (draft, transaction, transac
573
564
  // category/class became stale after the entity update). Otherwise
574
565
  // route through shouldAutoSelectAndAdd so the MAX_SELECTION_LIMIT
575
566
  // gate is consistently applied across all auto-add sites.
576
- if (!(0, exports.checkIfAllLineItemsAreCategoryClassFilled)(transaction, newLocalData, uncategorizedAccounts, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled)) {
567
+ if (!(0, exports.checkIfAllLineItemsAreCategoryClassFilled)(transaction, newLocalData, isAccountingClassesEnabled)) {
577
568
  selectedCheckBoxTransactionIds = selectedCheckBoxTransactionIds.filter((id) => id !== transaction.id);
578
569
  }
579
- else if ((0, exports.shouldAutoSelectAndAdd)(transaction, newLocalData, selectedCheckBoxTransactionIds, uncategorizedAccounts, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled)) {
570
+ else if ((0, exports.shouldAutoSelectAndAdd)(transaction, newLocalData, selectedCheckBoxTransactionIds, isAccountingClassesEnabled)) {
580
571
  selectedCheckBoxTransactionIds.push(transaction.id);
581
572
  }
582
573
  draft.selectedCheckBoxTransactionIds = selectedCheckBoxTransactionIds;
583
574
  return newLocalData;
584
575
  };
585
576
  exports.setEntityRecommendationForLineIdInLocalData = setEntityRecommendationForLineIdInLocalData;
586
- const checkIfAllLineItemsAreCategoryClassFilled = (transaction, transactionDetailLocalData, uncategorizedAccounts, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled) => {
577
+ const checkIfAllLineItemsAreCategoryClassFilled = (transaction, transactionDetailLocalData, isAccountingClassesEnabled) => {
587
578
  const lineItems = Object.values(transactionDetailLocalData.lineItemById);
588
579
  const isVendorTransactionAvailable = (0, vendorTransaction_1.isVendorTransaction)(transaction);
589
- const uncategorizedAccountTypes = isUncategorizedExpenseCategoryEnabled === true ? ['income'] : undefined;
590
580
  return lineItems.every((lineItem) => Boolean(lineItem?.account?.qboId) &&
591
581
  (isAccountingClassesEnabled === false ||
592
582
  Boolean(lineItem?.class?.qboId)) &&
593
- (0, transactionDetailLocalDataHelper_2.isAccountUncategorized)(uncategorizedAccounts, lineItem?.account?.qboId, uncategorizedAccountTypes) === false &&
594
583
  ((isVendorTransactionAvailable
595
584
  ? Boolean(transactionDetailLocalData?.vendor?.id)
596
585
  : Boolean(lineItem?.vendor?.id)) ||
@@ -17,7 +17,7 @@ import { TransactionFilters } from '../transactionFilterHelpers';
17
17
  import { SupportedTransactionCategorization, TransactionSaveUpdates, TransactionsTab, TransactionsTabViewState, TransactionsViewState, TransactionsViewUIState } from '../types/transactionsViewState';
18
18
  export declare const initialTransactionTabViewState: TransactionsTabViewState;
19
19
  export declare const initialState: TransactionsViewState;
20
- 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], {
20
+ 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], {
21
21
  selectedTab: "review" | "autoCategorized";
22
22
  period: TimePeriod;
23
23
  searchString: string | undefined;
@@ -26,14 +26,13 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
26
26
  cacheOverride: any;
27
27
  refreshViewInBackground: any;
28
28
  resetListItems: boolean | undefined;
29
- isUncategorizedExpenseCategoryEnabled: boolean | undefined;
30
29
  }, "expenseAutomationTransactionsView/fetchTransactionCategorization", never, never>, updateTransactionCategorizationUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
31
30
  selectedTab: TransactionsTab;
32
31
  uiState: Partial<TransactionsViewUIState>;
33
32
  }, "expenseAutomationTransactionsView/updateTransactionCategorizationUIState">, updateTransactionFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
34
33
  filters: TransactionFilters;
35
34
  selectedTab: TransactionsTab;
36
- }, "expenseAutomationTransactionsView/updateTransactionFilters">, 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], {
35
+ }, "expenseAutomationTransactionsView/updateTransactionFilters">, initializeTransactionCategorizationViewLocalData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionIds: string[], selectedPeriod: MonthYearPeriod, keepExistingListItems: any, pageToken: PageToken, totalCount: number, lineItemsByTransactionIds: Record<string, string[]>, refreshViewInBackground?: any], {
37
36
  selectedTab: "review" | "autoCategorized";
38
37
  transactionIds: string[];
39
38
  selectedPeriod: MonthYearPeriod;
@@ -42,7 +41,6 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
42
41
  totalCount: number;
43
42
  lineItemsByTransactionIds: Record<string, string[]>;
44
43
  refreshViewInBackground: any;
45
- isUncategorizedExpenseCategoryEnabled: boolean | undefined;
46
44
  }, "expenseAutomationTransactionsView/initializeTransactionCategorizationViewLocalData", never, never>, saveTransactionCategorizationLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
47
45
  keepExistingListItems: boolean;
48
46
  pageToken: PageToken;
@@ -56,17 +54,15 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
56
54
  selectedPeriod: MonthYearPeriod;
57
55
  selectedTab: TransactionsTab;
58
56
  status: ZeniAPIStatus;
59
- }, "expenseAutomationTransactionsView/fetchTransactionCategorizationFailure">, saveTransactionCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionIds: string[], cotTrackingByTransactionId: COTTransactionTrackingByTransactionId, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
57
+ }, "expenseAutomationTransactionsView/fetchTransactionCategorizationFailure">, saveTransactionCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionIds: string[], cotTrackingByTransactionId: COTTransactionTrackingByTransactionId], {
60
58
  selectedTab: "review" | "autoCategorized";
61
59
  transactionIds: string[];
62
60
  cotTrackingByTransactionId: COTTransactionTrackingByTransactionId;
63
- isUncategorizedExpenseCategoryEnabled: boolean | undefined;
64
- }, "expenseAutomationTransactionsView/saveTransactionCategorization", never, never>, updateTransactionCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionIds: string[], transactionSaveUpdates: TransactionSaveUpdates[], cotTrackingByTransactionId: COTTransactionTrackingByTransactionId, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
61
+ }, "expenseAutomationTransactionsView/saveTransactionCategorization", never, never>, updateTransactionCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionIds: string[], transactionSaveUpdates: TransactionSaveUpdates[], cotTrackingByTransactionId: COTTransactionTrackingByTransactionId], {
65
62
  selectedTab: "review" | "autoCategorized";
66
63
  transactionIds: string[];
67
64
  transactionSaveUpdates: TransactionSaveUpdates[];
68
65
  cotTrackingByTransactionId: COTTransactionTrackingByTransactionId;
69
- isUncategorizedExpenseCategoryEnabled: boolean | undefined;
70
66
  }, "expenseAutomationTransactionsView/updateTransactionCategorization", never, never>, updateCurrentSelectedTransactionCategorizationTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSelectedTab: "review" | "autoCategorized"], {
71
67
  newSelectedTab: "review" | "autoCategorized";
72
68
  }, "expenseAutomationTransactionsView/updateCurrentSelectedTransactionCategorizationTab", never, never>, updateTransactionCategorizationCompletedSubTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSubTab: "all" | "manual" | "ai_accountant"], {
@@ -75,10 +71,9 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
75
71
  selectedTab: "review" | "autoCategorized";
76
72
  fetchState: FetchState;
77
73
  error: ZeniAPIStatus<Record<string, unknown>> | undefined;
78
- }, "expenseAutomationTransactionsView/updateTransactionCategorizationSaveStatus", never, never>, markTransactionAsNotMiscategorized: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionsInReview: UpdateTransactionCategorizationResponsePayload, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
74
+ }, "expenseAutomationTransactionsView/updateTransactionCategorizationSaveStatus", never, never>, markTransactionAsNotMiscategorized: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionsInReview: UpdateTransactionCategorizationResponsePayload], {
79
75
  selectedTab: "review" | "autoCategorized";
80
76
  transactionsInReview: UpdateTransactionCategorizationResponsePayload;
81
- isUncategorizedExpenseCategoryEnabled: boolean | undefined;
82
77
  }, "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, updateLineItemsByTransactionId?: Record<string, string[]> | undefined], {
83
78
  removeTransactionIdsFromSelectedPeriod: string[];
84
79
  selectedPeriod: MonthYearPeriod;
@@ -94,7 +89,6 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
94
89
  transactionId: ID;
95
90
  uncategorizedAccounts: UncategorizedAccounts;
96
91
  isAccountingClassesEnabled?: boolean;
97
- isUncategorizedExpenseCategoryEnabled?: boolean;
98
92
  selectedEntity?: Entity;
99
93
  updatedVendor?: VendorBase;
100
94
  }, "expenseAutomationTransactionsView/updateSelectedVendorForTransaction">, updateSelectedCustomerForTransaction: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
@@ -104,10 +98,9 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
104
98
  transactionId: ID;
105
99
  uncategorizedAccounts: UncategorizedAccounts;
106
100
  isAccountingClassesEnabled?: boolean;
107
- isUncategorizedExpenseCategoryEnabled?: boolean;
108
101
  selectedEntity?: Entity;
109
102
  updatedCustomer?: CustomerBase;
110
- }, "expenseAutomationTransactionsView/updateSelectedCustomerForTransaction">, setAllItemsToCategoryClassInLocalDataForCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionId: string, lineId: string, transactions: SupportedTransactionWithCOT[], uncategorizedAccounts: UncategorizedAccounts, vendorId?: string | undefined, customerId?: string | undefined, selectedAccount?: AccountBase | undefined, selectedClassBase?: ClassBase | undefined, lineEntity?: Entity | undefined, recommendations?: RecommendationWithCOT[] | undefined, isUncategorizedExpenseCategoryEnabled?: boolean | undefined, isAccountingClassesEnabled?: boolean | undefined, selectedProjectBase?: ProjectBase | undefined], {
103
+ }, "expenseAutomationTransactionsView/updateSelectedCustomerForTransaction">, setAllItemsToCategoryClassInLocalDataForCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionId: string, lineId: string, transactions: SupportedTransactionWithCOT[], uncategorizedAccounts: UncategorizedAccounts, vendorId?: string | undefined, customerId?: string | undefined, selectedAccount?: AccountBase | undefined, selectedClassBase?: ClassBase | undefined, lineEntity?: Entity | undefined, recommendations?: RecommendationWithCOT[] | undefined, isAccountingClassesEnabled?: boolean | undefined, selectedProjectBase?: ProjectBase | undefined], {
111
104
  selectedTab: "review" | "autoCategorized";
112
105
  transactionId: string;
113
106
  lineId: string;
@@ -121,7 +114,6 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
121
114
  recommendations: RecommendationWithCOT[] | undefined;
122
115
  uncategorizedAccounts: UncategorizedAccounts;
123
116
  isAccountingClassesEnabled: boolean | undefined;
124
- isUncategorizedExpenseCategoryEnabled: boolean | undefined;
125
117
  }, "expenseAutomationTransactionsView/setAllItemsToCategoryClassInLocalDataForCategorization", never, never>, updateTotalCountForTransactionCategorization: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
126
118
  selectedPeriod: MonthYearPeriod;
127
119
  selectedTab: TransactionsTab;
@@ -137,7 +129,7 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
137
129
  }, "expenseAutomationTransactionsView/fetchTransactionCategorizationSuccess">, resetOtherTabsFetchState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
138
130
  tabs: TransactionsTab[];
139
131
  refreshViewInBackground?: boolean;
140
- }, "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], {
132
+ }, "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], {
141
133
  selectedTab: "review" | "autoCategorized";
142
134
  period: TimePeriod;
143
135
  searchString: string | undefined;
@@ -146,11 +138,10 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
146
138
  cacheOverride: any;
147
139
  refreshViewInBackground: any;
148
140
  resetListItems: any;
149
- isUncategorizedExpenseCategoryEnabled: boolean | undefined;
150
141
  }, "expenseAutomationTransactionsView/fetchTransactionCategorizationView", never, never>, updateSelectedCheckboxTransactionIds: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
151
142
  selectedTab: TransactionsTab;
152
143
  transactionIds: ID[];
153
- }, "expenseAutomationTransactionsView/updateSelectedCheckboxTransactionIds">, clearExpenseAutomationTransactionsViewPerTabView: import("@reduxjs/toolkit").ActionCreatorWithPayload<"review" | "autoCategorized", "expenseAutomationTransactionsView/clearExpenseAutomationTransactionsViewPerTabView">, clearExpenseAutomationTransactionsView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationTransactionsView/clearExpenseAutomationTransactionsView">, setEntityRecommendationForLineIdsForCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionId: TransactionID, transaction: SupportedTransactionWithCOT, lineIds: string[], entity: Entity, amount: number, recommendationWithCOTByLineId: RecommendationWithCOTByLineId, uncategorizedAccounts: UncategorizedAccounts, isUncategorizedExpenseCategoryEnabled?: boolean | undefined, isAccountingClassesEnabled?: boolean | undefined], {
144
+ }, "expenseAutomationTransactionsView/updateSelectedCheckboxTransactionIds">, clearExpenseAutomationTransactionsViewPerTabView: import("@reduxjs/toolkit").ActionCreatorWithPayload<"review" | "autoCategorized", "expenseAutomationTransactionsView/clearExpenseAutomationTransactionsViewPerTabView">, clearExpenseAutomationTransactionsView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationTransactionsView/clearExpenseAutomationTransactionsView">, setEntityRecommendationForLineIdsForCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionId: TransactionID, transaction: SupportedTransactionWithCOT, lineIds: string[], entity: Entity, amount: number, recommendationWithCOTByLineId: RecommendationWithCOTByLineId, uncategorizedAccounts: UncategorizedAccounts, isAccountingClassesEnabled?: boolean | undefined], {
154
145
  selectedTab: "review" | "autoCategorized";
155
146
  transactionId: TransactionID;
156
147
  transaction: SupportedTransactionWithCOT;
@@ -160,7 +151,6 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
160
151
  recommendationWithCOTByLineId: RecommendationWithCOTByLineId;
161
152
  uncategorizedAccounts: UncategorizedAccounts;
162
153
  isAccountingClassesEnabled: boolean | undefined;
163
- isUncategorizedExpenseCategoryEnabled: boolean | undefined;
164
154
  }, "expenseAutomationTransactionsView/setEntityRecommendationForLineIdsForCategorization", never, never>, markCategoryClassRecommendationsInProgressForCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionId: TransactionID, lineIds: string[]], {
165
155
  selectedTab: "review" | "autoCategorized";
166
156
  transactionId: TransactionID;
@@ -178,15 +168,12 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
178
168
  lineId: ID;
179
169
  selectedTab: TransactionsTab;
180
170
  transactionId: ID;
181
- }, "expenseAutomationTransactionsView/updateSelectedTransactionId">, syncTransactionCategorizationFromDetailSave: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, updatedTransaction: SupportedTransactionWithCOT, pendingReviewLineIds: string[], uncategorizedIncomeExpense: UncategorizedAccounts, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
171
+ }, "expenseAutomationTransactionsView/updateSelectedTransactionId">, syncTransactionCategorizationFromDetailSave: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, updatedTransaction: SupportedTransactionWithCOT, pendingReviewLineIds: string[]], {
182
172
  transactionId: TransactionID;
183
173
  updatedTransaction: SupportedTransactionWithCOT;
184
174
  pendingReviewLineIds: string[];
185
- uncategorizedIncomeExpense: UncategorizedAccounts;
186
- isUncategorizedExpenseCategoryEnabled: boolean | undefined;
187
- }, "expenseAutomationTransactionsView/syncTransactionCategorizationFromDetailSave", never, never>, backgroundRefetchReviewTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
175
+ }, "expenseAutomationTransactionsView/syncTransactionCategorizationFromDetailSave", never, never>, backgroundRefetchReviewTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod], {
188
176
  period: TimePeriod;
189
- isUncategorizedExpenseCategoryEnabled: boolean | undefined;
190
177
  }, "expenseAutomationTransactionsView/backgroundRefetchReviewTab", never, never>, removeTransactionFromAllTabs: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: string], {
191
178
  transactionId: string;
192
179
  }, "expenseAutomationTransactionsView/removeTransactionFromAllTabs", never, never>, updateTransactionCategorizationUploadReceiptState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionId: string, fetchStatus: FetchStateAndError], {
@@ -128,7 +128,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
128
128
  reducers: {
129
129
  fetchTransactionCategorizationView: {
130
130
  prepare(selectedTab, period, cacheOverride = false, keepExistingListItems = false, searchString, // when this is defined the output should go to search result IDs
131
- pageToken, refreshViewInBackground = false, resetListItems = false, isUncategorizedExpenseCategoryEnabled) {
131
+ pageToken, refreshViewInBackground = false, resetListItems = false) {
132
132
  return {
133
133
  payload: {
134
134
  selectedTab,
@@ -139,7 +139,6 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
139
139
  cacheOverride,
140
140
  refreshViewInBackground,
141
141
  resetListItems,
142
- isUncategorizedExpenseCategoryEnabled,
143
142
  },
144
143
  };
145
144
  },
@@ -207,7 +206,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
207
206
  }
208
207
  },
209
208
  prepare(selectedTab, period, cacheOverride = false, keepExistingListItems = false, searchString, // when this is defined the output should go to search result IDs
210
- pageToken, refreshViewInBackground = false, resetListItems, isUncategorizedExpenseCategoryEnabled) {
209
+ pageToken, refreshViewInBackground = false, resetListItems) {
211
210
  return {
212
211
  payload: {
213
212
  selectedTab,
@@ -218,13 +217,12 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
218
217
  cacheOverride,
219
218
  refreshViewInBackground,
220
219
  resetListItems,
221
- isUncategorizedExpenseCategoryEnabled,
222
220
  },
223
221
  };
224
222
  },
225
223
  },
226
224
  initializeTransactionCategorizationViewLocalData: {
227
- prepare(selectedTab, transactionIds, selectedPeriod, keepExistingListItems = false, pageToken, totalCount, lineItemsByTransactionIds, refreshViewInBackground = false, isUncategorizedExpenseCategoryEnabled) {
225
+ prepare(selectedTab, transactionIds, selectedPeriod, keepExistingListItems = false, pageToken, totalCount, lineItemsByTransactionIds, refreshViewInBackground = false) {
228
226
  return {
229
227
  payload: {
230
228
  selectedTab,
@@ -235,7 +233,6 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
235
233
  totalCount,
236
234
  lineItemsByTransactionIds,
237
235
  refreshViewInBackground,
238
- isUncategorizedExpenseCategoryEnabled,
239
236
  },
240
237
  };
241
238
  },
@@ -339,13 +336,12 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
339
336
  });
340
337
  },
341
338
  saveTransactionCategorization: {
342
- prepare(selectedTab, transactionIds, cotTrackingByTransactionId, isUncategorizedExpenseCategoryEnabled) {
339
+ prepare(selectedTab, transactionIds, cotTrackingByTransactionId) {
343
340
  return {
344
341
  payload: {
345
342
  selectedTab,
346
343
  transactionIds,
347
344
  cotTrackingByTransactionId,
348
- isUncategorizedExpenseCategoryEnabled,
349
345
  },
350
346
  };
351
347
  },
@@ -419,21 +415,20 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
419
415
  fetchState: 'In-Progress',
420
416
  };
421
417
  },
422
- prepare(selectedTab, transactionIds, transactionSaveUpdates, cotTrackingByTransactionId, isUncategorizedExpenseCategoryEnabled) {
418
+ prepare(selectedTab, transactionIds, transactionSaveUpdates, cotTrackingByTransactionId) {
423
419
  return {
424
420
  payload: {
425
421
  selectedTab,
426
422
  transactionIds,
427
423
  transactionSaveUpdates,
428
424
  cotTrackingByTransactionId,
429
- isUncategorizedExpenseCategoryEnabled,
430
425
  },
431
426
  };
432
427
  },
433
428
  },
434
429
  setAllItemsToCategoryClassInLocalDataForCategorization: {
435
430
  reducer(draft, action) {
436
- const { vendorId, customerId, selectedAccount, selectedClassBase, selectedProjectBase, transactions, transactionId, lineId, selectedTab, uncategorizedAccounts, isAccountingClassesEnabled, isUncategorizedExpenseCategoryEnabled, } = action.payload;
431
+ const { vendorId, customerId, selectedAccount, selectedClassBase, selectedProjectBase, transactions, transactionId, lineId, selectedTab, isAccountingClassesEnabled, } = action.payload;
437
432
  const transactionLocalData = (0, get_1.default)(draft.transactionCategorizationView[selectedTab]
438
433
  .transactionReviewLocalDataById, transactionId, undefined);
439
434
  const existingAccount = transactionLocalData?.transactionReviewLocalData.lineItemById[lineId]
@@ -459,7 +454,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
459
454
  const selectedCheckBoxTransactionIds = draft.transactionCategorizationView[selectedTab]
460
455
  .selectedCheckBoxTransactionIds;
461
456
  if (selectedTransaction != null &&
462
- (0, transactionCategorizationLocalDataHelper_1.shouldAutoSelectAndAdd)(selectedTransaction, newTransactionLocalData, selectedCheckBoxTransactionIds, uncategorizedAccounts, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled)) {
457
+ (0, transactionCategorizationLocalDataHelper_1.shouldAutoSelectAndAdd)(selectedTransaction, newTransactionLocalData, selectedCheckBoxTransactionIds, isAccountingClassesEnabled)) {
463
458
  draft.transactionCategorizationView[selectedTab].selectedCheckBoxTransactionIds = [
464
459
  ...selectedCheckBoxTransactionIds,
465
460
  transactionId,
@@ -482,7 +477,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
482
477
  : existingProjectId !== selectedProjectBase?.projectId
483
478
  ? 'project'
484
479
  : 'class';
485
- const { localData, similarTransactionUpdated } = (0, transactionCategorizationLocalDataHelper_1.toSetAllLineItemsToCategoryClass)(draft.transactionCategorizationView[selectedTab], transaction, transactionId, lineId, transactionLocalData.transactionReviewLocalData, updatedItem, uncategorizedAccounts, selectedTab, vendorId, customerId, selectedAccount, selectedClassBase, selectedProjectBase, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled);
480
+ const { localData, similarTransactionUpdated } = (0, transactionCategorizationLocalDataHelper_1.toSetAllLineItemsToCategoryClass)(draft.transactionCategorizationView[selectedTab], transaction, transactionId, lineId, transactionLocalData.transactionReviewLocalData, updatedItem, selectedTab, vendorId, customerId, selectedAccount, selectedClassBase, selectedProjectBase, isAccountingClassesEnabled);
486
481
  draft.transactionCategorizationView[selectedTab].transactionReviewLocalDataById[transaction.id] = {
487
482
  transactionId: transaction.id,
488
483
  transactionReviewLocalData: localData,
@@ -501,7 +496,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
501
496
  ...dirtyIds,
502
497
  ]);
503
498
  },
504
- prepare(selectedTab, transactionId, lineId, transactions, uncategorizedAccounts, vendorId, customerId, selectedAccount, selectedClassBase, lineEntity, recommendations, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled, selectedProjectBase) {
499
+ prepare(selectedTab, transactionId, lineId, transactions, uncategorizedAccounts, vendorId, customerId, selectedAccount, selectedClassBase, lineEntity, recommendations, isAccountingClassesEnabled, selectedProjectBase) {
505
500
  return {
506
501
  payload: {
507
502
  selectedTab,
@@ -517,13 +512,12 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
517
512
  recommendations,
518
513
  uncategorizedAccounts,
519
514
  isAccountingClassesEnabled,
520
- isUncategorizedExpenseCategoryEnabled,
521
515
  },
522
516
  };
523
517
  },
524
518
  },
525
519
  setEntityRecommendationForLineIdsForCategorization: {
526
- prepare(selectedTab, transactionId, transaction, lineIds, entity, amount, recommendationWithCOTByLineId, uncategorizedAccounts, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled) {
520
+ prepare(selectedTab, transactionId, transaction, lineIds, entity, amount, recommendationWithCOTByLineId, uncategorizedAccounts, isAccountingClassesEnabled) {
527
521
  return {
528
522
  payload: {
529
523
  selectedTab,
@@ -535,16 +529,15 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
535
529
  recommendationWithCOTByLineId,
536
530
  uncategorizedAccounts,
537
531
  isAccountingClassesEnabled,
538
- isUncategorizedExpenseCategoryEnabled,
539
532
  },
540
533
  };
541
534
  },
542
535
  reducer(draft, action) {
543
- const { entity, transaction, transactionId, selectedTab, lineIds, uncategorizedAccounts, isAccountingClassesEnabled, isUncategorizedExpenseCategoryEnabled, } = action.payload;
536
+ const { entity, transaction, transactionId, selectedTab, lineIds, isAccountingClassesEnabled, } = action.payload;
544
537
  const transactionLocalData = (0, get_1.default)(draft.transactionCategorizationView[selectedTab]
545
538
  .transactionReviewLocalDataById, transactionId.id, undefined);
546
539
  if (transactionLocalData != null) {
547
- const newLocalData = (0, transactionCategorizationLocalDataHelper_1.setEntityRecommendationForLineIdInLocalData)(draft.transactionCategorizationView[selectedTab], transaction, transactionLocalData.transactionReviewLocalData, entity, lineIds, uncategorizedAccounts, action.payload.recommendationWithCOTByLineId, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled);
540
+ const newLocalData = (0, transactionCategorizationLocalDataHelper_1.setEntityRecommendationForLineIdInLocalData)(draft.transactionCategorizationView[selectedTab], transaction, transactionLocalData.transactionReviewLocalData, entity, lineIds, action.payload.recommendationWithCOTByLineId, isAccountingClassesEnabled);
548
541
  // Release the per-line fetch flag for every line this fetch
549
542
  // covered. Done in-place on the freshly returned local data
550
543
  // (the helper produces a new mutable object), before we write
@@ -717,7 +710,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
717
710
  action.payload.status;
718
711
  },
719
712
  updateSelectedCustomerForTransaction(draft, action) {
720
- const { transactionId, lineId, updatedCustomer, selectedTransaction, selectedTab, uncategorizedAccounts, isAccountingClassesEnabled, isUncategorizedExpenseCategoryEnabled, } = action.payload;
713
+ const { transactionId, lineId, updatedCustomer, selectedTransaction, selectedTab, isAccountingClassesEnabled, } = action.payload;
721
714
  const transactionLocalData = (0, get_1.default)(draft.transactionCategorizationView[selectedTab]
722
715
  .transactionReviewLocalDataById, transactionId, undefined);
723
716
  if (transactionLocalData != null) {
@@ -770,7 +763,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
770
763
  .selectedCheckBoxTransactionIds;
771
764
  if (newTransactionLocalData.customer != null &&
772
765
  newTransactionLocalData.customer.id != null &&
773
- (0, transactionCategorizationLocalDataHelper_1.shouldAutoSelectAndAdd)(selectedTransaction, newTransactionLocalData, selectedCheckBoxTransactionIds, uncategorizedAccounts, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled)) {
766
+ (0, transactionCategorizationLocalDataHelper_1.shouldAutoSelectAndAdd)(selectedTransaction, newTransactionLocalData, selectedCheckBoxTransactionIds, isAccountingClassesEnabled)) {
774
767
  draft.transactionCategorizationView[selectedTab].selectedCheckBoxTransactionIds = [
775
768
  ...selectedCheckBoxTransactionIds,
776
769
  transactionId,
@@ -787,7 +780,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
787
780
  }
788
781
  },
789
782
  updateSelectedVendorForTransaction(draft, action) {
790
- const { transactionId, lineId, updatedVendor, selectedTransaction, selectedTab, uncategorizedAccounts, isAccountingClassesEnabled, isUncategorizedExpenseCategoryEnabled, } = action.payload;
783
+ const { transactionId, lineId, updatedVendor, selectedTransaction, selectedTab, isAccountingClassesEnabled, } = action.payload;
791
784
  const transactionLocalData = (0, get_1.default)(draft.transactionCategorizationView[selectedTab]
792
785
  .transactionReviewLocalDataById, transactionId, undefined);
793
786
  if (transactionLocalData != null) {
@@ -844,7 +837,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
844
837
  .selectedCheckBoxTransactionIds;
845
838
  if (newTransactionLocalData.vendor != null &&
846
839
  newTransactionLocalData.vendor.id != null &&
847
- (0, transactionCategorizationLocalDataHelper_1.shouldAutoSelectAndAdd)(selectedTransaction, newTransactionLocalData, selectedCheckBoxTransactionIds, uncategorizedAccounts, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled)) {
840
+ (0, transactionCategorizationLocalDataHelper_1.shouldAutoSelectAndAdd)(selectedTransaction, newTransactionLocalData, selectedCheckBoxTransactionIds, isAccountingClassesEnabled)) {
848
841
  draft.transactionCategorizationView[selectedTab].selectedCheckBoxTransactionIds = [
849
842
  ...selectedCheckBoxTransactionIds,
850
843
  transactionId,
@@ -892,12 +885,11 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
892
885
  error: undefined,
893
886
  };
894
887
  },
895
- prepare(selectedTab, transactionsInReview, isUncategorizedExpenseCategoryEnabled) {
888
+ prepare(selectedTab, transactionsInReview) {
896
889
  return {
897
890
  payload: {
898
891
  selectedTab,
899
892
  transactionsInReview,
900
- isUncategorizedExpenseCategoryEnabled,
901
893
  },
902
894
  };
903
895
  },
@@ -1007,19 +999,17 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
1007
999
  },
1008
1000
  },
1009
1001
  syncTransactionCategorizationFromDetailSave: {
1010
- prepare(transactionId, updatedTransaction, pendingReviewLineIds, uncategorizedIncomeExpense, isUncategorizedExpenseCategoryEnabled) {
1002
+ prepare(transactionId, updatedTransaction, pendingReviewLineIds) {
1011
1003
  return {
1012
1004
  payload: {
1013
1005
  transactionId,
1014
1006
  updatedTransaction,
1015
1007
  pendingReviewLineIds,
1016
- uncategorizedIncomeExpense,
1017
- isUncategorizedExpenseCategoryEnabled,
1018
1008
  },
1019
1009
  };
1020
1010
  },
1021
1011
  reducer(draft, action) {
1022
- const { transactionId, updatedTransaction, pendingReviewLineIds, uncategorizedIncomeExpense, isUncategorizedExpenseCategoryEnabled, } = action.payload;
1012
+ const { transactionId, updatedTransaction, pendingReviewLineIds, } = action.payload;
1023
1013
  const txnId = transactionId.id;
1024
1014
  const reviewTabView = draft.transactionCategorizationView.review;
1025
1015
  const autoTabView = draft.transactionCategorizationView.autoCategorized;
@@ -1041,7 +1031,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
1041
1031
  }
1042
1032
  // Partially reviewed: rebuild review tab local data with pending review lines
1043
1033
  if (existsInReview) {
1044
- const newLocalData = (0, transactionCategorizationLocalDataHelper_1.toTransactionDetailLocalData)(updatedTransaction, 'review', pendingReviewLineIds, uncategorizedIncomeExpense, isUncategorizedExpenseCategoryEnabled);
1034
+ const newLocalData = (0, transactionCategorizationLocalDataHelper_1.toTransactionDetailLocalData)(updatedTransaction, 'review', pendingReviewLineIds);
1045
1035
  reviewTabView.transactionReviewLocalDataById[txnId] = {
1046
1036
  transactionId: txnId,
1047
1037
  transactionReviewLocalData: {
@@ -1060,11 +1050,10 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
1060
1050
  },
1061
1051
  },
1062
1052
  backgroundRefetchReviewTab: {
1063
- prepare(period, isUncategorizedExpenseCategoryEnabled) {
1053
+ prepare(period) {
1064
1054
  return {
1065
1055
  payload: {
1066
1056
  period,
1067
- isUncategorizedExpenseCategoryEnabled,
1068
1057
  },
1069
1058
  };
1070
1059
  },
@@ -13,7 +13,7 @@ const transactionDetailState_1 = require("../transactionDetail/transactionDetail
13
13
  const recommendationHelper_1 = require("./recommendationHelper");
14
14
  const recommendationReducer_1 = require("./recommendationReducer");
15
15
  const fetchEntityRecommendationsByTransactionIdEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(recommendationReducer_1.fetchEntityRecommendationsByTransactionId.match), (0, operators_1.switchMap)((action) => {
16
- const { entity, amount, transactionDetails, isBulkFetch, isTransactionCategorizationFlow, isFetchCOT, isUncategorizedExpenseCategoryEnabled, } = action.payload;
16
+ const { entity, amount, transactionDetails, isBulkFetch, isTransactionCategorizationFlow, isFetchCOT, } = action.payload;
17
17
  const { expenseAutomationTransactionsViewState: { selectedTransactionCategorizationTab, }, } = state$.value;
18
18
  const query = {
19
19
  amount,
@@ -55,7 +55,7 @@ const fetchEntityRecommendationsByTransactionIdEpic = (actions$, state$, zeniAPI
55
55
  if (recommendationWithCOTByLineId != null) {
56
56
  const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(state$.value.accountState, state$.value.accountListState, 'accountList');
57
57
  if (isTransactionCategorizationFlow === true) {
58
- actions.push((0, transactionsViewReducer_1.setEntityRecommendationForLineIdsForCategorization)(selectedTransactionCategorizationTab, transactionId, transactionWithCOT, lineIds, entity, amount, recommendationWithCOTByLineId, uncategorizedIncomeExpense, isUncategorizedExpenseCategoryEnabled, (0, tenantSelector_1.getIsAccountingClassesEnabled)(state$.value)));
58
+ actions.push((0, transactionsViewReducer_1.setEntityRecommendationForLineIdsForCategorization)(selectedTransactionCategorizationTab, transactionId, transactionWithCOT, lineIds, entity, amount, recommendationWithCOTByLineId, uncategorizedIncomeExpense, (0, tenantSelector_1.getIsAccountingClassesEnabled)(state$.value)));
59
59
  }
60
60
  else {
61
61
  actions.push((0, transactionDetailReducer_1.setEntityRecommendationForLineIdsForTransactionDetail)(transactionId, transactionWithCOT, lineIds, entity, amount, recommendationWithCOTByLineId, uncategorizedIncomeExpense));