@zeniai/client-epic-state 5.0.66 → 5.0.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/entity/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/esm/entity/chargeCard/chargeCardReducer.js +1 -34
- package/lib/esm/entity/chargeCardTransaction/chargeCardTransactionReducer.js +1 -35
- package/lib/esm/index.js +5 -9
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +1 -2
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +0 -6
- 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/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 -28
- 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/index.d.ts +6 -10
- package/lib/index.js +36 -50
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +1 -2
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +0 -6
- 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/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 +2 -8
- 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 +1 -40
- 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 -29
- 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/package.json +28 -57
- 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/tsconfig.typecheck.tsbuildinfo +0 -1
- 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.clearChargeCardConfig = exports.updateChargeCardConfigFailure = exports.updateChargeCardConfig = exports.fetchChargeCardConfig = 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 chargeCard_1 = require("../../../../entity/chargeCard/chargeCard");
|
|
9
8
|
const chargeCardConfigPayload_1 = require("./chargeCardConfigPayload");
|
|
10
9
|
exports.initialState = {
|
|
@@ -35,10 +34,10 @@ const chargeCardConfig = (0, toolkit_1.createSlice)({
|
|
|
35
34
|
name: 'chargeCardConfig',
|
|
36
35
|
initialState: exports.initialState,
|
|
37
36
|
reducers: {
|
|
38
|
-
fetchChargeCardConfig
|
|
37
|
+
fetchChargeCardConfig(draft) {
|
|
39
38
|
draft.fetchState = 'In-Progress';
|
|
40
39
|
draft.error = undefined;
|
|
41
|
-
}
|
|
40
|
+
},
|
|
42
41
|
updateChargeCardConfig(draft, action) {
|
|
43
42
|
const { payload } = action;
|
|
44
43
|
draft.creditLimitFrequency =
|
|
@@ -6,7 +6,6 @@ const toolkit_1 = require("@reduxjs/toolkit");
|
|
|
6
6
|
const sortOrderPayload_1 = require("../../../../commonPayloadTypes/sortOrderPayload");
|
|
7
7
|
const attachmentPayload_1 = require("../../../../entity/transaction/payloadTypes/attachmentPayload");
|
|
8
8
|
const chargeCardDetail_1 = require("./chargeCardDetail");
|
|
9
|
-
const pusherActions_1 = require("../../../../commonStateTypes/pusherActions");
|
|
10
9
|
exports.initialState = {
|
|
11
10
|
detailById: {},
|
|
12
11
|
recurringExpensesByChargeCardId: {},
|
|
@@ -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,20 +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
|
|
167
|
-
? (0, amount_1.toAmount)(v, currencyCode, currencySymbol)
|
|
168
|
-
: undefined;
|
|
169
|
-
draft.creditAccount.available =
|
|
170
|
-
amt(action.payload.available) ?? draft.creditAccount.available;
|
|
171
|
-
draft.creditAccount.balance =
|
|
172
|
-
amt(action.payload.balance) ?? draft.creditAccount.balance;
|
|
173
|
-
draft.creditAccount.hold =
|
|
174
|
-
amt(action.payload.hold) ?? draft.creditAccount.hold;
|
|
175
|
-
draft.creditAccount.cashback =
|
|
176
|
-
amt(action.payload.cashback) ?? draft.creditAccount.cashback;
|
|
177
|
-
},
|
|
178
159
|
clearChargeCardList(draft) {
|
|
179
160
|
Object.assign(draft, exports.initialState);
|
|
180
161
|
},
|
|
@@ -330,7 +311,7 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
330
311
|
},
|
|
331
312
|
},
|
|
332
313
|
});
|
|
333
|
-
_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;
|
|
334
315
|
exports.default = chargeCardList.reducer;
|
|
335
316
|
// helper
|
|
336
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
|
},
|
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.67",
|
|
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",
|
|
@@ -33,34 +33,6 @@
|
|
|
33
33
|
"require": "./lib/view/*.js"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
-
"scripts": {
|
|
37
|
-
"clean": "rimraf lib",
|
|
38
|
-
"test:typecheck": "echo 'Typechecking test files...' && NODE_OPTIONS=--max-old-space-size=4096 time tsc -p tsconfig.typecheck.json",
|
|
39
|
-
"test": "pnpm test:typecheck && vitest run --typecheck",
|
|
40
|
-
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
|
|
41
|
-
"find-dead-code": "ts-prune | grep -v '(used in module)'",
|
|
42
|
-
"find-unused-exports": "ts-unused-exports ./tsconfig.json",
|
|
43
|
-
"circular-dependency": "npx madge --circular --extensions ts ./src",
|
|
44
|
-
"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__\"",
|
|
45
|
-
"only-build": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc && tsc -p tsconfig.esm.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
46
|
-
"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__\"",
|
|
47
|
-
"format": "prettier --write --ignore-unknown \"src/**/*\" && pnpm lint",
|
|
48
|
-
"format-watch": "(git diff --name-only --diff-filter=ACM && git ls-files --others --exclude-standard) | grep -E '\\.(ts|tsx)$' | xargs prettier --write",
|
|
49
|
-
"check-version": "node ./scripts/check_version.js",
|
|
50
|
-
"prepublishOnly": "chmod +x ./scripts/branch_validation.sh && ./scripts/branch_validation.sh && pnpm update-slack-group-topic && pnpm run check-version && pnpm clean && pnpm build",
|
|
51
|
-
"version": "git add -A src",
|
|
52
|
-
"postversion": "git push && git push --tags",
|
|
53
|
-
"check-dependencies": "node ./scripts/check_dependencies.js",
|
|
54
|
-
"clean-overrides": "node ./scripts/clean_overrides.js",
|
|
55
|
-
"create-release-branch": "chmod +x ./scripts/create_release_branch.sh && ./scripts/create_release_branch.sh",
|
|
56
|
-
"bump-update-web-app-cockpit-beta": "chmod +x ./scripts/bump_and_update_web_app_ui_beta.sh && ./scripts/bump_and_update_web_app_ui_beta.sh",
|
|
57
|
-
"send-release-notes": "chmod +x ./scripts/send_release_notes.sh && ./scripts/send_release_notes.sh",
|
|
58
|
-
"update-slack-group-topic": "chmod +x ./scripts/update-slack-group-topic.sh && ./scripts/update-slack-group-topic.sh",
|
|
59
|
-
"build-beta-and-copy": "chmod +x ./scripts/build_and_copy.sh && ./scripts/build_and_copy.sh",
|
|
60
|
-
"pr-approvals-update": "chmod +x ./scripts/pr_approvals.sh && ./scripts/pr_approvals.sh",
|
|
61
|
-
"raise-pr-automation": "chmod +x ./scripts/raise_pr_automation.sh && ./scripts/raise_pr_automation.sh",
|
|
62
|
-
"test:file": "scripts/test-file.sh"
|
|
63
|
-
},
|
|
64
36
|
"files": [
|
|
65
37
|
"lib/**/*"
|
|
66
38
|
],
|
|
@@ -131,32 +103,31 @@
|
|
|
131
103
|
"dayjs": "^1.10.7",
|
|
132
104
|
"url-parse": "^1.5.10"
|
|
133
105
|
},
|
|
134
|
-
"
|
|
135
|
-
"
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
106
|
+
"scripts": {
|
|
107
|
+
"clean": "rimraf lib",
|
|
108
|
+
"test:typecheck": "echo 'Typechecking test files...' && NODE_OPTIONS=--max-old-space-size=4096 time tsc -p tsconfig.typecheck.json",
|
|
109
|
+
"test": "pnpm test:typecheck && vitest run --typecheck",
|
|
110
|
+
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
|
|
111
|
+
"find-dead-code": "ts-prune | grep -v '(used in module)'",
|
|
112
|
+
"find-unused-exports": "ts-unused-exports ./tsconfig.json",
|
|
113
|
+
"circular-dependency": "npx madge --circular --extensions ts ./src",
|
|
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__\"",
|
|
115
|
+
"only-build": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc && tsc -p tsconfig.esm.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
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__\"",
|
|
117
|
+
"format": "prettier --write --ignore-unknown \"src/**/*\" && pnpm lint",
|
|
118
|
+
"format-watch": "(git diff --name-only --diff-filter=ACM && git ls-files --others --exclude-standard) | grep -E '\\.(ts|tsx)$' | xargs prettier --write",
|
|
119
|
+
"check-version": "node ./scripts/check_version.js",
|
|
120
|
+
"version": "git add -A src",
|
|
121
|
+
"postversion": "git push && git push --tags",
|
|
122
|
+
"check-dependencies": "node ./scripts/check_dependencies.js",
|
|
123
|
+
"clean-overrides": "node ./scripts/clean_overrides.js",
|
|
124
|
+
"create-release-branch": "chmod +x ./scripts/create_release_branch.sh && ./scripts/create_release_branch.sh",
|
|
125
|
+
"bump-update-web-app-cockpit-beta": "chmod +x ./scripts/bump_and_update_web_app_ui_beta.sh && ./scripts/bump_and_update_web_app_ui_beta.sh",
|
|
126
|
+
"send-release-notes": "chmod +x ./scripts/send_release_notes.sh && ./scripts/send_release_notes.sh",
|
|
127
|
+
"update-slack-group-topic": "chmod +x ./scripts/update-slack-group-topic.sh && ./scripts/update-slack-group-topic.sh",
|
|
128
|
+
"build-beta-and-copy": "chmod +x ./scripts/build_and_copy.sh && ./scripts/build_and_copy.sh",
|
|
129
|
+
"pr-approvals-update": "chmod +x ./scripts/pr_approvals.sh && ./scripts/pr_approvals.sh",
|
|
130
|
+
"raise-pr-automation": "chmod +x ./scripts/raise_pr_automation.sh && ./scripts/raise_pr_automation.sh",
|
|
131
|
+
"test:file": "scripts/test-file.sh"
|
|
161
132
|
}
|
|
162
|
-
}
|
|
133
|
+
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { PayloadAction, Draft } 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
|
-
};
|