@zeniai/client-epic-state 5.1.8-betaAS1 → 5.1.8-betaSS1
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/commonPayloadTypes/commonPayload.d.ts +4 -25
- package/lib/esm/index.js +3 -8
- package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +3 -3
- package/lib/esm/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +4 -3
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +12 -13
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/backgroundRefetchReviewTabEpic.js +19 -3
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +19 -9
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +2 -2
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscategorizedEpic.js +13 -2
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/saveTransactionCategorizationEpic.js +6 -2
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/triggerReviewTabRefetchEpic.js +2 -2
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/updateTransactionCategorizationEpic.js +6 -2
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewReducer.js +20 -3
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +48 -8
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +5 -4
- package/lib/esm/view/spendManagement/billPay/internationalWireVerification/epics/fetchIntlVerificationFormEpic.js +3 -7
- package/lib/esm/view/spendManagement/billPay/internationalWireVerification/epics/initializeIntlVerificationFormEpic.js +34 -33
- package/lib/esm/view/spendManagement/billPay/internationalWireVerification/epics/submitIntlVerificationEpic.js +7 -2
- package/lib/esm/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationPayload.js +8 -55
- package/lib/esm/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationReducer.js +6 -5
- package/lib/esm/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSelector.js +15 -39
- package/lib/index.d.ts +4 -10
- package/lib/index.js +30 -47
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +3 -3
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +4 -3
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.d.ts +0 -6
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +13 -14
- package/lib/view/expenseAutomationView/epics/transactionCategorization/backgroundRefetchReviewTabEpic.js +19 -3
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +19 -9
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscategorizedEpic.js +13 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/saveTransactionCategorizationEpic.js +6 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/triggerReviewTabRefetchEpic.js +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/updateTransactionCategorizationEpic.js +6 -2
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +6 -2
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.js +20 -3
- package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +9 -20
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +17 -8
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +48 -8
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +5 -4
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +5 -4
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -1
- package/lib/view/spendManagement/billPay/internationalWireVerification/epics/fetchIntlVerificationFormEpic.d.ts +3 -3
- package/lib/view/spendManagement/billPay/internationalWireVerification/epics/fetchIntlVerificationFormEpic.js +2 -6
- package/lib/view/spendManagement/billPay/internationalWireVerification/epics/initializeIntlVerificationFormEpic.d.ts +1 -2
- package/lib/view/spendManagement/billPay/internationalWireVerification/epics/initializeIntlVerificationFormEpic.js +33 -32
- package/lib/view/spendManagement/billPay/internationalWireVerification/epics/submitIntlVerificationEpic.js +7 -2
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationPayload.d.ts +1 -24
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationPayload.js +9 -59
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationReducer.js +5 -4
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSelector.js +15 -39
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationState.d.ts +1 -20
- package/package.json +1 -1
- package/lib/esm/view/spendManagement/billPay/internationalWireVerification/internationalWireOnboardingDetailsToLocalData.js +0 -146
- package/lib/esm/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationFieldConstants.js +0 -40
- package/lib/esm/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationLocalDataHelpers.js +0 -86
- package/lib/esm/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSubmitPayload.js +0 -154
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireOnboardingDetailsToLocalData.d.ts +0 -4
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireOnboardingDetailsToLocalData.js +0 -150
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationFieldConstants.d.ts +0 -38
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationFieldConstants.js +0 -43
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationLocalDataHelpers.d.ts +0 -27
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationLocalDataHelpers.js +0 -96
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSubmitPayload.d.ts +0 -32
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSubmitPayload.js +0 -159
|
@@ -11,7 +11,7 @@ const ownerListReducer_1 = require("../../../ownerList/ownerListReducer");
|
|
|
11
11
|
const projectListReducer_1 = require("../../../projectList/projectListReducer");
|
|
12
12
|
const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
|
|
13
13
|
const fetchTransactionCategorizationViewEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(transactionsViewReducer_1.fetchTransactionCategorizationView.match), (0, operators_1.mergeMap)((action) => {
|
|
14
|
-
const { selectedTab, cacheOverride, keepExistingListItems, pageToken, period, refreshViewInBackground, searchString, resetListItems, isUncategorizedExpenseCategoryEnabled, } = action.payload;
|
|
14
|
+
const { selectedTab, cacheOverride, keepExistingListItems, pageToken, period, refreshViewInBackground, searchString, resetListItems, isUncategorizedExpenseCategoryEnabled, statuses, countOnlyStatuses, } = action.payload;
|
|
15
15
|
const updateActions = [];
|
|
16
16
|
const { expenseAutomationTransactionsViewState } = state$.value;
|
|
17
17
|
const { fetchState, transactionIdsBySelectedPeriod } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTab];
|
|
@@ -45,7 +45,7 @@ const fetchTransactionCategorizationViewEpic = (actions$, state$) => actions$.pi
|
|
|
45
45
|
if (cacheOverride === true ||
|
|
46
46
|
fetchState === 'Not-Started' ||
|
|
47
47
|
transactionIds.length === 0) {
|
|
48
|
-
updateActions.push((0, transactionsViewReducer_1.fetchTransactionCategorization)(selectedTab, period, cacheOverride, keepExistingListItems, searchString, pageToken, refreshViewInBackground, resetListItems, isUncategorizedExpenseCategoryEnabled));
|
|
48
|
+
updateActions.push((0, transactionsViewReducer_1.fetchTransactionCategorization)(selectedTab, period, cacheOverride, keepExistingListItems, searchString, pageToken, refreshViewInBackground, resetListItems, isUncategorizedExpenseCategoryEnabled, statuses, countOnlyStatuses));
|
|
49
49
|
}
|
|
50
50
|
return (0, rxjs_1.from)(updateActions);
|
|
51
51
|
}));
|
|
@@ -13,7 +13,7 @@ const transactionCategorizationLocalDataHelper_1 = require("../../helpers/transa
|
|
|
13
13
|
const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
|
|
14
14
|
const markTransactionAsNotMiscategorizedEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(transactionsViewReducer_1.markTransactionAsNotMiscategorized.match), (0, operators_1.mergeMap)((action) => {
|
|
15
15
|
const { expenseAutomationViewState, expenseAutomationTransactionsViewState, } = state$.value;
|
|
16
|
-
const { transactionsInReview, selectedTab, isUncategorizedExpenseCategoryEnabled, } = action.payload;
|
|
16
|
+
const { transactionsInReview, selectedTab, isUncategorizedExpenseCategoryEnabled, reviewStatuses: reviewStatusesFromAction, } = action.payload;
|
|
17
17
|
const transactionsSuccess = transactionsInReview.transactions_update_success;
|
|
18
18
|
const transactionsFailed = transactionsInReview.transactions_update_failed;
|
|
19
19
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state$.value);
|
|
@@ -108,9 +108,20 @@ const markTransactionAsNotMiscategorizedEpic = (actions$, state$, zeniAPI) => ac
|
|
|
108
108
|
const timePeriodStart = (0, timePeriod_1.toAbsoluteDay)(period.start);
|
|
109
109
|
const timePeriodEnd = (0, timePeriod_1.toAbsoluteDay)(period.end);
|
|
110
110
|
if (timePeriodStart != null && timePeriodEnd != null) {
|
|
111
|
+
// Statsig-resolved Review-tab statuses are threaded
|
|
112
|
+
// through the EA save chain by `ExpenseAutomationScreen`
|
|
113
|
+
// (resolves via `useDynamicConfig` +
|
|
114
|
+
// `resolveTransactionCategorizationStatuses`). The
|
|
115
|
+
// hardcoded `['pending_review']` last-resort prevents
|
|
116
|
+
// accidental "all statuses" widening if the chain ever
|
|
117
|
+
// delivers `undefined` (defensive — every live caller
|
|
118
|
+
// should be passing this through).
|
|
119
|
+
const reviewStatuses = reviewStatusesFromAction ?? [
|
|
120
|
+
'pending_review',
|
|
121
|
+
];
|
|
111
122
|
actions.push((0, transactionsViewReducer_1.fetchTransactionCategorizationView)('review', { start: timePeriodStart, end: timePeriodEnd }, true, // cacheOverride = true to force refresh
|
|
112
123
|
false, undefined, undefined, true, // refreshViewInBackground
|
|
113
|
-
false, isUncategorizedExpenseCategoryEnabled));
|
|
124
|
+
false, isUncategorizedExpenseCategoryEnabled, reviewStatuses));
|
|
114
125
|
}
|
|
115
126
|
}
|
|
116
127
|
actions.push((0, transactionsViewReducer_1.updateTotalCountForTransactionCategorization)({
|
|
@@ -12,7 +12,7 @@ const accountListSelector_1 = require("../../../accountList/accountListSelector"
|
|
|
12
12
|
const saveTransactionHelper_1 = require("../../helpers/saveTransactionHelper");
|
|
13
13
|
const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
|
|
14
14
|
const saveTransactionCategorizationEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(transactionsViewReducer_1.saveTransactionCategorization.match), (0, operators_1.mergeMap)((action) => {
|
|
15
|
-
const { transactionIds, cotTrackingByTransactionId, selectedTab, isUncategorizedExpenseCategoryEnabled, } = action.payload;
|
|
15
|
+
const { transactionIds, cotTrackingByTransactionId, selectedTab, isUncategorizedExpenseCategoryEnabled, reviewStatuses, } = action.payload;
|
|
16
16
|
const fetchActions = [];
|
|
17
17
|
const { transactionState, expenseAutomationTransactionsViewState } = state$.value;
|
|
18
18
|
const transactionSaveUpdates = [];
|
|
@@ -25,7 +25,11 @@ const saveTransactionCategorizationEpic = (actions$, state$) => actions$.pipe((0
|
|
|
25
25
|
transactionSaveUpdates.push((0, saveTransactionHelper_1.toTransactionUpdatesFromTransactionCategorizationLocalData)(localData, transaction, uncategorizedIncomeExpense));
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
-
|
|
28
|
+
// Forward `reviewStatuses` so the downstream
|
|
29
|
+
// `updateTransactionCategorizationEpic` -> `markTransactionAsNotMiscategorized`
|
|
30
|
+
// chain receives the Statsig-resolved Review-tab statuses end-to-end
|
|
31
|
+
// without reading Statsig from epic-land.
|
|
32
|
+
fetchActions.push((0, transactionsViewReducer_1.updateTransactionCategorization)(selectedTab, transactionIds, transactionSaveUpdates, cotTrackingByTransactionId, isUncategorizedExpenseCategoryEnabled, reviewStatuses));
|
|
29
33
|
return (0, rxjs_1.from)(fetchActions);
|
|
30
34
|
}));
|
|
31
35
|
exports.saveTransactionCategorizationEpic = saveTransactionCategorizationEpic;
|
|
@@ -7,7 +7,7 @@ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
|
|
|
7
7
|
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
8
8
|
const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
|
|
9
9
|
const triggerReviewTabRefetchEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(transactionsViewReducer_1.syncTransactionCategorizationFromDetailSave.match), (0, operators_1.mergeMap)((action) => {
|
|
10
|
-
const { pendingReviewLineIds, transactionId, isUncategorizedExpenseCategoryEnabled, } = action.payload;
|
|
10
|
+
const { pendingReviewLineIds, transactionId, isUncategorizedExpenseCategoryEnabled, reviewStatuses, } = action.payload;
|
|
11
11
|
if (pendingReviewLineIds.length === 0) {
|
|
12
12
|
return rxjs_1.EMPTY;
|
|
13
13
|
}
|
|
@@ -26,6 +26,6 @@ const triggerReviewTabRefetchEpic = (actions$, state$) => actions$.pipe((0, oper
|
|
|
26
26
|
if (timePeriodStart == null || timePeriodEnd == null) {
|
|
27
27
|
return rxjs_1.EMPTY;
|
|
28
28
|
}
|
|
29
|
-
return (0, rxjs_1.of)((0, transactionsViewReducer_1.backgroundRefetchReviewTab)({ start: timePeriodStart, end: timePeriodEnd }, isUncategorizedExpenseCategoryEnabled));
|
|
29
|
+
return (0, rxjs_1.of)((0, transactionsViewReducer_1.backgroundRefetchReviewTab)({ start: timePeriodStart, end: timePeriodEnd }, isUncategorizedExpenseCategoryEnabled, reviewStatuses));
|
|
30
30
|
}));
|
|
31
31
|
exports.triggerReviewTabRefetchEpic = triggerReviewTabRefetchEpic;
|
|
@@ -21,7 +21,7 @@ const vendorSelector_1 = require("../../../../entity/vendor/vendorSelector");
|
|
|
21
21
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
22
22
|
const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
|
|
23
23
|
const updateTransactionCategorizationEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(transactionsViewReducer_1.updateTransactionCategorization.match), (0, operators_1.mergeMap)((action) => {
|
|
24
|
-
const { selectedTab, transactionIds, transactionSaveUpdates, cotTrackingByTransactionId, isUncategorizedExpenseCategoryEnabled, } = action.payload;
|
|
24
|
+
const { selectedTab, transactionIds, transactionSaveUpdates, cotTrackingByTransactionId, isUncategorizedExpenseCategoryEnabled, reviewStatuses, } = action.payload;
|
|
25
25
|
const { transactionState, vendorState, expenseAutomationTransactionsViewState, } = state$.value;
|
|
26
26
|
const payloadArray = preparePayload(selectedTab, transactionState, vendorState, expenseAutomationTransactionsViewState, transactionIds, transactionSaveUpdates, cotTrackingByTransactionId).filter((payload) => payload != null);
|
|
27
27
|
return zeniAPI
|
|
@@ -30,7 +30,11 @@ const updateTransactionCategorizationEpic = (actions$, state$, zeniAPI) => actio
|
|
|
30
30
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
31
31
|
const transactionsInReview = response.data;
|
|
32
32
|
const actions = [];
|
|
33
|
-
|
|
33
|
+
// Forward `reviewStatuses` so the downstream
|
|
34
|
+
// `markTransactionAsNotMiscategorizedEpic` can request the
|
|
35
|
+
// Statsig-resolved Review-tab statuses for its conditional
|
|
36
|
+
// background refetch via `fetchTransactionCategorizationView`.
|
|
37
|
+
actions.push((0, transactionsViewReducer_1.markTransactionAsNotMiscategorized)(selectedTab, transactionsInReview, isUncategorizedExpenseCategoryEnabled, reviewStatuses), (0, transactionsViewReducer_1.updateTransactionCategorizationSaveStatus)(selectedTab, 'Completed', (0, responsePayload_1.createZeniAPIStatus)('Completed', 'Transaction categorization updated successfully')));
|
|
34
38
|
return (0, rxjs_1.from)(actions);
|
|
35
39
|
}
|
|
36
40
|
else {
|
|
@@ -2,10 +2,12 @@ import { ID } from '../../commonStateTypes/common';
|
|
|
2
2
|
import { MonthYearPeriod } from '../../commonStateTypes/timePeriod';
|
|
3
3
|
import { ExpenseAutomationViewState } from './expenseAutomationViewState';
|
|
4
4
|
export declare const initialState: ExpenseAutomationViewState;
|
|
5
|
-
export declare const fetchAllExpenseAutomationTabs: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined, refreshViewInBackground?: boolean | undefined, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
|
|
5
|
+
export declare const fetchAllExpenseAutomationTabs: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined, refreshViewInBackground?: boolean | undefined, isUncategorizedExpenseCategoryEnabled?: boolean | undefined, statuses?: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined, countOnlyStatuses?: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined], {
|
|
6
6
|
cacheOverride: boolean;
|
|
7
7
|
refreshViewInBackground: boolean;
|
|
8
8
|
isUncategorizedExpenseCategoryEnabled: boolean;
|
|
9
|
+
statuses: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined;
|
|
10
|
+
countOnlyStatuses: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined;
|
|
9
11
|
}, "expenseAutomationView/fetchAllExpenseAutomationTabs", never, never>, updateCurrentSelectedPeriod: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, newSelectedPeriod: MonthYearPeriod], {
|
|
10
12
|
newSelectedPeriod: MonthYearPeriod;
|
|
11
13
|
tenantId: string;
|
|
@@ -13,8 +15,10 @@ export declare const fetchAllExpenseAutomationTabs: import("@reduxjs/toolkit").A
|
|
|
13
15
|
newSelectedView: "transaction_categorization" | "je_schedules" | "reconciliation" | "missing_receipts" | "flux_analysis" | "month_end_insights";
|
|
14
16
|
}, "expenseAutomationView/updateCurrentSelectedView", never, never>, clearExpenseAutomationView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationView/clearExpenseAutomationView">, initializeSelectedPeriodForTenants: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
15
17
|
selectedPeriodByTenantId: Record<ID, MonthYearPeriod>;
|
|
16
|
-
}, "expenseAutomationView/initializeSelectedPeriodForTenants">, refreshExpenseAutomationCurrentTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
|
|
18
|
+
}, "expenseAutomationView/initializeSelectedPeriodForTenants">, refreshExpenseAutomationCurrentTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[isUncategorizedExpenseCategoryEnabled?: boolean | undefined, statuses?: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined, countOnlyStatuses?: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined], {
|
|
17
19
|
isUncategorizedExpenseCategoryEnabled: boolean | undefined;
|
|
20
|
+
statuses: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined;
|
|
21
|
+
countOnlyStatuses: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined;
|
|
18
22
|
}, "expenseAutomationView/refreshExpenseAutomationCurrentTab", never, never>;
|
|
19
23
|
declare const _default: import("redux").Reducer<ExpenseAutomationViewState>;
|
|
20
24
|
export default _default;
|
|
@@ -22,20 +22,37 @@ const expenseAutomationView = (0, toolkit_1.createSlice)({
|
|
|
22
22
|
reducer() {
|
|
23
23
|
//do nothing
|
|
24
24
|
},
|
|
25
|
-
|
|
25
|
+
/**
|
|
26
|
+
* `statuses` / `countOnlyStatuses` carry the Statsig-resolved values
|
|
27
|
+
* for the currently selected transaction-categorization tab. The
|
|
28
|
+
* host (`ExpenseAutomationScreen`) resolves them via
|
|
29
|
+
* `useDynamicConfig` + `resolveTransactionCategorizationStatuses`
|
|
30
|
+
* and passes them in so the downstream bootstrap fetch hits the
|
|
31
|
+
* listing API with the correct status filter. Optional only as a
|
|
32
|
+
* defensive type concession for non-categorization callers (the
|
|
33
|
+
* action is also used to bootstrap the missing-receipts / reconciliation
|
|
34
|
+
* / month-end views, which don't consume these args).
|
|
35
|
+
*/
|
|
36
|
+
prepare(cacheOverride = false, refreshViewInBackground = false, isUncategorizedExpenseCategoryEnabled = false, statuses, countOnlyStatuses) {
|
|
26
37
|
return {
|
|
27
38
|
payload: {
|
|
28
39
|
cacheOverride,
|
|
29
40
|
refreshViewInBackground,
|
|
30
41
|
isUncategorizedExpenseCategoryEnabled,
|
|
42
|
+
statuses,
|
|
43
|
+
countOnlyStatuses,
|
|
31
44
|
},
|
|
32
45
|
};
|
|
33
46
|
},
|
|
34
47
|
},
|
|
35
48
|
refreshExpenseAutomationCurrentTab: {
|
|
36
|
-
prepare(isUncategorizedExpenseCategoryEnabled) {
|
|
49
|
+
prepare(isUncategorizedExpenseCategoryEnabled, statuses, countOnlyStatuses) {
|
|
37
50
|
return {
|
|
38
|
-
payload: {
|
|
51
|
+
payload: {
|
|
52
|
+
isUncategorizedExpenseCategoryEnabled,
|
|
53
|
+
statuses,
|
|
54
|
+
countOnlyStatuses,
|
|
55
|
+
},
|
|
39
56
|
};
|
|
40
57
|
},
|
|
41
58
|
reducer() {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { EntityRecommendationPayload } from '../../../commonPayloadTypes/recommendationPayload';
|
|
2
2
|
import { TransactionPayload } from '../../../entity/transaction/payloadTypes/transactionPayload';
|
|
3
|
+
import { CategorizationStatusType } from '../../../entity/transaction/stateTypes/transactionLine';
|
|
3
4
|
import { SupportedTransactionPayload } from '../../../entity/transaction/transactionState';
|
|
4
5
|
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
5
|
-
import { CompletedSubTab } from '../types/completedSubTab';
|
|
6
6
|
export interface TransactionCategorizationQueryPayload {
|
|
7
|
-
auto_categorized: boolean;
|
|
8
7
|
end_date: string | null;
|
|
9
8
|
page_size: number;
|
|
10
9
|
page_token: string | null;
|
|
@@ -12,13 +11,8 @@ export interface TransactionCategorizationQueryPayload {
|
|
|
12
11
|
sort_by: string;
|
|
13
12
|
sort_order: string;
|
|
14
13
|
start_date: string | null;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* returned page + `total_count` to one of the Completed sub-tabs. For the
|
|
18
|
-
* Review listing it is forced to `'all'` to preserve parent-tab semantics
|
|
19
|
-
* on the backend.
|
|
20
|
-
*/
|
|
21
|
-
sub_tab: CompletedSubTab;
|
|
14
|
+
count_only_statuses?: CategorizationStatusType[];
|
|
15
|
+
statuses?: CategorizationStatusType[];
|
|
22
16
|
}
|
|
23
17
|
export interface TransactionCategorizationPayload {
|
|
24
18
|
next_page_token: string | null;
|
|
@@ -26,18 +20,13 @@ export interface TransactionCategorizationPayload {
|
|
|
26
20
|
total_count: number;
|
|
27
21
|
transactions: SupportedTransactionPayload[];
|
|
28
22
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* Optional at the wire boundary so that any version-skew scenario
|
|
35
|
-
* (delayed BE rollout, cached SW response, hotfix without the BE change)
|
|
36
|
-
* deserializes cleanly. Consumers are expected to fall back to
|
|
37
|
-
* {@link total_count} when this is absent — see
|
|
38
|
-
* `fetchTransactionCategorizationEpic` for the canonical fallback.
|
|
23
|
+
* Backend-computed count for the optional {@link
|
|
24
|
+
* TransactionCategorizationQueryPayload.count_only_statuses} filter. Present
|
|
25
|
+
* only when the request supplied `count_only_statuses`; otherwise omitted,
|
|
26
|
+
* so any cached parent-badge value on the frontend stays intact across
|
|
27
|
+
* scoped fetches.
|
|
39
28
|
*/
|
|
40
|
-
|
|
29
|
+
count_only_total?: number;
|
|
41
30
|
}
|
|
42
31
|
export type TransactionCategorizationResponse = ZeniAPIResponse<TransactionCategorizationPayload>;
|
|
43
32
|
export interface EntityRelatedUpdatesPayload {
|
|
@@ -17,7 +17,7 @@ import { TransactionFilters } from '../transactionFilterHelpers';
|
|
|
17
17
|
import { SupportedTransactionCategorization, TransactionSaveUpdates, TransactionsTab, TransactionsTabViewState, TransactionsViewState, TransactionsViewUIState } from '../types/transactionsViewState';
|
|
18
18
|
export declare const initialTransactionTabViewState: TransactionsTabViewState;
|
|
19
19
|
export declare const initialState: TransactionsViewState;
|
|
20
|
-
export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", period: TimePeriod, cacheOverride?: any, keepExistingListItems?: any, searchString?: string | undefined, pageToken?: PageToken | undefined, refreshViewInBackground?: any, resetListItems?: boolean | undefined, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
|
|
20
|
+
export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", period: TimePeriod, cacheOverride?: any, keepExistingListItems?: any, searchString?: string | undefined, pageToken?: PageToken | undefined, refreshViewInBackground?: any, resetListItems?: boolean | undefined, isUncategorizedExpenseCategoryEnabled?: boolean | undefined, statuses?: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined, countOnlyStatuses?: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined], {
|
|
21
21
|
selectedTab: "review" | "autoCategorized";
|
|
22
22
|
period: TimePeriod;
|
|
23
23
|
searchString: string | undefined;
|
|
@@ -27,6 +27,8 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
27
27
|
refreshViewInBackground: any;
|
|
28
28
|
resetListItems: boolean | undefined;
|
|
29
29
|
isUncategorizedExpenseCategoryEnabled: boolean | undefined;
|
|
30
|
+
statuses: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined;
|
|
31
|
+
countOnlyStatuses: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined;
|
|
30
32
|
}, "expenseAutomationTransactionsView/fetchTransactionCategorization", never, never>, updateTransactionCategorizationUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
31
33
|
selectedTab: TransactionsTab;
|
|
32
34
|
uiState: Partial<TransactionsViewUIState>;
|
|
@@ -56,12 +58,14 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
56
58
|
selectedPeriod: MonthYearPeriod;
|
|
57
59
|
selectedTab: TransactionsTab;
|
|
58
60
|
status: ZeniAPIStatus;
|
|
59
|
-
}, "expenseAutomationTransactionsView/fetchTransactionCategorizationFailure">, saveTransactionCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionIds: string[], cotTrackingByTransactionId: COTTransactionTrackingByTransactionId, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
|
|
61
|
+
}, "expenseAutomationTransactionsView/fetchTransactionCategorizationFailure">, saveTransactionCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionIds: string[], cotTrackingByTransactionId: COTTransactionTrackingByTransactionId, isUncategorizedExpenseCategoryEnabled?: boolean | undefined, reviewStatuses?: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined], {
|
|
60
62
|
selectedTab: "review" | "autoCategorized";
|
|
61
63
|
transactionIds: string[];
|
|
62
64
|
cotTrackingByTransactionId: COTTransactionTrackingByTransactionId;
|
|
63
65
|
isUncategorizedExpenseCategoryEnabled: boolean | undefined;
|
|
64
|
-
|
|
66
|
+
reviewStatuses: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined;
|
|
67
|
+
}, "expenseAutomationTransactionsView/saveTransactionCategorization", never, never>, updateTransactionCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionIds: string[], transactionSaveUpdates: TransactionSaveUpdates[], cotTrackingByTransactionId: COTTransactionTrackingByTransactionId, isUncategorizedExpenseCategoryEnabled?: boolean | undefined, reviewStatuses?: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined], {
|
|
68
|
+
reviewStatuses: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined;
|
|
65
69
|
selectedTab: "review" | "autoCategorized";
|
|
66
70
|
transactionIds: string[];
|
|
67
71
|
transactionSaveUpdates: TransactionSaveUpdates[];
|
|
@@ -75,10 +79,11 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
75
79
|
selectedTab: "review" | "autoCategorized";
|
|
76
80
|
fetchState: FetchState;
|
|
77
81
|
error: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
78
|
-
}, "expenseAutomationTransactionsView/updateTransactionCategorizationSaveStatus", never, never>, markTransactionAsNotMiscategorized: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionsInReview: UpdateTransactionCategorizationResponsePayload, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
|
|
82
|
+
}, "expenseAutomationTransactionsView/updateTransactionCategorizationSaveStatus", never, never>, markTransactionAsNotMiscategorized: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionsInReview: UpdateTransactionCategorizationResponsePayload, isUncategorizedExpenseCategoryEnabled?: boolean | undefined, reviewStatuses?: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined], {
|
|
79
83
|
selectedTab: "review" | "autoCategorized";
|
|
80
84
|
transactionsInReview: UpdateTransactionCategorizationResponsePayload;
|
|
81
85
|
isUncategorizedExpenseCategoryEnabled: boolean | undefined;
|
|
86
|
+
reviewStatuses: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined;
|
|
82
87
|
}, "expenseAutomationTransactionsView/markTransactionAsNotMiscategorized", never, never>, updateStatusForTransactionNotMiscategorizedUpdateForCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", uncheckTransactionIds: string[], removeTransactionIdsFromSelectedPeriod: string[], selectedPeriod: MonthYearPeriod, fetchState: FetchState, error?: ZeniAPIStatus<Record<string, unknown>> | undefined, updateLineItemsByTransactionId?: Record<string, string[]> | undefined], {
|
|
83
88
|
removeTransactionIdsFromSelectedPeriod: string[];
|
|
84
89
|
selectedPeriod: MonthYearPeriod;
|
|
@@ -127,9 +132,9 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
127
132
|
selectedTab: TransactionsTab;
|
|
128
133
|
totalCount: number;
|
|
129
134
|
}, "expenseAutomationTransactionsView/updateTotalCountForTransactionCategorization">, updateParentTotalCountForTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
130
|
-
parentTotalCount: number;
|
|
131
135
|
selectedPeriod: MonthYearPeriod;
|
|
132
136
|
selectedTab: TransactionsTab;
|
|
137
|
+
parentTotalCount?: number;
|
|
133
138
|
}, "expenseAutomationTransactionsView/updateParentTotalCountForTab">, fetchTransactionCategorizationSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
134
139
|
selectedTab: TransactionsTab;
|
|
135
140
|
status: ZeniAPIStatus;
|
|
@@ -137,7 +142,7 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
137
142
|
}, "expenseAutomationTransactionsView/fetchTransactionCategorizationSuccess">, resetOtherTabsFetchState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
138
143
|
tabs: TransactionsTab[];
|
|
139
144
|
refreshViewInBackground?: boolean;
|
|
140
|
-
}, "expenseAutomationTransactionsView/resetOtherTabsFetchState">, fetchTransactionCategorizationView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", period: TimePeriod, cacheOverride?: any, keepExistingListItems?: any, searchString?: string | undefined, pageToken?: PageToken | undefined, refreshViewInBackground?: any, resetListItems?: any, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
|
|
145
|
+
}, "expenseAutomationTransactionsView/resetOtherTabsFetchState">, fetchTransactionCategorizationView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", period: TimePeriod, cacheOverride?: any, keepExistingListItems?: any, searchString?: string | undefined, pageToken?: PageToken | undefined, refreshViewInBackground?: any, resetListItems?: any, isUncategorizedExpenseCategoryEnabled?: boolean | undefined, statuses?: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined, countOnlyStatuses?: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined], {
|
|
141
146
|
selectedTab: "review" | "autoCategorized";
|
|
142
147
|
period: TimePeriod;
|
|
143
148
|
searchString: string | undefined;
|
|
@@ -147,6 +152,8 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
147
152
|
refreshViewInBackground: any;
|
|
148
153
|
resetListItems: any;
|
|
149
154
|
isUncategorizedExpenseCategoryEnabled: boolean | undefined;
|
|
155
|
+
statuses: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined;
|
|
156
|
+
countOnlyStatuses: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined;
|
|
150
157
|
}, "expenseAutomationTransactionsView/fetchTransactionCategorizationView", never, never>, updateSelectedCheckboxTransactionIds: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
151
158
|
selectedTab: TransactionsTab;
|
|
152
159
|
transactionIds: ID[];
|
|
@@ -178,15 +185,17 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
178
185
|
lineId: ID;
|
|
179
186
|
selectedTab: TransactionsTab;
|
|
180
187
|
transactionId: ID;
|
|
181
|
-
}, "expenseAutomationTransactionsView/updateSelectedTransactionId">, syncTransactionCategorizationFromDetailSave: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, updatedTransaction: SupportedTransactionWithCOT, pendingReviewLineIds: string[], uncategorizedIncomeExpense: UncategorizedAccounts, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
|
|
188
|
+
}, "expenseAutomationTransactionsView/updateSelectedTransactionId">, syncTransactionCategorizationFromDetailSave: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, updatedTransaction: SupportedTransactionWithCOT, pendingReviewLineIds: string[], uncategorizedIncomeExpense: UncategorizedAccounts, isUncategorizedExpenseCategoryEnabled?: boolean | undefined, reviewStatuses?: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined], {
|
|
182
189
|
transactionId: TransactionID;
|
|
183
190
|
updatedTransaction: SupportedTransactionWithCOT;
|
|
184
191
|
pendingReviewLineIds: string[];
|
|
185
192
|
uncategorizedIncomeExpense: UncategorizedAccounts;
|
|
186
193
|
isUncategorizedExpenseCategoryEnabled: boolean | undefined;
|
|
187
|
-
|
|
194
|
+
reviewStatuses: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined;
|
|
195
|
+
}, "expenseAutomationTransactionsView/syncTransactionCategorizationFromDetailSave", never, never>, backgroundRefetchReviewTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, isUncategorizedExpenseCategoryEnabled?: boolean | undefined, reviewStatuses?: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined], {
|
|
188
196
|
period: TimePeriod;
|
|
189
197
|
isUncategorizedExpenseCategoryEnabled: boolean | undefined;
|
|
198
|
+
reviewStatuses: ("auto_categorized" | "auto_reviewed" | "pending_review" | "review_complete")[] | undefined;
|
|
190
199
|
}, "expenseAutomationTransactionsView/backgroundRefetchReviewTab", never, never>, removeTransactionFromAllTabs: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: string], {
|
|
191
200
|
transactionId: string;
|
|
192
201
|
}, "expenseAutomationTransactionsView/removeTransactionFromAllTabs", never, never>, updateTransactionCategorizationUploadReceiptState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionId: string, fetchStatus: FetchStateAndError], {
|
|
@@ -128,7 +128,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
128
128
|
reducers: {
|
|
129
129
|
fetchTransactionCategorizationView: {
|
|
130
130
|
prepare(selectedTab, period, cacheOverride = false, keepExistingListItems = false, searchString, // when this is defined the output should go to search result IDs
|
|
131
|
-
pageToken, refreshViewInBackground = false, resetListItems = false, isUncategorizedExpenseCategoryEnabled) {
|
|
131
|
+
pageToken, refreshViewInBackground = false, resetListItems = false, isUncategorizedExpenseCategoryEnabled, statuses, countOnlyStatuses) {
|
|
132
132
|
return {
|
|
133
133
|
payload: {
|
|
134
134
|
selectedTab,
|
|
@@ -140,6 +140,8 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
140
140
|
refreshViewInBackground,
|
|
141
141
|
resetListItems,
|
|
142
142
|
isUncategorizedExpenseCategoryEnabled,
|
|
143
|
+
statuses,
|
|
144
|
+
countOnlyStatuses,
|
|
143
145
|
},
|
|
144
146
|
};
|
|
145
147
|
},
|
|
@@ -188,7 +190,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
188
190
|
}
|
|
189
191
|
},
|
|
190
192
|
prepare(selectedTab, period, cacheOverride = false, keepExistingListItems = false, searchString, // when this is defined the output should go to search result IDs
|
|
191
|
-
pageToken, refreshViewInBackground = false, resetListItems, isUncategorizedExpenseCategoryEnabled) {
|
|
193
|
+
pageToken, refreshViewInBackground = false, resetListItems, isUncategorizedExpenseCategoryEnabled, statuses, countOnlyStatuses) {
|
|
192
194
|
return {
|
|
193
195
|
payload: {
|
|
194
196
|
selectedTab,
|
|
@@ -200,6 +202,8 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
200
202
|
refreshViewInBackground,
|
|
201
203
|
resetListItems,
|
|
202
204
|
isUncategorizedExpenseCategoryEnabled,
|
|
205
|
+
statuses,
|
|
206
|
+
countOnlyStatuses,
|
|
203
207
|
},
|
|
204
208
|
};
|
|
205
209
|
},
|
|
@@ -318,13 +322,25 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
318
322
|
draft.transactionCategorizationView[selectedTab].filters = filters;
|
|
319
323
|
},
|
|
320
324
|
saveTransactionCategorization: {
|
|
321
|
-
|
|
325
|
+
/**
|
|
326
|
+
* `reviewStatuses` carries the Statsig-resolved Review-tab statuses
|
|
327
|
+
* forwarded by `ExpenseAutomationScreen`.
|
|
328
|
+
* `saveTransactionCategorizationEpic` threads them downstream into
|
|
329
|
+
* `updateTransactionCategorization` -> `markTransactionAsNotMiscategorized`
|
|
330
|
+
* so the conditional background Review-tab refetch in
|
|
331
|
+
* `markTransactionAsNotMiscategorizedEpic` can request the correct
|
|
332
|
+
* status set without reading Statsig from epic-land. Optional during
|
|
333
|
+
* the deprecation window so un-migrated callers continue to work via
|
|
334
|
+
* slice fallback.
|
|
335
|
+
*/
|
|
336
|
+
prepare(selectedTab, transactionIds, cotTrackingByTransactionId, isUncategorizedExpenseCategoryEnabled, reviewStatuses) {
|
|
322
337
|
return {
|
|
323
338
|
payload: {
|
|
324
339
|
selectedTab,
|
|
325
340
|
transactionIds,
|
|
326
341
|
cotTrackingByTransactionId,
|
|
327
342
|
isUncategorizedExpenseCategoryEnabled,
|
|
343
|
+
reviewStatuses,
|
|
328
344
|
},
|
|
329
345
|
};
|
|
330
346
|
},
|
|
@@ -398,9 +414,16 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
398
414
|
fetchState: 'In-Progress',
|
|
399
415
|
};
|
|
400
416
|
},
|
|
401
|
-
|
|
417
|
+
/**
|
|
418
|
+
* `reviewStatuses` carries the Statsig-resolved Review-tab statuses
|
|
419
|
+
* forwarded from `saveTransactionCategorization`.
|
|
420
|
+
* `updateTransactionCategorizationEpic` threads them downstream into
|
|
421
|
+
* `markTransactionAsNotMiscategorized`.
|
|
422
|
+
*/
|
|
423
|
+
prepare(selectedTab, transactionIds, transactionSaveUpdates, cotTrackingByTransactionId, isUncategorizedExpenseCategoryEnabled, reviewStatuses) {
|
|
402
424
|
return {
|
|
403
425
|
payload: {
|
|
426
|
+
reviewStatuses,
|
|
404
427
|
selectedTab,
|
|
405
428
|
transactionIds,
|
|
406
429
|
transactionSaveUpdates,
|
|
@@ -865,12 +888,20 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
865
888
|
error: undefined,
|
|
866
889
|
};
|
|
867
890
|
},
|
|
868
|
-
|
|
891
|
+
/**
|
|
892
|
+
* `reviewStatuses` carries the Statsig-resolved Review-tab statuses
|
|
893
|
+
* forwarded from the EA-screen save chain.
|
|
894
|
+
* `markTransactionAsNotMiscategorizedEpic` reads this payload value
|
|
895
|
+
* when dispatching the conditional background Review-tab refetch via
|
|
896
|
+
* `fetchTransactionCategorizationView`.
|
|
897
|
+
*/
|
|
898
|
+
prepare(selectedTab, transactionsInReview, isUncategorizedExpenseCategoryEnabled, reviewStatuses) {
|
|
869
899
|
return {
|
|
870
900
|
payload: {
|
|
871
901
|
selectedTab,
|
|
872
902
|
transactionsInReview,
|
|
873
903
|
isUncategorizedExpenseCategoryEnabled,
|
|
904
|
+
reviewStatuses,
|
|
874
905
|
},
|
|
875
906
|
};
|
|
876
907
|
},
|
|
@@ -928,10 +959,17 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
928
959
|
},
|
|
929
960
|
updateTotalCountForTransactionCategorization(draft, action) {
|
|
930
961
|
const { selectedTab, selectedPeriod, totalCount } = action.payload;
|
|
931
|
-
|
|
962
|
+
const periodId = (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod);
|
|
963
|
+
draft.transactionCategorizationView[selectedTab].uiState.totalCount[periodId] = totalCount;
|
|
964
|
+
if (selectedTab === 'review') {
|
|
965
|
+
draft.parentTotalCountByTab.review[periodId] = totalCount;
|
|
966
|
+
}
|
|
932
967
|
},
|
|
933
968
|
updateParentTotalCountForTab(draft, action) {
|
|
934
969
|
const { selectedTab, selectedPeriod, parentTotalCount } = action.payload;
|
|
970
|
+
if (parentTotalCount == null) {
|
|
971
|
+
return;
|
|
972
|
+
}
|
|
935
973
|
draft.parentTotalCountByTab[selectedTab][(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = parentTotalCount;
|
|
936
974
|
},
|
|
937
975
|
updateSelectedCheckboxTransactionIds(draft, action) {
|
|
@@ -980,7 +1018,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
980
1018
|
},
|
|
981
1019
|
},
|
|
982
1020
|
syncTransactionCategorizationFromDetailSave: {
|
|
983
|
-
prepare(transactionId, updatedTransaction, pendingReviewLineIds, uncategorizedIncomeExpense, isUncategorizedExpenseCategoryEnabled) {
|
|
1021
|
+
prepare(transactionId, updatedTransaction, pendingReviewLineIds, uncategorizedIncomeExpense, isUncategorizedExpenseCategoryEnabled, reviewStatuses) {
|
|
984
1022
|
return {
|
|
985
1023
|
payload: {
|
|
986
1024
|
transactionId,
|
|
@@ -988,6 +1026,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
988
1026
|
pendingReviewLineIds,
|
|
989
1027
|
uncategorizedIncomeExpense,
|
|
990
1028
|
isUncategorizedExpenseCategoryEnabled,
|
|
1029
|
+
reviewStatuses,
|
|
991
1030
|
},
|
|
992
1031
|
};
|
|
993
1032
|
},
|
|
@@ -1033,11 +1072,12 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
1033
1072
|
},
|
|
1034
1073
|
},
|
|
1035
1074
|
backgroundRefetchReviewTab: {
|
|
1036
|
-
prepare(period, isUncategorizedExpenseCategoryEnabled) {
|
|
1075
|
+
prepare(period, isUncategorizedExpenseCategoryEnabled, reviewStatuses) {
|
|
1037
1076
|
return {
|
|
1038
1077
|
payload: {
|
|
1039
1078
|
period,
|
|
1040
1079
|
isUncategorizedExpenseCategoryEnabled,
|
|
1080
|
+
reviewStatuses,
|
|
1041
1081
|
},
|
|
1042
1082
|
};
|
|
1043
1083
|
},
|
|
@@ -27,10 +27,11 @@ export interface ExpenseAutomationTransactionViewSelector extends SelectorView {
|
|
|
27
27
|
isAccountingProjectsEnabled: boolean;
|
|
28
28
|
markAsNotMiscategorizedStatus: FetchStateAndError;
|
|
29
29
|
/**
|
|
30
|
-
* Parent tab badge counts, sourced from the listing response's
|
|
31
|
-
* `
|
|
32
|
-
*
|
|
33
|
-
*
|
|
30
|
+
* Parent tab badge counts, sourced from the listing response's optional
|
|
31
|
+
* `count_only_total` (only emitted when the request supplied
|
|
32
|
+
* `count_only_statuses`). Used exclusively to drive the navbar / tab strip
|
|
33
|
+
* badge labels — every other count consumer (pagination, in-list "showing
|
|
34
|
+
* X of Y", save flows) keeps reading {@link totalCountByTab}.
|
|
34
35
|
*/
|
|
35
36
|
parentTabTotalCountByTab: Record<TransactionsTab, number>;
|
|
36
37
|
projectList: ProjectListSelectorView;
|
|
@@ -196,10 +196,11 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
196
196
|
review: monthYearPeriodId != null ? totalCountByReview[monthYearPeriodId] : 0,
|
|
197
197
|
autoCategorized: monthYearPeriodId != null ? totalCountByAutoCat[monthYearPeriodId] : 0,
|
|
198
198
|
};
|
|
199
|
-
// Parent-tab badge counts. Sourced from
|
|
200
|
-
//
|
|
201
|
-
//
|
|
202
|
-
//
|
|
199
|
+
// Parent-tab badge counts. Sourced from the listing response's optional
|
|
200
|
+
// `count_only_total` (only emitted when the request supplied
|
|
201
|
+
// `count_only_statuses`) and used exclusively by the navbar / tab strip
|
|
202
|
+
// badges. Independent of which Completed sub-tab is active so the badge
|
|
203
|
+
// stays stable across sub-tab switches.
|
|
203
204
|
const parentTotalCountByTab = expenseAutomationTransactionsViewState.parentTotalCountByTab;
|
|
204
205
|
const parentTabTotalCountByTab = {
|
|
205
206
|
review: monthYearPeriodId != null
|
|
@@ -139,7 +139,8 @@ export type TransactionsViewState = {
|
|
|
139
139
|
autoCategorizedSubTabCache: Partial<Record<CompletedSubTab, AutoCategorizedSubTabSnapshot>>;
|
|
140
140
|
/**
|
|
141
141
|
* Period-keyed parent tab counts, scoped per {@link TransactionsTab}.
|
|
142
|
-
*
|
|
142
|
+
* Populated from the listing response's optional `count_only_total` (only
|
|
143
|
+
* emitted when the request supplied `count_only_statuses`) and used
|
|
143
144
|
* exclusively to drive the parent tab badges on the UI — every other
|
|
144
145
|
* count consumer (pagination, sub-tab chips, in-tab "showing X of Y")
|
|
145
146
|
* keeps reading from {@link TransactionsViewUIState.totalCount}.
|
|
@@ -2,6 +2,6 @@ import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { RootState } from '../../../../../reducer';
|
|
4
4
|
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
5
|
-
import { fetchInternationalVerificationForm, updateInternationalVerificationForm, updateVerificationFormFailure
|
|
6
|
-
export type ActionType = ReturnType<typeof fetchInternationalVerificationForm> | ReturnType<typeof updateInternationalVerificationForm> | ReturnType<typeof updateVerificationFormFailure> | ReturnType<typeof
|
|
7
|
-
export declare const fetchIntlVerificationFormEpic: (actions$: ActionsObservable<ActionType>,
|
|
5
|
+
import { fetchInternationalVerificationForm, initializeIntlVerificationForm, updateInternationalVerificationForm, updateVerificationFormFailure } from '../internationalWireVerificationReducer';
|
|
6
|
+
export type ActionType = ReturnType<typeof fetchInternationalVerificationForm> | ReturnType<typeof updateInternationalVerificationForm> | ReturnType<typeof updateVerificationFormFailure> | ReturnType<typeof initializeIntlVerificationForm>;
|
|
7
|
+
export declare const fetchIntlVerificationFormEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -4,9 +4,8 @@ exports.fetchIntlVerificationFormEpic = void 0;
|
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const responsePayload_1 = require("../../../../../responsePayload");
|
|
7
|
-
const internationalWireOnboardingDetailsToLocalData_1 = require("../internationalWireOnboardingDetailsToLocalData");
|
|
8
7
|
const internationalWireVerificationReducer_1 = require("../internationalWireVerificationReducer");
|
|
9
|
-
const fetchIntlVerificationFormEpic = (actions$,
|
|
8
|
+
const fetchIntlVerificationFormEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(internationalWireVerificationReducer_1.fetchInternationalVerificationForm.match), (0, operators_1.switchMap)((action) => {
|
|
10
9
|
const query = {
|
|
11
10
|
region: 'US',
|
|
12
11
|
legal_type: 'BUSINESS',
|
|
@@ -15,14 +14,11 @@ const fetchIntlVerificationFormEpic = (actions$, state$, zeniAPI) => actions$.pi
|
|
|
15
14
|
.getJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/international-wire/onboarding-fields?query=${encodeURIComponent(JSON.stringify(query))}`)
|
|
16
15
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
17
16
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
18
|
-
const onboardingDataFromCompanyInfo = state$.value.companyState.companiesById[action.payload.companyId]
|
|
19
|
-
?.companyBillPayInfo?.internationalWireOnboardingDetails;
|
|
20
|
-
const localData = (0, internationalWireOnboardingDetailsToLocalData_1.toVerificationFormLocalDataFromOnboardingDetails)(onboardingDataFromCompanyInfo, response.data.labels);
|
|
21
17
|
return (0, rxjs_1.from)([
|
|
22
18
|
(0, internationalWireVerificationReducer_1.updateInternationalVerificationForm)({
|
|
23
19
|
internationalWireFormPayload: response.data.labels,
|
|
24
20
|
}),
|
|
25
|
-
(0, internationalWireVerificationReducer_1.
|
|
21
|
+
(0, internationalWireVerificationReducer_1.initializeIntlVerificationForm)(action.payload.companyId, response.data.labels),
|
|
26
22
|
]);
|
|
27
23
|
}
|
|
28
24
|
else {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { RootState } from '../../../../../reducer';
|
|
4
|
-
import { fetchBillPaySetupViewSuccess } from '../../billPaySetupView/billPaySetupViewReducer';
|
|
5
4
|
import { initializeIntlVerificationForm, updateVerificationFormLocalData } from '../internationalWireVerificationReducer';
|
|
6
5
|
export type ActionType = ReturnType<typeof updateVerificationFormLocalData> | ReturnType<typeof initializeIntlVerificationForm>;
|
|
7
|
-
export declare const initializeIntlVerificationFormEpic: (actions$: ActionsObservable<ActionType
|
|
6
|
+
export declare const initializeIntlVerificationFormEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|