@zeniai/client-epic-state 5.0.65-betaML2 → 5.0.65-betaRR1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/entity/aiCfo/aiCfoPayload.d.ts +135 -1
- package/lib/entity/aiCfo/aiCfoReducer.js +111 -2
- package/lib/entity/aiCfo/aiCfoState.d.ts +141 -4
- package/lib/entity/aiCfo/aiCfoState.js +10 -1
- package/lib/entity/cardPolicy/cardPolicyPayload.d.ts +171 -0
- package/lib/entity/cardPolicy/cardPolicyPayload.js +112 -0
- package/lib/entity/cardPolicy/cardPolicyReducer.d.ts +13 -0
- package/lib/entity/cardPolicy/cardPolicyReducer.js +184 -0
- package/lib/entity/cardPolicy/cardPolicySelector.d.ts +28 -0
- package/lib/entity/cardPolicy/cardPolicySelector.js +86 -0
- package/lib/entity/cardPolicy/cardPolicyState.d.ts +162 -0
- package/lib/entity/cardPolicy/cardPolicyState.js +14 -0
- package/lib/entity/cardPolicy/extractPolicyDocumentEpic.d.ts +18 -0
- package/lib/entity/cardPolicy/extractPolicyDocumentEpic.js +54 -0
- package/lib/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.d.ts +26 -0
- package/lib/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.js +47 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +6 -2
- package/lib/entity/tenant/clearAllEpic.js +8 -0
- package/lib/epic.d.ts +9 -2
- package/lib/epic.js +9 -2
- package/lib/esm/entity/aiCfo/aiCfoReducer.js +112 -3
- package/lib/esm/entity/aiCfo/aiCfoState.js +7 -0
- package/lib/esm/entity/cardPolicy/cardPolicyPayload.js +101 -0
- package/lib/esm/entity/cardPolicy/cardPolicyReducer.js +180 -0
- package/lib/esm/entity/cardPolicy/cardPolicySelector.js +66 -0
- package/lib/esm/entity/cardPolicy/cardPolicyState.js +9 -0
- package/lib/esm/entity/cardPolicy/extractPolicyDocumentEpic.js +50 -0
- package/lib/esm/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.js +43 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +8 -0
- package/lib/esm/epic.js +9 -2
- package/lib/esm/index.js +21 -7
- package/lib/esm/reducer.js +12 -0
- package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +1 -21
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +14 -117
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +0 -28
- package/lib/esm/view/recommendation/recommendationHelper.js +0 -29
- package/lib/esm/view/recommendation/recommendationReducer.js +1 -36
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.js +70 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.js +22 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.js +44 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js +49 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.js +42 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js +72 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.js +21 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.js +46 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js +50 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js +6 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +34 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.js +17 -0
- package/lib/esm/view/transactionDetail/transactionDetailReducer.js +1 -110
- package/lib/esm/view/transactionDetail/transactionDetailSelector.js +0 -22
- package/lib/index.d.ts +20 -8
- package/lib/index.js +119 -35
- package/lib/reducer.d.ts +12 -0
- package/lib/reducer.js +12 -0
- package/lib/view/companyHealthMetricView/companyHealthMetricViewSelector.d.ts +1 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +0 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -23
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +1 -14
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +14 -117
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +0 -2
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +0 -3
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +0 -29
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +0 -1
- package/lib/view/onboardingView/cockpitView/types/onboardingCockpitViewTypes.d.ts +1 -1
- package/lib/view/people/peopleTypes.d.ts +1 -1
- package/lib/view/recommendation/recommendationHelper.d.ts +0 -9
- package/lib/view/recommendation/recommendationHelper.js +1 -31
- package/lib/view/recommendation/recommendationReducer.d.ts +1 -18
- package/lib/view/recommendation/recommendationReducer.js +2 -37
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.d.ts +14 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.js +74 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.d.ts +21 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.js +28 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.d.ts +25 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.js +2 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.d.ts +19 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.js +48 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.d.ts +18 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js +53 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.d.ts +16 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.js +46 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.d.ts +15 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js +76 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.d.ts +21 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.js +27 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.d.ts +19 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.js +2 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.d.ts +19 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.js +50 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.d.ts +12 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js +54 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.d.ts +4 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js +10 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.d.ts +15 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.js +2 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +38 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.d.ts +15 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.js +21 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +1 -1
- package/lib/view/transactionDetail/transactionDetailReducer.d.ts +1 -11
- package/lib/view/transactionDetail/transactionDetailReducer.js +2 -111
- package/lib/view/transactionDetail/transactionDetailSelector.d.ts +0 -2
- package/lib/view/transactionDetail/transactionDetailSelector.js +1 -24
- package/lib/view/transactionDetail/transactionDetailTypes.d.ts +0 -1
- package/package.json +1 -1
- package/lib/esm/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.js +0 -88
- package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
- package/lib/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.d.ts +0 -9
- package/lib/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.js +0 -92
package/lib/reducer.js
CHANGED
|
@@ -51,6 +51,7 @@ const billTransactionReducer_1 = __importStar(require("./entity/billPay/billTran
|
|
|
51
51
|
const contactReducer_1 = __importStar(require("./entity/billPay/contact/contactReducer"));
|
|
52
52
|
const recurringBillsReducer_1 = __importStar(require("./entity/billPay/recurringBills/recurringBillsReducer"));
|
|
53
53
|
const cardPaymentReducer_1 = __importStar(require("./entity/cardPayment/cardPaymentReducer"));
|
|
54
|
+
const cardPolicyReducer_1 = __importStar(require("./entity/cardPolicy/cardPolicyReducer"));
|
|
54
55
|
const chargeCardReducer_1 = __importStar(require("./entity/chargeCard/chargeCardReducer"));
|
|
55
56
|
const chargeCardRepaymentReducer_1 = __importStar(require("./entity/chargeCardRepayment/chargeCardRepaymentReducer"));
|
|
56
57
|
const chargeCardTransactionReducer_1 = __importStar(require("./entity/chargeCardTransaction/chargeCardTransactionReducer"));
|
|
@@ -123,6 +124,9 @@ const bankAccountViewReducer_1 = __importStar(require("./view/bankAccountView/ba
|
|
|
123
124
|
const billPayCardReducer_1 = __importStar(require("./view/billPayCard/billPayCardReducer"));
|
|
124
125
|
const cardBalanceReducer_1 = __importStar(require("./view/cardBalance/cardBalanceReducer"));
|
|
125
126
|
const cardPaymentViewReducer_1 = __importStar(require("./view/cardPayment/cardPaymentViewReducer"));
|
|
127
|
+
const cardPolicyDetailReducer_1 = __importStar(require("./view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer"));
|
|
128
|
+
const cardPolicyListReducer_1 = __importStar(require("./view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer"));
|
|
129
|
+
const createCardPolicyReducer_1 = __importStar(require("./view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer"));
|
|
126
130
|
const cashBalanceReducer_1 = __importStar(require("./view/cashBalance/cashBalanceReducer"));
|
|
127
131
|
const cashFlowReducer_1 = __importStar(require("./view/cashFlow/cashFlowReducer"));
|
|
128
132
|
const cashInCashOutReducer_1 = __importStar(require("./view/cashInCashOut/cashInCashOutReducer"));
|
|
@@ -276,6 +280,7 @@ const initialEntitiesState = {
|
|
|
276
280
|
bankAccountState: bankAccountReducer_1.initialState,
|
|
277
281
|
billTransactionState: billTransactionReducer_1.initialState,
|
|
278
282
|
cardPaymentState: cardPaymentReducer_1.initialState,
|
|
283
|
+
cardPolicyState: cardPolicyReducer_1.initialState,
|
|
279
284
|
chargeCardState: chargeCardReducer_1.initialState,
|
|
280
285
|
chargeCardRepaymentState: chargeCardRepaymentReducer_1.initialState,
|
|
281
286
|
chargeCardTransactionState: chargeCardTransactionReducer_1.initialState,
|
|
@@ -360,6 +365,8 @@ const initialViewsState = {
|
|
|
360
365
|
billsBulkActionViewState: billsBulkActionViewReducer_1.initialState,
|
|
361
366
|
cardBalanceState: cardBalanceReducer_1.initialState,
|
|
362
367
|
cardPaymentViewState: cardPaymentViewReducer_1.initialState,
|
|
368
|
+
cardPolicyDetailState: cardPolicyDetailReducer_1.initialState,
|
|
369
|
+
cardPolicyListState: cardPolicyListReducer_1.initialState,
|
|
363
370
|
cardUserOnboardingState: cardUserOnboardingReducer_1.initialState,
|
|
364
371
|
cashbackDetailState: cashbackDetailReducer_1.initialState,
|
|
365
372
|
cashBalanceState: cashBalanceReducer_1.initialState,
|
|
@@ -383,6 +390,7 @@ const initialViewsState = {
|
|
|
383
390
|
companyTaskManagerViewState: companyTaskManagerViewReducer_1.initialState,
|
|
384
391
|
companyViewState: companyViewReducer_1.initialState,
|
|
385
392
|
countryListState: countryListReducer_1.initialState,
|
|
393
|
+
createCardPolicyState: createCardPolicyReducer_1.initialState,
|
|
386
394
|
creditAgentEntityState: creditAgentReducer_1.initialCreditAgentEntityState,
|
|
387
395
|
creditAgentViewState: creditAgentViewReducer_1.initialState,
|
|
388
396
|
dashboardLayoutState: dashboardLayoutReducer_1.initialState,
|
|
@@ -512,6 +520,7 @@ const entityReducers = {
|
|
|
512
520
|
billPayConfigState: billPayConfigReducer_1.default,
|
|
513
521
|
billTransactionState: billTransactionReducer_1.default,
|
|
514
522
|
cardPaymentState: cardPaymentReducer_1.default,
|
|
523
|
+
cardPolicyState: cardPolicyReducer_1.default,
|
|
515
524
|
chargeCardState: chargeCardReducer_1.default,
|
|
516
525
|
chargeCardRepaymentState: chargeCardRepaymentReducer_1.default,
|
|
517
526
|
chargeCardTransactionState: chargeCardTransactionReducer_1.default,
|
|
@@ -595,6 +604,8 @@ const viewReducers = {
|
|
|
595
604
|
billsBulkActionViewState: billsBulkActionViewReducer_1.default,
|
|
596
605
|
cardBalanceState: cardBalanceReducer_1.default,
|
|
597
606
|
cardPaymentViewState: cardPaymentViewReducer_1.default,
|
|
607
|
+
cardPolicyDetailState: cardPolicyDetailReducer_1.default,
|
|
608
|
+
cardPolicyListState: cardPolicyListReducer_1.default,
|
|
598
609
|
cardUserOnboardingState: cardUserOnboardingReducer_1.default,
|
|
599
610
|
cashbackDetailState: cashbackDetailReducer_1.default,
|
|
600
611
|
cashBalanceState: cashBalanceReducer_1.default,
|
|
@@ -618,6 +629,7 @@ const viewReducers = {
|
|
|
618
629
|
companyTaskManagerViewState: companyTaskManagerViewReducer_1.default,
|
|
619
630
|
companyViewState: companyViewReducer_1.default,
|
|
620
631
|
countryListState: countryListReducer_1.default,
|
|
632
|
+
createCardPolicyState: createCardPolicyReducer_1.default,
|
|
621
633
|
creditAgentEntityState: creditAgentReducer_1.default,
|
|
622
634
|
creditAgentViewState: creditAgentViewReducer_1.default,
|
|
623
635
|
dashboardState: dashboardReducer_1.default,
|
|
@@ -13,7 +13,7 @@ declare const toFrequencyLabelType: (v: string) => "High" | "Low" | "Very Low" |
|
|
|
13
13
|
type FrequencyLabelType = ReturnType<typeof toFrequencyLabelType>;
|
|
14
14
|
declare const toFrequencyValueType: (v: string) => "high" | "low" | "very_low" | "mid" | "very_high";
|
|
15
15
|
type FrequencyValueType = ReturnType<typeof toFrequencyValueType>;
|
|
16
|
-
declare const toProductServiceKeyType: (v: string) => "reimbursement" | "
|
|
16
|
+
declare const toProductServiceKeyType: (v: string) => "reimbursement" | "cards" | "accounts" | "billpay" | "zeni_tax_plan" | "cfo_plan" | "payroll_manager_service_plan";
|
|
17
17
|
export type ProductServiceKey = ReturnType<typeof toProductServiceKeyType>;
|
|
18
18
|
export type CompanyHealthMetricDropDownOption = {
|
|
19
19
|
label: FrequencyLabelType;
|
package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts
CHANGED
|
@@ -27,7 +27,6 @@ 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
30
|
export declare const toTransactionDetailLocalData: (transaction: SupportedTransactionWithCOT, selectedTab: TransactionsTab, lineItemsByTransactionIds: string[], uncategorizedIncomeExpense: UncategorizedAccounts, isUncategorizedExpenseCategoryEnabled?: boolean) => TransactionReviewLocalData;
|
|
32
31
|
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) => {
|
|
33
32
|
localData: TransactionReviewLocalData;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hasTransactionLocalDataChanges = exports.isAnyItemWithUncategorizedExpenseAccount = exports.getSnackbarMessageForTransactionReview = exports.mergeTabSpecificLineItems = exports.getLineItemsByTransactionIdsFromLocalData = exports.getLineItemsByTransactionsIdsFromResponse = exports.checkIfAllLineItemsAreCategoryClassFilled = exports.setEntityRecommendationForLineIdInLocalData = exports.toSetAllLineItemsToCategoryClass = exports.toTransactionDetailLocalData = exports.
|
|
3
|
+
exports.hasTransactionLocalDataChanges = exports.isAnyItemWithUncategorizedExpenseAccount = exports.getSnackbarMessageForTransactionReview = exports.mergeTabSpecificLineItems = exports.getLineItemsByTransactionIdsFromLocalData = exports.getLineItemsByTransactionsIdsFromResponse = exports.checkIfAllLineItemsAreCategoryClassFilled = exports.setEntityRecommendationForLineIdInLocalData = exports.toSetAllLineItemsToCategoryClass = exports.toTransactionDetailLocalData = exports.MAX_SELECTION_LIMIT = exports.filterAutoTabLineItems = exports.removeTransactionFromTabView = exports.getPendingReviewLineIdsFromTransaction = void 0;
|
|
4
4
|
const vendorTransaction_1 = require("../../../entity/transaction/stateTypes/vendorTransaction");
|
|
5
5
|
const transactionDetailLocalDataHelper_1 = require("../../transactionDetail/transactionDetailLocalDataHelper");
|
|
6
6
|
const transactionDetailLocalDataHelper_2 = require("../../transactionDetail/transactionDetailLocalDataHelper");
|
|
@@ -65,23 +65,6 @@ const filterAutoTabLineItems = (tabView, transactionId, updatedTransaction) => {
|
|
|
65
65
|
};
|
|
66
66
|
exports.filterAutoTabLineItems = filterAutoTabLineItems;
|
|
67
67
|
exports.MAX_SELECTION_LIMIT = 5;
|
|
68
|
-
// Returns true when the transaction should be auto-added to the
|
|
69
|
-
// selectedCheckBoxTransactionIds list after a categorization-related
|
|
70
|
-
// state mutation: all line items are filled, the selection limit has
|
|
71
|
-
// not been hit, and the id isn't already in the list. Consolidates the
|
|
72
|
-
// triplet that was inlined at four sites (updateSelectedCustomer/Vendor,
|
|
73
|
-
// setAllItemsToCategoryClassInLocalDataForCategorization, and
|
|
74
|
-
// setEntityRecommendationForLineIdInLocalData below).
|
|
75
|
-
const shouldAutoSelectAndAdd = (transaction, localData, selectedCheckBoxTransactionIds, uncategorizedAccounts, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled) => {
|
|
76
|
-
if (selectedCheckBoxTransactionIds.includes(transaction.id)) {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
if (selectedCheckBoxTransactionIds.length >= exports.MAX_SELECTION_LIMIT) {
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
return (0, exports.checkIfAllLineItemsAreCategoryClassFilled)(transaction, localData, uncategorizedAccounts, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled);
|
|
83
|
-
};
|
|
84
|
-
exports.shouldAutoSelectAndAdd = shouldAutoSelectAndAdd;
|
|
85
68
|
const toTransactionDetailLocalData = (transaction, selectedTab, lineItemsByTransactionIds, uncategorizedIncomeExpense, isUncategorizedExpenseCategoryEnabled) => {
|
|
86
69
|
const transactionLocal = {
|
|
87
70
|
...transactionsViewState_1.initialSupportedTransactionCategorization.transactionReviewLocalData,
|
|
@@ -569,14 +552,10 @@ const setEntityRecommendationForLineIdInLocalData = (draft, transaction, transac
|
|
|
569
552
|
selectedEntity: transactionDetailLocalData.selectedEntity,
|
|
570
553
|
tabSpecificLineItems: transactionDetailLocalData.tabSpecificLineItems,
|
|
571
554
|
};
|
|
572
|
-
// Auto-uncheck if not all line items are filled (the row's
|
|
573
|
-
// category/class became stale after the entity update). Otherwise
|
|
574
|
-
// route through shouldAutoSelectAndAdd so the MAX_SELECTION_LIMIT
|
|
575
|
-
// gate is consistently applied across all auto-add sites.
|
|
576
555
|
if (!(0, exports.checkIfAllLineItemsAreCategoryClassFilled)(transaction, newLocalData, uncategorizedAccounts, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled)) {
|
|
577
556
|
selectedCheckBoxTransactionIds = selectedCheckBoxTransactionIds.filter((id) => id !== transaction.id);
|
|
578
557
|
}
|
|
579
|
-
else if ((
|
|
558
|
+
else if (selectedCheckBoxTransactionIds.includes(transaction.id) === false) {
|
|
580
559
|
selectedCheckBoxTransactionIds.push(transaction.id);
|
|
581
560
|
}
|
|
582
561
|
draft.selectedCheckBoxTransactionIds = selectedCheckBoxTransactionIds;
|
|
@@ -157,20 +157,7 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
157
157
|
uncategorizedAccounts: UncategorizedAccounts;
|
|
158
158
|
isAccountingClassesEnabled: boolean | undefined;
|
|
159
159
|
isUncategorizedExpenseCategoryEnabled: boolean | undefined;
|
|
160
|
-
}, "expenseAutomationTransactionsView/setEntityRecommendationForLineIdsForCategorization", never, never>,
|
|
161
|
-
selectedTab: "review" | "autoCategorized";
|
|
162
|
-
transactionId: TransactionID;
|
|
163
|
-
lineIds: string[];
|
|
164
|
-
}, "expenseAutomationTransactionsView/markCategoryClassRecommendationsInProgressForCategorization", never, never>, markCategoryClassRecommendationsCompletedForCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionId: TransactionID, lineIds: string[]], {
|
|
165
|
-
selectedTab: "review" | "autoCategorized";
|
|
166
|
-
transactionId: TransactionID;
|
|
167
|
-
lineIds: string[];
|
|
168
|
-
}, "expenseAutomationTransactionsView/markCategoryClassRecommendationsCompletedForCategorization", never, never>, markCategoryClassRecommendationsFailureForCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionId: TransactionID, lineIds: string[], error: ZeniAPIStatus<Record<string, unknown>>], {
|
|
169
|
-
selectedTab: "review" | "autoCategorized";
|
|
170
|
-
transactionId: TransactionID;
|
|
171
|
-
lineIds: string[];
|
|
172
|
-
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
173
|
-
}, "expenseAutomationTransactionsView/markCategoryClassRecommendationsFailureForCategorization", never, never>, updateSelectedTransactionId: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
160
|
+
}, "expenseAutomationTransactionsView/setEntityRecommendationForLineIdsForCategorization", never, never>, updateSelectedTransactionId: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
174
161
|
lineId: ID;
|
|
175
162
|
selectedTab: TransactionsTab;
|
|
176
163
|
transactionId: ID;
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
var _a;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.uploadTransactionCategorizationReceiptSuccess = exports.updateTransactionCategorizationUploadReceiptState = exports.backgroundRefetchReviewTab = exports.syncTransactionCategorizationFromDetailSave = exports.updateSelectedTransactionId = exports.
|
|
7
|
+
exports.uploadTransactionCategorizationReceiptSuccess = exports.updateTransactionCategorizationUploadReceiptState = exports.backgroundRefetchReviewTab = exports.syncTransactionCategorizationFromDetailSave = exports.updateSelectedTransactionId = exports.setEntityRecommendationForLineIdsForCategorization = exports.clearExpenseAutomationTransactionsView = exports.clearExpenseAutomationTransactionsViewPerTabView = exports.updateSelectedCheckboxTransactionIds = exports.fetchTransactionCategorizationView = exports.resetOtherTabsFetchState = exports.fetchTransactionCategorizationSuccess = exports.updateParentTotalCountForTab = exports.updateTotalCountForTransactionCategorization = exports.setAllItemsToCategoryClassInLocalDataForCategorization = exports.updateSelectedCustomerForTransaction = exports.updateSelectedVendorForTransaction = exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = exports.markTransactionAsNotMiscategorized = exports.updateTransactionCategorizationSaveStatus = exports.updateTransactionCategorizationCompletedSubTab = exports.updateCurrentSelectedTransactionCategorizationTab = exports.updateTransactionCategorization = exports.saveTransactionCategorization = exports.fetchTransactionCategorizationFailure = exports.saveTransactionCategorizationLocalData = exports.initializeTransactionCategorizationViewLocalData = exports.updateTransactionCategorizationUIState = exports.fetchTransactionCategorization = exports.initialState = exports.initialTransactionTabViewState = void 0;
|
|
8
8
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
9
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
10
10
|
const uniq_1 = __importDefault(require("lodash/uniq"));
|
|
@@ -427,9 +427,12 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
427
427
|
const selectedCheckBoxTransactionIds = draft.transactionCategorizationView[selectedTab]
|
|
428
428
|
.selectedCheckBoxTransactionIds;
|
|
429
429
|
if (selectedTransaction != null &&
|
|
430
|
-
(0, transactionCategorizationLocalDataHelper_1.
|
|
430
|
+
(0, transactionCategorizationLocalDataHelper_1.checkIfAllLineItemsAreCategoryClassFilled)(selectedTransaction, newTransactionLocalData, uncategorizedAccounts, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled) === true && // check if all line items are filled
|
|
431
|
+
selectedCheckBoxTransactionIds.length < transactionCategorizationLocalDataHelper_1.MAX_SELECTION_LIMIT &&
|
|
432
|
+
selectedCheckBoxTransactionIds.includes(transactionId) === false) {
|
|
431
433
|
draft.transactionCategorizationView[selectedTab].selectedCheckBoxTransactionIds = [
|
|
432
|
-
...
|
|
434
|
+
...draft.transactionCategorizationView[selectedTab]
|
|
435
|
+
.selectedCheckBoxTransactionIds,
|
|
433
436
|
transactionId,
|
|
434
437
|
];
|
|
435
438
|
}
|
|
@@ -512,26 +515,9 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
512
515
|
const transactionLocalData = (0, get_1.default)(draft.transactionCategorizationView[selectedTab]
|
|
513
516
|
.transactionReviewLocalDataById, transactionId.id, undefined);
|
|
514
517
|
if (transactionLocalData != null) {
|
|
515
|
-
const newLocalData = (0, transactionCategorizationLocalDataHelper_1.setEntityRecommendationForLineIdInLocalData)(draft.transactionCategorizationView[selectedTab], transaction, transactionLocalData.transactionReviewLocalData, entity, lineIds, uncategorizedAccounts, action.payload.recommendationWithCOTByLineId, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled);
|
|
516
|
-
// Release the per-line fetch flag for every line this fetch
|
|
517
|
-
// covered. Done in-place on the freshly returned local data
|
|
518
|
-
// (the helper produces a new mutable object), before we write
|
|
519
|
-
// it back to the draft.
|
|
520
|
-
lineIds.forEach((lineId) => {
|
|
521
|
-
const lineItem = newLocalData.lineItemById[lineId];
|
|
522
|
-
if (lineItem != null) {
|
|
523
|
-
newLocalData.lineItemById[lineId] = {
|
|
524
|
-
...lineItem,
|
|
525
|
-
categoryClassRecommendationsFetchState: {
|
|
526
|
-
fetchState: 'Completed',
|
|
527
|
-
error: undefined,
|
|
528
|
-
},
|
|
529
|
-
};
|
|
530
|
-
}
|
|
531
|
-
});
|
|
532
518
|
draft.transactionCategorizationView[selectedTab].transactionReviewLocalDataById[transaction.id] = {
|
|
533
519
|
transactionId: transaction.id,
|
|
534
|
-
transactionReviewLocalData:
|
|
520
|
+
transactionReviewLocalData: (0, transactionCategorizationLocalDataHelper_1.setEntityRecommendationForLineIdInLocalData)(draft.transactionCategorizationView[selectedTab], transaction, transactionLocalData.transactionReviewLocalData, entity, lineIds, uncategorizedAccounts, action.payload.recommendationWithCOTByLineId, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled),
|
|
535
521
|
};
|
|
536
522
|
// Mark transaction as dirty (autofill happened)
|
|
537
523
|
if (!draft.transactionCategorizationView[selectedTab].transactionIdsWithUnsavedData.includes(transaction.id)) {
|
|
@@ -544,99 +530,6 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
544
530
|
}
|
|
545
531
|
},
|
|
546
532
|
},
|
|
547
|
-
// Start arm of the line-update recommendations fetch. Flips covered
|
|
548
|
-
// lines to In-Progress AND removes the transaction from
|
|
549
|
-
// selectedCheckBoxTransactionIds — the row is unchecked + disabled
|
|
550
|
-
// until either the success arm (recheck if limit allows) or the
|
|
551
|
-
// failure arm releases the per-line flag.
|
|
552
|
-
markCategoryClassRecommendationsInProgressForCategorization: {
|
|
553
|
-
reducer(draft, action) {
|
|
554
|
-
const { selectedTab, transactionId, lineIds } = action.payload;
|
|
555
|
-
const tab = draft.transactionCategorizationView[selectedTab];
|
|
556
|
-
const transactionLocalData = (0, get_1.default)(tab.transactionReviewLocalDataById, transactionId.id, undefined);
|
|
557
|
-
if (transactionLocalData != null) {
|
|
558
|
-
lineIds.forEach((lineId) => {
|
|
559
|
-
const lineItem = transactionLocalData.transactionReviewLocalData.lineItemById[lineId];
|
|
560
|
-
if (lineItem != null) {
|
|
561
|
-
transactionLocalData.transactionReviewLocalData.lineItemById[lineId] = {
|
|
562
|
-
...lineItem,
|
|
563
|
-
categoryClassRecommendationsFetchState: {
|
|
564
|
-
fetchState: 'In-Progress',
|
|
565
|
-
error: undefined,
|
|
566
|
-
},
|
|
567
|
-
};
|
|
568
|
-
}
|
|
569
|
-
});
|
|
570
|
-
}
|
|
571
|
-
// Uncheck on fetch start: the row's existing category/class are
|
|
572
|
-
// stale after a payee change, so we drop the auto-selection until
|
|
573
|
-
// fresh recommendations land.
|
|
574
|
-
if (tab.selectedCheckBoxTransactionIds.includes(transactionId.id)) {
|
|
575
|
-
tab.selectedCheckBoxTransactionIds =
|
|
576
|
-
tab.selectedCheckBoxTransactionIds.filter((id) => id !== transactionId.id);
|
|
577
|
-
}
|
|
578
|
-
},
|
|
579
|
-
prepare(selectedTab, transactionId, lineIds) {
|
|
580
|
-
return { payload: { selectedTab, transactionId, lineIds } };
|
|
581
|
-
},
|
|
582
|
-
},
|
|
583
|
-
// Completed arm. Used by the epic when the HTTP call succeeds but the
|
|
584
|
-
// server returned no per-line recommendations — we still need to
|
|
585
|
-
// release the In-Progress flag so the skeleton resolves. Successful
|
|
586
|
-
// responses with recommendations go through
|
|
587
|
-
// setEntityRecommendationForLineIdsForCategorization instead (which
|
|
588
|
-
// also flips the lines to Completed).
|
|
589
|
-
markCategoryClassRecommendationsCompletedForCategorization: {
|
|
590
|
-
reducer(draft, action) {
|
|
591
|
-
const { selectedTab, transactionId, lineIds } = action.payload;
|
|
592
|
-
const transactionLocalData = (0, get_1.default)(draft.transactionCategorizationView[selectedTab]
|
|
593
|
-
.transactionReviewLocalDataById, transactionId.id, undefined);
|
|
594
|
-
if (transactionLocalData != null) {
|
|
595
|
-
lineIds.forEach((lineId) => {
|
|
596
|
-
const lineItem = transactionLocalData.transactionReviewLocalData.lineItemById[lineId];
|
|
597
|
-
if (lineItem != null) {
|
|
598
|
-
transactionLocalData.transactionReviewLocalData.lineItemById[lineId] = {
|
|
599
|
-
...lineItem,
|
|
600
|
-
categoryClassRecommendationsFetchState: {
|
|
601
|
-
fetchState: 'Completed',
|
|
602
|
-
error: undefined,
|
|
603
|
-
},
|
|
604
|
-
};
|
|
605
|
-
}
|
|
606
|
-
});
|
|
607
|
-
}
|
|
608
|
-
},
|
|
609
|
-
prepare(selectedTab, transactionId, lineIds) {
|
|
610
|
-
return { payload: { selectedTab, transactionId, lineIds } };
|
|
611
|
-
},
|
|
612
|
-
},
|
|
613
|
-
// Failure arm. Flips covered lines to Error so the skeleton resolves
|
|
614
|
-
// and downstream UI can react to the failure. The transaction stays
|
|
615
|
-
// unchecked from the start-arm action.
|
|
616
|
-
markCategoryClassRecommendationsFailureForCategorization: {
|
|
617
|
-
reducer(draft, action) {
|
|
618
|
-
const { selectedTab, transactionId, lineIds, error } = action.payload;
|
|
619
|
-
const transactionLocalData = (0, get_1.default)(draft.transactionCategorizationView[selectedTab]
|
|
620
|
-
.transactionReviewLocalDataById, transactionId.id, undefined);
|
|
621
|
-
if (transactionLocalData != null) {
|
|
622
|
-
lineIds.forEach((lineId) => {
|
|
623
|
-
const lineItem = transactionLocalData.transactionReviewLocalData.lineItemById[lineId];
|
|
624
|
-
if (lineItem != null) {
|
|
625
|
-
transactionLocalData.transactionReviewLocalData.lineItemById[lineId] = {
|
|
626
|
-
...lineItem,
|
|
627
|
-
categoryClassRecommendationsFetchState: {
|
|
628
|
-
fetchState: 'Error',
|
|
629
|
-
error,
|
|
630
|
-
},
|
|
631
|
-
};
|
|
632
|
-
}
|
|
633
|
-
});
|
|
634
|
-
}
|
|
635
|
-
},
|
|
636
|
-
prepare(selectedTab, transactionId, lineIds, error) {
|
|
637
|
-
return { payload: { selectedTab, transactionId, lineIds, error } };
|
|
638
|
-
},
|
|
639
|
-
},
|
|
640
533
|
fetchTransactionCategorizationSuccess(draft, action) {
|
|
641
534
|
const { selectedTab, refreshViewInBackground } = action.payload;
|
|
642
535
|
if (draft.transactionCategorizationView[selectedTab].fetchState ===
|
|
@@ -732,7 +625,9 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
732
625
|
.selectedCheckBoxTransactionIds;
|
|
733
626
|
if (newTransactionLocalData.customer != null &&
|
|
734
627
|
newTransactionLocalData.customer.id != null &&
|
|
735
|
-
(0, transactionCategorizationLocalDataHelper_1.
|
|
628
|
+
(0, transactionCategorizationLocalDataHelper_1.checkIfAllLineItemsAreCategoryClassFilled)(selectedTransaction, newTransactionLocalData, uncategorizedAccounts, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled) === true && // check if all line items are filled
|
|
629
|
+
selectedCheckBoxTransactionIds.length < transactionCategorizationLocalDataHelper_1.MAX_SELECTION_LIMIT &&
|
|
630
|
+
selectedCheckBoxTransactionIds.includes(transactionId) === false) {
|
|
736
631
|
draft.transactionCategorizationView[selectedTab].selectedCheckBoxTransactionIds = [
|
|
737
632
|
...selectedCheckBoxTransactionIds,
|
|
738
633
|
transactionId,
|
|
@@ -806,7 +701,9 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
806
701
|
.selectedCheckBoxTransactionIds;
|
|
807
702
|
if (newTransactionLocalData.vendor != null &&
|
|
808
703
|
newTransactionLocalData.vendor.id != null &&
|
|
809
|
-
(0, transactionCategorizationLocalDataHelper_1.
|
|
704
|
+
(0, transactionCategorizationLocalDataHelper_1.checkIfAllLineItemsAreCategoryClassFilled)(selectedTransaction, newTransactionLocalData, uncategorizedAccounts, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled) === true && // check if all line items are filled
|
|
705
|
+
selectedCheckBoxTransactionIds.length < transactionCategorizationLocalDataHelper_1.MAX_SELECTION_LIMIT &&
|
|
706
|
+
selectedCheckBoxTransactionIds.includes(transactionId) === false) {
|
|
810
707
|
draft.transactionCategorizationView[selectedTab].selectedCheckBoxTransactionIds = [
|
|
811
708
|
...selectedCheckBoxTransactionIds,
|
|
812
709
|
transactionId,
|
|
@@ -1039,5 +936,5 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
1039
936
|
},
|
|
1040
937
|
},
|
|
1041
938
|
});
|
|
1042
|
-
_a = expenseAutomationTransactionsView.actions, exports.fetchTransactionCategorization = _a.fetchTransactionCategorization, exports.updateTransactionCategorizationUIState = _a.updateTransactionCategorizationUIState, exports.initializeTransactionCategorizationViewLocalData = _a.initializeTransactionCategorizationViewLocalData, exports.saveTransactionCategorizationLocalData = _a.saveTransactionCategorizationLocalData, exports.fetchTransactionCategorizationFailure = _a.fetchTransactionCategorizationFailure, exports.saveTransactionCategorization = _a.saveTransactionCategorization, exports.updateTransactionCategorization = _a.updateTransactionCategorization, exports.updateCurrentSelectedTransactionCategorizationTab = _a.updateCurrentSelectedTransactionCategorizationTab, exports.updateTransactionCategorizationCompletedSubTab = _a.updateTransactionCategorizationCompletedSubTab, exports.updateTransactionCategorizationSaveStatus = _a.updateTransactionCategorizationSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = _a.updateStatusForTransactionNotMiscategorizedUpdateForCategorization, exports.updateSelectedVendorForTransaction = _a.updateSelectedVendorForTransaction, exports.updateSelectedCustomerForTransaction = _a.updateSelectedCustomerForTransaction, exports.setAllItemsToCategoryClassInLocalDataForCategorization = _a.setAllItemsToCategoryClassInLocalDataForCategorization, exports.updateTotalCountForTransactionCategorization = _a.updateTotalCountForTransactionCategorization, exports.updateParentTotalCountForTab = _a.updateParentTotalCountForTab, exports.fetchTransactionCategorizationSuccess = _a.fetchTransactionCategorizationSuccess, exports.resetOtherTabsFetchState = _a.resetOtherTabsFetchState, exports.fetchTransactionCategorizationView = _a.fetchTransactionCategorizationView, exports.updateSelectedCheckboxTransactionIds = _a.updateSelectedCheckboxTransactionIds, exports.clearExpenseAutomationTransactionsViewPerTabView = _a.clearExpenseAutomationTransactionsViewPerTabView, exports.clearExpenseAutomationTransactionsView = _a.clearExpenseAutomationTransactionsView, exports.setEntityRecommendationForLineIdsForCategorization = _a.setEntityRecommendationForLineIdsForCategorization, exports.
|
|
939
|
+
_a = expenseAutomationTransactionsView.actions, exports.fetchTransactionCategorization = _a.fetchTransactionCategorization, exports.updateTransactionCategorizationUIState = _a.updateTransactionCategorizationUIState, exports.initializeTransactionCategorizationViewLocalData = _a.initializeTransactionCategorizationViewLocalData, exports.saveTransactionCategorizationLocalData = _a.saveTransactionCategorizationLocalData, exports.fetchTransactionCategorizationFailure = _a.fetchTransactionCategorizationFailure, exports.saveTransactionCategorization = _a.saveTransactionCategorization, exports.updateTransactionCategorization = _a.updateTransactionCategorization, exports.updateCurrentSelectedTransactionCategorizationTab = _a.updateCurrentSelectedTransactionCategorizationTab, exports.updateTransactionCategorizationCompletedSubTab = _a.updateTransactionCategorizationCompletedSubTab, exports.updateTransactionCategorizationSaveStatus = _a.updateTransactionCategorizationSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = _a.updateStatusForTransactionNotMiscategorizedUpdateForCategorization, exports.updateSelectedVendorForTransaction = _a.updateSelectedVendorForTransaction, exports.updateSelectedCustomerForTransaction = _a.updateSelectedCustomerForTransaction, exports.setAllItemsToCategoryClassInLocalDataForCategorization = _a.setAllItemsToCategoryClassInLocalDataForCategorization, exports.updateTotalCountForTransactionCategorization = _a.updateTotalCountForTransactionCategorization, exports.updateParentTotalCountForTab = _a.updateParentTotalCountForTab, exports.fetchTransactionCategorizationSuccess = _a.fetchTransactionCategorizationSuccess, exports.resetOtherTabsFetchState = _a.resetOtherTabsFetchState, exports.fetchTransactionCategorizationView = _a.fetchTransactionCategorizationView, exports.updateSelectedCheckboxTransactionIds = _a.updateSelectedCheckboxTransactionIds, exports.clearExpenseAutomationTransactionsViewPerTabView = _a.clearExpenseAutomationTransactionsViewPerTabView, exports.clearExpenseAutomationTransactionsView = _a.clearExpenseAutomationTransactionsView, exports.setEntityRecommendationForLineIdsForCategorization = _a.setEntityRecommendationForLineIdsForCategorization, exports.updateSelectedTransactionId = _a.updateSelectedTransactionId, exports.syncTransactionCategorizationFromDetailSave = _a.syncTransactionCategorizationFromDetailSave, exports.backgroundRefetchReviewTab = _a.backgroundRefetchReviewTab, exports.updateTransactionCategorizationUploadReceiptState = _a.updateTransactionCategorizationUploadReceiptState, exports.uploadTransactionCategorizationReceiptSuccess = _a.uploadTransactionCategorizationReceiptSuccess;
|
|
1043
940
|
exports.default = expenseAutomationTransactionsView.reducer;
|
|
@@ -20,8 +20,6 @@ export interface ExpenseAutomationTransactionViewSelector extends SelectorView {
|
|
|
20
20
|
classList: ClassBase[];
|
|
21
21
|
completionStatus: CompletionStatusType;
|
|
22
22
|
fetchStateByTransactionTabs: Record<TransactionsTab, FetchStateAndError>;
|
|
23
|
-
hasInFlightCategoryClassRecommendations: boolean;
|
|
24
|
-
inFlightCategoryClassRecommendationsByTransactionId: Record<ID, boolean>;
|
|
25
23
|
isAccountingProjectsEnabled: boolean;
|
|
26
24
|
markAsNotMiscategorizedStatus: FetchStateAndError;
|
|
27
25
|
/**
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { ID } from '../../../commonStateTypes/common';
|
|
2
1
|
import { RootState } from '../../../reducer';
|
|
3
2
|
import { ExpenseAutomationTransactionViewSelector } from '../selectorTypes/transactionsViewSelectorTypes';
|
|
4
|
-
export declare const getCategorizationInFlightRecommendationsByTransactionId: (state: RootState) => Record<ID, boolean>;
|
|
5
|
-
export declare const getCategorizationHasInFlightRecommendations: (state: RootState) => boolean;
|
|
6
3
|
export declare function getExpenseAutomationTransactionView(state: RootState): ExpenseAutomationTransactionViewSelector;
|
|
@@ -3,9 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getCategorizationHasInFlightRecommendations = exports.getCategorizationInFlightRecommendationsByTransactionId = void 0;
|
|
7
6
|
exports.getExpenseAutomationTransactionView = getExpenseAutomationTransactionView;
|
|
8
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
9
7
|
const omit_1 = __importDefault(require("lodash/omit"));
|
|
10
8
|
const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
|
|
11
9
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
@@ -16,29 +14,6 @@ const accountListSelector_1 = require("../../accountList/accountListSelector");
|
|
|
16
14
|
const classListSelector_1 = require("../../classList/classListSelector");
|
|
17
15
|
const projectListSelector_1 = require("../../projectList/projectListSelector");
|
|
18
16
|
const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
|
|
19
|
-
// Per-transaction "any line is fetching category/class recommendations?"
|
|
20
|
-
// map for the active categorization tab. Memoized on the active tab's
|
|
21
|
-
// transactionReviewLocalDataById reference, so steady state (no fetches
|
|
22
|
-
// in flight) recomputes only when local data changes — and the row-table
|
|
23
|
-
// can read a single map lookup per row instead of re-iterating the
|
|
24
|
-
// row's lineItemById in the render path.
|
|
25
|
-
exports.getCategorizationInFlightRecommendationsByTransactionId = (0, toolkit_1.createSelector)((state) => state.expenseAutomationTransactionsViewState
|
|
26
|
-
.selectedTransactionCategorizationTab, (state) => state.expenseAutomationTransactionsViewState
|
|
27
|
-
.transactionCategorizationView, (selectedTab, transactionCategorizationView) => {
|
|
28
|
-
const tab = transactionCategorizationView[selectedTab];
|
|
29
|
-
const result = {};
|
|
30
|
-
for (const [transactionId, data] of Object.entries(tab.transactionReviewLocalDataById)) {
|
|
31
|
-
const lineItems = Object.values(data.transactionReviewLocalData.lineItemById);
|
|
32
|
-
if (lineItems.some((lineItem) => lineItem.categoryClassRecommendationsFetchState?.fetchState ===
|
|
33
|
-
'In-Progress')) {
|
|
34
|
-
result[transactionId] = true;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return result;
|
|
38
|
-
});
|
|
39
|
-
// Page-level "any line on the active tab is in flight?" flag. Drives the
|
|
40
|
-
// list-page Save disable.
|
|
41
|
-
exports.getCategorizationHasInFlightRecommendations = (0, toolkit_1.createSelector)(exports.getCategorizationInFlightRecommendationsByTransactionId, (inFlightByTransactionId) => Object.keys(inFlightByTransactionId).length > 0);
|
|
42
17
|
function getExpenseAutomationTransactionView(state) {
|
|
43
18
|
const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, projectState, projectListState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
|
|
44
19
|
const { selectedTransactionCategorizationCompletedSubTab, selectedTransactionCategorizationTab, } = expenseAutomationTransactionsViewState;
|
|
@@ -134,8 +109,6 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
134
109
|
: [];
|
|
135
110
|
const transactionCompletionStatus = allSteps.find((step) => step.step === 'transaction_categorization')?.completionStatus;
|
|
136
111
|
const completionStatus = transactionCompletionStatus ?? 'incomplete';
|
|
137
|
-
const inFlightCategoryClassRecommendationsByTransactionId = (0, exports.getCategorizationInFlightRecommendationsByTransactionId)(state);
|
|
138
|
-
const hasInFlightCategoryClassRecommendations = (0, exports.getCategorizationHasInFlightRecommendations)(state);
|
|
139
112
|
return {
|
|
140
113
|
version: 0,
|
|
141
114
|
fetchState: fetchStatus.fetchState,
|
|
@@ -149,8 +122,6 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
149
122
|
classList: allClasses,
|
|
150
123
|
accountsHierarchyList,
|
|
151
124
|
classHierarchyList,
|
|
152
|
-
hasInFlightCategoryClassRecommendations,
|
|
153
|
-
inFlightCategoryClassRecommendationsByTransactionId,
|
|
154
125
|
isAccountingProjectsEnabled,
|
|
155
126
|
projectList,
|
|
156
127
|
transactionLocalData,
|
|
@@ -48,7 +48,6 @@ export interface TransactionCategorizationLineItemData extends TransactionLineBa
|
|
|
48
48
|
transactionId: ID;
|
|
49
49
|
account?: AccountBase;
|
|
50
50
|
categorizationStatus?: CategorizationStatusType;
|
|
51
|
-
categoryClassRecommendationsFetchState?: FetchStateAndError;
|
|
52
51
|
class?: ClassBase;
|
|
53
52
|
customer?: CustomerBase;
|
|
54
53
|
item?: ProductOrService;
|
|
@@ -3,7 +3,7 @@ import { CompanyWithSchema } from '../../../../entity/company/companySelector';
|
|
|
3
3
|
import { OnboardingCustomerInfo } from '../../../../entity/onboardingCustomer/onboardingCustomerState';
|
|
4
4
|
import { Tenant } from '../../../../entity/tenant/tenantState';
|
|
5
5
|
import { CompanyDetailsLocalData, PrimaryContactLocalData } from '../../../spendManagement/commonSetup/setupViewState';
|
|
6
|
-
declare const toProductGroupType: (v: string) => "
|
|
6
|
+
declare const toProductGroupType: (v: string) => "cards" | "other" | "bookkeeping" | "banking" | "spend_management";
|
|
7
7
|
export type ProductGroupType = ReturnType<typeof toProductGroupType>;
|
|
8
8
|
export declare const toProductType: (v: string) => "zeni_treasury" | "other" | "bookkeeping" | "zeni_checking" | "zeni_bill_pay" | "zeni_reimbursements" | "zeni_cards" | "zeni_payroll" | "zeni_cfo" | "zeni_tax";
|
|
9
9
|
export declare const toProductTypeStrict: (v: string) => "zeni_treasury" | "other" | "bookkeeping" | "zeni_checking" | "zeni_bill_pay" | "zeni_reimbursements" | "zeni_cards" | "zeni_payroll" | "zeni_cfo" | "zeni_tax" | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const toPeopleSortKeyType: (v: string) => "
|
|
1
|
+
declare const toPeopleSortKeyType: (v: string) => "name" | "role" | "manager" | "department" | "lastSeen";
|
|
2
2
|
export type PeopleViewSortKey = ReturnType<typeof toPeopleSortKeyType>;
|
|
3
3
|
export {};
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import { RecommendationPayload, RecommendationPayloadWithCOT } from '../../commonPayloadTypes/recommendationPayload';
|
|
2
2
|
import { ID } from '../../commonStateTypes/common';
|
|
3
3
|
import { Recommendation, RecommendationWithCOT } from '../../commonStateTypes/recommendationBase';
|
|
4
|
-
import { Entity } from '../../entity/genericEntity/entity';
|
|
5
4
|
import { RecommendationByLineId, RecommendationWithCOTByLineId } from '../../entity/transaction/stateTypes/transaction';
|
|
6
|
-
import { SupportedTransaction } from '../../entity/transaction/transactionState';
|
|
7
5
|
export declare const getRecommendationFromRecommendationPayload: (payload: RecommendationPayload[]) => Recommendation[] | undefined;
|
|
8
6
|
export declare const getRecommendationByLineIdFromRecommendationPayload: (recommendationPayload: RecommendationPayload[], lineIds: ID[]) => RecommendationByLineId | undefined;
|
|
9
7
|
export declare const getRecommendationWithCOTFromRecommendationPayloadWithCOT: (payload: RecommendationPayloadWithCOT[]) => RecommendationWithCOT[] | undefined;
|
|
10
|
-
export declare const buildRecommendationUrl: (accountMicroServiceBaseUrl: string, entity: Entity, amount: number, transactionDetails: {
|
|
11
|
-
lineIds: ID[];
|
|
12
|
-
transaction: SupportedTransaction;
|
|
13
|
-
transactionId: {
|
|
14
|
-
id: string;
|
|
15
|
-
};
|
|
16
|
-
}, isFetchCOT: boolean) => string;
|
|
17
8
|
export declare const getRecommendationByLineIdWithCOTFromRecommendationPayloadWithCOT: (recommendationPayload: RecommendationPayloadWithCOT[], lineIds: ID[]) => RecommendationWithCOTByLineId | undefined;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRecommendationByLineIdWithCOTFromRecommendationPayloadWithCOT = exports.
|
|
3
|
+
exports.getRecommendationByLineIdWithCOTFromRecommendationPayloadWithCOT = exports.getRecommendationWithCOTFromRecommendationPayloadWithCOT = exports.getRecommendationByLineIdFromRecommendationPayload = exports.getRecommendationFromRecommendationPayload = void 0;
|
|
4
4
|
const transactionPayload_1 = require("../../entity/transaction/payloadTypes/transactionPayload");
|
|
5
|
-
const transactionDetailState_1 = require("../transactionDetail/transactionDetailState");
|
|
6
5
|
const getRecommendationFromRecommendationPayload = (payload) => {
|
|
7
6
|
if (payload == null || payload.length === 0) {
|
|
8
7
|
return undefined;
|
|
@@ -44,35 +43,6 @@ const getRecommendationWithCOTFromRecommendationPayloadWithCOT = (payload) => {
|
|
|
44
43
|
return recommendations;
|
|
45
44
|
};
|
|
46
45
|
exports.getRecommendationWithCOTFromRecommendationPayloadWithCOT = getRecommendationWithCOTFromRecommendationPayloadWithCOT;
|
|
47
|
-
// Pluralized URL segment for entity types. Mirrors the legacy
|
|
48
|
-
// fetchEntityRecommendationsByTransactionIdEpic.toEntityTypeURL.
|
|
49
|
-
const toEntityTypeUrlSegment = (entityType) => `${entityType}s`;
|
|
50
|
-
// Build the recommendations URL for a single entity + transaction target.
|
|
51
|
-
// Centralizes the URL shape so the legacy
|
|
52
|
-
// fetchEntityRecommendationsByTransactionIdEpic and the new
|
|
53
|
-
// fetchEntityRecommendationsForLineUpdateEpic stay in lockstep.
|
|
54
|
-
const buildRecommendationUrl = (accountMicroServiceBaseUrl, entity, amount, transactionDetails, isFetchCOT) => {
|
|
55
|
-
const entityQuery = {
|
|
56
|
-
entity_name: entity.name,
|
|
57
|
-
entity_type: entity.type,
|
|
58
|
-
};
|
|
59
|
-
// Entity-id-null case: server expects entity_name / entity_type query
|
|
60
|
-
// instead of the {entityType}/{qboId}/recommendations path.
|
|
61
|
-
if (entity.qboId === entity.name) {
|
|
62
|
-
return `${accountMicroServiceBaseUrl}/1.0/recommendations?query=${encodeURIComponent(JSON.stringify(entityQuery))}`;
|
|
63
|
-
}
|
|
64
|
-
const query = {
|
|
65
|
-
amount,
|
|
66
|
-
transaction_id: (0, transactionDetailState_1.getActualTransactionID)(transactionDetails.transactionId.id),
|
|
67
|
-
transaction_type: transactionDetails.transaction.type,
|
|
68
|
-
line_ids: transactionDetails.lineIds,
|
|
69
|
-
};
|
|
70
|
-
if (isFetchCOT === true) {
|
|
71
|
-
query.include_cot = true;
|
|
72
|
-
}
|
|
73
|
-
return `${accountMicroServiceBaseUrl}/1.0/${toEntityTypeUrlSegment(entity.type)}/${entity.qboId}/recommendations?query=${encodeURIComponent(JSON.stringify(query))}`;
|
|
74
|
-
};
|
|
75
|
-
exports.buildRecommendationUrl = buildRecommendationUrl;
|
|
76
46
|
const getRecommendationByLineIdWithCOTFromRecommendationPayloadWithCOT = (recommendationPayload, lineIds) => {
|
|
77
47
|
if (recommendationPayload.length === 0) {
|
|
78
48
|
return undefined;
|
|
@@ -5,7 +5,6 @@ import { TransactionID } from '../../entity/transaction/stateTypes/transaction';
|
|
|
5
5
|
import { SupportedTransaction } from '../../entity/transaction/transactionState';
|
|
6
6
|
import { ZeniAPIStatus } from '../../responsePayload';
|
|
7
7
|
import { EntityRecommendationState } from './recommendationState';
|
|
8
|
-
export type RecommendationLineUpdateFlowType = 'categorization' | 'detail';
|
|
9
8
|
export declare const initialState: EntityRecommendationState;
|
|
10
9
|
export declare const fetchEntityRecommendationsByTransactionId: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[entity: Entity, amount: number, transactionDetails: {
|
|
11
10
|
lineIds: ID[];
|
|
@@ -23,23 +22,7 @@ export declare const fetchEntityRecommendationsByTransactionId: import("@reduxjs
|
|
|
23
22
|
isTransactionCategorizationFlow: any;
|
|
24
23
|
isFetchCOT: any;
|
|
25
24
|
isUncategorizedExpenseCategoryEnabled: boolean | undefined;
|
|
26
|
-
}, "recommendation/fetchEntityRecommendationsByTransactionId", never, never>,
|
|
27
|
-
lineIds: ID[];
|
|
28
|
-
transaction: SupportedTransaction;
|
|
29
|
-
transactionId: TransactionID;
|
|
30
|
-
}, flowType: RecommendationLineUpdateFlowType, selectedTab?: "review" | "autoCategorized" | undefined, isFetchCOT?: any, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
|
|
31
|
-
entity: Entity;
|
|
32
|
-
amount: number;
|
|
33
|
-
transactionDetails: {
|
|
34
|
-
lineIds: ID[];
|
|
35
|
-
transaction: SupportedTransaction;
|
|
36
|
-
transactionId: TransactionID;
|
|
37
|
-
};
|
|
38
|
-
flowType: RecommendationLineUpdateFlowType;
|
|
39
|
-
selectedTab: "review" | "autoCategorized" | undefined;
|
|
40
|
-
isFetchCOT: any;
|
|
41
|
-
isUncategorizedExpenseCategoryEnabled: boolean | undefined;
|
|
42
|
-
}, "recommendation/fetchEntityRecommendationsForLineUpdate", never, never>, fetchRecommendationByEntityName: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[entityName: string, entityType: EntityType], {
|
|
25
|
+
}, "recommendation/fetchEntityRecommendationsByTransactionId", never, never>, fetchRecommendationByEntityName: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[entityName: string, entityType: EntityType], {
|
|
43
26
|
entityName: string;
|
|
44
27
|
entityType: EntityType;
|
|
45
28
|
}, "recommendation/fetchRecommendationByEntityName", never, never>, fetchRecommendationByEntityId: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[entityId: string, entityType: EntityType], {
|