@zeniai/client-epic-state 5.0.71-betaVR3 → 5.0.72
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 +10 -12
- package/lib/epic.js +11 -13
- 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 +11 -13
- package/lib/esm/index.js +15 -19
- 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/fetchMultipleBatchDetailsEpic.js +5 -21
- 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/missingReceipts/watchBulkUploadBatchStatusEpic.js +9 -13
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -11
- package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +2 -81
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +1 -127
- package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +0 -2
- 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 +16 -20
- package/lib/index.js +58 -75
- package/lib/reducer.d.ts +2 -2
- package/lib/reducer.js +2 -2
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -0
- 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/fetchMultipleBatchDetailsEpic.js +5 -21
- 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/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +5 -11
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +8 -12
- 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 +2 -15
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +3 -83
- 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 -14
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +0 -14
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +0 -2
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -20
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +2 -20
- 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/epics/missingReceipts/refreshBatchDetailsForBatchIdEpic.js +0 -52
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/syncTabsAfterAutomatchEpic.js +0 -53
- package/lib/esm/view/expenseAutomationView/types/completedSubTab.js +0 -17
- package/lib/view/expenseAutomationView/epics/missingReceipts/refreshBatchDetailsForBatchIdEpic.d.ts +0 -18
- package/lib/view/expenseAutomationView/epics/missingReceipts/refreshBatchDetailsForBatchIdEpic.js +0 -56
- package/lib/view/expenseAutomationView/epics/missingReceipts/syncTabsAfterAutomatchEpic.d.ts +0 -28
- package/lib/view/expenseAutomationView/epics/missingReceipts/syncTabsAfterAutomatchEpic.js +0 -57
- package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +0 -10
- package/lib/view/expenseAutomationView/types/completedSubTab.js +0 -21
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.clearChargeCardDetail = exports.verifyOtpCardHolderFailure = exports.verifyOtpCardHolderSuccess = exports.verifyOtpCardHolder = exports.sendOtpCardHolderFailure = exports.sendOtpCardHolderSuccess = exports.resendOtpCardHolder = exports.sendOtpCardHolder = exports.updateChargeCardsRecurringExpensesFetchState = exports.updateChargeCardsRecurringExpenses = exports.fetchChargeCardsRecurringExpenses = exports.updateChargeCardTransactionStatisticsFetchState = exports.updateChargeCardTransactionStatistics = exports.fetchChargeCardTransactionStatistics = exports.updateDepositAccountLimitFetchStatus = exports.fetchDepositAccountLimit = exports.closeChargeCardSuccessOrFailure = exports.closeChargeCard = exports.unlockChargeCardSuccessOrFailure = exports.unlockChargeCard = exports.lockChargeCardSuccessOrFailure = exports.lockChargeCard = exports.updateChargeCardNameSuccessOrFailure = exports.updateChargeCardName = exports.updateChargeCardSpendLimitSuccessOrFailure = exports.updateChargeCardSpendLimit = exports.updateChargeCardDetailUpdateStatus = exports.completeDebitCardSetPinWait = exports.startDebitCardSetPinWait = exports.completeCVVActivationWait = exports.startCVVActivationWait = exports.updateChargeCardDetail = exports.updateChargeCardTransactionListFailure = exports.updateChargeCardTransactionAttachmentsInCardDetail = exports.updateChargeCardTransactionReceiptsShowTickFetchStatus = exports.updateDebitCardPinAttemptSuccessOrFailure = exports.updateDebitCardPinAttempt = exports.updatePhysicalChargeCardAttempt = exports.updatePhysicalChargeCardAttemptSuccessOrFailure = exports.updateChargeCardTransactionAttachmentsFailure = exports.updateChargeCardTransactionIsViewReceiptClicked = exports.fetchChargeCardTransactionAttachments = exports.updateChargeCardTransactionUploadReceiptsFetchStatus = exports.updateChargeCardTransactionList = exports.updateChargeCardDetailUIState = exports.fetchChargeCardTransactionList = exports.updateChargeCardDetailFetchState = exports.fetchChargeCardDetail = exports.fetchChargeCardDetailPage = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const sortOrderPayload_1 = require("../../../../commonPayloadTypes/sortOrderPayload");
|
|
7
|
-
const pusherActions_1 = require("../../../../commonStateTypes/pusherActions");
|
|
8
7
|
const attachmentPayload_1 = require("../../../../entity/transaction/payloadTypes/attachmentPayload");
|
|
9
8
|
const chargeCardDetail_1 = require("./chargeCardDetail");
|
|
10
9
|
exports.initialState = {
|
|
@@ -69,30 +68,19 @@ const chargeCardDetail = (0, toolkit_1.createSlice)({
|
|
|
69
68
|
},
|
|
70
69
|
fetchChargeCardTransactionList: {
|
|
71
70
|
reducer(draft, action) {
|
|
72
|
-
const { chargeCardId, pageToken, pageTokenType
|
|
71
|
+
const { chargeCardId, pageToken, pageTokenType } = action.payload;
|
|
73
72
|
const existingCardDetail = draft.detailById[chargeCardId] ?? chargeCardDetail_1.emptyChargeCardDetail;
|
|
74
|
-
const existingUi = existingCardDetail.transactionList.uiState;
|
|
75
|
-
// cacheOverride=true (Pusher): preserve fetchState, error, and scroll
|
|
76
|
-
// to avoid skeleton flash. Normal fetches reset as before.
|
|
77
73
|
draft.detailById[chargeCardId] = {
|
|
78
74
|
...existingCardDetail,
|
|
79
75
|
transactionList: {
|
|
80
76
|
...existingCardDetail.transactionList,
|
|
81
|
-
fetchState:
|
|
82
|
-
|
|
83
|
-
: 'In-Progress',
|
|
84
|
-
error: cacheOverride
|
|
85
|
-
? existingCardDetail.transactionList.error
|
|
86
|
-
: undefined,
|
|
77
|
+
fetchState: 'In-Progress',
|
|
78
|
+
error: undefined,
|
|
87
79
|
uiState: {
|
|
88
|
-
...
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
? existingUi.scrollYOffset
|
|
93
|
-
: existingUi.pageToken === null
|
|
94
|
-
? 0
|
|
95
|
-
: existingUi.scrollYOffset,
|
|
80
|
+
...existingCardDetail.transactionList.uiState,
|
|
81
|
+
scrollYOffset: existingCardDetail.transactionList.uiState.pageToken === null
|
|
82
|
+
? 0
|
|
83
|
+
: existingCardDetail.transactionList.uiState.scrollYOffset,
|
|
96
84
|
pageToken: pageToken,
|
|
97
85
|
pageTokenType: pageTokenType,
|
|
98
86
|
},
|
|
@@ -109,24 +97,18 @@ const chargeCardDetail = (0, toolkit_1.createSlice)({
|
|
|
109
97
|
const { chargeCardId, data, cacheOverride } = action.payload;
|
|
110
98
|
const existingCardDetail = draft.detailById[chargeCardId] ?? chargeCardDetail_1.emptyChargeCardDetail;
|
|
111
99
|
const newTransactionIds = data.transactions.map((tran) => tran.transaction_id);
|
|
112
|
-
const existingIds = existingCardDetail.transactionList.transactionIds;
|
|
113
|
-
// cacheOverride (Pusher): refresh page 1 but keep page 2+ IDs.
|
|
114
|
-
// Normal pagination: append new page, deduped.
|
|
115
|
-
const newIdSet = new Set(newTransactionIds);
|
|
116
|
-
const mergedTransactionIds = cacheOverride
|
|
117
|
-
? [
|
|
118
|
-
...newTransactionIds,
|
|
119
|
-
...existingIds.filter((id) => !newIdSet.has(id)),
|
|
120
|
-
]
|
|
121
|
-
: [
|
|
122
|
-
...existingIds,
|
|
123
|
-
...newTransactionIds.filter((id) => !existingIds.includes(id)),
|
|
124
|
-
];
|
|
125
100
|
draft.detailById[chargeCardId] = {
|
|
126
101
|
...existingCardDetail,
|
|
127
102
|
transactionList: {
|
|
128
103
|
...existingCardDetail.transactionList,
|
|
129
|
-
transactionIds:
|
|
104
|
+
transactionIds: [
|
|
105
|
+
...new Set([
|
|
106
|
+
...(cacheOverride
|
|
107
|
+
? []
|
|
108
|
+
: existingCardDetail.transactionList.transactionIds),
|
|
109
|
+
...newTransactionIds,
|
|
110
|
+
]),
|
|
111
|
+
],
|
|
130
112
|
fetchState: 'Completed',
|
|
131
113
|
error: undefined,
|
|
132
114
|
uiState: {
|
|
@@ -138,12 +120,9 @@ const chargeCardDetail = (0, toolkit_1.createSlice)({
|
|
|
138
120
|
limit: data.query.limit,
|
|
139
121
|
pageToken: data.query.page_token,
|
|
140
122
|
pageTokenType: data.query.page_token_type,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
: existingCardDetail.transactionList.uiState.pageToken === null
|
|
145
|
-
? 0
|
|
146
|
-
: existingCardDetail.transactionList.uiState.scrollYOffset,
|
|
123
|
+
scrollYOffset: existingCardDetail.transactionList.uiState.pageToken === null
|
|
124
|
+
? 0
|
|
125
|
+
: existingCardDetail.transactionList.uiState.scrollYOffset,
|
|
147
126
|
},
|
|
148
127
|
},
|
|
149
128
|
};
|
|
@@ -657,22 +636,6 @@ const chargeCardDetail = (0, toolkit_1.createSlice)({
|
|
|
657
636
|
Object.assign(draft, exports.initialState);
|
|
658
637
|
},
|
|
659
638
|
},
|
|
660
|
-
extraReducers: (builder) => {
|
|
661
|
-
const prependTransaction = (draft, cardId, txId) => {
|
|
662
|
-
const detail = draft.detailById[cardId];
|
|
663
|
-
if (detail != null &&
|
|
664
|
-
!detail.transactionList.transactionIds.includes(txId)) {
|
|
665
|
-
detail.transactionList.transactionIds.unshift(txId);
|
|
666
|
-
}
|
|
667
|
-
};
|
|
668
|
-
builder
|
|
669
|
-
.addCase(pusherActions_1.addChargeCardTransactionFromPusher, (draft, action) => {
|
|
670
|
-
prependTransaction(draft, action.payload.cardId, action.payload.transaction.transaction_id);
|
|
671
|
-
})
|
|
672
|
-
.addCase(pusherActions_1.addDeclinedChargeCardTransactionFromPusher, (draft, action) => {
|
|
673
|
-
prependTransaction(draft, action.payload.cardId, action.payload.transaction.transaction_id);
|
|
674
|
-
});
|
|
675
|
-
},
|
|
676
639
|
});
|
|
677
640
|
_a = chargeCardDetail.actions, exports.fetchChargeCardDetailPage = _a.fetchChargeCardDetailPage, exports.fetchChargeCardDetail = _a.fetchChargeCardDetail, exports.updateChargeCardDetailFetchState = _a.updateChargeCardDetailFetchState, exports.fetchChargeCardTransactionList = _a.fetchChargeCardTransactionList, exports.updateChargeCardDetailUIState = _a.updateChargeCardDetailUIState, exports.updateChargeCardTransactionList = _a.updateChargeCardTransactionList, exports.updateChargeCardTransactionUploadReceiptsFetchStatus = _a.updateChargeCardTransactionUploadReceiptsFetchStatus, exports.fetchChargeCardTransactionAttachments = _a.fetchChargeCardTransactionAttachments, exports.updateChargeCardTransactionIsViewReceiptClicked = _a.updateChargeCardTransactionIsViewReceiptClicked, exports.updateChargeCardTransactionAttachmentsFailure = _a.updateChargeCardTransactionAttachmentsFailure, exports.updatePhysicalChargeCardAttemptSuccessOrFailure = _a.updatePhysicalChargeCardAttemptSuccessOrFailure, exports.updatePhysicalChargeCardAttempt = _a.updatePhysicalChargeCardAttempt, exports.updateDebitCardPinAttempt = _a.updateDebitCardPinAttempt, exports.updateDebitCardPinAttemptSuccessOrFailure = _a.updateDebitCardPinAttemptSuccessOrFailure, exports.updateChargeCardTransactionReceiptsShowTickFetchStatus = _a.updateChargeCardTransactionReceiptsShowTickFetchStatus, exports.updateChargeCardTransactionAttachmentsInCardDetail = _a.updateChargeCardTransactionAttachmentsInCardDetail, exports.updateChargeCardTransactionListFailure = _a.updateChargeCardTransactionListFailure, exports.updateChargeCardDetail = _a.updateChargeCardDetail, exports.startCVVActivationWait = _a.startCVVActivationWait, exports.completeCVVActivationWait = _a.completeCVVActivationWait, exports.startDebitCardSetPinWait = _a.startDebitCardSetPinWait, exports.completeDebitCardSetPinWait = _a.completeDebitCardSetPinWait, exports.updateChargeCardDetailUpdateStatus = _a.updateChargeCardDetailUpdateStatus, exports.updateChargeCardSpendLimit = _a.updateChargeCardSpendLimit, exports.updateChargeCardSpendLimitSuccessOrFailure = _a.updateChargeCardSpendLimitSuccessOrFailure, exports.updateChargeCardName = _a.updateChargeCardName, exports.updateChargeCardNameSuccessOrFailure = _a.updateChargeCardNameSuccessOrFailure, exports.lockChargeCard = _a.lockChargeCard, exports.lockChargeCardSuccessOrFailure = _a.lockChargeCardSuccessOrFailure, exports.unlockChargeCard = _a.unlockChargeCard, exports.unlockChargeCardSuccessOrFailure = _a.unlockChargeCardSuccessOrFailure, exports.closeChargeCard = _a.closeChargeCard, exports.closeChargeCardSuccessOrFailure = _a.closeChargeCardSuccessOrFailure, exports.fetchDepositAccountLimit = _a.fetchDepositAccountLimit, exports.updateDepositAccountLimitFetchStatus = _a.updateDepositAccountLimitFetchStatus, exports.fetchChargeCardTransactionStatistics = _a.fetchChargeCardTransactionStatistics, exports.updateChargeCardTransactionStatistics = _a.updateChargeCardTransactionStatistics, exports.updateChargeCardTransactionStatisticsFetchState = _a.updateChargeCardTransactionStatisticsFetchState, exports.fetchChargeCardsRecurringExpenses = _a.fetchChargeCardsRecurringExpenses, exports.updateChargeCardsRecurringExpenses = _a.updateChargeCardsRecurringExpenses, exports.updateChargeCardsRecurringExpensesFetchState = _a.updateChargeCardsRecurringExpensesFetchState, exports.sendOtpCardHolder = _a.sendOtpCardHolder, exports.resendOtpCardHolder = _a.resendOtpCardHolder, exports.sendOtpCardHolderSuccess = _a.sendOtpCardHolderSuccess, exports.sendOtpCardHolderFailure = _a.sendOtpCardHolderFailure, exports.verifyOtpCardHolder = _a.verifyOtpCardHolder, exports.verifyOtpCardHolderSuccess = _a.verifyOtpCardHolderSuccess, exports.verifyOtpCardHolderFailure = _a.verifyOtpCardHolderFailure, exports.clearChargeCardDetail = _a.clearChargeCardDetail;
|
|
678
641
|
exports.default = chargeCardDetail.reducer;
|
|
@@ -19,24 +19,13 @@ const fetchChargeCardDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((
|
|
|
19
19
|
const chargeCardAction = [];
|
|
20
20
|
const state = state$.value;
|
|
21
21
|
const chargeCardDetail = (0, get_1.default)(state.chargeCardDetailState.detailById, chargeCardId, undefined);
|
|
22
|
-
// Skip if a user-triggered fetch is already in-flight (not applicable
|
|
23
|
-
// to cacheOverride/Pusher refreshes, which always proceed).
|
|
24
22
|
if (cacheOverride === true ||
|
|
25
23
|
chargeCardDetail == null ||
|
|
26
24
|
chargeCardDetail.fetchState !== 'In-Progress') {
|
|
27
|
-
// Silent refresh: preserve fetchState to avoid skeleton flash.
|
|
28
|
-
// Discriminate via fetchState (not null-check) because the reducer
|
|
29
|
-
// always creates an entry before the epic runs.
|
|
30
|
-
const isSilentRefresh = cacheOverride === true &&
|
|
31
|
-
chargeCardDetail != null &&
|
|
32
|
-
chargeCardDetail.fetchState !== 'Not-Started';
|
|
33
25
|
chargeCardAction.push((0, chargeCardDetailReducer_1.updateChargeCardDetailFetchState)({
|
|
34
26
|
chargeCardId,
|
|
35
|
-
isRefreshingViewInBackground:
|
|
36
|
-
fetchState:
|
|
37
|
-
? chargeCardDetail.fetchState
|
|
38
|
-
: 'In-Progress',
|
|
39
|
-
error: isSilentRefresh ? chargeCardDetail.error : undefined,
|
|
27
|
+
isRefreshingViewInBackground: cacheOverride,
|
|
28
|
+
fetchState: 'In-Progress',
|
|
40
29
|
}));
|
|
41
30
|
const query = {
|
|
42
31
|
is_include_card_activation_events: true,
|
|
@@ -54,8 +43,6 @@ const fetchChargeCardDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((
|
|
|
54
43
|
}));
|
|
55
44
|
}
|
|
56
45
|
else {
|
|
57
|
-
// Surface errors even on silent refresh so the user
|
|
58
|
-
// knows data is stale (follow-up: consider toast instead).
|
|
59
46
|
return (0, rxjs_1.of)((0, chargeCardDetailReducer_1.updateChargeCardDetailFetchState)({
|
|
60
47
|
chargeCardId,
|
|
61
48
|
fetchState: 'Error',
|
|
@@ -64,7 +51,6 @@ const fetchChargeCardDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((
|
|
|
64
51
|
}));
|
|
65
52
|
}
|
|
66
53
|
}), (0, operators_1.catchError)((error) => {
|
|
67
|
-
// Surface network failures even on silent refresh.
|
|
68
54
|
return (0, rxjs_1.of)((0, chargeCardDetailReducer_1.updateChargeCardDetailFetchState)({
|
|
69
55
|
chargeCardId,
|
|
70
56
|
fetchState: 'Error',
|
package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js
CHANGED
|
@@ -18,16 +18,15 @@ const fetchChargeCardDetailPageEpic = (actions$, state$) => actions$.pipe((0, op
|
|
|
18
18
|
? exsitingChargeCardDetail.transactionList.uiState.pageTokenType
|
|
19
19
|
: null;
|
|
20
20
|
if (cacheOverride === true) {
|
|
21
|
-
// Forward cacheOverride to all sub-fetches to prevent skeleton flash.
|
|
22
21
|
chargeCardTransactionListAction.push((0, chargeCardDetailReducer_1.fetchChargeCardDetail)(chargeCardId, cacheOverride));
|
|
23
22
|
//latest transactions need to be fetched hence removing pageToken and pageTokenType
|
|
24
|
-
chargeCardTransactionListAction.push((0, chargeCardDetailReducer_1.fetchChargeCardTransactionList)(chargeCardId, null, null
|
|
25
|
-
chargeCardTransactionListAction.push((0, chargeCardConfigReducer_1.fetchChargeCardConfig)(
|
|
23
|
+
chargeCardTransactionListAction.push((0, chargeCardDetailReducer_1.fetchChargeCardTransactionList)(chargeCardId, null, null));
|
|
24
|
+
chargeCardTransactionListAction.push((0, chargeCardConfigReducer_1.fetchChargeCardConfig)());
|
|
26
25
|
if (doFetchCreditAccounts && isCreditCardEnabled) {
|
|
27
|
-
chargeCardTransactionListAction.push((0, chargeCardListReducer_1.fetchCreditAccount)(
|
|
26
|
+
chargeCardTransactionListAction.push((0, chargeCardListReducer_1.fetchCreditAccount)());
|
|
28
27
|
}
|
|
29
28
|
if (doFetchCreditAccounts && isCreditCardEnabled) {
|
|
30
|
-
chargeCardTransactionListAction.push((0, chargeCardListReducer_1.fetchCreditAccountRepayment)(
|
|
29
|
+
chargeCardTransactionListAction.push((0, chargeCardListReducer_1.fetchCreditAccountRepayment)());
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
else {
|
|
@@ -10,30 +10,15 @@ export declare const fetchChargeCardListPage: import("@reduxjs/toolkit").ActionC
|
|
|
10
10
|
isDebitCardEnabled: boolean;
|
|
11
11
|
isCreditCardEnabled: boolean;
|
|
12
12
|
cacheOverride: any;
|
|
13
|
-
}, "chargeCardList/fetchChargeCardListPage", never, never>, fetchCreditAccountRepayment: import("@reduxjs/toolkit").
|
|
14
|
-
cacheOverride: boolean;
|
|
15
|
-
}, "chargeCardList/fetchCreditAccountRepayment", never, never>, updateCreditAccountRepayment: import("@reduxjs/toolkit").ActionCreatorWithPayload<CreditAccountRepaymentPayload, "chargeCardList/updateCreditAccountRepayment">, updateCreditAccountRepaymentFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateCreditAccountRepaymentFailure">, updateCreditAccountRepaymentAmountAndDate: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
13
|
+
}, "chargeCardList/fetchChargeCardListPage", never, never>, fetchCreditAccountRepayment: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/fetchCreditAccountRepayment">, updateCreditAccountRepayment: import("@reduxjs/toolkit").ActionCreatorWithPayload<CreditAccountRepaymentPayload, "chargeCardList/updateCreditAccountRepayment">, updateCreditAccountRepaymentFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateCreditAccountRepaymentFailure">, updateCreditAccountRepaymentAmountAndDate: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
16
14
|
amount: Amount;
|
|
17
15
|
date: ZeniDate;
|
|
18
|
-
}, "chargeCardList/updateCreditAccountRepaymentAmountAndDate">, updateRowActionCardId: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, "chargeCardList/updateRowActionCardId">, fetchCreditAccount: import("@reduxjs/toolkit").
|
|
19
|
-
cacheOverride: boolean;
|
|
20
|
-
}, "chargeCardList/fetchCreditAccount", never, never>, updateCreditAccount: import("@reduxjs/toolkit").ActionCreatorWithPayload<CreditAccountPayload[], "chargeCardList/updateCreditAccount">, updateCreditAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateCreditAccountFailure">, fetchDebitCardSummary: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined], {
|
|
21
|
-
cacheOverride: boolean;
|
|
22
|
-
}, "chargeCardList/fetchDebitCardSummary", never, never>, updateDebitCardSummary: import("@reduxjs/toolkit").ActionCreatorWithPayload<DebitCardSummariesPayload, "chargeCardList/updateDebitCardSummary">, updateDebitCardSummaryFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateDebitCardSummaryFailure">, fetchChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined], {
|
|
23
|
-
cacheOverride: boolean;
|
|
24
|
-
}, "chargeCardList/fetchChargeCardList", never, never>, updateChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
16
|
+
}, "chargeCardList/updateCreditAccountRepaymentAmountAndDate">, updateRowActionCardId: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, "chargeCardList/updateRowActionCardId">, fetchCreditAccount: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/fetchCreditAccount">, updateCreditAccount: import("@reduxjs/toolkit").ActionCreatorWithPayload<CreditAccountPayload[], "chargeCardList/updateCreditAccount">, updateCreditAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateCreditAccountFailure">, fetchDebitCardSummary: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/fetchDebitCardSummary">, updateDebitCardSummary: import("@reduxjs/toolkit").ActionCreatorWithPayload<DebitCardSummariesPayload, "chargeCardList/updateDebitCardSummary">, updateDebitCardSummaryFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateDebitCardSummaryFailure">, fetchChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/fetchChargeCardList">, updateChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
25
17
|
chargeCardListPayload: ChargeCardListPayload;
|
|
26
18
|
keepExistingListItems?: boolean;
|
|
27
19
|
}, "chargeCardList/updateChargeCardList">, updateChargeCardListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateChargeCardListFailure">, updateSearchText: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "chargeCardList/updateSearchText">, updateBulkActionCardIds: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "chargeCardList/updateBulkActionCardIds">, updateChargeCardListUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
28
20
|
uiState: Partial<ChargeCardListUIState>;
|
|
29
|
-
}, "chargeCardList/updateChargeCardListUIState">,
|
|
30
|
-
currencyCode: string;
|
|
31
|
-
currencySymbol: string;
|
|
32
|
-
available?: number;
|
|
33
|
-
balance?: number;
|
|
34
|
-
cashback?: number;
|
|
35
|
-
hold?: number;
|
|
36
|
-
}, "chargeCardList/updateCreditAccountBalanceFromPusher">, clearChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/clearChargeCardList">, resendCardInvite: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cardId: string], {
|
|
21
|
+
}, "chargeCardList/updateChargeCardListUIState">, clearChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/clearChargeCardList">, resendCardInvite: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cardId: string], {
|
|
37
22
|
cardId: string;
|
|
38
23
|
}, "chargeCardList/resendCardInvite", never, never>, resendCardInviteSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
39
24
|
cardId: ID;
|
|
@@ -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.72",
|
|
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\"",
|
|
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');
|