@zeniai/client-epic-state 4.17.48 → 4.17.49
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/chargeCard.d.ts +1 -0
- package/lib/entity/chargeCard/chargeCardPayload.d.ts +1 -0
- package/lib/entity/chargeCard/chargeCardPayload.js +10 -9
- package/lib/entity/chargeCardRepayment/chargeCardRepayment.d.ts +32 -0
- package/lib/entity/chargeCardRepayment/chargeCardRepayment.js +14 -0
- package/lib/entity/chargeCardRepayment/chargeCardRepaymentPayload.d.ts +28 -0
- package/lib/entity/chargeCardRepayment/chargeCardRepaymentPayload.js +34 -0
- package/lib/entity/chargeCardRepayment/chargeCardRepaymentReducer.d.ts +6 -0
- package/lib/entity/chargeCardRepayment/chargeCardRepaymentReducer.js +41 -0
- package/lib/entity/chargeCardRepayment/chargeCardRepaymentSelector.d.ts +4 -0
- package/lib/entity/chargeCardRepayment/chargeCardRepaymentSelector.js +17 -0
- package/lib/entity/company/companyPayload.d.ts +1 -0
- package/lib/entity/company/companyPayload.js +1 -0
- package/lib/entity/company/companyReducer.d.ts +4 -1
- package/lib/entity/company/companyReducer.js +7 -2
- package/lib/entity/company/companyStateTypes.d.ts +1 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +3 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +4 -2
- package/lib/entity/tenant/clearAllEpic.js +4 -0
- package/lib/epic.d.ts +5 -1
- package/lib/epic.js +5 -1
- package/lib/index.d.ts +6 -3
- package/lib/index.js +18 -8
- package/lib/reducer.d.ts +6 -0
- package/lib/reducer.js +6 -0
- package/lib/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +2 -1
- package/lib/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +1 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.js +4 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailPayload.d.ts +1 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +9 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +36 -4
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +4 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +16 -9
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +13 -3
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/postChargeCardEmailForLowBalanceToAdminEpic.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/postChargeCardEmailForLowBalanceToAdminEpic.js +34 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListPayload.d.ts +1 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +6 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +9 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +7 -0
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.d.ts +13 -0
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +49 -0
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailSelector.d.ts +11 -0
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailSelector.js +32 -0
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailState.d.ts +12 -0
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailState.js +2 -0
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentPayload.d.ts +7 -0
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentPayload.js +2 -0
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/fetchChargeCardRepaymentDetailEpic.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/fetchChargeCardRepaymentDetailEpic.js +24 -0
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/initiateChargeCardRepaymentEpic.d.ts +10 -0
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/initiateChargeCardRepaymentEpic.js +87 -0
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.d.ts +4 -1
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.js +32 -2
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewState.d.ts +1 -0
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/acceptChargeCardTermsEpic.js +5 -1
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/enableChargeCardAutoPayEpic.d.ts +11 -0
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/enableChargeCardAutoPayEpic.js +54 -0
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +1 -0
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +2 -0
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.d.ts +2 -1
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js +21 -11
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +1 -0
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +1 -1
- package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailReducer.js +1 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearChargeCardDetail = exports.verifyOtpCardHolderFailure = exports.verifyOtpCardHolderSuccess = exports.verifyOtpCardHolder = exports.sendOtpCardHolderFailure = exports.sendOtpCardHolderSuccess = exports.resendOtpCardHolder = exports.sendOtpCardHolder = exports.updateChargeCardTransactionStatisticsFetchState = exports.updateChargeCardTransactionStatistics = exports.fetchChargeCardTransactionStatistics = exports.updateDepositAccountLimitFetchStatus = exports.fetchDepositAccountLimit = 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;
|
|
4
|
+
exports.clearChargeCardDetail = exports.verifyOtpCardHolderFailure = exports.verifyOtpCardHolderSuccess = exports.verifyOtpCardHolder = exports.sendOtpCardHolderFailure = exports.sendOtpCardHolderSuccess = exports.resendOtpCardHolder = exports.sendOtpCardHolder = exports.updateChargeCardTransactionStatisticsFetchState = exports.updateChargeCardTransactionStatistics = exports.fetchChargeCardTransactionStatistics = exports.updateDepositAccountLimitFetchStatus = exports.fetchDepositAccountLimit = 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.updateChargeCardEmailForLowBalanceToAdminFetchState = exports.postChargeCardEmailForLowBalanceToAdmin = exports.fetchChargeCardDetailPage = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const sortOrderPayload_1 = require("../../../../commonPayloadTypes/sortOrderPayload");
|
|
7
7
|
const attachmentPayload_1 = require("../../../../entity/transaction/payloadTypes/attachmentPayload");
|
|
@@ -17,9 +17,41 @@ const chargeCardDetail = (0, toolkit_1.createSlice)({
|
|
|
17
17
|
reducer() {
|
|
18
18
|
//do nothing
|
|
19
19
|
},
|
|
20
|
-
prepare(chargeCardId, doFetchCreditAccounts, cacheOverride = false) {
|
|
20
|
+
prepare(chargeCardId, doFetchCreditAccounts, isCreditCardEnabled, cacheOverride = false) {
|
|
21
21
|
return {
|
|
22
|
-
payload: {
|
|
22
|
+
payload: {
|
|
23
|
+
chargeCardId,
|
|
24
|
+
doFetchCreditAccounts,
|
|
25
|
+
isCreditCardEnabled,
|
|
26
|
+
cacheOverride,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
postChargeCardEmailForLowBalanceToAdmin: {
|
|
32
|
+
reducer(draft, action) {
|
|
33
|
+
const { chargeCardId } = action.payload;
|
|
34
|
+
draft.detailById[chargeCardId].notifyAdminForLowBalance.fetchState =
|
|
35
|
+
'In-Progress';
|
|
36
|
+
draft.detailById[chargeCardId].notifyAdminForLowBalance.error =
|
|
37
|
+
undefined;
|
|
38
|
+
},
|
|
39
|
+
prepare(chargeCardId) {
|
|
40
|
+
return {
|
|
41
|
+
payload: { chargeCardId },
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
updateChargeCardEmailForLowBalanceToAdminFetchState: {
|
|
46
|
+
reducer(draft, action) {
|
|
47
|
+
const { chargeCardId, fetchState, error } = action.payload;
|
|
48
|
+
draft.detailById[chargeCardId].notifyAdminForLowBalance.fetchState =
|
|
49
|
+
fetchState;
|
|
50
|
+
draft.detailById[chargeCardId].notifyAdminForLowBalance.error = error;
|
|
51
|
+
},
|
|
52
|
+
prepare(chargeCardId, fetchState, error) {
|
|
53
|
+
return {
|
|
54
|
+
payload: { chargeCardId, fetchState, error },
|
|
23
55
|
};
|
|
24
56
|
},
|
|
25
57
|
},
|
|
@@ -352,5 +384,5 @@ const chargeCardDetail = (0, toolkit_1.createSlice)({
|
|
|
352
384
|
},
|
|
353
385
|
},
|
|
354
386
|
});
|
|
355
|
-
_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.fetchDepositAccountLimit = _a.fetchDepositAccountLimit, exports.updateDepositAccountLimitFetchStatus = _a.updateDepositAccountLimitFetchStatus, exports.fetchChargeCardTransactionStatistics = _a.fetchChargeCardTransactionStatistics, exports.updateChargeCardTransactionStatistics = _a.updateChargeCardTransactionStatistics, exports.updateChargeCardTransactionStatisticsFetchState = _a.updateChargeCardTransactionStatisticsFetchState, 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;
|
|
387
|
+
_a = chargeCardDetail.actions, exports.fetchChargeCardDetailPage = _a.fetchChargeCardDetailPage, exports.postChargeCardEmailForLowBalanceToAdmin = _a.postChargeCardEmailForLowBalanceToAdmin, exports.updateChargeCardEmailForLowBalanceToAdminFetchState = _a.updateChargeCardEmailForLowBalanceToAdminFetchState, 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.fetchDepositAccountLimit = _a.fetchDepositAccountLimit, exports.updateDepositAccountLimitFetchStatus = _a.updateDepositAccountLimitFetchStatus, exports.fetchChargeCardTransactionStatistics = _a.fetchChargeCardTransactionStatistics, exports.updateChargeCardTransactionStatistics = _a.updateChargeCardTransactionStatistics, exports.updateChargeCardTransactionStatisticsFetchState = _a.updateChargeCardTransactionStatisticsFetchState, 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;
|
|
356
388
|
exports.default = chargeCardDetail.reducer;
|
|
@@ -8,7 +8,7 @@ import { Attachment } from '../../../../entity/transaction/stateTypes/attachment
|
|
|
8
8
|
import { RootState } from '../../../../reducer';
|
|
9
9
|
import { TwoFactorAuthenticationView } from '../../../twoFactorAuthentication/twoFactorAuthenticationSelector';
|
|
10
10
|
import { ChargeCardConfigState } from '../chargeCardConfig/chargeCardConfigState';
|
|
11
|
-
import { CreditAccount } from '../chargeCardList/chargeCardList';
|
|
11
|
+
import { CreditAccount, CreditAccountRepayment } from '../chargeCardList/chargeCardList';
|
|
12
12
|
import { ChargeCardWithUser } from '../chargeCardList/chargeCardListSelector';
|
|
13
13
|
import { ChargeCardDetailUiState, TransactionStatistics } from './chargeCardDetail';
|
|
14
14
|
export interface ChargeCardDetailSelectorView extends SelectorView {
|
|
@@ -25,14 +25,16 @@ export interface ChargeCardDetailSelectorView extends SelectorView {
|
|
|
25
25
|
updateFetchState: FetchStateAndError;
|
|
26
26
|
updatePhysicalChargeCardAttemptFetchState: FetchStateAndError;
|
|
27
27
|
creditAccount: CreditAccount;
|
|
28
|
+
creditAccountRepayment: CreditAccountRepayment;
|
|
28
29
|
transactionStatistics: TransactionStatistics;
|
|
29
30
|
depositAccountLimitFetchState: FetchStateAndError;
|
|
30
31
|
updateChargeCardLimitFetchState: FetchStateAndError;
|
|
32
|
+
notifyAdminForLowBalance: FetchStateAndError;
|
|
31
33
|
depositAccountLimit?: DepositAccountWithLimit;
|
|
32
34
|
chargeCard?: ChargeCardWithUser;
|
|
33
35
|
connectedAccount?: ConnectedAccount;
|
|
34
36
|
}
|
|
35
|
-
export declare const getChargeCardDetailView: (state: RootState, chargeCardId: ID, includeCreditAccountInfo: boolean) => ChargeCardDetailSelectorView;
|
|
37
|
+
export declare const getChargeCardDetailView: (state: RootState, chargeCardId: ID, includeCreditAccountInfo: boolean, isCreditCardEnabled: boolean) => ChargeCardDetailSelectorView;
|
|
36
38
|
export interface DebitCardPinSetSelectorView extends SelectorView {
|
|
37
39
|
updateDebitCardPinAttemptFetchState: FetchStateAndError;
|
|
38
40
|
updateStatus: FetchStateAndError;
|
|
@@ -17,8 +17,8 @@ const userRoleSelector_1 = require("../../../../entity/userRole/userRoleSelector
|
|
|
17
17
|
const twoFactorAuthentication_1 = require("../../../twoFactorAuthentication/twoFactorAuthentication");
|
|
18
18
|
const twoFactorAuthenticationSelector_1 = require("../../../twoFactorAuthentication/twoFactorAuthenticationSelector");
|
|
19
19
|
const chargeCardDetail_1 = require("./chargeCardDetail");
|
|
20
|
-
const getChargeCardDetailView = (state, chargeCardId, includeCreditAccountInfo) => {
|
|
21
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
20
|
+
const getChargeCardDetailView = (state, chargeCardId, includeCreditAccountInfo, isCreditCardEnabled) => {
|
|
21
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
22
22
|
const { tenantState, addressState, chargeCardDetailState, chargeCardState, classState, userState, userRoleState, chargeCardConfigState, chargeCardTransactionState, chargeCardListState, connectedAccountState, depositAccountState, } = state;
|
|
23
23
|
const twoFactorAuthenticationView = (0, twoFactorAuthenticationSelector_1.getTwoFactorAuthenticationViewForChargeCardHolder)(state, chargeCardId);
|
|
24
24
|
const loggedInUserId = (_b = (_a = tenantState.loggedInUser) === null || _a === void 0 ? void 0 : _a.userId) !== null && _b !== void 0 ? _b : '';
|
|
@@ -43,13 +43,15 @@ const getChargeCardDetailView = (state, chargeCardId, includeCreditAccountInfo)
|
|
|
43
43
|
error: undefined,
|
|
44
44
|
};
|
|
45
45
|
if (chargeCardDetail) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
const requiredFetchStates = [
|
|
47
|
+
chargeCardDetail,
|
|
48
|
+
chargeCardConfigState,
|
|
49
|
+
];
|
|
50
|
+
if (includeCreditAccountInfo && isCreditCardEnabled) {
|
|
51
|
+
requiredFetchStates.push(chargeCardListState.creditAccount);
|
|
52
|
+
requiredFetchStates.push(chargeCardListState.creditAccountRepayment);
|
|
53
|
+
}
|
|
54
|
+
reducedFetchState = (0, reduceFetchState_1.reduceFetchState)(requiredFetchStates);
|
|
53
55
|
}
|
|
54
56
|
if (chargeCardDetail &&
|
|
55
57
|
chargeCardDetail.fetchState === 'Completed' &&
|
|
@@ -120,7 +122,12 @@ const getChargeCardDetailView = (state, chargeCardId, includeCreditAccountInfo)
|
|
|
120
122
|
depositAccountLimit,
|
|
121
123
|
version: '1.0',
|
|
122
124
|
creditAccount: chargeCardListState.creditAccount,
|
|
125
|
+
creditAccountRepayment: chargeCardListState.creditAccountRepayment,
|
|
123
126
|
transactionStatistics: (_o = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.transactionStatistics) !== null && _o !== void 0 ? _o : chargeCardDetail_1.initialTransactionStatistics,
|
|
127
|
+
notifyAdminForLowBalance: (_p = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.notifyAdminForLowBalance) !== null && _p !== void 0 ? _p : {
|
|
128
|
+
fetchState: 'Not-Started',
|
|
129
|
+
error: undefined,
|
|
130
|
+
},
|
|
124
131
|
};
|
|
125
132
|
};
|
|
126
133
|
exports.getChargeCardDetailView = getChargeCardDetailView;
|
package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { RootState } from '../../../../reducer';
|
|
4
4
|
import { fetchChargeCardConfig } from '../chargeCardConfig/chargeCardConfigReducer';
|
|
5
|
-
import { fetchCreditAccount } from '../chargeCardList/chargeCardListReducer';
|
|
5
|
+
import { fetchCreditAccount, fetchCreditAccountRepayment } from '../chargeCardList/chargeCardListReducer';
|
|
6
6
|
import { fetchChargeCardDetail, fetchChargeCardDetailPage, fetchChargeCardTransactionList } from './chargeCardDetailReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof fetchChargeCardDetailPage> | ReturnType<typeof fetchChargeCardDetail> | ReturnType<typeof fetchChargeCardTransactionList> | ReturnType<typeof fetchChargeCardConfig> | ReturnType<typeof fetchCreditAccount>;
|
|
7
|
+
export type ActionType = ReturnType<typeof fetchChargeCardDetailPage> | ReturnType<typeof fetchChargeCardDetail> | ReturnType<typeof fetchChargeCardTransactionList> | ReturnType<typeof fetchChargeCardConfig> | ReturnType<typeof fetchCreditAccount> | ReturnType<typeof fetchCreditAccountRepayment>;
|
|
8
8
|
export declare const fetchChargeCardDetailPageEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js
CHANGED
|
@@ -7,7 +7,7 @@ const chargeCardConfigReducer_1 = require("../chargeCardConfig/chargeCardConfigR
|
|
|
7
7
|
const chargeCardListReducer_1 = require("../chargeCardList/chargeCardListReducer");
|
|
8
8
|
const chargeCardDetailReducer_1 = require("./chargeCardDetailReducer");
|
|
9
9
|
const fetchChargeCardDetailPageEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(chargeCardDetailReducer_1.fetchChargeCardDetailPage.match), (0, operators_1.mergeMap)((action) => {
|
|
10
|
-
const { chargeCardId, cacheOverride, doFetchCreditAccounts } = action.payload;
|
|
10
|
+
const { chargeCardId, cacheOverride, doFetchCreditAccounts, isCreditCardEnabled, } = action.payload;
|
|
11
11
|
const chargeCardTransactionListAction = [];
|
|
12
12
|
const state = state$.value;
|
|
13
13
|
const exsitingChargeCardDetail = state.chargeCardDetailState.detailById[chargeCardId];
|
|
@@ -22,9 +22,12 @@ const fetchChargeCardDetailPageEpic = (actions$, state$) => actions$.pipe((0, op
|
|
|
22
22
|
//latest transactions need to be fetched hence removing pageToken and pageTokenType
|
|
23
23
|
chargeCardTransactionListAction.push((0, chargeCardDetailReducer_1.fetchChargeCardTransactionList)(chargeCardId, null, null));
|
|
24
24
|
chargeCardTransactionListAction.push((0, chargeCardConfigReducer_1.fetchChargeCardConfig)());
|
|
25
|
-
if (doFetchCreditAccounts) {
|
|
25
|
+
if (doFetchCreditAccounts && isCreditCardEnabled) {
|
|
26
26
|
chargeCardTransactionListAction.push((0, chargeCardListReducer_1.fetchCreditAccount)());
|
|
27
27
|
}
|
|
28
|
+
if (doFetchCreditAccounts && isCreditCardEnabled) {
|
|
29
|
+
chargeCardTransactionListAction.push((0, chargeCardListReducer_1.fetchCreditAccountRepayment)());
|
|
30
|
+
}
|
|
28
31
|
}
|
|
29
32
|
else {
|
|
30
33
|
const chargeCardDetail = state.chargeCardDetailState.detailById[chargeCardId];
|
|
@@ -47,9 +50,16 @@ const fetchChargeCardDetailPageEpic = (actions$, state$) => actions$.pipe((0, op
|
|
|
47
50
|
const chargeCardList = state.chargeCardListState;
|
|
48
51
|
if (chargeCardList.creditAccount.fetchState !== 'Completed' &&
|
|
49
52
|
chargeCardList.creditAccount.fetchState !== 'In-Progress' &&
|
|
50
|
-
doFetchCreditAccounts
|
|
53
|
+
doFetchCreditAccounts &&
|
|
54
|
+
isCreditCardEnabled) {
|
|
51
55
|
chargeCardTransactionListAction.push((0, chargeCardListReducer_1.fetchCreditAccount)());
|
|
52
56
|
}
|
|
57
|
+
if (chargeCardList.creditAccountRepayment.fetchState !== 'Completed' &&
|
|
58
|
+
chargeCardList.creditAccountRepayment.fetchState !== 'In-Progress' &&
|
|
59
|
+
doFetchCreditAccounts &&
|
|
60
|
+
isCreditCardEnabled) {
|
|
61
|
+
chargeCardTransactionListAction.push((0, chargeCardListReducer_1.fetchCreditAccountRepayment)());
|
|
62
|
+
}
|
|
53
63
|
}
|
|
54
64
|
return (0, rxjs_1.concat)((0, rxjs_1.from)(chargeCardTransactionListAction));
|
|
55
65
|
}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
4
|
+
import { RootState } from '../../../../reducer';
|
|
5
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
6
|
+
import { postChargeCardEmailForLowBalanceToAdmin, updateChargeCardEmailForLowBalanceToAdminFetchState } from './chargeCardDetailReducer';
|
|
7
|
+
export type ActionType = ReturnType<typeof postChargeCardEmailForLowBalanceToAdmin> | ReturnType<typeof updateChargeCardEmailForLowBalanceToAdminFetchState> | ReturnType<typeof openSnackbar>;
|
|
8
|
+
export declare const postChargeCardEmailForLowBalanceToAdminEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.postChargeCardEmailForLowBalanceToAdminEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
7
|
+
const responsePayload_1 = require("../../../../responsePayload");
|
|
8
|
+
const chargeCardDetailReducer_1 = require("./chargeCardDetailReducer");
|
|
9
|
+
const postChargeCardEmailForLowBalanceToAdminEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardDetailReducer_1.postChargeCardEmailForLowBalanceToAdmin.match), (0, operators_1.mergeMap)((action) => {
|
|
10
|
+
const { chargeCardId } = action.payload;
|
|
11
|
+
return zeniAPI
|
|
12
|
+
.postAndGetJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards/email-notifications`, {
|
|
13
|
+
notify_admin_low_balance_alert: true,
|
|
14
|
+
card_id: chargeCardId,
|
|
15
|
+
})
|
|
16
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
17
|
+
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
18
|
+
const actions = [
|
|
19
|
+
(0, chargeCardDetailReducer_1.updateChargeCardEmailForLowBalanceToAdminFetchState)(chargeCardId, 'Completed'),
|
|
20
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
21
|
+
messageSection: 'notify_admin_for_low_balance',
|
|
22
|
+
messageText: 'success',
|
|
23
|
+
type: 'success',
|
|
24
|
+
}),
|
|
25
|
+
];
|
|
26
|
+
return (0, rxjs_1.from)(actions);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return (0, rxjs_1.of)((0, chargeCardDetailReducer_1.updateChargeCardEmailForLowBalanceToAdminFetchState)(chargeCardId, 'Error', response.status));
|
|
30
|
+
}
|
|
31
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, chargeCardDetailReducer_1.updateChargeCardEmailForLowBalanceToAdminFetchState)(chargeCardId, 'Error', (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Post Charge Card Email For Low Balance To Admin errored out' +
|
|
32
|
+
JSON.stringify(error))))));
|
|
33
|
+
}));
|
|
34
|
+
exports.postChargeCardEmailForLowBalanceToAdminEpic = postChargeCardEmailForLowBalanceToAdminEpic;
|
|
@@ -46,6 +46,7 @@ export interface CreditAccountRepayment extends FetchStateAndError {
|
|
|
46
46
|
remainingAmountOverdue: Amount;
|
|
47
47
|
statementPeriodEnd: ZeniDate;
|
|
48
48
|
statementPeriodStart: ZeniDate;
|
|
49
|
+
initiatedRepaymentDate?: ZeniDate;
|
|
49
50
|
}
|
|
50
51
|
export declare const initialCreditAcc: CreditAccount;
|
|
51
52
|
export declare const initialDebitCardSummaries: DebitCardSummaries;
|
|
@@ -70,6 +70,7 @@ exports.initialCreditAccountRepayment = {
|
|
|
70
70
|
statementPeriodStart: (0, zeniDayJS_1.dateNow)(),
|
|
71
71
|
nextRepaymentDueDate: (0, zeniDayJS_1.dateNow)(),
|
|
72
72
|
remainingAmountDue: { amount: 0, currencyCode: 'USD', currencySymbol: '$' },
|
|
73
|
+
initiatedRepaymentDate: undefined,
|
|
73
74
|
};
|
|
74
75
|
const ALL_CHARGE_CARD_SORT_KEYS = [
|
|
75
76
|
'owner',
|
|
@@ -45,6 +45,7 @@ export interface CreditAccountRepaymentPayload {
|
|
|
45
45
|
remaining_amount_overdue: number;
|
|
46
46
|
statement_period_end: string;
|
|
47
47
|
statement_period_start: string;
|
|
48
|
+
initiated_repayment_date?: string | null;
|
|
48
49
|
}
|
|
49
50
|
interface CreditAccountListPayload {
|
|
50
51
|
credit_accounts: CreditAccountPayload[];
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { Amount } from '../../../../commonStateTypes/amount';
|
|
1
2
|
import { ID } from '../../../../commonStateTypes/common';
|
|
2
3
|
import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
4
|
+
import { ZeniDate } from '../../../../zeniDayJS';
|
|
3
5
|
import { ChargeCardListState, ChargeCardListUIState } from './chargeCardList';
|
|
4
6
|
import { ChargeCardListPayload, CreditAccountPayload, CreditAccountRepaymentPayload, DebitCardSummariesPayload } from './chargeCardListPayload';
|
|
5
7
|
export declare const initialState: ChargeCardListState;
|
|
@@ -8,7 +10,10 @@ export declare const fetchChargeCardListPage: import("@reduxjs/toolkit").ActionC
|
|
|
8
10
|
isDebitCardEnabled: boolean;
|
|
9
11
|
isCreditCardEnabled: boolean;
|
|
10
12
|
cacheOverride: any;
|
|
11
|
-
}, "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">,
|
|
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<{
|
|
14
|
+
amount: Amount;
|
|
15
|
+
date: ZeniDate;
|
|
16
|
+
}, "chargeCardList/updateCreditAccountRepaymentAmountAndDate">, 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<{
|
|
12
17
|
chargeCardListPayload: ChargeCardListPayload;
|
|
13
18
|
keepExistingListItems?: boolean;
|
|
14
19
|
}, "chargeCardList/updateChargeCardList">, updateChargeCardListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateChargeCardListFailure">, updateSearchText: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "chargeCardList/updateSearchText">, updateChargeCardListUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.revokeCardInviteFailure = exports.revokeCardInviteSuccess = exports.revokeCardInvite = exports.resendCardInviteFailure = exports.resendCardInviteSuccess = exports.resendCardInvite = exports.clearChargeCardList = exports.updateChargeCardListUIState = exports.updateSearchText = exports.updateChargeCardListFailure = exports.updateChargeCardList = exports.fetchChargeCardList = exports.updateDebitCardSummaryFailure = exports.updateDebitCardSummary = exports.fetchDebitCardSummary = exports.updateCreditAccountFailure = exports.updateCreditAccount = exports.fetchCreditAccount = exports.updateCreditAccountRepaymentFailure = exports.updateCreditAccountRepayment = exports.fetchCreditAccountRepayment = exports.fetchChargeCardListPage = exports.initialState = void 0;
|
|
4
|
+
exports.revokeCardInviteFailure = exports.revokeCardInviteSuccess = exports.revokeCardInvite = exports.resendCardInviteFailure = exports.resendCardInviteSuccess = exports.resendCardInvite = exports.clearChargeCardList = exports.updateChargeCardListUIState = exports.updateSearchText = exports.updateChargeCardListFailure = exports.updateChargeCardList = exports.fetchChargeCardList = exports.updateDebitCardSummaryFailure = exports.updateDebitCardSummary = exports.fetchDebitCardSummary = exports.updateCreditAccountFailure = exports.updateCreditAccount = exports.fetchCreditAccount = 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
7
|
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
@@ -48,6 +48,10 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
48
48
|
draft.creditAccountRepayment.fetchState = 'In-Progress';
|
|
49
49
|
draft.creditAccountRepayment.error = undefined;
|
|
50
50
|
},
|
|
51
|
+
updateCreditAccountRepaymentAmountAndDate(draft, action) {
|
|
52
|
+
draft.creditAccountRepayment.initiatedRepayments = action.payload.amount;
|
|
53
|
+
draft.creditAccountRepayment.initiatedRepaymentDate = action.payload.date;
|
|
54
|
+
},
|
|
51
55
|
updateCreditAccountRepayment(draft, action) {
|
|
52
56
|
draft.creditAccountRepayment = toCreditAccountRepayment(action.payload);
|
|
53
57
|
},
|
|
@@ -156,7 +160,7 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
156
160
|
},
|
|
157
161
|
},
|
|
158
162
|
});
|
|
159
|
-
_a = chargeCardList.actions, exports.fetchChargeCardListPage = _a.fetchChargeCardListPage, exports.fetchCreditAccountRepayment = _a.fetchCreditAccountRepayment, exports.updateCreditAccountRepayment = _a.updateCreditAccountRepayment, exports.updateCreditAccountRepaymentFailure = _a.updateCreditAccountRepaymentFailure, 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.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;
|
|
163
|
+
_a = chargeCardList.actions, exports.fetchChargeCardListPage = _a.fetchChargeCardListPage, exports.fetchCreditAccountRepayment = _a.fetchCreditAccountRepayment, exports.updateCreditAccountRepayment = _a.updateCreditAccountRepayment, exports.updateCreditAccountRepaymentFailure = _a.updateCreditAccountRepaymentFailure, exports.updateCreditAccountRepaymentAmountAndDate = _a.updateCreditAccountRepaymentAmountAndDate, 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.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;
|
|
160
164
|
exports.default = chargeCardList.reducer;
|
|
161
165
|
// helper
|
|
162
166
|
const toCreditAccount = (payload) => ({
|
|
@@ -186,6 +190,9 @@ const toCreditAccountRepayment = (payload) => ({
|
|
|
186
190
|
currentBalance: (0, amount_1.toAmount)(payload.current_balance, payload.currency_code, payload.currency_symbol),
|
|
187
191
|
initiatedRepayments: (0, amount_1.toAmount)(payload.initiated_repayments, payload.currency_code, payload.currency_symbol),
|
|
188
192
|
nextRepaymentDueDate: (0, zeniDayJS_1.date)(payload.next_repayment_due_date),
|
|
193
|
+
initiatedRepaymentDate: payload.initiated_repayment_date != null
|
|
194
|
+
? (0, zeniDayJS_1.date)(payload.initiated_repayment_date)
|
|
195
|
+
: undefined,
|
|
189
196
|
providerCreditAccountId: payload.provider_credit_account_id,
|
|
190
197
|
remainingAmountDue: (0, amount_1.toAmount)(payload.remaining_amount_due, payload.currency_code, payload.currency_symbol),
|
|
191
198
|
remainingAmountOverdue: (0, amount_1.toAmount)(payload.remaining_amount_overdue, payload.currency_code, payload.currency_symbol),
|
|
@@ -44,7 +44,7 @@ const getChargeCardListView = (state, includeCreditAccountDebitSummaryAndCashbac
|
|
|
44
44
|
];
|
|
45
45
|
if (includeCreditAccountDebitSummaryAndCashbackInfo) {
|
|
46
46
|
if (isCreditCardEnabled) {
|
|
47
|
-
requiredFetchStates.push(chargeCardListState.creditAccount);
|
|
47
|
+
requiredFetchStates.push(chargeCardListState.creditAccount, chargeCardListState.creditAccountRepayment);
|
|
48
48
|
}
|
|
49
49
|
if (isDebitCardEnabled) {
|
|
50
50
|
requiredFetchStates.push(chargeCardListState.debitCardSummaries);
|
package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ import { fetchClassList } from '../../../classList/classListReducer';
|
|
|
5
5
|
import { fetchUserListByType } from '../../../userListView/userListViewReducer';
|
|
6
6
|
import { fetchCashbackDetail } from '../cashbackDetail/cashbackDetailReducer';
|
|
7
7
|
import { fetchChargeCardConfig } from '../chargeCardConfig/chargeCardConfigReducer';
|
|
8
|
-
import { fetchChargeCardList, fetchChargeCardListPage, fetchCreditAccount, fetchDebitCardSummary } from './chargeCardListReducer';
|
|
9
|
-
export type ActionType = ReturnType<typeof fetchChargeCardListPage> | ReturnType<typeof fetchCreditAccount> | ReturnType<typeof fetchChargeCardList> | ReturnType<typeof fetchChargeCardConfig> | ReturnType<typeof fetchUserListByType> | ReturnType<typeof fetchCashbackDetail> | ReturnType<typeof fetchClassList> | ReturnType<typeof fetchDebitCardSummary>;
|
|
8
|
+
import { fetchChargeCardList, fetchChargeCardListPage, fetchCreditAccount, fetchCreditAccountRepayment, fetchDebitCardSummary } from './chargeCardListReducer';
|
|
9
|
+
export type ActionType = ReturnType<typeof fetchChargeCardListPage> | ReturnType<typeof fetchCreditAccount> | ReturnType<typeof fetchChargeCardList> | ReturnType<typeof fetchChargeCardConfig> | ReturnType<typeof fetchUserListByType> | ReturnType<typeof fetchCashbackDetail> | ReturnType<typeof fetchClassList> | ReturnType<typeof fetchDebitCardSummary> | ReturnType<typeof fetchCreditAccountRepayment>;
|
|
10
10
|
export declare const fetchChargeCardListPageEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
@@ -17,6 +17,7 @@ const fetchChargeCardListPageEpic = (actions$, state$) => actions$.pipe((0, oper
|
|
|
17
17
|
if (doFetchCreditAccountsDebitSummaryAndCashback === true) {
|
|
18
18
|
if (isCreditCardEnabled) {
|
|
19
19
|
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchCreditAccount)());
|
|
20
|
+
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchCreditAccountRepayment)());
|
|
20
21
|
}
|
|
21
22
|
if (isDebitCardEnabled) {
|
|
22
23
|
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchDebitCardSummary)());
|
|
@@ -37,6 +38,12 @@ const fetchChargeCardListPageEpic = (actions$, state$) => actions$.pipe((0, oper
|
|
|
37
38
|
chargeCardList.creditAccount.fetchState !== 'In-Progress') {
|
|
38
39
|
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchCreditAccount)());
|
|
39
40
|
}
|
|
41
|
+
if (doFetchCreditAccountsDebitSummaryAndCashback === true &&
|
|
42
|
+
isCreditCardEnabled &&
|
|
43
|
+
chargeCardList.creditAccountRepayment.fetchState !== 'Completed' &&
|
|
44
|
+
chargeCardList.creditAccountRepayment.fetchState !== 'In-Progress') {
|
|
45
|
+
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchCreditAccountRepayment)());
|
|
46
|
+
}
|
|
40
47
|
if (doFetchCreditAccountsDebitSummaryAndCashback &&
|
|
41
48
|
cashbackDetailState.fetchState !== 'In-Progress' &&
|
|
42
49
|
cashbackDetailState.hasValidState() === false) {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FetchState, ID } from '../../../../commonStateTypes/common';
|
|
2
|
+
import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
3
|
+
import { FundingAccount } from '../../commonSetup/setupViewSelector';
|
|
4
|
+
import { ChargeCardRepaymentDetailLocalData, ChargeCardRepaymentDetailState } from './chargeCardRepaymentDetailState';
|
|
5
|
+
export declare const initialState: ChargeCardRepaymentDetailState;
|
|
6
|
+
export declare const fetchChargeCardRepaymentDetail: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardRepaymentDetail/fetchChargeCardRepaymentDetail">, initiateChargeCardRepayment: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
7
|
+
companyId: ID;
|
|
8
|
+
}, "chargeCardRepaymentDetail/initiateChargeCardRepayment">, updateNewAddedChargeCardPaymentAccount: import("@reduxjs/toolkit").ActionCreatorWithPayload<FundingAccount, "chargeCardRepaymentDetail/updateNewAddedChargeCardPaymentAccount">, updateChargeCardRepaymentLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardRepaymentDetailLocalData, "chargeCardRepaymentDetail/updateChargeCardRepaymentLocalStore">, updateChargeCardRepaymentStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
9
|
+
fetchState: FetchState;
|
|
10
|
+
error?: ZeniAPIStatus;
|
|
11
|
+
}, "chargeCardRepaymentDetail/updateChargeCardRepaymentStatus">, clearChargeCardRepaymentDetail: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardRepaymentDetail/clearChargeCardRepaymentDetail">;
|
|
12
|
+
declare const _default: import("redux").Reducer<ChargeCardRepaymentDetailState>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.clearChargeCardRepaymentDetail = exports.updateChargeCardRepaymentStatus = exports.updateChargeCardRepaymentLocalStore = exports.updateNewAddedChargeCardPaymentAccount = exports.initiateChargeCardRepayment = exports.fetchChargeCardRepaymentDetail = exports.initialState = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
exports.initialState = {
|
|
7
|
+
localData: {
|
|
8
|
+
amount: {
|
|
9
|
+
amount: 0,
|
|
10
|
+
currencyCode: 'USD',
|
|
11
|
+
currencySymbol: '$',
|
|
12
|
+
},
|
|
13
|
+
isAutoRepayment: false,
|
|
14
|
+
transferFrom: undefined,
|
|
15
|
+
idempotencyKey: '',
|
|
16
|
+
},
|
|
17
|
+
fetchState: 'Not-Started',
|
|
18
|
+
error: undefined,
|
|
19
|
+
};
|
|
20
|
+
const chargeCardRepaymentDetail = (0, toolkit_1.createSlice)({
|
|
21
|
+
name: 'chargeCardRepaymentDetail',
|
|
22
|
+
initialState: exports.initialState,
|
|
23
|
+
reducers: {
|
|
24
|
+
fetchChargeCardRepaymentDetail() {
|
|
25
|
+
//do nothing
|
|
26
|
+
},
|
|
27
|
+
updateChargeCardRepaymentLocalStore(draft, action) {
|
|
28
|
+
draft.localData = action.payload;
|
|
29
|
+
},
|
|
30
|
+
updateNewAddedChargeCardPaymentAccount(draft, action) {
|
|
31
|
+
draft.localData.transferFrom = action.payload;
|
|
32
|
+
},
|
|
33
|
+
initiateChargeCardRepayment(draft,
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
35
|
+
_action) {
|
|
36
|
+
draft.fetchState = 'In-Progress';
|
|
37
|
+
draft.error = undefined;
|
|
38
|
+
},
|
|
39
|
+
updateChargeCardRepaymentStatus(draft, action) {
|
|
40
|
+
draft.fetchState = action.payload.fetchState;
|
|
41
|
+
draft.error = action.payload.error;
|
|
42
|
+
},
|
|
43
|
+
clearChargeCardRepaymentDetail(draft) {
|
|
44
|
+
Object.assign(draft, exports.initialState);
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
_a = chargeCardRepaymentDetail.actions, exports.fetchChargeCardRepaymentDetail = _a.fetchChargeCardRepaymentDetail, exports.initiateChargeCardRepayment = _a.initiateChargeCardRepayment, exports.updateNewAddedChargeCardPaymentAccount = _a.updateNewAddedChargeCardPaymentAccount, exports.updateChargeCardRepaymentLocalStore = _a.updateChargeCardRepaymentLocalStore, exports.updateChargeCardRepaymentStatus = _a.updateChargeCardRepaymentStatus, exports.clearChargeCardRepaymentDetail = _a.clearChargeCardRepaymentDetail;
|
|
49
|
+
exports.default = chargeCardRepaymentDetail.reducer;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FetchState } from '../../../../commonStateTypes/common';
|
|
2
|
+
import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
+
import { RootState } from '../../../../reducer';
|
|
4
|
+
import { FundingAccount } from '../../commonSetup/setupViewSelector';
|
|
5
|
+
import { ChargeCardRepaymentDetailLocalData } from './chargeCardRepaymentDetailState';
|
|
6
|
+
export interface ChargeCardRepaymentDetailSelectorView extends SelectorView {
|
|
7
|
+
chargeCardRepaymentDetailLocalData: ChargeCardRepaymentDetailLocalData;
|
|
8
|
+
transferFromAccounts: FundingAccount[];
|
|
9
|
+
updateStatus: FetchState;
|
|
10
|
+
}
|
|
11
|
+
export declare const getChargeCardRepaymentDetail: (state: RootState) => ChargeCardRepaymentDetailSelectorView;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getChargeCardRepaymentDetail = void 0;
|
|
4
|
+
const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
|
|
5
|
+
const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
|
|
6
|
+
const depositAccountListSelector_1 = require("../../zeniAccounts/depositAccountList/depositAccountListSelector");
|
|
7
|
+
const paymentAccountListSelector_1 = require("../../zeniAccounts/paymentAccountList/paymentAccountListSelector");
|
|
8
|
+
const getChargeCardRepaymentDetail = (state) => {
|
|
9
|
+
const { chargeCardRepaymentDetailState, depositAccountState, paymentAccountState, depositAccountListState, paymentAccountListState, } = state;
|
|
10
|
+
const { localData, fetchState, error } = chargeCardRepaymentDetailState;
|
|
11
|
+
const depositAccountsView = (0, depositAccountListSelector_1.getAllDepositAccounts)(depositAccountState, depositAccountListState);
|
|
12
|
+
const paymentAccountsView = (0, paymentAccountListSelector_1.getAllPaymentAccounts)(paymentAccountState, paymentAccountListState);
|
|
13
|
+
let transferFromAccounts = [];
|
|
14
|
+
if (depositAccountsView.fetchState === 'Completed' &&
|
|
15
|
+
paymentAccountsView.fetchState === 'Completed') {
|
|
16
|
+
transferFromAccounts = (0, setupViewSelector_1.getAllFundingAccounts)(depositAccountsView.depositAccounts, paymentAccountsView.paymentAccounts, paymentAccountListState.paymentAccountBalanceFetchStatus);
|
|
17
|
+
}
|
|
18
|
+
const reducedFetchState = (0, reduceFetchState_1.reduceAllFetchState)([
|
|
19
|
+
depositAccountsView,
|
|
20
|
+
paymentAccountsView,
|
|
21
|
+
...Object.values(paymentAccountListState.paymentAccountBalanceFetchStatus),
|
|
22
|
+
]);
|
|
23
|
+
return {
|
|
24
|
+
chargeCardRepaymentDetailLocalData: localData,
|
|
25
|
+
fetchState: reducedFetchState.fetchState,
|
|
26
|
+
updateStatus: fetchState,
|
|
27
|
+
error,
|
|
28
|
+
transferFromAccounts,
|
|
29
|
+
version: 0,
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
exports.getChargeCardRepaymentDetail = getChargeCardRepaymentDetail;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Amount } from '../../../../commonStateTypes/amount';
|
|
2
|
+
import { FetchStateAndError, ID } from '../../../../commonStateTypes/common';
|
|
3
|
+
import { FundingAccount } from '../../commonSetup/setupViewSelector';
|
|
4
|
+
export interface ChargeCardRepaymentDetailState extends FetchStateAndError {
|
|
5
|
+
localData: ChargeCardRepaymentDetailLocalData;
|
|
6
|
+
}
|
|
7
|
+
export interface ChargeCardRepaymentDetailLocalData {
|
|
8
|
+
amount: Amount;
|
|
9
|
+
isAutoRepayment: boolean;
|
|
10
|
+
idempotencyKey: ID;
|
|
11
|
+
transferFrom?: FundingAccount;
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ChargeCardRepaymentPayload } from '../../../../entity/chargeCardRepayment/chargeCardRepaymentPayload';
|
|
2
|
+
import { ZeniAPIResponse } from '../../../../responsePayload';
|
|
3
|
+
interface ChargeCardRepaymentDetailPayload {
|
|
4
|
+
card_repayment: ChargeCardRepaymentPayload;
|
|
5
|
+
}
|
|
6
|
+
export type ChargeCardRepaymentResponse = ZeniAPIResponse<ChargeCardRepaymentDetailPayload>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../../reducer';
|
|
4
|
+
import { fetchDepositAccountList } from '../../zeniAccounts/depositAccountList/depositAccountListReducer';
|
|
5
|
+
import { fetchPaymentAccountList } from '../../zeniAccounts/paymentAccountList/paymentAccountListReducer';
|
|
6
|
+
import { fetchChargeCardRepaymentDetail } from './chargeCardRepaymentDetailReducer';
|
|
7
|
+
export type ActionType = ReturnType<typeof fetchChargeCardRepaymentDetail> | ReturnType<typeof fetchPaymentAccountList> | ReturnType<typeof fetchDepositAccountList>;
|
|
8
|
+
export declare const fetchChargeCardRepaymentDetailEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchChargeCardRepaymentDetailEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const depositAccountListReducer_1 = require("../../zeniAccounts/depositAccountList/depositAccountListReducer");
|
|
7
|
+
const paymentAccountListReducer_1 = require("../../zeniAccounts/paymentAccountList/paymentAccountListReducer");
|
|
8
|
+
const chargeCardRepaymentDetailReducer_1 = require("./chargeCardRepaymentDetailReducer");
|
|
9
|
+
const fetchChargeCardRepaymentDetailEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(chargeCardRepaymentDetailReducer_1.fetchChargeCardRepaymentDetail.match), (0, operators_1.mergeMap)(() => {
|
|
10
|
+
const fetchChargeCardRepaymentDetailActions = [];
|
|
11
|
+
const state = state$.value;
|
|
12
|
+
const depositAccounts = state.depositAccountListState;
|
|
13
|
+
if (depositAccounts.fetchState !== 'In-Progress' &&
|
|
14
|
+
depositAccounts.fetchState !== 'Completed') {
|
|
15
|
+
fetchChargeCardRepaymentDetailActions.push((0, depositAccountListReducer_1.fetchDepositAccountList)());
|
|
16
|
+
}
|
|
17
|
+
const paymentAccounts = state.paymentAccountListState;
|
|
18
|
+
if (paymentAccounts.fetchState !== 'In-Progress' &&
|
|
19
|
+
paymentAccounts.fetchState !== 'Completed') {
|
|
20
|
+
fetchChargeCardRepaymentDetailActions.push((0, paymentAccountListReducer_1.fetchPaymentAccountList)());
|
|
21
|
+
}
|
|
22
|
+
return (0, rxjs_1.from)(fetchChargeCardRepaymentDetailActions);
|
|
23
|
+
}));
|
|
24
|
+
exports.fetchChargeCardRepaymentDetailEpic = fetchChargeCardRepaymentDetailEpic;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { updateChargeCardRepayment } from '../../../../entity/chargeCardRepayment/chargeCardRepaymentReducer';
|
|
4
|
+
import { updateCompanyPrimaryAccount, updateEnableAutoPayForChargeCard } from '../../../../entity/company/companyReducer';
|
|
5
|
+
import { RootState } from '../../../../reducer';
|
|
6
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
7
|
+
import { updateCreditAccountRepaymentAmountAndDate } from '../chargeCardList/chargeCardListReducer';
|
|
8
|
+
import { initiateChargeCardRepayment, updateChargeCardRepaymentStatus } from './chargeCardRepaymentDetailReducer';
|
|
9
|
+
export type ActionType = ReturnType<typeof initiateChargeCardRepayment> | ReturnType<typeof updateChargeCardRepayment> | ReturnType<typeof updateCreditAccountRepaymentAmountAndDate> | ReturnType<typeof updateChargeCardRepaymentStatus> | ReturnType<typeof updateCompanyPrimaryAccount> | ReturnType<typeof updateEnableAutoPayForChargeCard>;
|
|
10
|
+
export declare const initiateChargeCardRepaymentEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|