@zeniai/client-epic-state 5.0.69 → 5.0.70
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/coreEpics.js +1 -1
- package/lib/entity/account/accountSelector.d.ts +1 -1
- package/lib/entity/account/accountState.d.ts +1 -1
- package/lib/entity/account/subAccountSelector.d.ts +1 -1
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +3 -1
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +2 -1
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.d.ts +1 -1
- package/lib/entity/chargeCard/chargeCardReducer.d.ts +2 -19
- package/lib/entity/chargeCard/chargeCardReducer.js +2 -35
- package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.d.ts +1 -14
- package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.js +2 -36
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +1 -1
- package/lib/entity/sectionProjectView/sectionProjectViewSelector.js +1 -1
- package/lib/entity/tenant/SessionManager.js +3 -6
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -2
- package/lib/entity/tenant/clearAllEpic.js +2 -2
- package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.js +2 -6
- package/lib/entity/tenant/epic/saveOAuthConnectionEpic.js +2 -6
- package/lib/entity/tenant/tenantReducer.js +1 -6
- package/lib/entity/transaction/payloadTypes/transactionLinePayload.js +1 -3
- package/lib/epic.d.ts +9 -9
- package/lib/epic.js +10 -10
- package/lib/esm/coreEpics.js +1 -1
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +3 -1
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +2 -1
- package/lib/esm/entity/chargeCard/chargeCardReducer.js +1 -34
- package/lib/esm/entity/chargeCardTransaction/chargeCardTransactionReducer.js +1 -35
- package/lib/esm/entity/sectionProjectView/sectionProjectViewSelector.js +1 -1
- package/lib/esm/entity/tenant/SessionManager.js +1 -4
- package/lib/esm/entity/tenant/clearAllEpic.js +2 -2
- package/lib/esm/entity/tenant/epic/saveAPIKeyConnectionEpic.js +2 -6
- package/lib/esm/entity/tenant/epic/saveOAuthConnectionEpic.js +2 -6
- package/lib/esm/entity/tenant/tenantReducer.js +1 -6
- package/lib/esm/entity/transaction/payloadTypes/transactionLinePayload.js +1 -3
- package/lib/esm/epic.js +10 -10
- package/lib/esm/index.js +13 -17
- package/lib/esm/reducer.js +2 -2
- package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +5 -2
- package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +5 -2
- package/lib/esm/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +1 -4
- package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewSelector.js +1 -1
- package/lib/esm/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +1 -1
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +2 -2
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +1 -2
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +6 -8
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +1 -7
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -11
- package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +1 -2
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +1 -127
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -20
- package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +2 -0
- package/lib/esm/view/financeStatement/financeStatementSelector.js +1 -1
- package/lib/esm/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +2 -3
- package/lib/esm/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +2 -3
- package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +18 -55
- package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +2 -16
- package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +4 -5
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +9 -26
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +6 -9
- package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +2 -3
- package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentPageEpic.js +1 -1
- package/lib/esm/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +3 -7
- package/lib/esm/view/taskManager/cannedResponsesView/epics/fetchCannedResponsesEpic.js +1 -1
- package/lib/esm/view/taskManager/cannedResponsesView/epics/saveCannedResponseEpic.js +1 -1
- package/lib/esm/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +1 -1
- package/lib/esm/view/transactionDetail/transactionDetailSelector.js +1 -7
- package/lib/index.d.ts +15 -19
- package/lib/index.js +58 -72
- package/lib/reducer.d.ts +2 -2
- package/lib/reducer.js +2 -2
- package/lib/view/aiAccountantView/aiAccountantViewPayload.d.ts +2 -2
- package/lib/view/aiAccountantView/aiAccountantViewReducer.d.ts +1 -1
- package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +5 -2
- package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +5 -2
- package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +1 -4
- package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.d.ts +1 -1
- package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.js +1 -1
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +2 -2
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +1 -2
- package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +6 -8
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +1 -7
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +0 -10
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +0 -21
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -2
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +1 -2
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +3 -9
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +2 -128
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +1 -2
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +0 -14
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -20
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +2 -1
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +4 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -41
- package/lib/view/financeStatement/financeStatementSelector.js +1 -1
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.d.ts +1 -3
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +2 -3
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.d.ts +1 -3
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +2 -3
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +18 -55
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +2 -16
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +4 -5
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +3 -18
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +10 -27
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +6 -9
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.d.ts +1 -3
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +2 -3
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentPageEpic.js +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.d.ts +1 -3
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +3 -7
- package/lib/view/transactionDetail/transactionDetailSelector.js +1 -7
- package/lib/view/zeniOAuthView/zeniOAuthSelector.d.ts +1 -1
- package/package.json +4 -9
- package/lib/commonStateTypes/cacheOverrideFetchReducer.d.ts +0 -17
- package/lib/commonStateTypes/cacheOverrideFetchReducer.js +0 -20
- package/lib/commonStateTypes/pusherActions.d.ts +0 -11
- package/lib/commonStateTypes/pusherActions.js +0 -6
- package/lib/esm/commonStateTypes/cacheOverrideFetchReducer.js +0 -16
- package/lib/esm/commonStateTypes/pusherActions.js +0 -3
- package/lib/esm/view/expenseAutomationView/types/completedSubTab.js +0 -17
- package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +0 -10
- package/lib/view/expenseAutomationView/types/completedSubTab.js +0 -21
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.revokeChargeCardsInviteSuccessOrFailure = exports.revokeChargeCardsInvite = exports.closeChargeCardsSuccessOrFailure = exports.closeChargeCards = exports.unlockChargeCardsSuccessOrFailure = exports.unlockChargeCards = exports.lockChargeCardsSuccessOrFailure = exports.lockChargeCards = exports.updateChargeCardsSpendLimitSuccessOrFailure = exports.updateChargeCardsSpendLimit = exports.revokeCardInviteFailure = exports.revokeCardInviteSuccess = exports.revokeCardInvite = exports.resendCardInviteFailure = exports.resendCardInviteSuccess = exports.resendCardInvite = exports.clearChargeCardList = exports.
|
|
4
|
+
exports.revokeChargeCardsInviteSuccessOrFailure = exports.revokeChargeCardsInvite = exports.closeChargeCardsSuccessOrFailure = exports.closeChargeCards = exports.unlockChargeCardsSuccessOrFailure = exports.unlockChargeCards = exports.lockChargeCardsSuccessOrFailure = exports.lockChargeCards = exports.updateChargeCardsSpendLimitSuccessOrFailure = exports.updateChargeCardsSpendLimit = exports.revokeCardInviteFailure = exports.revokeCardInviteSuccess = exports.revokeCardInvite = exports.resendCardInviteFailure = exports.resendCardInviteSuccess = exports.resendCardInvite = exports.clearChargeCardList = exports.updateChargeCardListUIState = exports.updateBulkActionCardIds = exports.updateSearchText = exports.updateChargeCardListFailure = exports.updateChargeCardList = exports.fetchChargeCardList = exports.updateDebitCardSummaryFailure = exports.updateDebitCardSummary = exports.fetchDebitCardSummary = exports.updateCreditAccountFailure = exports.updateCreditAccount = exports.fetchCreditAccount = exports.updateRowActionCardId = exports.updateCreditAccountRepaymentAmountAndDate = exports.updateCreditAccountRepaymentFailure = exports.updateCreditAccountRepayment = exports.fetchCreditAccountRepayment = exports.fetchChargeCardListPage = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const amount_1 = require("../../../../commonStateTypes/amount");
|
|
7
|
-
const cacheOverrideFetchReducer_1 = require("../../../../commonStateTypes/cacheOverrideFetchReducer");
|
|
8
7
|
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
9
8
|
const chargeCardList_1 = require("./chargeCardList");
|
|
10
9
|
exports.initialState = {
|
|
@@ -48,10 +47,6 @@ exports.initialState = {
|
|
|
48
47
|
revokeCardInvite: chargeCardList_1.initialResendRevokeCardInvite,
|
|
49
48
|
creditAccountRepayment: chargeCardList_1.initialCreditAccountRepayment,
|
|
50
49
|
};
|
|
51
|
-
// Silent-Pusher-refresh contract: when cacheOverride=true, fetch reducers
|
|
52
|
-
// leave fetchState and error unchanged so the list page's reduceFetchState
|
|
53
|
-
// selector stays 'Completed' and doesn't flash ChargeCardListLoading.
|
|
54
|
-
// See createCacheOverrideFetchReducer for details.
|
|
55
50
|
const chargeCardList = (0, toolkit_1.createSlice)({
|
|
56
51
|
name: 'chargeCardList',
|
|
57
52
|
initialState: exports.initialState,
|
|
@@ -71,10 +66,10 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
71
66
|
};
|
|
72
67
|
},
|
|
73
68
|
},
|
|
74
|
-
fetchCreditAccountRepayment
|
|
69
|
+
fetchCreditAccountRepayment(draft) {
|
|
75
70
|
draft.creditAccountRepayment.fetchState = 'In-Progress';
|
|
76
71
|
draft.creditAccountRepayment.error = undefined;
|
|
77
|
-
}
|
|
72
|
+
},
|
|
78
73
|
updateCreditAccountRepaymentAmountAndDate(draft, action) {
|
|
79
74
|
draft.creditAccountRepayment.initiatedRepayments = action.payload.amount;
|
|
80
75
|
draft.creditAccountRepayment.initiatedRepaymentDate = action.payload.date;
|
|
@@ -92,10 +87,10 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
92
87
|
updateRowActionCardId(draft, action) {
|
|
93
88
|
draft.rowActionCardId = action.payload;
|
|
94
89
|
},
|
|
95
|
-
fetchCreditAccount
|
|
90
|
+
fetchCreditAccount(draft) {
|
|
96
91
|
draft.creditAccount.fetchState = 'In-Progress';
|
|
97
92
|
draft.creditAccount.error = undefined;
|
|
98
|
-
}
|
|
93
|
+
},
|
|
99
94
|
updateCreditAccount(draft, action) {
|
|
100
95
|
if (action.payload.length > 0) {
|
|
101
96
|
draft.creditAccount = toCreditAccount(action.payload[0]);
|
|
@@ -108,10 +103,10 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
108
103
|
error: action.payload,
|
|
109
104
|
};
|
|
110
105
|
},
|
|
111
|
-
fetchDebitCardSummary
|
|
106
|
+
fetchDebitCardSummary(draft) {
|
|
112
107
|
draft.debitCardSummaries.fetchState = 'In-Progress';
|
|
113
108
|
draft.debitCardSummaries.error = undefined;
|
|
114
|
-
}
|
|
109
|
+
},
|
|
115
110
|
updateDebitCardSummary(draft, action) {
|
|
116
111
|
draft.debitCardSummaries = toDebitCardSummaries(action.payload);
|
|
117
112
|
},
|
|
@@ -122,10 +117,10 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
122
117
|
error: action.payload,
|
|
123
118
|
};
|
|
124
119
|
},
|
|
125
|
-
fetchChargeCardList
|
|
120
|
+
fetchChargeCardList(draft) {
|
|
126
121
|
draft.fetchState = 'In-Progress';
|
|
127
122
|
draft.error = undefined;
|
|
128
|
-
}
|
|
123
|
+
},
|
|
129
124
|
updateChargeCardList(draft, action) {
|
|
130
125
|
const { cards, unassigned_credit } = action.payload.chargeCardListPayload;
|
|
131
126
|
const newCard = cards.map((card) => card.card_id);
|
|
@@ -161,18 +156,6 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
161
156
|
draft.uiState.scrollYOffset = action.payload.uiState.scrollYOffset;
|
|
162
157
|
}
|
|
163
158
|
},
|
|
164
|
-
updateCreditAccountBalanceFromPusher(draft, action) {
|
|
165
|
-
const { currencyCode, currencySymbol } = action.payload;
|
|
166
|
-
const amt = (v) => v !== undefined ? (0, amount_1.toAmount)(v, currencyCode, currencySymbol) : undefined;
|
|
167
|
-
draft.creditAccount.available =
|
|
168
|
-
amt(action.payload.available) ?? draft.creditAccount.available;
|
|
169
|
-
draft.creditAccount.balance =
|
|
170
|
-
amt(action.payload.balance) ?? draft.creditAccount.balance;
|
|
171
|
-
draft.creditAccount.hold =
|
|
172
|
-
amt(action.payload.hold) ?? draft.creditAccount.hold;
|
|
173
|
-
draft.creditAccount.cashback =
|
|
174
|
-
amt(action.payload.cashback) ?? draft.creditAccount.cashback;
|
|
175
|
-
},
|
|
176
159
|
clearChargeCardList(draft) {
|
|
177
160
|
Object.assign(draft, exports.initialState);
|
|
178
161
|
},
|
|
@@ -328,7 +311,7 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
328
311
|
},
|
|
329
312
|
},
|
|
330
313
|
});
|
|
331
|
-
_a = chargeCardList.actions, exports.fetchChargeCardListPage = _a.fetchChargeCardListPage, exports.fetchCreditAccountRepayment = _a.fetchCreditAccountRepayment, exports.updateCreditAccountRepayment = _a.updateCreditAccountRepayment, exports.updateCreditAccountRepaymentFailure = _a.updateCreditAccountRepaymentFailure, exports.updateCreditAccountRepaymentAmountAndDate = _a.updateCreditAccountRepaymentAmountAndDate, exports.updateRowActionCardId = _a.updateRowActionCardId, exports.fetchCreditAccount = _a.fetchCreditAccount, exports.updateCreditAccount = _a.updateCreditAccount, exports.updateCreditAccountFailure = _a.updateCreditAccountFailure, exports.fetchDebitCardSummary = _a.fetchDebitCardSummary, exports.updateDebitCardSummary = _a.updateDebitCardSummary, exports.updateDebitCardSummaryFailure = _a.updateDebitCardSummaryFailure, exports.fetchChargeCardList = _a.fetchChargeCardList, exports.updateChargeCardList = _a.updateChargeCardList, exports.updateChargeCardListFailure = _a.updateChargeCardListFailure, exports.updateSearchText = _a.updateSearchText, exports.updateBulkActionCardIds = _a.updateBulkActionCardIds, exports.updateChargeCardListUIState = _a.updateChargeCardListUIState, exports.
|
|
314
|
+
_a = chargeCardList.actions, exports.fetchChargeCardListPage = _a.fetchChargeCardListPage, exports.fetchCreditAccountRepayment = _a.fetchCreditAccountRepayment, exports.updateCreditAccountRepayment = _a.updateCreditAccountRepayment, exports.updateCreditAccountRepaymentFailure = _a.updateCreditAccountRepaymentFailure, exports.updateCreditAccountRepaymentAmountAndDate = _a.updateCreditAccountRepaymentAmountAndDate, exports.updateRowActionCardId = _a.updateRowActionCardId, exports.fetchCreditAccount = _a.fetchCreditAccount, exports.updateCreditAccount = _a.updateCreditAccount, exports.updateCreditAccountFailure = _a.updateCreditAccountFailure, exports.fetchDebitCardSummary = _a.fetchDebitCardSummary, exports.updateDebitCardSummary = _a.updateDebitCardSummary, exports.updateDebitCardSummaryFailure = _a.updateDebitCardSummaryFailure, exports.fetchChargeCardList = _a.fetchChargeCardList, exports.updateChargeCardList = _a.updateChargeCardList, exports.updateChargeCardListFailure = _a.updateChargeCardListFailure, exports.updateSearchText = _a.updateSearchText, exports.updateBulkActionCardIds = _a.updateBulkActionCardIds, exports.updateChargeCardListUIState = _a.updateChargeCardListUIState, exports.clearChargeCardList = _a.clearChargeCardList, exports.resendCardInvite = _a.resendCardInvite, exports.resendCardInviteSuccess = _a.resendCardInviteSuccess, exports.resendCardInviteFailure = _a.resendCardInviteFailure, exports.revokeCardInvite = _a.revokeCardInvite, exports.revokeCardInviteSuccess = _a.revokeCardInviteSuccess, exports.revokeCardInviteFailure = _a.revokeCardInviteFailure, exports.updateChargeCardsSpendLimit = _a.updateChargeCardsSpendLimit, exports.updateChargeCardsSpendLimitSuccessOrFailure = _a.updateChargeCardsSpendLimitSuccessOrFailure, exports.lockChargeCards = _a.lockChargeCards, exports.lockChargeCardsSuccessOrFailure = _a.lockChargeCardsSuccessOrFailure, exports.unlockChargeCards = _a.unlockChargeCards, exports.unlockChargeCardsSuccessOrFailure = _a.unlockChargeCardsSuccessOrFailure, exports.closeChargeCards = _a.closeChargeCards, exports.closeChargeCardsSuccessOrFailure = _a.closeChargeCardsSuccessOrFailure, exports.revokeChargeCardsInvite = _a.revokeChargeCardsInvite, exports.revokeChargeCardsInviteSuccessOrFailure = _a.revokeChargeCardsInviteSuccessOrFailure;
|
|
332
315
|
exports.default = chargeCardList.reducer;
|
|
333
316
|
// helper
|
|
334
317
|
const toCreditAccount = (payload) => ({
|
|
@@ -17,21 +17,18 @@ const fetchChargeCardListPageEpic = (actions$, state$) => actions$.pipe((0, oper
|
|
|
17
17
|
const state = state$.value;
|
|
18
18
|
const cashbackDetailState = state.cashbackDetailState;
|
|
19
19
|
if (cacheOverride === true) {
|
|
20
|
-
// Forward cacheOverride to all sub-fetches to prevent skeleton flash.
|
|
21
20
|
if (doFetchCreditAccountsDebitSummaryAndCashback === true) {
|
|
22
21
|
if (isCreditCardEnabled) {
|
|
23
|
-
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchCreditAccount)(
|
|
24
|
-
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchCreditAccountRepayment)(
|
|
22
|
+
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchCreditAccount)());
|
|
23
|
+
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchCreditAccountRepayment)());
|
|
25
24
|
}
|
|
26
25
|
if (isDebitCardEnabled) {
|
|
27
|
-
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchDebitCardSummary)(
|
|
26
|
+
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchDebitCardSummary)());
|
|
28
27
|
}
|
|
29
|
-
chargeCardListPageAction.push((0, cashbackDetailReducer_1.fetchCashbackDetail)(
|
|
28
|
+
chargeCardListPageAction.push((0, cashbackDetailReducer_1.fetchCashbackDetail)());
|
|
30
29
|
}
|
|
31
|
-
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchChargeCardList)(
|
|
32
|
-
|
|
33
|
-
chargeCardListPageAction.push((0, chargeCardConfigReducer_1.fetchChargeCardConfig)(true));
|
|
34
|
-
// These don't participate in the list page's reduceFetchState.
|
|
30
|
+
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchChargeCardList)());
|
|
31
|
+
chargeCardListPageAction.push((0, chargeCardConfigReducer_1.fetchChargeCardConfig)());
|
|
35
32
|
chargeCardListPageAction.push((0, userListViewReducer_1.fetchUserListByType)('cardHolderCandidate', true));
|
|
36
33
|
chargeCardListPageAction.push((0, userListViewReducer_1.fetchUserListByType)('cardAdmin', true));
|
|
37
34
|
chargeCardListPageAction.push((0, classListReducer_1.fetchClassList)());
|
|
@@ -8,9 +8,7 @@ export declare const addRepaymentToChargeCardPaymentHistory: import("@reduxjs/to
|
|
|
8
8
|
zeniCreditAccountId: ID;
|
|
9
9
|
}, "chargeCardPaymentHistory/addRepaymentToChargeCardPaymentHistory">, fetchChargeCardPaymentPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: any], {
|
|
10
10
|
cacheOverride: any;
|
|
11
|
-
}, "chargeCardPaymentHistory/fetchChargeCardPaymentPage", never, never>, fetchChargeCardPaymentHistory: import("@reduxjs/toolkit").
|
|
12
|
-
cacheOverride: boolean;
|
|
13
|
-
}, "chargeCardPaymentHistory/fetchChargeCardPaymentHistory", never, never>, updateChargeCardPaymentHistory: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardPaymentHistoryPayload, "chargeCardPaymentHistory/updateChargeCardPaymentHistory">, updateChargeCardPaymentHistoryFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardPaymentHistory/updateChargeCardPaymentHistoryFailure">, clearChargeCardPaymentHistory: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardPaymentHistory/clearChargeCardPaymentHistory">, updatePaymentHistoryFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
11
|
+
}, "chargeCardPaymentHistory/fetchChargeCardPaymentPage", never, never>, fetchChargeCardPaymentHistory: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardPaymentHistory/fetchChargeCardPaymentHistory">, updateChargeCardPaymentHistory: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardPaymentHistoryPayload, "chargeCardPaymentHistory/updateChargeCardPaymentHistory">, updateChargeCardPaymentHistoryFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardPaymentHistory/updateChargeCardPaymentHistoryFailure">, clearChargeCardPaymentHistory: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardPaymentHistory/clearChargeCardPaymentHistory">, updatePaymentHistoryFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
14
12
|
filters: PaymentHistoryFilters;
|
|
15
13
|
}, "chargeCardPaymentHistory/updatePaymentHistoryFilters">, updatePaymentHistorySearchText: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "chargeCardPaymentHistory/updatePaymentHistorySearchText">, updatePaymentHistoryDownloadUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
16
14
|
uiState: Partial<ChargeCardPaymentHistoryDownloadUIState>;
|
|
@@ -3,7 +3,6 @@ var _a;
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.updatePaymentHistoryUIState = exports.updatePaymentHistoryDownloadUIState = exports.updatePaymentHistorySearchText = exports.updatePaymentHistoryFilters = exports.clearChargeCardPaymentHistory = exports.updateChargeCardPaymentHistoryFailure = exports.updateChargeCardPaymentHistory = exports.fetchChargeCardPaymentHistory = exports.fetchChargeCardPaymentPage = exports.addRepaymentToChargeCardPaymentHistory = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const cacheOverrideFetchReducer_1 = require("../../../../commonStateTypes/cacheOverrideFetchReducer");
|
|
7
6
|
const chargeCardPaymentHistory_1 = require("./chargeCardPaymentHistory");
|
|
8
7
|
exports.initialState = chargeCardPaymentHistory_1.initialChargeCardPaymentHistoryState;
|
|
9
8
|
const chargeCardPaymentHistory = (0, toolkit_1.createSlice)({
|
|
@@ -22,10 +21,10 @@ const chargeCardPaymentHistory = (0, toolkit_1.createSlice)({
|
|
|
22
21
|
};
|
|
23
22
|
},
|
|
24
23
|
},
|
|
25
|
-
fetchChargeCardPaymentHistory
|
|
24
|
+
fetchChargeCardPaymentHistory(draft) {
|
|
26
25
|
draft.fetchState = 'In-Progress';
|
|
27
26
|
draft.error = undefined;
|
|
28
|
-
}
|
|
27
|
+
},
|
|
29
28
|
updateChargeCardPaymentHistory(draft, action) {
|
|
30
29
|
const payload = action.payload;
|
|
31
30
|
draft.creditAccountId = payload.credit_account_id;
|
|
@@ -11,7 +11,7 @@ const fetchChargeCardPaymentPageEpic = (actions$, state$) => actions$.pipe((0, o
|
|
|
11
11
|
const state = state$.value;
|
|
12
12
|
const chargeCardPaymentHistoryState = state.chargeCardPaymentHistoryState;
|
|
13
13
|
if (cacheOverride === true) {
|
|
14
|
-
chargeCardPaymentPageActions.push((0, chargeCardPaymentHistoryReducer_1.fetchChargeCardPaymentHistory)(
|
|
14
|
+
chargeCardPaymentPageActions.push((0, chargeCardPaymentHistoryReducer_1.fetchChargeCardPaymentHistory)());
|
|
15
15
|
}
|
|
16
16
|
else {
|
|
17
17
|
if (chargeCardPaymentHistoryState.fetchState !== 'Completed' &&
|
|
@@ -3,9 +3,7 @@ import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
|
3
3
|
import { FundingAccount } from '../../commonSetup/setupViewSelector';
|
|
4
4
|
import { ChargeCardRepaymentDetailLocalData, ChargeCardRepaymentDetailState } from './chargeCardRepaymentDetailState';
|
|
5
5
|
export declare const initialState: ChargeCardRepaymentDetailState;
|
|
6
|
-
export declare const fetchChargeCardRepaymentDetail: import("@reduxjs/toolkit").
|
|
7
|
-
cacheOverride: boolean;
|
|
8
|
-
}, "chargeCardRepaymentDetail/fetchChargeCardRepaymentDetail", never, never>, initiateChargeCardRepayment: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
6
|
+
export declare const fetchChargeCardRepaymentDetail: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardRepaymentDetail/fetchChargeCardRepaymentDetail">, initiateChargeCardRepayment: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
9
7
|
companyId: ID;
|
|
10
8
|
}, "chargeCardRepaymentDetail/initiateChargeCardRepayment">, updateNewAddedChargeCardPaymentAccount: import("@reduxjs/toolkit").ActionCreatorWithPayload<FundingAccount, "chargeCardRepaymentDetail/updateNewAddedChargeCardPaymentAccount">, updateChargeCardRepaymentLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardRepaymentDetailLocalData, "chargeCardRepaymentDetail/updateChargeCardRepaymentLocalStore">, updateChargeCardRepaymentStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
11
9
|
fetchState: FetchState;
|
|
@@ -3,7 +3,6 @@ var _a;
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.clearChargeCardRepaymentDetail = exports.updateChargeCardRepaymentStatus = exports.updateChargeCardRepaymentLocalStore = exports.updateNewAddedChargeCardPaymentAccount = exports.initiateChargeCardRepayment = exports.fetchChargeCardRepaymentDetail = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const cacheOverrideFetchReducer_1 = require("../../../../commonStateTypes/cacheOverrideFetchReducer");
|
|
7
6
|
exports.initialState = {
|
|
8
7
|
localData: {
|
|
9
8
|
amount: {
|
|
@@ -22,12 +21,9 @@ const chargeCardRepaymentDetail = (0, toolkit_1.createSlice)({
|
|
|
22
21
|
name: 'chargeCardRepaymentDetail',
|
|
23
22
|
initialState: exports.initialState,
|
|
24
23
|
reducers: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
fetchChargeCardRepaymentDetail: (0, cacheOverrideFetchReducer_1.createCacheOverrideFetchReducer)(() => {
|
|
29
|
-
// do nothing
|
|
30
|
-
}),
|
|
24
|
+
fetchChargeCardRepaymentDetail() {
|
|
25
|
+
//do nothing
|
|
26
|
+
},
|
|
31
27
|
updateChargeCardRepaymentLocalStore(draft, action) {
|
|
32
28
|
draft.localData = action.payload;
|
|
33
29
|
},
|
|
@@ -63,13 +63,7 @@ const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = tr
|
|
|
63
63
|
const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state);
|
|
64
64
|
const classList = isAccountingClassesEnabled
|
|
65
65
|
? (0, classListSelector_1.getClassList)(classState, classListState)
|
|
66
|
-
: {
|
|
67
|
-
classes: [],
|
|
68
|
-
nestedClassHierarchy: [],
|
|
69
|
-
fetchState: 'Completed',
|
|
70
|
-
error: undefined,
|
|
71
|
-
version: 0,
|
|
72
|
-
};
|
|
66
|
+
: { classes: [], nestedClassHierarchy: [], fetchState: 'Completed', error: undefined, version: 0 };
|
|
73
67
|
const isAccountingProjectsEnabled = (0, tenantSelector_1.getIsAccountingProjectsEnabled)(state);
|
|
74
68
|
const projectList = isAccountingProjectsEnabled
|
|
75
69
|
? (0, projectListSelector_1.getProjectList)(projectState, projectListState)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FetchState } from '../../commonStateTypes/common';
|
|
2
1
|
import { RootState } from '../../reducer';
|
|
2
|
+
import { FetchState } from '../../commonStateTypes/common';
|
|
3
3
|
export declare const getZeniOAuthApproveFetchState: (state: RootState) => FetchState;
|
|
4
4
|
export declare const getZeniOAuthApproveRedirectUrl: (state: RootState) => string | undefined;
|
|
5
5
|
export declare const getZeniOAuthApproveError: (state: RootState) => string | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.70",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -106,17 +106,12 @@
|
|
|
106
106
|
"scripts": {
|
|
107
107
|
"clean": "rimraf lib",
|
|
108
108
|
"test:typecheck": "echo 'Typechecking test files...' && NODE_OPTIONS=--max-old-space-size=4096 time tsc -p tsconfig.typecheck.json",
|
|
109
|
-
"test
|
|
110
|
-
"
|
|
111
|
-
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --max-warnings 0 --fix",
|
|
112
|
-
"lint-modified-files": "chmod +x ./scripts/lint-modified-files.sh && ./scripts/lint-modified-files.sh",
|
|
113
|
-
"lint:fix-modified-files": "chmod +x ./scripts/lint-modified-files.sh && LINT_FIX=true ./scripts/lint-modified-files.sh",
|
|
114
|
-
"tsc-modified-files": "chmod +x ./scripts/tsc-modified-files.sh && ./scripts/tsc-modified-files.sh",
|
|
115
|
-
"typecheck": "tsc --noEmit",
|
|
109
|
+
"test": "pnpm test:typecheck && vitest run --typecheck",
|
|
110
|
+
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
|
|
116
111
|
"find-dead-code": "ts-prune | grep -v '(used in module)'",
|
|
117
112
|
"find-unused-exports": "ts-unused-exports ./tsconfig.json",
|
|
118
113
|
"circular-dependency": "npx madge --circular --extensions ts ./src",
|
|
119
|
-
"build": "concurrently --kill-others-on-fail --handle-input \"echo 'TypeScript build in progress...' && time tsc && echo 'ESM build...' && tsc -p tsconfig.esm.json\" \"echo 'Running tests and typecheck
|
|
114
|
+
"build": "concurrently --kill-others-on-fail --handle-input \"echo 'Running ESLint...' && eslint . --ext .js,.jsx,.ts,.tsx\" \"echo 'TypeScript build in progress...' && time tsc && echo 'ESM build...' && tsc -p tsconfig.esm.json\" \"echo 'Running tests and typecheck...' && pnpm test\" && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
120
115
|
"only-build": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc && tsc -p tsconfig.esm.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
121
116
|
"only-build-dev": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc -p tsconfig.dev.json && tsc -p tsconfig.esm.dev.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
122
117
|
"format": "prettier --write --ignore-unknown \"src/**/*\" && pnpm lint",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Draft, PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
-
/**
|
|
3
|
-
* Factory for `fetchXxx` reducers that support Pusher-driven silent refresh.
|
|
4
|
-
* When `cacheOverride=true`, fetchState and error are left untouched so the
|
|
5
|
-
* UI doesn't flash a skeleton. When `false`, `applyTo` runs the normal
|
|
6
|
-
* 'In-Progress' transition.
|
|
7
|
-
*/
|
|
8
|
-
export declare const createCacheOverrideFetchReducer: <TState>(applyTo: (draft: Draft<TState>) => void) => {
|
|
9
|
-
prepare: (cacheOverride?: boolean) => {
|
|
10
|
-
payload: {
|
|
11
|
-
cacheOverride: boolean;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
reducer: (draft: Draft<TState>, action: PayloadAction<{
|
|
15
|
-
cacheOverride: boolean;
|
|
16
|
-
}>) => void;
|
|
17
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createCacheOverrideFetchReducer = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Factory for `fetchXxx` reducers that support Pusher-driven silent refresh.
|
|
6
|
-
* When `cacheOverride=true`, fetchState and error are left untouched so the
|
|
7
|
-
* UI doesn't flash a skeleton. When `false`, `applyTo` runs the normal
|
|
8
|
-
* 'In-Progress' transition.
|
|
9
|
-
*/
|
|
10
|
-
const createCacheOverrideFetchReducer = (applyTo) => ({
|
|
11
|
-
reducer(draft, action) {
|
|
12
|
-
if (action.payload.cacheOverride !== true) {
|
|
13
|
-
applyTo(draft);
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
prepare(cacheOverride = false) {
|
|
17
|
-
return { payload: { cacheOverride } };
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
exports.createCacheOverrideFetchReducer = createCacheOverrideFetchReducer;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ChargeCardTransactionPayload } from '../entity/chargeCardTransaction/chargeCardTransactionPayload';
|
|
2
|
-
import { ID } from './common';
|
|
3
|
-
export declare const addChargeCardTransactionFromPusher: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
4
|
-
cardId: ID;
|
|
5
|
-
transaction: ChargeCardTransactionPayload;
|
|
6
|
-
}, string>;
|
|
7
|
-
export declare const addDeclinedChargeCardTransactionFromPusher: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
8
|
-
cardId: ID;
|
|
9
|
-
transaction: ChargeCardTransactionPayload;
|
|
10
|
-
declineReason?: string;
|
|
11
|
-
}, string>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addDeclinedChargeCardTransactionFromPusher = exports.addChargeCardTransactionFromPusher = void 0;
|
|
4
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
5
|
-
exports.addChargeCardTransactionFromPusher = (0, toolkit_1.createAction)('chargeCardDetail/addChargeCardTransactionFromPusher');
|
|
6
|
-
exports.addDeclinedChargeCardTransactionFromPusher = (0, toolkit_1.createAction)('chargeCardDetail/addDeclinedChargeCardTransactionFromPusher');
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Factory for `fetchXxx` reducers that support Pusher-driven silent refresh.
|
|
3
|
-
* When `cacheOverride=true`, fetchState and error are left untouched so the
|
|
4
|
-
* UI doesn't flash a skeleton. When `false`, `applyTo` runs the normal
|
|
5
|
-
* 'In-Progress' transition.
|
|
6
|
-
*/
|
|
7
|
-
export const createCacheOverrideFetchReducer = (applyTo) => ({
|
|
8
|
-
reducer(draft, action) {
|
|
9
|
-
if (action.payload.cacheOverride !== true) {
|
|
10
|
-
applyTo(draft);
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
prepare(cacheOverride = false) {
|
|
14
|
-
return { payload: { cacheOverride } };
|
|
15
|
-
},
|
|
16
|
-
});
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { createAction } from '@reduxjs/toolkit';
|
|
2
|
-
export const addChargeCardTransactionFromPusher = createAction('chargeCardDetail/addChargeCardTransactionFromPusher');
|
|
3
|
-
export const addDeclinedChargeCardTransactionFromPusher = createAction('chargeCardDetail/addDeclinedChargeCardTransactionFromPusher');
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { stringToUnion } from '../../../commonStateTypes/stringToUnion';
|
|
2
|
-
/**
|
|
3
|
-
* Sub-tabs that can appear under any "Completed" tab in the Expense Automation
|
|
4
|
-
* surface (Transaction Categorization Completed and Missing Receipts Completed
|
|
5
|
-
* both use this exact union). Forwarded verbatim to listing APIs as `sub_tab`
|
|
6
|
-
* / `match_type`. `'all'` preserves parent-tab semantics on the backend.
|
|
7
|
-
*/
|
|
8
|
-
const COMPLETED_SUB_TABS = ['all', 'ai_accountant', 'manual'];
|
|
9
|
-
export const toCompletedSubTab = (v) => stringToUnion(v.trim().toLowerCase(), COMPLETED_SUB_TABS);
|
|
10
|
-
/**
|
|
11
|
-
* "No sub-tab filter" sentinel — single source of truth for the default
|
|
12
|
-
* value of {@link CompletedSubTab}. Use this constant in initial slice
|
|
13
|
-
* state and at any call site that needs to fall back to the parent-tab
|
|
14
|
-
* listing semantics (review tab requests, manual-search overrides, etc.)
|
|
15
|
-
* so a future rename of the union doesn't require chasing literals.
|
|
16
|
-
*/
|
|
17
|
-
export const DEFAULT_COMPLETED_SUB_TAB = 'all';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const toCompletedSubTab: (v: string) => "all" | "manual" | "ai_accountant";
|
|
2
|
-
export type CompletedSubTab = ReturnType<typeof toCompletedSubTab>;
|
|
3
|
-
/**
|
|
4
|
-
* "No sub-tab filter" sentinel — single source of truth for the default
|
|
5
|
-
* value of {@link CompletedSubTab}. Use this constant in initial slice
|
|
6
|
-
* state and at any call site that needs to fall back to the parent-tab
|
|
7
|
-
* listing semantics (review tab requests, manual-search overrides, etc.)
|
|
8
|
-
* so a future rename of the union doesn't require chasing literals.
|
|
9
|
-
*/
|
|
10
|
-
export declare const DEFAULT_COMPLETED_SUB_TAB: CompletedSubTab;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_COMPLETED_SUB_TAB = exports.toCompletedSubTab = void 0;
|
|
4
|
-
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
5
|
-
/**
|
|
6
|
-
* Sub-tabs that can appear under any "Completed" tab in the Expense Automation
|
|
7
|
-
* surface (Transaction Categorization Completed and Missing Receipts Completed
|
|
8
|
-
* both use this exact union). Forwarded verbatim to listing APIs as `sub_tab`
|
|
9
|
-
* / `match_type`. `'all'` preserves parent-tab semantics on the backend.
|
|
10
|
-
*/
|
|
11
|
-
const COMPLETED_SUB_TABS = ['all', 'ai_accountant', 'manual'];
|
|
12
|
-
const toCompletedSubTab = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), COMPLETED_SUB_TABS);
|
|
13
|
-
exports.toCompletedSubTab = toCompletedSubTab;
|
|
14
|
-
/**
|
|
15
|
-
* "No sub-tab filter" sentinel — single source of truth for the default
|
|
16
|
-
* value of {@link CompletedSubTab}. Use this constant in initial slice
|
|
17
|
-
* state and at any call site that needs to fall back to the parent-tab
|
|
18
|
-
* listing semantics (review tab requests, manual-search overrides, etc.)
|
|
19
|
-
* so a future rename of the union doesn't require chasing literals.
|
|
20
|
-
*/
|
|
21
|
-
exports.DEFAULT_COMPLETED_SUB_TAB = 'all';
|