@zeniai/client-epic-state 5.0.69-betaAR4 → 5.0.69-betaAR5

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 (66) hide show
  1. package/lib/commonStateTypes/filterPrimitives.d.ts +23 -0
  2. package/lib/commonStateTypes/filterPrimitives.js +21 -0
  3. package/lib/entity/account/accountSelector.d.ts +26 -0
  4. package/lib/entity/account/accountSelector.js +47 -1
  5. package/lib/entity/account/accountState.d.ts +5 -0
  6. package/lib/entity/account/accountState.js +11 -4
  7. package/lib/entity/approvalRule/approvalRulePayload.d.ts +5 -27
  8. package/lib/entity/approvalRule/approvalRulePayload.js +10 -131
  9. package/lib/entity/approvalRule/approvalRuleSelector.d.ts +1 -25
  10. package/lib/entity/approvalRule/approvalRuleSelector.js +0 -40
  11. package/lib/entity/approvalRule/approvalRuleState.d.ts +7 -48
  12. package/lib/entity/class/classSelector.d.ts +35 -0
  13. package/lib/entity/class/classSelector.js +50 -0
  14. package/lib/esm/commonStateTypes/filterPrimitives.js +20 -0
  15. package/lib/esm/entity/account/accountSelector.js +46 -1
  16. package/lib/esm/entity/account/accountState.js +7 -1
  17. package/lib/esm/entity/approvalRule/approvalRulePayload.js +10 -131
  18. package/lib/esm/entity/approvalRule/approvalRuleSelector.js +0 -35
  19. package/lib/esm/entity/class/classSelector.js +48 -0
  20. package/lib/esm/index.js +11 -6
  21. package/lib/esm/view/companyHealthMetricView/companyHealthMetricViewSelector.js +1 -1
  22. package/lib/esm/view/companyView/helpers/cockpitHelpers.js +1 -1
  23. package/lib/esm/view/companyView/selector/companyManagementViewSelector.js +1 -1
  24. package/lib/esm/view/companyView/selector/companyPortfolioViewSelector.js +1 -1
  25. package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +11 -1
  26. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +69 -12
  27. package/lib/esm/view/expenseAutomationView/transactionFilterHelpers.js +245 -0
  28. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +7 -11
  29. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +16 -61
  30. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +2 -7
  31. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +7 -11
  32. package/lib/esm/view/spendManagement/spendManagementFilterHelpers.js +4 -2
  33. package/lib/esm/view/subscriptionView/subscriptionViewSelector.js +1 -1
  34. package/lib/esm/view/taskManager/taskListView/taskListReducer.js +1 -1
  35. package/lib/index.d.ts +9 -8
  36. package/lib/index.js +41 -38
  37. package/lib/view/companyHealthMetricView/companyHealthMetricViewSelector.js +1 -1
  38. package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +2 -2
  39. package/lib/view/companyView/helpers/cockpitHelpers.js +1 -1
  40. package/lib/view/companyView/selector/companyManagementViewSelector.js +1 -1
  41. package/lib/view/companyView/selector/companyPortfolioViewSelector.js +1 -1
  42. package/lib/view/companyView/types/cockpitTypes.d.ts +2 -2
  43. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +5 -1
  44. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +12 -2
  45. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +4 -1
  46. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +71 -12
  47. package/lib/view/expenseAutomationView/transactionFilterHelpers.d.ts +66 -0
  48. package/lib/view/expenseAutomationView/transactionFilterHelpers.js +249 -0
  49. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -0
  50. package/lib/view/people/peopleTypes.d.ts +1 -1
  51. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  52. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +6 -10
  53. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.d.ts +1 -9
  54. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +16 -61
  55. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonState.d.ts +5 -31
  56. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +2 -7
  57. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
  58. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistory.d.ts +1 -1
  59. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
  60. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +6 -10
  61. package/lib/view/spendManagement/spendManagementFilterHelpers.d.ts +12 -3
  62. package/lib/view/spendManagement/spendManagementFilterHelpers.js +4 -2
  63. package/lib/view/subscriptionView/subscriptionViewSelector.js +1 -1
  64. package/lib/view/taskManager/taskListView/taskList.d.ts +4 -4
  65. package/lib/view/taskManager/taskListView/taskListReducer.js +1 -1
  66. package/package.json +1 -1
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Shared filter primitives — used by both Transaction Categorization and
3
+ * Spend Management filter pipelines.
4
+ *
5
+ * These types are deliberately decoupled from any specific feature group:
6
+ *
7
+ * - `CategoryCombinationOperator` is how a `categories[]` array combines
8
+ * (`AND` ⇒ every category must match; `OR` ⇒ any category matches).
9
+ * - `FilterCategoryType` is the input-type tag a filter category uses to
10
+ * pick its value-picker UI (text autocomplete, user picker, date range,
11
+ * number range, plain dropdown).
12
+ *
13
+ * They used to be redeclared locally in both `transactionFilterHelpers.ts`
14
+ * and `spendManagementFilterHelpers.ts` to keep the feature groups
15
+ * independent. Centralising them here is consistent with Route B (which
16
+ * separated the *matching pipelines*, not the *shared primitive types*) and
17
+ * removes the maintenance trap of two identical type definitions drifting
18
+ * apart over time.
19
+ */
20
+ export {};
@@ -1,7 +1,8 @@
1
+ import { createSelector } from '@reduxjs/toolkit';
1
2
  import flatMap from 'lodash/flatMap';
2
3
  import { getCOABalances } from '../../commonStateTypes/coaBalance/coaBalance';
3
4
  import { sortComparator } from '../../commonStateTypes/coaBalance/sortBalancesByFreeRangeTotal';
4
- import { getAccountKey, } from './accountState';
5
+ import { getAccountKey, isPaymentAccountType, } from './accountState';
5
6
  function getCommonAccountFields(accountState, id) {
6
7
  const key = getAccountKey(id.reportId, id.accountId, id.classesViewParentId, id.accountsViewParentId, id.projectsViewParentId);
7
8
  const account = accountState.accountsByKey[key];
@@ -179,3 +180,47 @@ export const getAccountIdsForLabels = (accountState, labels) => {
179
180
  });
180
181
  return allAccountIdsForLabels;
181
182
  };
183
+ /**
184
+ * Returns all accounts currently in state (single pass over accountsByKey).
185
+ * Use for dropdowns that need account names and types; map to
186
+ * { accountId, accountName, accountType } as needed.
187
+ */
188
+ export const getAllAccounts = (accountState) => Object.values(accountState.accountsByKey);
189
+ /**
190
+ * Partitions accounts for transaction filter dropdowns: bank/credit_card → paymentAccountNames,
191
+ * all other account types → categoryOptions. Use for payment_account_name and category filter options.
192
+ *
193
+ * Memoised via `createSelector` so the composite `{categoryOptions,
194
+ * paymentAccountNames}` keeps a stable identity across Redux dispatches that
195
+ * don't change account data. Without this, every consumer using
196
+ * `useSelector(state => getTransactionFilterAccountOptions(state.accountState))`
197
+ * would re-render on every dispatch (the inline call returns a fresh outer
198
+ * object each time, defeating reference equality).
199
+ */
200
+ export const getTransactionFilterAccountOptions = createSelector(
201
+ // Key the memo on the underlying `accountsByKey` record rather than on
202
+ // `getAllAccounts` output: the latter returns a fresh `Object.values(...)`
203
+ // array on every call, which would defeat reselect's reference-equality
204
+ // check and re-run the projection on every dispatch.
205
+ [(accountState) => accountState.accountsByKey], (accountsByKey) => {
206
+ const accounts = Object.values(accountsByKey);
207
+ const paymentAccountNames = [];
208
+ const categoryOptions = [];
209
+ for (const account of accounts) {
210
+ if (account.accountType == null) {
211
+ continue;
212
+ }
213
+ const option = {
214
+ accountId: account.accountId,
215
+ accountName: account.accountName,
216
+ accountType: account.accountType,
217
+ };
218
+ if (isPaymentAccountType(account.accountType)) {
219
+ paymentAccountNames.push(option);
220
+ }
221
+ else {
222
+ categoryOptions.push(option);
223
+ }
224
+ }
225
+ return { categoryOptions, paymentAccountNames };
226
+ });
@@ -1,7 +1,7 @@
1
1
  import { getNestedAccountIDStr, } from '../../commonStateTypes/accountView/nestedAccountID';
2
2
  import { getNestedClassIDStr, } from '../../commonStateTypes/classesView/nestedClassID';
3
3
  import { stringToUnion, stringToUnionStrict, } from '../../commonStateTypes/stringToUnion';
4
- const ALL_ACCOUNT_TYPES = [
4
+ export const ALL_ACCOUNT_TYPES = [
5
5
  'bank',
6
6
  'credit_card',
7
7
  'expenses',
@@ -25,6 +25,12 @@ const ALL_ACCOUNT_TYPES = [
25
25
  ];
26
26
  export const toAccountType = (v) => stringToUnion(v, ALL_ACCOUNT_TYPES);
27
27
  export const toAccountTypeStrict = (v) => stringToUnionStrict(v ?? '', ALL_ACCOUNT_TYPES);
28
+ /** Account types used for payment-account filters (e.g. transaction filter "payment account name"). */
29
+ export const PAYMENT_ACCOUNT_TYPES = ['bank', 'credit_card'];
30
+ export function isPaymentAccountType(accountType) {
31
+ return (accountType != null &&
32
+ PAYMENT_ACCOUNT_TYPES.includes(accountType));
33
+ }
28
34
  const ALL_ACCOUNT_LABELS = [
29
35
  'uncategorized_income',
30
36
  'uncategorized_expense',
@@ -14,139 +14,18 @@ export const toApprovalRule = (payload) => ({
14
14
  version: payload.version,
15
15
  criteria: toApprovalCriteria(payload.criteria),
16
16
  steps: toApprovalSteps(payload.steps),
17
- description: payload.description ?? undefined,
18
- priority: payload.priority,
19
- isFallback: payload.is_fallback ?? false,
20
- // separationOfDuties: backend doesn't ship this field yet; left undefined
21
- // until the spec is finalized.
22
- areApprovalsSerialized: payload.are_approvals_serialized,
23
- pendingApprovalsCount: payload.pending_approvals_count,
24
- pendingEntityApprovalUpdateStatus: payload.pending_entity_approval_update_status,
25
17
  });
26
- /**
27
- * Maps the wire-level criteria block into the state-side discriminated
28
- * `Criteria[]` union.
29
- *
30
- * The wire keeps each condition as a flat row inside `conditions[]`.
31
- * Amount comparisons can show up as a `gte` only, a `lte` only, or a
32
- * `gte` + `lte` pair — those collapse into a single AmountCriteria whose
33
- * `comparator` is `greater_than`, `less_than`, or `range` respectively.
34
- *
35
- * Vendor and department conditions map one-to-one: `in` becomes `is`,
36
- * `not_in` becomes `is_not`.
37
- *
38
- * Resilient to two forms of upstream drift:
39
- * - Missing / null criteria → returns [].
40
- * - Legacy criteria shape (array of amount-range objects, the pre-3.0
41
- * wire) → converted to an AmountCriteria so existing rules in production
42
- * still render while the backend rolls out.
43
- */
44
18
  const toApprovalCriteria = (payload) => {
45
- if (payload == null) {
46
- return [];
47
- }
48
- if (Array.isArray(payload)) {
49
- // Legacy pre-3.0 wire: an array of amount-range entries.
50
- return legacyAmountRangeToCriteria(payload);
51
- }
52
- if (!Array.isArray(payload.conditions)) {
53
- return [];
54
- }
55
- const results = [];
56
- const amountCriteria = toAmountCriteria(payload);
57
- if (amountCriteria != null) {
58
- results.push(amountCriteria);
59
- }
60
- payload.conditions
61
- .filter((condition) => condition.field === 'vendor_id')
62
- .forEach((condition) => {
63
- const vendor = toVendorCriteria(condition);
64
- if (vendor != null) {
65
- results.push(vendor);
66
- }
67
- });
68
- payload.conditions
69
- .filter((condition) => condition.field === 'department_id')
70
- .forEach((condition) => {
71
- const department = toDepartmentCriteria(condition);
72
- if (department != null) {
73
- results.push(department);
74
- }
75
- });
76
- return results;
77
- };
78
- const legacyAmountRangeToCriteria = (legacy) => {
79
- if (legacy.length === 0) {
80
- return [];
81
- }
82
- const first = legacy[0] ?? {};
83
- const currency = first.currency_code ?? 'USD';
84
- const symbol = first.currency_symbol ?? '$';
85
- const min = typeof first.min === 'number'
86
- ? toAmount(first.min, currency, symbol)
87
- : undefined;
88
- const max = typeof first.max === 'number'
89
- ? toAmount(first.max, currency, symbol)
90
- : undefined;
91
- if (min == null && max == null) {
92
- return [];
93
- }
94
- const comparator = min != null && max != null
95
- ? 'range'
96
- : min != null
97
- ? 'greater_than'
98
- : 'less_than';
99
- return [{ type: 'amount', comparator, min, max }];
100
- };
101
- const toAmountCriteria = (payload) => {
102
- if (!Array.isArray(payload.conditions)) {
103
- return undefined;
104
- }
105
- const amountConditions = payload.conditions.filter((condition) => condition.field === 'amount');
106
- const gteCondition = amountConditions.find((condition) => condition.type === 'gte' || condition.type === 'eq');
107
- const lteCondition = amountConditions.find((condition) => condition.type === 'lte');
108
- if (gteCondition == null && lteCondition == null) {
109
- return undefined;
110
- }
111
- const currencyCode = payload.currency_code ?? 'USD';
112
- const currencySymbol = payload.currency_symbol ?? '$';
113
- const min = typeof gteCondition?.value === 'number'
114
- ? toAmount(gteCondition.value, currencyCode, currencySymbol)
115
- : undefined;
116
- const max = typeof lteCondition?.value === 'number'
117
- ? toAmount(lteCondition.value, currencyCode, currencySymbol)
118
- : undefined;
119
- let comparator;
120
- if (min != null && max != null) {
121
- comparator = 'range';
122
- }
123
- else if (min != null) {
124
- comparator = 'greater_than';
125
- }
126
- else {
127
- comparator = 'less_than';
128
- }
129
- return { type: 'amount', comparator, min, max };
130
- };
131
- const toVendorCriteria = (condition) => {
132
- if (!Array.isArray(condition.value)) {
133
- return undefined;
134
- }
135
- return {
136
- type: 'vendor',
137
- operator: condition.type === 'not_in' ? 'is_not' : 'is',
138
- vendorIds: condition.value,
139
- };
140
- };
141
- const toDepartmentCriteria = (condition) => {
142
- if (!Array.isArray(condition.value)) {
143
- return undefined;
144
- }
145
- return {
146
- type: 'department',
147
- operator: condition.type === 'not_in' ? 'is_not' : 'is',
148
- departmentIds: condition.value,
149
- };
19
+ return payload.map((criteria) => ({
20
+ rangeType: criteria.type,
21
+ rangeEntity: criteria.range_entity,
22
+ range: {
23
+ min: toAmount(criteria.min, criteria.currency_code, criteria.currency_symbol),
24
+ max: criteria.max != null
25
+ ? toAmount(criteria.max, criteria.currency_code, criteria.currency_symbol)
26
+ : undefined,
27
+ },
28
+ }));
150
29
  };
151
30
  const toApprovalSteps = (payload) => {
152
31
  return payload.map((step) => ({
@@ -7,38 +7,3 @@ export function getApprovalRulesByIds(approvalRuleState, approvalRuleIds) {
7
7
  .filter((value) => value != null);
8
8
  return approvalRulesByIds;
9
9
  }
10
- /**
11
- * Returns the amount-range portion of a rule's criteria, if any.
12
- *
13
- * Use this whenever a caller needs to read amount min/max from the new
14
- * discriminated `Criteria` union without inlining a type guard.
15
- */
16
- export function getAmountCriteria(criteria) {
17
- return criteria.find((c) => c.type === 'amount');
18
- }
19
- export function getVendorCriteria(criteria) {
20
- return criteria.find((c) => c.type === 'vendor');
21
- }
22
- export function getDepartmentCriteria(criteria) {
23
- return criteria.find((c) => c.type === 'department');
24
- }
25
- /**
26
- * Returns all rules of the given entityType, sorted by `priority` ascending.
27
- *
28
- * Rules without a `priority` value sort to the end (treated as Infinity).
29
- * Use this for the list page where rules render in evaluation order.
30
- */
31
- export function getApprovalRulesByEntityType(approvalRuleState, entityType) {
32
- return Object.values(approvalRuleState.approvalRuleById)
33
- .filter((rule) => rule.entityType === entityType)
34
- .sort((a, b) => (a.priority ?? Infinity) - (b.priority ?? Infinity));
35
- }
36
- /**
37
- * Returns the tenant's fallback rule for the given entityType, if one exists.
38
- *
39
- * The fallback rule is shown by the "fallback engine active" banner on the
40
- * list page and is used to handle bills/reimbursements that match no other rule.
41
- */
42
- export function getFallbackApprovalRule(approvalRuleState, entityType) {
43
- return Object.values(approvalRuleState.approvalRuleById).find((rule) => rule.entityType === entityType && rule.isFallback === true);
44
- }
@@ -1,3 +1,4 @@
1
+ import { createSelector } from '@reduxjs/toolkit';
1
2
  import recordGet from 'lodash/get';
2
3
  import { getCOABalances } from '../../commonStateTypes/coaBalance/coaBalance';
3
4
  import { getAccount } from '../account/accountSelector';
@@ -50,3 +51,50 @@ export function getClassReport(classState, accountState, id, filter) {
50
51
  accounts: accountReport,
51
52
  };
52
53
  }
54
+ /**
55
+ * Returns all classes currently in state (single pass over classesByKey).
56
+ * Use for dropdowns that need class names; map to { classId, className } as needed.
57
+ */
58
+ export function getAllClasses(classState) {
59
+ return Object.values(classState.classesByKey);
60
+ }
61
+ /**
62
+ * Memoised projection of `getAllClasses` to the `{classId, className}` shape
63
+ * expected by filter dropdowns. Consumers should prefer this over inlining a
64
+ * `getAllClasses(...).map(...)` inside `useSelector`: the inline map allocates
65
+ * a fresh array on every Redux dispatch, breaking `useSelector`'s
66
+ * reference-equality optimisation and triggering re-renders on every state
67
+ * change unrelated to class data.
68
+ *
69
+ * Two cleanups happen here, intentionally inside the selector so every
70
+ * consumer benefits uniformly:
71
+ * 1. **Drop entries with a blank `className`.** Soft-deleted classes can
72
+ * retain their classId in state while the human name is blanked, which
73
+ * would otherwise render as an empty row in the filter dropdown.
74
+ * 2. **Dedupe by `classId`.** `classesByKey` is keyed by
75
+ * `${classId}-${reportId}` (see `getClassKey`), so a class loaded under
76
+ * multiple report contexts appears as multiple entries from
77
+ * `Object.values(classesByKey)`. The first non-blank entry per
78
+ * `classId` wins.
79
+ */
80
+ export const getClassFilterOptions = createSelector(
81
+ // Key the memo on the underlying `classesByKey` record rather than on
82
+ // `getAllClasses` output: the latter returns a fresh `Object.values(...)`
83
+ // array on every call, which would defeat reselect's reference-equality
84
+ // check and re-run the projection on every dispatch.
85
+ [(classState) => classState.classesByKey], (classesByKey) => {
86
+ const classes = Object.values(classesByKey);
87
+ const seenClassIds = new Set();
88
+ const options = [];
89
+ for (const c of classes) {
90
+ if (c.classId == null || seenClassIds.has(c.classId)) {
91
+ continue;
92
+ }
93
+ if (c.className == null || c.className.trim() === '') {
94
+ continue;
95
+ }
96
+ seenClassIds.add(c.classId);
97
+ options.push({ classId: c.classId, className: c.className });
98
+ }
99
+ return options;
100
+ });
package/lib/esm/index.js CHANGED
@@ -24,6 +24,7 @@ import { mapTimePeriodtoTimeframeTick, toTimePeriod, toTimeframeTick, } from './
24
24
  import { isAgingReport, isCashFlowOrBalanceSheetReport, isDashboardClassesViewReport, isDashboardReport, isFluxAnalysisOpExReport, isOpExByVendorReport, isPAndLClassesViewReport, isPAndLProjectViewReport, isPAndLReport, } from './commonStateTypes/viewAndReport/reportIDHelper';
25
25
  import { toReportFormatStrict, toReportID, } from './commonStateTypes/viewAndReport/viewAndReport';
26
26
  import { PAYMENT_BUSINESS_DAYS, filterDays, getNextNthWorkingDay, getPreviousNthWorkingDay, getYearsList, holidaysFormatted, isHoliday, isHolidayToday, } from './commonStateTypes/workingDayHelper';
27
+ import { getAllAccounts, getTransactionFilterAccountOptions, } from './entity/account/accountSelector';
27
28
  import { toAccountType, toReconciliationAccountSource, } from './entity/account/accountState';
28
29
  import { getAccountGroupKey, toAccountGroupType, } from './entity/accountGroup/accountGroupState';
29
30
  /**
@@ -32,7 +33,6 @@ import { getAccountGroupKey, toAccountGroupType, } from './entity/accountGroup/a
32
33
  import { getAccountReconByAccountIdAndSelectedPeriod, } from './entity/accountRecon/accountReconSelector';
33
34
  import { getAddressByAddressId } from './entity/address/addressSelector';
34
35
  import { toAttributeOrRoleTypeStrict, toAttributeTypeStrict, toRoleTypeStrict, } from './entity/approvalRule/approvalRuleState';
35
- import { getAmountCriteria, getApprovalRulesByEntityType, getDepartmentCriteria, getFallbackApprovalRule, getVendorCriteria, } from './entity/approvalRule/approvalRuleSelector';
36
36
  import { toOutsideZeniPaymentModeType, } from './entity/billPay/billTransaction/billTransactionState';
37
37
  import { toRecurringBillFrequency, toRecurringBillFrequencyStrict, } from './entity/billPay/recurringBills/recurringBillsState';
38
38
  import { toCardAddressType, toCardType, toCreditLimitFrequencyCodeType, toShippingAddressType, } from './entity/chargeCard/chargeCard';
@@ -169,7 +169,7 @@ import { clearExpenseAutomationFluxAnalysisView, fetchFluxAnalysisView, reviewFl
169
169
  import { clearJeScheduleLocalData as clearExpenseAutomationJEScheduleLocalData, clearExpenseAutomationJESchedulesView, fetchJeSchedulesPage as fetchExpenseAutomationJESchedulesPage, ignoreRecommendedJeSchedule as ignoreExpenseAutomationJESchedule, initializeAccountSettingsView as initializeJeAccountSettingsView, initializeJeScheduleLocalData, removeJeScheduleTransactionKey, retryJeSchedule as retryExpenseAutomationJESchedule, saveAccountSettings as saveJeAccountSettings, saveAccountSettingsLocalData as saveJeAccountSettingsLocalData, updateJESchedulesUIState as updateExpenseAutomationJESchedulesUIState, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, } from './view/expenseAutomationView/reducers/jeSchedulesViewReducer';
170
170
  import { acknowledgeBulkUploadConfirmMatchComplete, bulkUploadAutomatchingTimedOut, bulkUploadReceipts, bulkUploadReceiptsFailure, bulkUploadReceiptsSuccess, clearBulkUpload, clearManualSearchResults, clearMissingReceiptsTabNavigation, confirmBulkUploadMatch, confirmBulkUploadMatchFailure, confirmBulkUploadMatchSuccess, fetchBulkUploadBatchDetails, fetchBulkUploadBatchDetailsFailure, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatches, fetchBulkUploadBatchesFailure, fetchBulkUploadBatchesSuccess, fetchCompletedTransactions, fetchCompletedTransactionsFailure, fetchCompletedTransactionsSuccess, fetchMissingReceipts as fetchExpenseAutomationMissingReceipts, fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, markMissingReceiptAsDone as markExpenseAutomationMissingReceiptAsDone, pusherBatchStatusUpdate, requestMissingReceiptsTabNavigation, restoreBulkUploadAutomatchingOnMount, restoreBulkUploadMatchingState, searchTransactionsForManualMatch, searchTransactionsForManualMatchFailure, searchTransactionsForManualMatchSuccess, setBulkUploadCompletedSubTab, setBulkUploadResultsTab, setBulkUploadSortConfig, setBulkUploadUploadedFileCount, storeBatchDetails, updateBulkUploadProgress, updateMissingReceiptUploadState as updateExpenseAutomationMissingReceiptUploadState, updateMissingReceiptsUIState as updateExpenseAutomationMissingReceiptsUIState, uploadMissingReceiptSuccess as uploadExpenseAutomationMissingReceiptSuccess, } from './view/expenseAutomationView/reducers/missingReceiptsViewReducer';
171
171
  import { deleteAccountStatement, excludeAccountFromReconciliation, fetchReconciliation as fetchReconciliationView, includeAccountInReconciliation, saveReconciliationDetail as saveExpenseAutomationReconciliationDetail, saveReconciliationReview as saveExpenseAutomationReconciliationReview, setConnectionInProgressForAccount as setConnectionInProgressForAccountReconciliation, setStatementParseInProgress, updateAccountReconciliationLocalData as updateExpenseAutomationAccountReconciliationLocalData, updateSelectedAccountId as updateExpenseAutomationAccountReconciliationSelectedAccountId, updateSelectedTab as updateExpenseAutomationAccountReconciliationSelectedTab, updateReconListScrollPosition as updateExpenseAutomationReconListScrollPosition, updateReviewTabSortState as updateExpenseAutomationReconReviewTabListSortState, updateReviewTabLocalData as updateExpenseAutomationReconReviewTabLocalData, updateReconcileTabListScrollState as updateExpenseAutomationReconcileTabListScrollState, updateReconcileTabListSortState as updateExpenseAutomationReconcileTabListSortState, updateReconcileTabLocalData as updateExpenseAutomationReconcileTabLocalData, updateSelectedDrawerAccountId as updateExpenseAutomationSelectedDrawerAccountId, updateNodeCollapseState, updateStatementUploadChosen, uploadAccountStatement, } from './view/expenseAutomationView/reducers/reconciliationViewReducer';
172
- import { backgroundRefetchReviewTab, clearExpenseAutomationTransactionsView, fetchTransactionCategorization, fetchTransactionCategorizationFailure, fetchTransactionCategorizationView, initializeTransactionCategorizationViewLocalData, markTransactionAsNotMiscategorized, saveTransactionCategorization, saveTransactionCategorizationLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, setEntityRecommendationForLineIdsForCategorization, syncTransactionCategorizationFromDetailSave, updateCurrentSelectedTransactionCategorizationTab, updateSelectedCheckboxTransactionIds, updateSelectedCustomerForTransaction, updateSelectedTransactionId, updateSelectedVendorForTransaction, updateTransactionCategorization, updateTransactionCategorizationCompletedSubTab, updateTransactionCategorizationSaveStatus, updateTransactionCategorizationUIState, updateTransactionCategorizationUploadReceiptState, uploadTransactionCategorizationReceiptSuccess, } from './view/expenseAutomationView/reducers/transactionsViewReducer';
172
+ import { backgroundRefetchReviewTab, clearExpenseAutomationTransactionsView, fetchTransactionCategorization, fetchTransactionCategorizationFailure, fetchTransactionCategorizationView, initializeTransactionCategorizationViewLocalData, markTransactionAsNotMiscategorized, saveTransactionCategorization, saveTransactionCategorizationLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, setEntityRecommendationForLineIdsForCategorization, syncTransactionCategorizationFromDetailSave, updateCurrentSelectedTransactionCategorizationTab, updateSelectedCheckboxTransactionIds, updateSelectedCustomerForTransaction, updateSelectedTransactionId, updateSelectedVendorForTransaction, updateTransactionCategorization, updateTransactionCategorizationCompletedSubTab, updateTransactionCategorizationSaveStatus, updateTransactionCategorizationUIState, updateTransactionCategorizationUploadReceiptState, updateTransactionFilters, uploadTransactionCategorizationReceiptSuccess, } from './view/expenseAutomationView/reducers/transactionsViewReducer';
173
173
  import { getExpenseAutomationFluxAnalysisView } from './view/expenseAutomationView/selectors/fluxAnalysisViewSelector';
174
174
  import { getExpenseAutomationReconciliationView, isAccountReconReport, } from './view/expenseAutomationView/selectors/reconciliationViewSelector';
175
175
  import { getExpenseAutomationTransactionView } from './view/expenseAutomationView/selectors/transactionCategorizationSelector';
@@ -337,6 +337,7 @@ import { getRemiBusinessVerificationDetails, getRemiSetupViewDetails, } from './
337
337
  import { approveOrRejectRemisBulkAction, autoReviewPendingApprovalRemis, cancelOrDeleteRemisBulkAction, clearAllRemisFromBulkActionList, clearRemiBulkActionView, incrementRemiBulkActionProcessedCount, removeRemiFromBulkActionList, reviewDraftRemisBulkAction, submitDraftRemisBulkAction, updateRemisBulkActionList, } from './view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewReducer';
338
338
  import { getRemisBulkOperationProgress, getRemisBulkReviewView, } from './view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewSelector';
339
339
  import { hideCreatedByFilter, } from './view/spendManagement/spendManagementFilterHelpers';
340
+ import { TRANSACTION_FILTER_CATEGORIES, applyTransactionFilters, } from './view/expenseAutomationView/transactionFilterHelpers';
340
341
  import { acceptTreasuryTerms, clearTreasurySetupView, fetchPortfolioAllocation, fetchTreasuryFunds, fetchTreasurySetupView, updateFundAllocationLocalData, updatePortfolioAllocation, updateTreasuryVideoViewed, } from './view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer';
341
342
  import { getTreasuryBusinessVerificationDetails, getTreasurySetupViewDetails, } from './view/spendManagement/treasury/treasurySetUp/treasurySetupViewSelector';
342
343
  import { getTreasuryFundsMaximumYield, } from './view/spendManagement/treasury/treasurySetUp/treasurySetupViewState';
@@ -449,15 +450,15 @@ export {
449
450
  BATCH_FILE_STATUSES, isUnmatchedTabFileStatus, DEFAULT_COMPLETED_SUB_TAB, toBatchFileStatus, toBatchStatusValue, toBulkUploadPhase, toBulkUploadResultsTab, toBulkUploadSortKey, toCompletedSubTab, toMatchSource, toMissingReceiptsTab, toExpenseAutomationJEScheduleMainTab, toExpenseAutomationJEScheduleSortKey, getExpenseAutomationView, toExpenseAutomationMissingReceiptsSortKey, toExpenseAutomationTransactionsTabKey, toExpenseAutomationViewType, uploadExpenseAutomationMissingReceiptSuccess, markExpenseAutomationMissingReceiptAsDone, fetchAllExpenseAutomationTabs, refreshExpenseAutomationCurrentTab, updateCurrentSelectedTransactionCategorizationTab, updateTransactionCategorizationCompletedSubTab, fetchExpenseAutomationMissingReceipts,
450
451
  // Bulk Upload Actions
451
452
  bulkUploadReceipts, bulkUploadAutomatchingTimedOut, bulkUploadReceiptsSuccess, bulkUploadReceiptsFailure, restoreBulkUploadAutomatchingOnMount, restoreBulkUploadMatchingState, updateBulkUploadProgress, pusherBatchStatusUpdate, requestMissingReceiptsTabNavigation, clearMissingReceiptsTabNavigation, fetchBulkUploadBatchDetails, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatchDetailsFailure, storeBatchDetails, fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, fetchBulkUploadBatches, fetchBulkUploadBatchesSuccess, fetchBulkUploadBatchesFailure, confirmBulkUploadMatch, confirmBulkUploadMatchSuccess, confirmBulkUploadMatchFailure, setBulkUploadResultsTab, setBulkUploadCompletedSubTab, setBulkUploadSortConfig, setBulkUploadUploadedFileCount, clearBulkUpload, searchTransactionsForManualMatch, searchTransactionsForManualMatchSuccess, searchTransactionsForManualMatchFailure, clearManualSearchResults, acknowledgeBulkUploadConfirmMatchComplete, fetchCompletedTransactions, fetchCompletedTransactionsSuccess, fetchCompletedTransactionsFailure, fetchFluxAnalysisView, clearExpenseAutomationFluxAnalysisView, updateOperatingExpensesIdsForReview as updateFluxOperatingExpensesIdsForReview, updateSelectedSectionIdsForReview as updateFluxAnalysisSelectedSectionIdsForReview, reviewFluxAnalysisView, updateExpenseAutomationMissingReceiptUploadState, updateExpenseAutomationMissingReceiptsUIState, updateTransactionCategorizationUploadReceiptState, uploadTransactionCategorizationReceiptSuccess, getExpenseAutomationFluxAnalysisView, updateCurrentSelectedView, updateCurrentSelectedPeriod, getExpenseAutomationTransactionView, updateFluxAnalysisViewUIState, updateFluxAnalysisViewPageMetaData, MAX_SELECTION_LIMIT, checkIfAllLineItemsAreCategoryClassFilled, getLineItemsByTransactionIdsFromLocalData, isAnyItemWithUncategorizedExpenseAccount, excludeAccountFromReconciliation, includeAccountInReconciliation, saveExpenseAutomationReconciliationDetail, updateExpenseAutomationReconcileTabListScrollState, updateExpenseAutomationReconReviewTabListSortState, updateExpenseAutomationReconcileTabListSortState, updateExpenseAutomationReconcileTabLocalData, updateExpenseAutomationAccountReconciliationSelectedTab, updateExpenseAutomationAccountReconciliationSelectedAccountId, getExpenseAutomationReconciliationView, fetchReconciliationView, uploadAccountStatementIntoDocumentAI, updateExpenseAutomationReconListScrollPosition, setConnectionInProgressForAccountReconciliation, getAccountReconByAccountIdAndSelectedPeriod, toReconciliationTabsType, isAccountReconReport, updateExpenseAutomationReconReviewTabLocalData, updateExpenseAutomationSelectedDrawerAccountId, saveExpenseAutomationReconciliationReview, updateExpenseAutomationAccountReconciliationLocalData, toReconciliationAccountSource, deleteAccountStatement, uploadAccountStatement, updateNodeCollapseState, updateStatementUploadChosen, isReviewTransactionBankTransferType, isReviewTransactionBillPaymentType, isReviewTransactionCreditCardPaymentType, isReviewTransactionDepositType, isReviewTransactionExpenseType, isReviewTransactionCreditCardCreditType, setStatementParseInProgress, };
452
- export { fetchTransactionCategorization, fetchTransactionCategorizationView, updateTransactionCategorizationUIState, updateSelectedCheckboxTransactionIds, setEntityRecommendationForLineIdsForCategorization, initializeTransactionCategorizationViewLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, saveTransactionCategorizationLocalData, fetchTransactionCategorizationFailure, saveTransactionCategorization, updateTransactionCategorization, updateTransactionCategorizationSaveStatus, markTransactionAsNotMiscategorized, updateSelectedVendorForTransaction, updateSelectedCustomerForTransaction, updateSelectedTransactionId, syncTransactionCategorizationFromDetailSave, backgroundRefetchReviewTab, clearExpenseAutomationTransactionsView, toTransactionsSortKey, };
453
+ export { fetchTransactionCategorization, fetchTransactionCategorizationView, updateTransactionCategorizationUIState, updateTransactionFilters, updateSelectedCheckboxTransactionIds, setEntityRecommendationForLineIdsForCategorization, initializeTransactionCategorizationViewLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, saveTransactionCategorizationLocalData, fetchTransactionCategorizationFailure, saveTransactionCategorization, updateTransactionCategorization, updateTransactionCategorizationSaveStatus, markTransactionAsNotMiscategorized, updateSelectedVendorForTransaction, updateSelectedCustomerForTransaction, updateSelectedTransactionId, syncTransactionCategorizationFromDetailSave, backgroundRefetchReviewTab, clearExpenseAutomationTransactionsView, toTransactionsSortKey, };
453
454
  export { TOP_EX_TIME_PERIODS };
454
455
  export { toTimeframeTick, mapTimePeriodtoTimeframeTick, toTimePeriod, toAbsoluteDay, toMonthYearPeriodId, convertToPeriod, };
455
456
  export { toVendorSpendTrendFilterTabsTypeStrict, } from './entity/vendorExpense/vendorExpenseSelector';
456
457
  export { getNumberOfPeriods };
457
458
  export { SCHEDULE_DAYS_OF_MONTH, toScheduleDaysOfMonth, toMonth, toMonthStrict, toQuarter, toQuarterStrict, };
458
459
  export { getTenantBaseById, getCurrentTenant, getIsAccountingClassesEnabled, getIsAccountingProjectsEnabled, getTenantsByCheckInDateSelector, getTenantsBaseByCheckInDateSelector, getTenantsCoreDetailsByCheckInDateSelector, toTenantCoreDetailsView, getTenantBaseViewForTenantView, getTenantBaseViewForTenantId, isZeniDomainTenant, isTenantUsingZeniCOA, fetchActiveTenant, fetchAllTenants, updateCurrentTenant, clearAll, doMagicLinkSignIn, verifyDeviceWithTwoFA, resendVerifyDeviceOTP, sendEmailMagicLinkToUser, doSignIn, updateSignInState, doSignOut, sendSessionHeartbeat, resetSignInState, fetchExcludedResourcesForTenant, fetchExternalConnectionsForTenant, saveExternalConnectionForTenant, deleteConnection, saveAPIKeyConnection, saveConnectorCredentials, saveOAuthConnection, toExternalIntegrationType, toExternalSupportedTool, fetchSubscriptionSummaryForTenant, isTenantBankingOnly, isTenantCardsOnly, isTenantBookkeepingEnabled, isOtherProductsEnabledForTenant, };
459
- export { toAccountType, toAccountGroupType, getAccountGroupKey, };
460
- export { getClassById } from './entity/class/classSelector';
460
+ export { toAccountType, toAccountGroupType, getAccountGroupKey, getAllAccounts, getTransactionFilterAccountOptions, };
461
+ export { getAllClasses, getClassById, getClassFilterOptions, } from './entity/class/classSelector';
461
462
  export { getForecast };
462
463
  export { getUserName, getUserByUserId, getUsersByUserIds, getAllZeniUsersFromState, } from './entity/user/userSelector';
463
464
  export { toUserRoleType, toUserRoleTypeStrict, isFinOpsUserRoleType, hasAdminLevelAccess, hasFullOrAdminLevelAccess, hasReimbursementUserAccess, hasEmployeeLevelAccess, hasBookKeepingAdminLevelAccess, hasBookKeepingUserLevelAccess, isNonZeniRole, hasInvestorBankerLevelAccess, getUserRoleMap, hasOnlyBillPayAccess, hasZeniRoleOrCompanyOfficerAccess, hasSuperAdminLevelAccess, hasBillPayFallbackAdminLevelAccess, hasRemiFallbackAdminLevelAccess, hasOnlyReimbursementAccess, hasOnlyChargeCardAccess, hasOnlyZeniAccountsAccess, isZeniSignedInUser, getUserRoleByUserId, getUserRoleByUserIds, hasChargeCardAccess, hasZeniAccountsAccess, hasTreasuryAccess, hasTreasuryAdminLevelAccess, hasBillPayAccess, hasReimbursementAccess, hasReimbursementAdminLevelAccess, hasBillPayAdminLevelAccess, hasChargeCardAdminLevelAccess, hasSpendManagementAccess, hasSpendManagementAdminLevelAccess, hasZeniAccountsAdminLevelAccess, hasAnyCompanyRole, hasAnyFinOpRole, hasBillPayAccessible, hasReimbursementAccessible, hasZeniAccountsAccessible, hasChargeCardAccessible, hasTreasuryAccessible, hasAICFOAccess, };
@@ -557,6 +558,10 @@ export { toRemiSubTabType, toRemiSubTabTypeStrict, toRemiTabType, toRemiTabTypeS
557
558
  export { getClassList, fetchClassList, getProjectList, fetchProjectList, };
558
559
  export { fetchBillList, fetchBillListPerTab, updateTab, updateSubTab, updateSelectedBillId, updateBillDetailSaveBillCode, fetchVendorByNameAndParseInvoice, saveBillUpdatesToLocalStore, discardBillUpdatesInLocalStore, saveBillDetail, approveOrRejectBill, updateApprovalStatusOnSuccess, deleteBill, cancelAndDeleteBill, retryOrRefundBill, getBillList, getBillDownloadList, getBillDetailView, checkApproveRejectBtnShowForBill, getBillTransactionDetailKey, fetchBillDetail, fetchEditBillDetailPage, fetchAndUpdateVendorRecommendations, fetchDuplicateBill, clearBillPayReview, getEditBillDetail, getReviewPageBillDetail, fetchBillAndInitializeLocalStore, updateShowAutofill, saveVendorSuccessOrFailure, updateBillListUIState, BILL_PAY_FILTER_CATEGORIES, updateVendorDetailLocalData, resetVendorDetailLocalData, resetVendorSaveStatus, updateContactsInVendorDetailLocalData, updateVendorTabDetailUIState, updateContactsInVendorTabDetailLocalData, updateBillUploadFetchState, updateBillListSearchResult, fetchUserDetails, verifyUser, updateVendorContact, toPaymentToOption, convertAmountToHomeCurrency, fetchVendorAndUpdateBillLocalData, markBillForRetry, updateWithdrawFromAccountId, removeBillFileFromLocalStore, replaceBillFileInLocalStore, updateShouldReplaceBillData, };
559
560
  export { hideCreatedByFilter, };
561
+ // Transaction Categorization filter API — lives under Expense Automation,
562
+ // not Spend Management. Kept in a separate re-export block to make the
563
+ // separation visible at the barrel level.
564
+ export { TRANSACTION_FILTER_CATEGORIES, applyTransactionFilters, };
560
565
  export { fetchBillPaySetupView, fetchZeniAccountSetupView, enableSetup, getPaymentAccounts, getPlaidLinkToken, updateSelectedCompanyOfficer, updateSetupViewLocalStoreData, updateBusinessVerificationDetails, updatePaymentAccount, updatePaymentAccountLoginStatus, updatePaymentAccountStatus, establishPlaidConnection, updateMappedCashAccount, updatePrimaryFundingAccount, acceptBillPayTerms, acceptZeniAccountTerms, acceptBillPayUpdatedTerms, saveSetupViewDataInLocalStore, saveCompnayOfficerPhoneInLocalStore, saveCompnayOfficerAdditionalDocumentsInLocalStore, saveTreasuryAdditionalDocumentsInLocalStore, saveIndustryAndIncDateInLocalStore, clearSetupViewDataInLocalStore, clearBillPaySetupView, clearZeniAccountSetupView, sendOtp, resendOtp, verifyOtp, getBillPaySetupViewDetails, getPlaidAccountDetails, getZeniAccountSetupViewDetails, getBusinessVerificationDetails, getBillPayBusinessVerificationDetails, getZeniAccountBusinessVerificationDetails, getTreasuryBusinessVerificationDetails, getCommonSetupViewDetails, getTwoFactorAuthenticationView, getTwoFactorAuthenticationViewForCardUserOnboarding, getTwoFactorAuthenticationViewForChargeCardHolder, };
561
566
  export { getApprovalRuleViewDetails, getBankConnectionsSetupViewDetails, getIntegrationsView, };
562
567
  export { fetchUserFinancialAccount };
@@ -564,7 +569,7 @@ export { getUserFinancialAccount };
564
569
  export { fetchRemiSetupView, updateMileageDetails, saveRemiSetupViewDataInLocalStore, acceptRemiTerms, acceptEmployeeRemiTerms, clearRemiSetupView, getRemiSetupViewDetails, getRemiBusinessVerificationDetails, };
565
570
  export { VERIFIED_PAYMENT_ACCOUNT_PROVIDER_VERIFICATION_STATUS, };
566
571
  export { isSuccessResponse, isInvalidSessionError, isAccessDeniedError, };
567
- export { getAmountCriteria, getApprovalRulesByEntityType, getDepartmentCriteria, getFallbackApprovalRule, getVendorCriteria, toAttributeTypeStrict, toAttributeOrRoleTypeStrict, toRoleTypeStrict, };
572
+ export { toAttributeTypeStrict, toAttributeOrRoleTypeStrict, toRoleTypeStrict, };
568
573
  export { getBillPaySetupApproverView, getBillPaySetupApproverUpdateDataView, fetchBillPaySetupApproverView, fetchBillPayApproversDetails, fetchBillPayApproversList, deleteBillPayApprovalRule, saveBillPaySetupApproverViewUpdateData, saveBillPaySetupApproverViewUpdates, setBillsSetupApproverViewListeningToPusherEvent, initializeBillPaySetupApproverViewUpdateData, clearBillPaySetupApproverViewUpdateData, clearBillPaySetupApproverView, };
569
574
  export { getRemiSetupApproverView, getRemiSetupApproverUpdateDataView, fetchRemiSetupApproverView, fetchRemiApproversList, fetchRemiApproversDetails, deleteRemiApprovalRule, saveRemiSetupApproverViewUpdateData, saveRemiSetupApproverViewUpdates, initializeRemiSetupApproverViewUpdateData, setRemiSetupApproverViewListeningToPusherEvent, clearRemiSetupApproverViewUpdateData, clearRemiSetupApproverView, };
570
575
  export { getRemiDetailView, checkApproveRejectBtnShowForRemi, };
@@ -291,7 +291,7 @@ const applyAdvancedFiltersOnCompaniesList = (allCompanies, filters, filteredComp
291
291
  const key = currentFilter.field;
292
292
  const categoryValue = getCategoryValueForCompany(key, company);
293
293
  if (categoryValue == null) {
294
- if (currentFilter.matchingOperator === 'not-equal') {
294
+ if (currentFilter.matchingOperator === 'not_equal') {
295
295
  return true;
296
296
  }
297
297
  return false;
@@ -48,7 +48,7 @@ export const filterCompanyOnCategoriesWithSingleValue = (categoryValue, currentF
48
48
  return filterCompanyOnRangeCategoryType(categoryValue, currentFilter);
49
49
  }
50
50
  // if filter category is not annualRecurringRevenue OR monthlyRecurringRevenue
51
- if (currentFilter.matchingOperator === 'not-equal') {
51
+ if (currentFilter.matchingOperator === 'not_equal') {
52
52
  return currentFilter.values.indexOf(categoryValue) === -1;
53
53
  }
54
54
  return currentFilter.values.indexOf(categoryValue) > -1;
@@ -150,7 +150,7 @@ const applyAdvancedFiltersOnCompaniesList = (allCompanies, filters, filteredComp
150
150
  const key = currentFilter.field;
151
151
  const categoryValue = getCategoryValueForCompany(key, company);
152
152
  if (categoryValue == null) {
153
- if (currentFilter.matchingOperator === 'not-equal') {
153
+ if (currentFilter.matchingOperator === 'not_equal') {
154
154
  return true;
155
155
  }
156
156
  return false;
@@ -116,7 +116,7 @@ const applyAdvancedFiltersOnCompaniesList = (allCompanies, filters, filteredComp
116
116
  const key = currentFilter.field;
117
117
  const categoryValue = getCategoryValueForCompany(key, company);
118
118
  if (categoryValue == null) {
119
- if (currentFilter.matchingOperator === 'not-equal') {
119
+ if (currentFilter.matchingOperator === 'not_equal') {
120
120
  return true;
121
121
  }
122
122
  return false;
@@ -28,6 +28,10 @@ export const initialTransactionTabViewState = {
28
28
  totalCount: {},
29
29
  limit: 10,
30
30
  },
31
+ filters: {
32
+ categoryCombinationOperator: 'AND',
33
+ categories: [],
34
+ },
31
35
  fetchState: 'Not-Started',
32
36
  error: undefined,
33
37
  hasValidState() {
@@ -299,6 +303,12 @@ const expenseAutomationTransactionsView = createSlice({
299
303
  uiState.totalCount;
300
304
  }
301
305
  },
306
+ updateTransactionFilters(draft, action) {
307
+ const { selectedTab, filters } = action.payload;
308
+ // `filters` is non-nullable per the payload type, so no runtime
309
+ // null-check is needed — dropping it removes a dead defensive branch.
310
+ draft.transactionCategorizationView[selectedTab].filters = filters;
311
+ },
302
312
  saveTransactionCategorization: {
303
313
  prepare(selectedTab, transactionIds, cotTrackingByTransactionId, isUncategorizedExpenseCategoryEnabled) {
304
314
  return {
@@ -929,5 +939,5 @@ const expenseAutomationTransactionsView = createSlice({
929
939
  },
930
940
  },
931
941
  });
932
- export const { fetchTransactionCategorization, updateTransactionCategorizationUIState, initializeTransactionCategorizationViewLocalData, saveTransactionCategorizationLocalData, fetchTransactionCategorizationFailure, saveTransactionCategorization, updateTransactionCategorization, updateCurrentSelectedTransactionCategorizationTab, updateTransactionCategorizationCompletedSubTab, updateTransactionCategorizationSaveStatus, markTransactionAsNotMiscategorized, updateStatusForTransactionNotMiscategorizedUpdateForCategorization, updateSelectedVendorForTransaction, updateSelectedCustomerForTransaction, setAllItemsToCategoryClassInLocalDataForCategorization, updateTotalCountForTransactionCategorization, updateParentTotalCountForTab, fetchTransactionCategorizationSuccess, resetOtherTabsFetchState, fetchTransactionCategorizationView, updateSelectedCheckboxTransactionIds, clearExpenseAutomationTransactionsViewPerTabView, clearExpenseAutomationTransactionsView, setEntityRecommendationForLineIdsForCategorization, updateSelectedTransactionId, syncTransactionCategorizationFromDetailSave, backgroundRefetchReviewTab, updateTransactionCategorizationUploadReceiptState, uploadTransactionCategorizationReceiptSuccess, } = expenseAutomationTransactionsView.actions;
942
+ export const { fetchTransactionCategorization, updateTransactionCategorizationUIState, updateTransactionFilters, initializeTransactionCategorizationViewLocalData, saveTransactionCategorizationLocalData, fetchTransactionCategorizationFailure, saveTransactionCategorization, updateTransactionCategorization, updateCurrentSelectedTransactionCategorizationTab, updateTransactionCategorizationCompletedSubTab, updateTransactionCategorizationSaveStatus, markTransactionAsNotMiscategorized, updateStatusForTransactionNotMiscategorizedUpdateForCategorization, updateSelectedVendorForTransaction, updateSelectedCustomerForTransaction, setAllItemsToCategoryClassInLocalDataForCategorization, updateTotalCountForTransactionCategorization, updateParentTotalCountForTab, fetchTransactionCategorizationSuccess, resetOtherTabsFetchState, fetchTransactionCategorizationView, updateSelectedCheckboxTransactionIds, clearExpenseAutomationTransactionsViewPerTabView, clearExpenseAutomationTransactionsView, setEntityRecommendationForLineIdsForCategorization, updateSelectedTransactionId, syncTransactionCategorizationFromDetailSave, backgroundRefetchReviewTab, updateTransactionCategorizationUploadReceiptState, uploadTransactionCategorizationReceiptSuccess, } = expenseAutomationTransactionsView.actions;
933
943
  export default expenseAutomationTransactionsView.reducer;