@zeniai/client-epic-state 5.0.69-betaML31 → 5.0.69-betaML4
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/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
- package/lib/entity/account/accountSelector.d.ts +9 -0
- package/lib/entity/account/accountSelector.js +14 -1
- package/lib/entity/account/accountState.d.ts +1 -1
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/sectionProjectView/sectionProjectView.d.ts +1 -1
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +2 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +4 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +20 -58
- package/lib/entity/transaction/stateTypes/transaction.d.ts +3 -0
- package/lib/epic.d.ts +3 -2
- package/lib/epic.js +3 -2
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
- package/lib/esm/entity/account/accountSelector.js +11 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +20 -58
- package/lib/esm/epic.js +3 -2
- package/lib/esm/index.js +9 -8
- package/lib/esm/reducer.js +3 -0
- package/lib/esm/view/createTransferEntry/createTransferEntryReducer.js +56 -0
- package/lib/esm/view/createTransferEntry/createTransferEntrySelector.js +64 -0
- package/lib/esm/view/createTransferEntry/createTransferEntryState.js +17 -0
- package/lib/esm/view/createTransferEntry/epics/createTransferEntryEpic.js +112 -0
- package/lib/esm/view/createTransferEntry/epics/fetchTransferAccountsEpic.js +36 -0
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +8 -0
- package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +1 -21
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +26 -117
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +9 -59
- package/lib/esm/view/recommendation/recommendationHelper.js +0 -29
- package/lib/esm/view/recommendation/recommendationReducer.js +1 -36
- package/lib/esm/view/transactionDetail/epics/transactionDetailEpic.js +14 -2
- package/lib/esm/view/transactionDetail/transactionDetailReducer.js +8 -122
- package/lib/esm/view/transactionDetail/transactionDetailSelector.js +6 -23
- package/lib/index.d.ts +9 -9
- package/lib/index.js +43 -36
- package/lib/reducer.d.ts +3 -0
- package/lib/reducer.js +3 -0
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/createTransferEntry/createTransferEntryReducer.d.ts +32 -0
- package/lib/view/createTransferEntry/createTransferEntryReducer.js +60 -0
- package/lib/view/createTransferEntry/createTransferEntrySelector.d.ts +39 -0
- package/lib/view/createTransferEntry/createTransferEntrySelector.js +69 -0
- package/lib/view/createTransferEntry/createTransferEntryState.d.ts +30 -0
- package/lib/view/createTransferEntry/createTransferEntryState.js +20 -0
- package/lib/view/createTransferEntry/epics/createTransferEntryEpic.d.ts +11 -0
- package/lib/view/createTransferEntry/epics/createTransferEntryEpic.js +116 -0
- package/lib/view/createTransferEntry/epics/fetchTransferAccountsEpic.d.ts +14 -0
- package/lib/view/createTransferEntry/epics/fetchTransferAccountsEpic.js +40 -0
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.d.ts +2 -1
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +8 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -23
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +4 -15
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +26 -117
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +4 -3
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +1 -3
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +11 -61
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +0 -1
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- 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/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/transactionDetail/epics/transactionDetailEpic.d.ts +2 -1
- package/lib/view/transactionDetail/epics/transactionDetailEpic.js +14 -2
- package/lib/view/transactionDetail/transactionDetailPayload.d.ts +1 -1
- package/lib/view/transactionDetail/transactionDetailReducer.d.ts +3 -12
- package/lib/view/transactionDetail/transactionDetailReducer.js +9 -123
- package/lib/view/transactionDetail/transactionDetailSelector.d.ts +6 -3
- package/lib/view/transactionDetail/transactionDetailSelector.js +7 -25
- package/lib/view/transactionDetail/transactionDetailTypes.d.ts +0 -1
- package/package.json +1 -1
- package/lib/esm/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.js +0 -83
- package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
- package/lib/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.d.ts +0 -9
- package/lib/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.js +0 -87
|
@@ -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;
|
|
@@ -183,7 +170,9 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
183
170
|
}, "expenseAutomationTransactionsView/syncTransactionCategorizationFromDetailSave", never, never>, backgroundRefetchReviewTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
|
|
184
171
|
period: TimePeriod;
|
|
185
172
|
isUncategorizedExpenseCategoryEnabled: boolean | undefined;
|
|
186
|
-
}, "expenseAutomationTransactionsView/backgroundRefetchReviewTab", never, never>,
|
|
173
|
+
}, "expenseAutomationTransactionsView/backgroundRefetchReviewTab", never, never>, removeTransactionFromAllTabs: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: string], {
|
|
174
|
+
transactionId: string;
|
|
175
|
+
}, "expenseAutomationTransactionsView/removeTransactionFromAllTabs", never, never>, updateTransactionCategorizationUploadReceiptState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionId: string, fetchStatus: FetchStateAndError], {
|
|
187
176
|
selectedTab: "review" | "autoCategorized";
|
|
188
177
|
transactionId: string;
|
|
189
178
|
fetchStatus: FetchStateAndError;
|
|
@@ -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.
|
|
7
|
+
exports.uploadTransactionCategorizationReceiptSuccess = exports.updateTransactionCategorizationUploadReceiptState = exports.removeTransactionFromAllTabs = 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"));
|
|
@@ -12,6 +12,7 @@ const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
|
12
12
|
const vendorTransaction_1 = require("../../../entity/transaction/stateTypes/vendorTransaction");
|
|
13
13
|
const transactionCategorizationLocalDataHelper_1 = require("../helpers/transactionCategorizationLocalDataHelper");
|
|
14
14
|
const completedSubTab_1 = require("../types/completedSubTab");
|
|
15
|
+
const transactionsViewState_1 = require("../types/transactionsViewState");
|
|
15
16
|
exports.initialTransactionTabViewState = {
|
|
16
17
|
saveStatus: {
|
|
17
18
|
fetchState: 'Not-Started',
|
|
@@ -427,9 +428,12 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
427
428
|
const selectedCheckBoxTransactionIds = draft.transactionCategorizationView[selectedTab]
|
|
428
429
|
.selectedCheckBoxTransactionIds;
|
|
429
430
|
if (selectedTransaction != null &&
|
|
430
|
-
(0, transactionCategorizationLocalDataHelper_1.
|
|
431
|
+
(0, transactionCategorizationLocalDataHelper_1.checkIfAllLineItemsAreCategoryClassFilled)(selectedTransaction, newTransactionLocalData, uncategorizedAccounts, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled) === true && // check if all line items are filled
|
|
432
|
+
selectedCheckBoxTransactionIds.length < transactionCategorizationLocalDataHelper_1.MAX_SELECTION_LIMIT &&
|
|
433
|
+
selectedCheckBoxTransactionIds.includes(transactionId) === false) {
|
|
431
434
|
draft.transactionCategorizationView[selectedTab].selectedCheckBoxTransactionIds = [
|
|
432
|
-
...
|
|
435
|
+
...draft.transactionCategorizationView[selectedTab]
|
|
436
|
+
.selectedCheckBoxTransactionIds,
|
|
433
437
|
transactionId,
|
|
434
438
|
];
|
|
435
439
|
}
|
|
@@ -512,26 +516,9 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
512
516
|
const transactionLocalData = (0, get_1.default)(draft.transactionCategorizationView[selectedTab]
|
|
513
517
|
.transactionReviewLocalDataById, transactionId.id, undefined);
|
|
514
518
|
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
519
|
draft.transactionCategorizationView[selectedTab].transactionReviewLocalDataById[transaction.id] = {
|
|
533
520
|
transactionId: transaction.id,
|
|
534
|
-
transactionReviewLocalData:
|
|
521
|
+
transactionReviewLocalData: (0, transactionCategorizationLocalDataHelper_1.setEntityRecommendationForLineIdInLocalData)(draft.transactionCategorizationView[selectedTab], transaction, transactionLocalData.transactionReviewLocalData, entity, lineIds, uncategorizedAccounts, action.payload.recommendationWithCOTByLineId, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled),
|
|
535
522
|
};
|
|
536
523
|
// Mark transaction as dirty (autofill happened)
|
|
537
524
|
if (!draft.transactionCategorizationView[selectedTab].transactionIdsWithUnsavedData.includes(transaction.id)) {
|
|
@@ -544,99 +531,6 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
544
531
|
}
|
|
545
532
|
},
|
|
546
533
|
},
|
|
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
534
|
fetchTransactionCategorizationSuccess(draft, action) {
|
|
641
535
|
const { selectedTab, refreshViewInBackground } = action.payload;
|
|
642
536
|
if (draft.transactionCategorizationView[selectedTab].fetchState ===
|
|
@@ -732,7 +626,9 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
732
626
|
.selectedCheckBoxTransactionIds;
|
|
733
627
|
if (newTransactionLocalData.customer != null &&
|
|
734
628
|
newTransactionLocalData.customer.id != null &&
|
|
735
|
-
(0, transactionCategorizationLocalDataHelper_1.
|
|
629
|
+
(0, transactionCategorizationLocalDataHelper_1.checkIfAllLineItemsAreCategoryClassFilled)(selectedTransaction, newTransactionLocalData, uncategorizedAccounts, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled) === true && // check if all line items are filled
|
|
630
|
+
selectedCheckBoxTransactionIds.length < transactionCategorizationLocalDataHelper_1.MAX_SELECTION_LIMIT &&
|
|
631
|
+
selectedCheckBoxTransactionIds.includes(transactionId) === false) {
|
|
736
632
|
draft.transactionCategorizationView[selectedTab].selectedCheckBoxTransactionIds = [
|
|
737
633
|
...selectedCheckBoxTransactionIds,
|
|
738
634
|
transactionId,
|
|
@@ -806,7 +702,9 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
806
702
|
.selectedCheckBoxTransactionIds;
|
|
807
703
|
if (newTransactionLocalData.vendor != null &&
|
|
808
704
|
newTransactionLocalData.vendor.id != null &&
|
|
809
|
-
(0, transactionCategorizationLocalDataHelper_1.
|
|
705
|
+
(0, transactionCategorizationLocalDataHelper_1.checkIfAllLineItemsAreCategoryClassFilled)(selectedTransaction, newTransactionLocalData, uncategorizedAccounts, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled) === true && // check if all line items are filled
|
|
706
|
+
selectedCheckBoxTransactionIds.length < transactionCategorizationLocalDataHelper_1.MAX_SELECTION_LIMIT &&
|
|
707
|
+
selectedCheckBoxTransactionIds.includes(transactionId) === false) {
|
|
810
708
|
draft.transactionCategorizationView[selectedTab].selectedCheckBoxTransactionIds = [
|
|
811
709
|
...selectedCheckBoxTransactionIds,
|
|
812
710
|
transactionId,
|
|
@@ -1037,7 +935,18 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
1037
935
|
};
|
|
1038
936
|
},
|
|
1039
937
|
},
|
|
938
|
+
removeTransactionFromAllTabs: {
|
|
939
|
+
prepare(transactionId) {
|
|
940
|
+
return { payload: { transactionId } };
|
|
941
|
+
},
|
|
942
|
+
reducer(draft, action) {
|
|
943
|
+
const { transactionId } = action.payload;
|
|
944
|
+
for (const tab of transactionsViewState_1.TRANSACTIONS_TABS) {
|
|
945
|
+
(0, transactionCategorizationLocalDataHelper_1.removeTransactionFromTabView)(draft.transactionCategorizationView[tab], transactionId);
|
|
946
|
+
}
|
|
947
|
+
},
|
|
948
|
+
},
|
|
1040
949
|
},
|
|
1041
950
|
});
|
|
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.
|
|
951
|
+
_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.removeTransactionFromAllTabs = _a.removeTransactionFromAllTabs, exports.updateTransactionCategorizationUploadReceiptState = _a.updateTransactionCategorizationUploadReceiptState, exports.uploadTransactionCategorizationReceiptSuccess = _a.uploadTransactionCategorizationReceiptSuccess;
|
|
1043
952
|
exports.default = expenseAutomationTransactionsView.reducer;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NestedAccountHierarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID';
|
|
2
2
|
import { NestedClassHierarchyForReport } from '../../../commonStateTypes/classesView/nestedClassID';
|
|
3
|
-
import { CompletionStatusType, FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
3
|
+
import { CompletionStatusType, FetchState, FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
4
4
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
5
5
|
import { AccountBase } from '../../../entity/account/accountState';
|
|
6
6
|
import { ClassBase } from '../../../entity/class/classState';
|
|
@@ -19,9 +19,9 @@ export interface ExpenseAutomationTransactionViewSelector extends SelectorView {
|
|
|
19
19
|
classHierarchyList: NestedClassHierarchyForReport[];
|
|
20
20
|
classList: ClassBase[];
|
|
21
21
|
completionStatus: CompletionStatusType;
|
|
22
|
+
createTransferEntryStatus: FetchState;
|
|
23
|
+
creditCardTransferAccountsList: AccountBase[];
|
|
22
24
|
fetchStateByTransactionTabs: Record<TransactionsTab, FetchStateAndError>;
|
|
23
|
-
hasInFlightCategoryClassRecommendations: boolean;
|
|
24
|
-
inFlightCategoryClassRecommendationsByTransactionId: Record<ID, boolean>;
|
|
25
25
|
isAccountingProjectsEnabled: boolean;
|
|
26
26
|
markAsNotMiscategorizedStatus: FetchStateAndError;
|
|
27
27
|
/**
|
|
@@ -45,6 +45,7 @@ export interface ExpenseAutomationTransactionViewSelector extends SelectorView {
|
|
|
45
45
|
transactionIdsWithUnsavedData: ID[];
|
|
46
46
|
transactionLocalData: TransactionReviewLocalDataSelectorView[];
|
|
47
47
|
transactions: SupportedTransactionWithCOT[];
|
|
48
|
+
transferAccounts: AccountBase[];
|
|
48
49
|
uiState: TransactionsViewUIState;
|
|
49
50
|
uncategorizedAccounts: UncategorizedAccounts;
|
|
50
51
|
uploadReceiptStatusById: Record<ID, FetchStateAndError>;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { ID } from '../../../commonStateTypes/common';
|
|
2
1
|
import { RootState } from '../../../reducer';
|
|
3
2
|
import { ExpenseAutomationTransactionViewSelector } from '../selectorTypes/transactionsViewSelectorTypes';
|
|
4
|
-
export
|
|
5
|
-
export declare const getCategorizationHasInFlightRecommendations: (state: RootState) => boolean;
|
|
3
|
+
export { getLastTransferEntryReplacement } from '../../createTransferEntry/createTransferEntrySelector';
|
|
6
4
|
export declare function getExpenseAutomationTransactionView(state: RootState): ExpenseAutomationTransactionViewSelector;
|
|
@@ -3,9 +3,8 @@ 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.
|
|
6
|
+
exports.getLastTransferEntryReplacement = void 0;
|
|
7
7
|
exports.getExpenseAutomationTransactionView = getExpenseAutomationTransactionView;
|
|
8
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
9
8
|
const omit_1 = __importDefault(require("lodash/omit"));
|
|
10
9
|
const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
|
|
11
10
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
@@ -14,64 +13,15 @@ const transactionHelper_1 = require("../../../entity/transaction/transactionHelp
|
|
|
14
13
|
const transactionSelector_1 = require("../../../entity/transaction/transactionSelector");
|
|
15
14
|
const accountListSelector_1 = require("../../accountList/accountListSelector");
|
|
16
15
|
const classListSelector_1 = require("../../classList/classListSelector");
|
|
16
|
+
const createTransferEntrySelector_1 = require("../../createTransferEntry/createTransferEntrySelector");
|
|
17
17
|
const projectListSelector_1 = require("../../projectList/projectListSelector");
|
|
18
18
|
const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
|
|
19
|
-
//
|
|
20
|
-
// `
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const computeCategorizationInFlightRecommendations = (transactionReviewLocalDataById) => {
|
|
24
|
-
const result = {};
|
|
25
|
-
if (transactionReviewLocalDataById == null) {
|
|
26
|
-
return result;
|
|
27
|
-
}
|
|
28
|
-
for (const [transactionId, data] of Object.entries(transactionReviewLocalDataById)) {
|
|
29
|
-
const lineItems = Object.values(data.transactionReviewLocalData.lineItemById);
|
|
30
|
-
if (lineItems.some((lineItem) => lineItem.categoryClassRecommendationsFetchState?.fetchState ===
|
|
31
|
-
'In-Progress')) {
|
|
32
|
-
result[transactionId] = true;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return result;
|
|
36
|
-
};
|
|
37
|
-
// Per-tab createSelector instances. Each one is memoized on its OWN tab's
|
|
38
|
-
// transactionReviewLocalDataById reference. Switching tabs A->B->A no
|
|
39
|
-
// longer busts the memo for tab A — the dispatcher below just returns
|
|
40
|
-
// whichever per-tab selector matches the active tab, and reselect keeps
|
|
41
|
-
// the prior result alive as long as the underlying slice ref is stable.
|
|
42
|
-
const getReviewInFlightRecommendationsByTransactionId = (0, toolkit_1.createSelector)((state) => state.expenseAutomationTransactionsViewState.transactionCategorizationView
|
|
43
|
-
.review.transactionReviewLocalDataById, computeCategorizationInFlightRecommendations);
|
|
44
|
-
const getAutoCategorizedInFlightRecommendationsByTransactionId = (0, toolkit_1.createSelector)((state) => state.expenseAutomationTransactionsViewState.transactionCategorizationView
|
|
45
|
-
.autoCategorized.transactionReviewLocalDataById, computeCategorizationInFlightRecommendations);
|
|
46
|
-
// Per-transaction "any line is fetching category/class recommendations?"
|
|
47
|
-
// map for the active categorization tab. Dispatches to the per-tab
|
|
48
|
-
// memoized selector above so steady state (no fetches in flight)
|
|
49
|
-
// recomputes only when the active tab's local data changes; tab switches
|
|
50
|
-
// are O(1) cache lookups.
|
|
51
|
-
//
|
|
52
|
-
// `default` guards against the union "lying" at runtime: `TransactionsTab`
|
|
53
|
-
// is produced via `stringToUnion`, which falls back to `s as StringUnion`
|
|
54
|
-
// for unrecognized strings, so an unexpected value can land in state. The
|
|
55
|
-
// downstream `getCategorizationHasInFlightRecommendations` calls
|
|
56
|
-
// `Object.keys` on this result, so we must always return an object.
|
|
57
|
-
const getCategorizationInFlightRecommendationsByTransactionId = (state) => {
|
|
58
|
-
const tab = state.expenseAutomationTransactionsViewState
|
|
59
|
-
.selectedTransactionCategorizationTab;
|
|
60
|
-
switch (tab) {
|
|
61
|
-
case 'review':
|
|
62
|
-
return getReviewInFlightRecommendationsByTransactionId(state);
|
|
63
|
-
case 'autoCategorized':
|
|
64
|
-
return getAutoCategorizedInFlightRecommendationsByTransactionId(state);
|
|
65
|
-
default:
|
|
66
|
-
return {};
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
exports.getCategorizationInFlightRecommendationsByTransactionId = getCategorizationInFlightRecommendationsByTransactionId;
|
|
70
|
-
// Page-level "any line on the active tab is in flight?" flag. Drives the
|
|
71
|
-
// list-page Save disable.
|
|
72
|
-
exports.getCategorizationHasInFlightRecommendations = (0, toolkit_1.createSelector)(exports.getCategorizationInFlightRecommendationsByTransactionId, (inFlightByTransactionId) => Object.keys(inFlightByTransactionId).length > 0);
|
|
19
|
+
// Re-exported here for back-compat. New code should import from
|
|
20
|
+
// `view/createTransferEntry/createTransferEntrySelector`.
|
|
21
|
+
var createTransferEntrySelector_2 = require("../../createTransferEntry/createTransferEntrySelector");
|
|
22
|
+
Object.defineProperty(exports, "getLastTransferEntryReplacement", { enumerable: true, get: function () { return createTransferEntrySelector_2.getLastTransferEntryReplacement; } });
|
|
73
23
|
function getExpenseAutomationTransactionView(state) {
|
|
74
|
-
const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, projectState, projectListState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
|
|
24
|
+
const { accountState, classState, classListState, accountListState, createTransferEntryState, expenseAutomationTransactionsViewState, expenseAutomationViewState, projectState, projectListState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
|
|
75
25
|
const { selectedTransactionCategorizationCompletedSubTab, selectedTransactionCategorizationTab, } = expenseAutomationTransactionsViewState;
|
|
76
26
|
const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, uploadReceiptStatusById, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
|
|
77
27
|
const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(accountState, accountListState, 'accountList');
|
|
@@ -165,8 +115,7 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
165
115
|
: [];
|
|
166
116
|
const transactionCompletionStatus = allSteps.find((step) => step.step === 'transaction_categorization')?.completionStatus;
|
|
167
117
|
const completionStatus = transactionCompletionStatus ?? 'incomplete';
|
|
168
|
-
const
|
|
169
|
-
const hasInFlightCategoryClassRecommendations = (0, exports.getCategorizationHasInFlightRecommendations)(state);
|
|
118
|
+
const { transferAccountsList, creditCardTransferAccountsList } = (0, createTransferEntrySelector_1.getResolvedTransferAccounts)(state);
|
|
170
119
|
return {
|
|
171
120
|
version: 0,
|
|
172
121
|
fetchState: fetchStatus.fetchState,
|
|
@@ -180,8 +129,6 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
180
129
|
classList: allClasses,
|
|
181
130
|
accountsHierarchyList,
|
|
182
131
|
classHierarchyList,
|
|
183
|
-
hasInFlightCategoryClassRecommendations,
|
|
184
|
-
inFlightCategoryClassRecommendationsByTransactionId,
|
|
185
132
|
isAccountingProjectsEnabled,
|
|
186
133
|
projectList,
|
|
187
134
|
transactionLocalData,
|
|
@@ -189,6 +136,7 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
189
136
|
refreshStatus,
|
|
190
137
|
saveStatus,
|
|
191
138
|
markAsNotMiscategorizedStatus,
|
|
139
|
+
createTransferEntryStatus: createTransferEntryState.createTransferEntryStatus,
|
|
192
140
|
completionStatus,
|
|
193
141
|
totalCountByTab,
|
|
194
142
|
parentTabTotalCountByTab,
|
|
@@ -196,6 +144,8 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
196
144
|
uploadReceiptStatusById,
|
|
197
145
|
selectedTransactionId,
|
|
198
146
|
selectedTransactionLineId,
|
|
147
|
+
creditCardTransferAccountsList,
|
|
148
|
+
transferAccounts: transferAccountsList,
|
|
199
149
|
selectedTransactionCategorizationCompletedSubTab,
|
|
200
150
|
};
|
|
201
151
|
}
|
|
@@ -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;
|
|
@@ -17,7 +17,7 @@ export declare const fetchFinanceStatement: import("@reduxjs/toolkit").ActionCre
|
|
|
17
17
|
firstMonthOfFY: Month;
|
|
18
18
|
maxNumOfPeriodsToHighlight: number;
|
|
19
19
|
thisPeriod: TimeframeTick;
|
|
20
|
-
}, "financeStatement/updateFinanceStatementThisPeriod">, updateCOABalancesRange: import("@reduxjs/toolkit").ActionCreatorWithPayload<COABalancesRange, "financeStatement/updateCOABalancesRange">, updateSelectedReportId: import("@reduxjs/toolkit").ActionCreatorWithPayload<"cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation", "financeStatement/updateSelectedReportId">, updateFinanceStatementAdditionalBalancesSelection: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
20
|
+
}, "financeStatement/updateFinanceStatementThisPeriod">, updateCOABalancesRange: import("@reduxjs/toolkit").ActionCreatorWithPayload<COABalancesRange, "financeStatement/updateCOABalancesRange">, updateSelectedReportId: import("@reduxjs/toolkit").ActionCreatorWithPayload<"cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts", "financeStatement/updateSelectedReportId">, updateFinanceStatementAdditionalBalancesSelection: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
21
21
|
additionalBalances: COABalanceType[];
|
|
22
22
|
coaBalances: COABalance[];
|
|
23
23
|
firstMonthOfFY: Month;
|
|
@@ -3,9 +3,9 @@ import { ZeniAPIStatus } from '../../responsePayload';
|
|
|
3
3
|
import { VendorReviewViewAllRecommendationsPayload } from '../vendorReviewView/common/payload/commonTypes';
|
|
4
4
|
import { GlobalMerchantViewState, GlobalRecommendationFetchSource, NewGlobalMerchantCurrentSelection } from './globalMerchantViewState';
|
|
5
5
|
export declare const initialState: GlobalMerchantViewState;
|
|
6
|
-
export declare const createGlobalMerchant: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[merchantId?: string | undefined, context?: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | undefined], {
|
|
6
|
+
export declare const createGlobalMerchant: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[merchantId?: string | undefined, context?: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts" | undefined], {
|
|
7
7
|
merchantId: string | undefined;
|
|
8
|
-
context: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | undefined;
|
|
8
|
+
context: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts" | undefined;
|
|
9
9
|
}, "globalMerchantView/createGlobalMerchant", never, never>, createGlobalMerchantSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
10
10
|
merchantId: ID;
|
|
11
11
|
}, "globalMerchantView/createGlobalMerchantSuccess">, createGlobalMerchantFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -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], {
|