@zeniai/client-epic-state 4.7.74 → 4.7.76
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/commonStateTypes/workingDayHelper.d.ts +9 -5
- package/lib/commonStateTypes/workingDayHelper.js +36 -12
- package/lib/entity/account/accountPayload.d.ts +1 -1
- package/lib/entity/billPay/billTransaction/billTransactionPayload.d.ts +3 -0
- package/lib/entity/billPay/billTransaction/billTransactionPayload.js +2 -2
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +3 -0
- package/lib/entity/billPay/recurringBills/recurringBillsPayload.d.ts +34 -0
- package/lib/entity/billPay/recurringBills/recurringBillsPayload.js +44 -0
- package/lib/entity/billPay/recurringBills/recurringBillsReducer.d.ts +6 -0
- package/lib/entity/billPay/recurringBills/recurringBillsReducer.js +40 -0
- package/lib/entity/billPay/recurringBills/recurringBillsState.d.ts +33 -0
- package/lib/entity/billPay/recurringBills/recurringBillsState.js +14 -0
- package/lib/entity/chargeCard/chargeCard.d.ts +3 -2
- package/lib/entity/chargeCard/chargeCardPayload.d.ts +4 -14
- package/lib/entity/chargeCard/chargeCardPayload.js +1 -0
- package/lib/entity/depositAccount/depositAccountPayload.d.ts +2 -5
- package/lib/entity/entityApprovalStatus/entityApprovalStatusPayload.d.ts +1 -0
- package/lib/entity/entityApprovalStatus/entityApprovalStatusPayload.js +1 -0
- package/lib/entity/entityApprovalStatus/entityApprovalStatusState.d.ts +1 -0
- package/lib/entity/paymentAccount/paymentAccountPayload.d.ts +1 -0
- package/lib/entity/paymentAccount/paymentAccountPayload.js +2 -1
- package/lib/entity/paymentAccount/paymentAccountSelector.d.ts +2 -0
- package/lib/entity/paymentAccount/paymentAccountSelector.js +14 -1
- package/lib/entity/paymentAccount/paymentAccountState.d.ts +1 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +5 -2
- package/lib/entity/tenant/clearAllEpic.js +6 -0
- package/lib/entity/transaction/payloadTypes/transactionLinePayload.d.ts +2 -2
- package/lib/entity/transaction/payloadTypes/transactionLinePayload.js +2 -2
- package/lib/entity/transaction/stateTypes/attachment.js +5 -5
- package/lib/epic.d.ts +9 -10
- package/lib/epic.js +9 -10
- package/lib/index.d.ts +26 -14
- package/lib/index.js +37 -22
- package/lib/reducer.d.ts +9 -0
- package/lib/reducer.js +9 -0
- package/lib/view/accountList/accountListReducer.js +2 -1
- package/lib/view/accountList/accountListState.d.ts +1 -1
- package/lib/view/accountList/fetchAccountListEpic.js +16 -7
- package/lib/view/commonVendorView/vendorView/epics/saveVendorEpic.js +1 -0
- package/lib/view/commonVendorView/vendorView/epics/twoFactorAuth/verifyUserEpic.d.ts +2 -2
- package/lib/view/commonVendorView/vendorView/epics/twoFactorAuth/verifyUserEpic.js +2 -2
- package/lib/view/commonVendorView/vendorView/vendorViewReducer.d.ts +4 -9
- package/lib/view/commonVendorView/vendorView/vendorViewReducer.js +41 -70
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +2 -2
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +2 -9
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +70 -102
- package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
- package/lib/view/people/deletePersonEpic.d.ts +1 -1
- package/lib/view/people/invitePeopleEpic.d.ts +1 -1
- package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
- package/lib/view/people/resendInviteEpic.d.ts +1 -1
- package/lib/view/settingsView/epic/fetchBankAccountsListEpic.d.ts +22 -0
- package/lib/view/settingsView/epic/fetchBankAccountsListEpic.js +30 -0
- package/lib/view/settingsView/epic/fetchBankConnectionsViewEpic.d.ts +6 -0
- package/lib/view/settingsView/epic/fetchBankConnectionsViewEpic.js +14 -0
- package/lib/view/settingsView/epic/fetchMyProfileEpic.d.ts +43 -0
- package/lib/view/settingsView/epic/fetchMyProfileEpic.js +50 -0
- package/lib/view/settingsView/epic/fetchMyProfileViewEpic.d.ts +7 -0
- package/lib/view/settingsView/epic/fetchMyProfileViewEpic.js +17 -0
- package/lib/view/settingsView/settingsViewPayload.d.ts +8 -0
- package/lib/view/settingsView/settingsViewReducer.d.ts +13 -0
- package/lib/view/settingsView/settingsViewReducer.js +71 -0
- package/lib/view/settingsView/settingsViewSelector.d.ts +14 -0
- package/lib/view/settingsView/settingsViewSelector.js +119 -0
- package/lib/view/settingsView/settingsViewState.d.ts +12 -0
- package/lib/view/settingsView/settingsViewState.js +2 -0
- package/lib/view/settingsView/types/settingsViewSelectorTypes.d.ts +29 -0
- package/lib/view/settingsView/types/settingsViewSelectorTypes.js +2 -0
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewPayload.d.ts +3 -0
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.d.ts +5 -0
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.js +13 -2
- package/lib/view/spendManagement/billPay/billDetailView/epics/cancelAndDeleteBillEpic.d.ts +2 -1
- package/lib/view/spendManagement/billPay/billDetailView/epics/cancelAndDeleteBillEpic.js +19 -8
- package/lib/view/spendManagement/billPay/billDetailView/epics/deleteBillEpic.d.ts +2 -1
- package/lib/view/spendManagement/billPay/billDetailView/epics/deleteBillEpic.js +14 -4
- package/lib/view/spendManagement/billPay/billDetailView/epics/fetchBillDetailEpic.d.ts +2 -1
- package/lib/view/spendManagement/billPay/billDetailView/epics/fetchBillDetailEpic.js +5 -2
- package/lib/view/spendManagement/billPay/billList/billListPayload.d.ts +2 -0
- package/lib/view/spendManagement/billPay/billList/billListSelector.d.ts +3 -0
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +10 -2
- package/lib/view/spendManagement/billPay/billList/fetchBillListPerTabEpic.d.ts +2 -1
- package/lib/view/spendManagement/billPay/billList/fetchBillListPerTabEpic.js +3 -1
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.d.ts +4 -0
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +31 -9
- package/lib/view/spendManagement/billPay/editBillView/editBillViewPayload.d.ts +4 -0
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.js +17 -0
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +10 -2
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +59 -14
- package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +28 -0
- package/lib/view/spendManagement/billPay/editBillView/editBillViewState.js +1 -0
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +3 -3
- package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.js +13 -2
- package/lib/view/spendManagement/billPay/editBillView/epics/parseInvoiceToBillEpic.js +3 -2
- package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.d.ts +11 -24
- package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.js +100 -14
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.d.ts +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +4 -1
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigState.d.ts +2 -2
- 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/chargeCardDetailReducer.d.ts +7 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +25 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +3 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +6 -1
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateChargeCardDetailEpic.d.ts +11 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateChargeCardDetailEpic.js +60 -0
- package/lib/view/spendManagement/commonHistoryView/commonHistory.d.ts +1 -0
- package/lib/view/spendManagement/commonHistoryView/commonHistoryPayload.d.ts +1 -0
- package/lib/view/spendManagement/commonHistoryView/commonHistoryPayload.js +9 -5
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +2 -9
- package/lib/view/spendManagement/commonSetup/setupViewReducer.js +72 -104
- package/lib/view/spendManagement/helpers.d.ts +11 -1
- package/lib/view/spendManagement/helpers.js +134 -1
- package/lib/view/spendManagement/reimbursement/remiDetailView/remiDetailViewSelector.d.ts +1 -0
- package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigPayload.d.ts +1 -0
- package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigPayload.js +1 -0
- package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigReducer.js +3 -1
- package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigSelector.d.ts +1 -0
- package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigSelector.js +2 -1
- package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigState.d.ts +1 -0
- package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +10 -0
- package/lib/view/twoFactorAuthentication/resendOtpEpic.js +90 -0
- package/lib/view/twoFactorAuthentication/sendOtpEpic.d.ts +10 -0
- package/lib/view/twoFactorAuthentication/sendOtpEpic.js +93 -0
- package/lib/view/twoFactorAuthentication/twoFactorAuthentication.d.ts +16 -0
- package/lib/view/twoFactorAuthentication/twoFactorAuthentication.js +2 -0
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationPayload.d.ts +19 -0
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationPayload.js +11 -0
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationReducer.d.ts +21 -0
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationReducer.js +101 -0
- package/lib/view/twoFactorAuthentication/verifyOtpEpic.d.ts +10 -0
- package/lib/view/twoFactorAuthentication/verifyOtpEpic.js +90 -0
- package/package.json +5 -4
- package/lib/view/commonVendorView/vendorView/epics/twoFactorAuth/vendorViewResendOtpEpic.d.ts +0 -7
- package/lib/view/commonVendorView/vendorView/epics/twoFactorAuth/vendorViewResendOtpEpic.js +0 -24
- package/lib/view/commonVendorView/vendorView/epics/twoFactorAuth/vendorViewSendOtpEpic.d.ts +0 -7
- package/lib/view/commonVendorView/vendorView/epics/twoFactorAuth/vendorViewSendOtpEpic.js +0 -26
- package/lib/view/commonVendorView/vendorView/epics/twoFactorAuth/vendorViewVerifyOtpEpic.d.ts +0 -7
- package/lib/view/commonVendorView/vendorView/epics/twoFactorAuth/vendorViewVerifyOtpEpic.js +0 -28
- package/lib/view/onboardingView/customerView/epic/twoFactorAuthentication/resendOnboardingOfficerOtpEpic.d.ts +0 -7
- package/lib/view/onboardingView/customerView/epic/twoFactorAuthentication/resendOnboardingOfficerOtpEpic.js +0 -24
- package/lib/view/onboardingView/customerView/epic/twoFactorAuthentication/sendOnboardingOfficerOtpEpic.d.ts +0 -7
- package/lib/view/onboardingView/customerView/epic/twoFactorAuthentication/sendOnboardingOfficerOtpEpic.js +0 -27
- package/lib/view/onboardingView/customerView/epic/twoFactorAuthentication/verifyOnboardingOfficerOtpEpic.d.ts +0 -7
- package/lib/view/onboardingView/customerView/epic/twoFactorAuthentication/verifyOnboardingOfficerOtpEpic.js +0 -30
- package/lib/view/spendManagement/commonSetup/epic/twoFactorAuthentication/resendOtpEpic.d.ts +0 -7
- package/lib/view/spendManagement/commonSetup/epic/twoFactorAuthentication/resendOtpEpic.js +0 -23
- package/lib/view/spendManagement/commonSetup/epic/twoFactorAuthentication/sendOtpEpic.d.ts +0 -7
- package/lib/view/spendManagement/commonSetup/epic/twoFactorAuthentication/sendOtpEpic.js +0 -26
- package/lib/view/spendManagement/commonSetup/epic/twoFactorAuthentication/verifyOtpEpic.d.ts +0 -7
- package/lib/view/spendManagement/commonSetup/epic/twoFactorAuthentication/verifyOtpEpic.js +0 -27
- package/lib/view/spendManagement/commonSetup/types/twoFactorAuthentication.d.ts +0 -10
- /package/lib/view/{spendManagement/commonSetup/types/twoFactorAuthentication.js → settingsView/settingsViewPayload.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearSetupView = exports.clearSetupViewDataInLocalStore = exports.saveIndustryAndIncDateInLocalStore = exports.
|
|
4
|
+
exports.clearSetupView = exports.clearSetupViewDataInLocalStore = exports.saveIndustryAndIncDateInLocalStore = exports.verifyOtpFailureSpendManagementSetUp = exports.verifyOtpSuccessSpendManagementSetUp = exports.verifyOtpSpendManagementSetUp = exports.sendOtpFailureSpendManagementSetUp = exports.sendOtpSuccessSpendManagementSetUp = exports.resendOtpSpendManagementSetUp = exports.sendOtpSpendManagementSetUp = exports.updateSetupViewAccountDetails = exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = exports.saveCompnayOfficerPhoneInLocalStore = exports.saveSetupViewDataInLocalStore = exports.updateSetupViewLocalStoreData = exports.updateSelectedCompanyOfficer = exports.establishPlaidConnectionFailure = exports.establishPlaidConnectionSuccess = exports.establishPlaidConnection = exports.getPlaidLinkTokenFailure = exports.getPlaidLinkTokenSuccess = exports.getPlaidLinkToken = exports.updatePaymentAccountLoginStatusFailure = exports.updatePaymentAccountLoginStatusSuccess = exports.updatePaymentAccountLoginStatus = exports.updatePaymentAccountStatusFailure = exports.updatePaymentAccountStatusSuccess = exports.updatePaymentAccountStatus = exports.updatePaymentAccountFailure = exports.updatePaymentAccountSuccess = exports.updatePaymentAccount = exports.getPaymentAccountsFailure = exports.getPaymentAccountsSuccess = exports.getPaymentAccounts = exports.updateBusinessVerificationDetailsFailure = exports.updateBusinessVerificationDetailsSuccess = exports.updateBusinessVerificationDetails = exports.enableSetupFailure = exports.enableSetupSuccess = exports.enableSetup = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
7
7
|
const initialFetchStatus = {
|
|
@@ -505,100 +505,74 @@ const setupView = (0, toolkit_1.createSlice)({
|
|
|
505
505
|
};
|
|
506
506
|
},
|
|
507
507
|
},
|
|
508
|
-
sendOtp
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
draft.companyOfficerUpdateStatus[officerType].localData
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
});
|
|
524
|
-
},
|
|
525
|
-
prepare(phoneNumber) {
|
|
526
|
-
return { payload: { phoneNumber } };
|
|
527
|
-
},
|
|
508
|
+
sendOtp(draft) {
|
|
509
|
+
Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
|
|
510
|
+
var _a;
|
|
511
|
+
if (draft.companyOfficerUpdateStatus[officerType].localData != null &&
|
|
512
|
+
((_a = draft.companyOfficerUpdateStatus[officerType].localData) === null || _a === void 0 ? void 0 : _a.isSelectedForVerification) === true) {
|
|
513
|
+
draft.companyOfficerUpdateStatus[officerType].sendOtpStatus = {
|
|
514
|
+
fetchState: 'In-Progress',
|
|
515
|
+
error: undefined,
|
|
516
|
+
};
|
|
517
|
+
draft.companyOfficerUpdateStatus[officerType].localData =
|
|
518
|
+
Object.assign({}, draft.companyOfficerUpdateStatus[officerType].localData, {
|
|
519
|
+
isPhoneVerified: false,
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
});
|
|
528
523
|
},
|
|
529
|
-
resendOtp
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
});
|
|
541
|
-
},
|
|
542
|
-
prepare(otpChallenge) {
|
|
543
|
-
return { payload: { otpChallenge } };
|
|
544
|
-
},
|
|
524
|
+
resendOtp(draft) {
|
|
525
|
+
Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
|
|
526
|
+
var _a;
|
|
527
|
+
if (draft.companyOfficerUpdateStatus[officerType].localData != null &&
|
|
528
|
+
((_a = draft.companyOfficerUpdateStatus[officerType].localData) === null || _a === void 0 ? void 0 : _a.isSelectedForVerification) === true) {
|
|
529
|
+
draft.companyOfficerUpdateStatus[officerType].sendOtpStatus = {
|
|
530
|
+
fetchState: 'In-Progress',
|
|
531
|
+
error: undefined,
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
});
|
|
545
535
|
},
|
|
546
|
-
sendOtpSuccess
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
draft.companyOfficerUpdateStatus[officerType].localData
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
});
|
|
562
|
-
},
|
|
563
|
-
prepare(otpChallenge) {
|
|
564
|
-
return { payload: { otpChallenge } };
|
|
565
|
-
},
|
|
536
|
+
sendOtpSuccess(draft, action) {
|
|
537
|
+
Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
|
|
538
|
+
var _a;
|
|
539
|
+
if (draft.companyOfficerUpdateStatus[officerType].localData != null &&
|
|
540
|
+
((_a = draft.companyOfficerUpdateStatus[officerType].localData) === null || _a === void 0 ? void 0 : _a.isSelectedForVerification) === true) {
|
|
541
|
+
draft.companyOfficerUpdateStatus[officerType].sendOtpStatus = {
|
|
542
|
+
fetchState: 'Completed',
|
|
543
|
+
error: undefined,
|
|
544
|
+
};
|
|
545
|
+
draft.companyOfficerUpdateStatus[officerType].localData =
|
|
546
|
+
Object.assign({}, draft.companyOfficerUpdateStatus[officerType].localData, {
|
|
547
|
+
otpChallenge: action.payload.otpChallenge,
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
});
|
|
566
551
|
},
|
|
567
|
-
sendOtpFailure
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
});
|
|
579
|
-
},
|
|
580
|
-
prepare(error) {
|
|
581
|
-
return {
|
|
582
|
-
payload: error,
|
|
583
|
-
};
|
|
584
|
-
},
|
|
552
|
+
sendOtpFailure(draft, action) {
|
|
553
|
+
Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
|
|
554
|
+
var _a;
|
|
555
|
+
if (draft.companyOfficerUpdateStatus[officerType].localData != null &&
|
|
556
|
+
((_a = draft.companyOfficerUpdateStatus[officerType].localData) === null || _a === void 0 ? void 0 : _a.isSelectedForVerification) === true) {
|
|
557
|
+
draft.companyOfficerUpdateStatus[officerType].sendOtpStatus = {
|
|
558
|
+
fetchState: 'Error',
|
|
559
|
+
error: action.payload,
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
});
|
|
585
563
|
},
|
|
586
|
-
verifyOtp
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
564
|
+
verifyOtp(draft) {
|
|
565
|
+
Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
|
|
566
|
+
var _a;
|
|
567
|
+
if (draft.companyOfficerUpdateStatus[officerType].localData != null &&
|
|
568
|
+
((_a = draft.companyOfficerUpdateStatus[officerType].localData) === null || _a === void 0 ? void 0 : _a.isSelectedForVerification) === true) {
|
|
569
|
+
draft.companyOfficerUpdateStatus[officerType].otpverificationStatus =
|
|
570
|
+
{
|
|
593
571
|
fetchState: 'In-Progress',
|
|
594
572
|
error: undefined,
|
|
595
573
|
};
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
},
|
|
599
|
-
prepare(otpCode, otpChallenge) {
|
|
600
|
-
return { payload: { otpCode, otpChallenge } };
|
|
601
|
-
},
|
|
574
|
+
}
|
|
575
|
+
});
|
|
602
576
|
},
|
|
603
577
|
verifyOtpSuccess(draft) {
|
|
604
578
|
Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
|
|
@@ -617,24 +591,18 @@ const setupView = (0, toolkit_1.createSlice)({
|
|
|
617
591
|
}
|
|
618
592
|
});
|
|
619
593
|
},
|
|
620
|
-
verifyOtpFailure
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
594
|
+
verifyOtpFailure(draft, action) {
|
|
595
|
+
Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
|
|
596
|
+
var _a;
|
|
597
|
+
if (draft.companyOfficerUpdateStatus[officerType].localData != null &&
|
|
598
|
+
((_a = draft.companyOfficerUpdateStatus[officerType].localData) === null || _a === void 0 ? void 0 : _a.isSelectedForVerification) === true) {
|
|
599
|
+
draft.companyOfficerUpdateStatus[officerType].otpverificationStatus =
|
|
600
|
+
{
|
|
627
601
|
fetchState: 'Error',
|
|
628
602
|
error: action.payload,
|
|
629
603
|
};
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
},
|
|
633
|
-
prepare(error) {
|
|
634
|
-
return {
|
|
635
|
-
payload: error,
|
|
636
|
-
};
|
|
637
|
-
},
|
|
604
|
+
}
|
|
605
|
+
});
|
|
638
606
|
},
|
|
639
607
|
saveIndustryAndIncDateInLocalStore(draft, action) {
|
|
640
608
|
if (draft.companyDetails.localData != null) {
|
|
@@ -651,5 +619,5 @@ const setupView = (0, toolkit_1.createSlice)({
|
|
|
651
619
|
},
|
|
652
620
|
},
|
|
653
621
|
});
|
|
654
|
-
_a = setupView.actions, exports.enableSetup = _a.enableSetup, exports.enableSetupSuccess = _a.enableSetupSuccess, exports.enableSetupFailure = _a.enableSetupFailure, exports.updateBusinessVerificationDetails = _a.updateBusinessVerificationDetails, exports.updateBusinessVerificationDetailsSuccess = _a.updateBusinessVerificationDetailsSuccess, exports.updateBusinessVerificationDetailsFailure = _a.updateBusinessVerificationDetailsFailure, exports.getPaymentAccounts = _a.getPaymentAccounts, exports.getPaymentAccountsSuccess = _a.getPaymentAccountsSuccess, exports.getPaymentAccountsFailure = _a.getPaymentAccountsFailure, exports.updatePaymentAccount = _a.updatePaymentAccount, exports.updatePaymentAccountSuccess = _a.updatePaymentAccountSuccess, exports.updatePaymentAccountFailure = _a.updatePaymentAccountFailure, exports.updatePaymentAccountStatus = _a.updatePaymentAccountStatus, exports.updatePaymentAccountStatusSuccess = _a.updatePaymentAccountStatusSuccess, exports.updatePaymentAccountStatusFailure = _a.updatePaymentAccountStatusFailure, exports.updatePaymentAccountLoginStatus = _a.updatePaymentAccountLoginStatus, exports.updatePaymentAccountLoginStatusSuccess = _a.updatePaymentAccountLoginStatusSuccess, exports.updatePaymentAccountLoginStatusFailure = _a.updatePaymentAccountLoginStatusFailure, exports.getPlaidLinkToken = _a.getPlaidLinkToken, exports.getPlaidLinkTokenSuccess = _a.getPlaidLinkTokenSuccess, exports.getPlaidLinkTokenFailure = _a.getPlaidLinkTokenFailure, exports.establishPlaidConnection = _a.establishPlaidConnection, exports.establishPlaidConnectionSuccess = _a.establishPlaidConnectionSuccess, exports.establishPlaidConnectionFailure = _a.establishPlaidConnectionFailure, exports.updateSelectedCompanyOfficer = _a.updateSelectedCompanyOfficer, exports.updateSetupViewLocalStoreData = _a.updateSetupViewLocalStoreData, exports.saveSetupViewDataInLocalStore = _a.saveSetupViewDataInLocalStore, exports.saveCompnayOfficerPhoneInLocalStore = _a.saveCompnayOfficerPhoneInLocalStore, exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = _a.saveCompnayOfficerAdditionalDocumentsInLocalStore, exports.updateSetupViewAccountDetails = _a.updateSetupViewAccountDetails, exports.
|
|
622
|
+
_a = setupView.actions, exports.enableSetup = _a.enableSetup, exports.enableSetupSuccess = _a.enableSetupSuccess, exports.enableSetupFailure = _a.enableSetupFailure, exports.updateBusinessVerificationDetails = _a.updateBusinessVerificationDetails, exports.updateBusinessVerificationDetailsSuccess = _a.updateBusinessVerificationDetailsSuccess, exports.updateBusinessVerificationDetailsFailure = _a.updateBusinessVerificationDetailsFailure, exports.getPaymentAccounts = _a.getPaymentAccounts, exports.getPaymentAccountsSuccess = _a.getPaymentAccountsSuccess, exports.getPaymentAccountsFailure = _a.getPaymentAccountsFailure, exports.updatePaymentAccount = _a.updatePaymentAccount, exports.updatePaymentAccountSuccess = _a.updatePaymentAccountSuccess, exports.updatePaymentAccountFailure = _a.updatePaymentAccountFailure, exports.updatePaymentAccountStatus = _a.updatePaymentAccountStatus, exports.updatePaymentAccountStatusSuccess = _a.updatePaymentAccountStatusSuccess, exports.updatePaymentAccountStatusFailure = _a.updatePaymentAccountStatusFailure, exports.updatePaymentAccountLoginStatus = _a.updatePaymentAccountLoginStatus, exports.updatePaymentAccountLoginStatusSuccess = _a.updatePaymentAccountLoginStatusSuccess, exports.updatePaymentAccountLoginStatusFailure = _a.updatePaymentAccountLoginStatusFailure, exports.getPlaidLinkToken = _a.getPlaidLinkToken, exports.getPlaidLinkTokenSuccess = _a.getPlaidLinkTokenSuccess, exports.getPlaidLinkTokenFailure = _a.getPlaidLinkTokenFailure, exports.establishPlaidConnection = _a.establishPlaidConnection, exports.establishPlaidConnectionSuccess = _a.establishPlaidConnectionSuccess, exports.establishPlaidConnectionFailure = _a.establishPlaidConnectionFailure, exports.updateSelectedCompanyOfficer = _a.updateSelectedCompanyOfficer, exports.updateSetupViewLocalStoreData = _a.updateSetupViewLocalStoreData, exports.saveSetupViewDataInLocalStore = _a.saveSetupViewDataInLocalStore, exports.saveCompnayOfficerPhoneInLocalStore = _a.saveCompnayOfficerPhoneInLocalStore, exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = _a.saveCompnayOfficerAdditionalDocumentsInLocalStore, exports.updateSetupViewAccountDetails = _a.updateSetupViewAccountDetails, exports.sendOtpSpendManagementSetUp = _a.sendOtp, exports.resendOtpSpendManagementSetUp = _a.resendOtp, exports.sendOtpSuccessSpendManagementSetUp = _a.sendOtpSuccess, exports.sendOtpFailureSpendManagementSetUp = _a.sendOtpFailure, exports.verifyOtpSpendManagementSetUp = _a.verifyOtp, exports.verifyOtpSuccessSpendManagementSetUp = _a.verifyOtpSuccess, exports.verifyOtpFailureSpendManagementSetUp = _a.verifyOtpFailure, exports.saveIndustryAndIncDateInLocalStore = _a.saveIndustryAndIncDateInLocalStore, exports.clearSetupViewDataInLocalStore = _a.clearSetupViewDataInLocalStore, exports.clearSetupView = _a.clearSetupView;
|
|
655
623
|
exports.default = setupView.reducer;
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { ZeniDate } from '../../zeniDayJS';
|
|
2
2
|
import { BillActivity } from './billPay/billDetailView/billDetailViewSelector';
|
|
3
|
-
import { BusinessVerificationDetails, CompanyOfficersDetails } from './commonSetup/setupViewSelector';
|
|
4
3
|
import { RemiActivity } from './reimbursement/remiDetailView/remiDetailViewSelector';
|
|
4
|
+
import { BusinessVerificationDetails, CompanyOfficersDetails } from './commonSetup/setupViewSelector';
|
|
5
|
+
import { RecurringBillConfigLocalData, RecurringBillInstance } from './billPay/editBillView/editBillViewState';
|
|
6
|
+
import { RecurringBillConfig, RecurringBillFrequency } from '../../entity/billPay/recurringBills/recurringBillsState';
|
|
5
7
|
export declare const getLatestApprovalDate: (allActivities: BillActivity[] | RemiActivity[]) => ZeniDate | undefined;
|
|
6
8
|
export declare function getSpendManagementEffectiveListPeriod(): import("../..").TimePeriod;
|
|
7
9
|
export declare const getSelectedCompanyOfficer: (verificationDetails: BusinessVerificationDetails) => CompanyOfficersDetails | undefined;
|
|
10
|
+
export declare const getPaymentDateFromVendorReceiveDate: (vendorReceiveDate: ZeniDate, maxPaymentProcessingDays: number) => ZeniDate;
|
|
11
|
+
export declare const updateRecurringBillDetails: (currentRecurringConfig: RecurringBillConfigLocalData, prevRecurringConfig?: RecurringBillConfigLocalData | undefined, currentInstances?: RecurringBillInstance[] | undefined, currentBillAmount?: number | undefined) => {
|
|
12
|
+
recurringConfig: RecurringBillConfigLocalData;
|
|
13
|
+
recurringInstances: RecurringBillInstance[] | undefined;
|
|
14
|
+
};
|
|
15
|
+
export declare const isRecurringConfigChanged: (recurringBillNewConfig: RecurringBillConfigLocalData, originalRecurringBillConfig: Partial<RecurringBillConfig>, checkApprovalChange: boolean) => boolean;
|
|
16
|
+
export declare const getTotalPayments: (startDate: ZeniDate, endDate: ZeniDate, frequency: RecurringBillFrequency, currentInstance?: RecurringBillInstance | undefined) => number;
|
|
17
|
+
export declare const getEndDate: (startDate: ZeniDate, frequency: RecurringBillFrequency, totalPayments: number, currentInstance?: RecurringBillInstance | undefined) => ZeniDate;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSelectedCompanyOfficer = exports.getSpendManagementEffectiveListPeriod = exports.getLatestApprovalDate = void 0;
|
|
3
|
+
exports.getEndDate = exports.getTotalPayments = exports.isRecurringConfigChanged = exports.updateRecurringBillDetails = exports.getPaymentDateFromVendorReceiveDate = exports.getSelectedCompanyOfficer = exports.getSpendManagementEffectiveListPeriod = exports.getLatestApprovalDate = void 0;
|
|
4
4
|
const timeframeTick_1 = require("../../commonStateTypes/timeframeTick");
|
|
5
5
|
const workingDayHelper_1 = require("../../commonStateTypes/workingDayHelper");
|
|
6
6
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
@@ -45,3 +45,136 @@ const getSelectedCompanyOfficer = (verificationDetails) => {
|
|
|
45
45
|
return officer;
|
|
46
46
|
};
|
|
47
47
|
exports.getSelectedCompanyOfficer = getSelectedCompanyOfficer;
|
|
48
|
+
const getPaymentDateFromVendorReceiveDate = (vendorReceiveDate, maxPaymentProcessingDays) => {
|
|
49
|
+
let paymentDate = vendorReceiveDate.subtract(maxPaymentProcessingDays, 'day');
|
|
50
|
+
while ((0, workingDayHelper_1.isHoliday)(paymentDate.toDate()) === true) {
|
|
51
|
+
paymentDate = paymentDate.subtract(1, 'day');
|
|
52
|
+
}
|
|
53
|
+
return paymentDate;
|
|
54
|
+
};
|
|
55
|
+
exports.getPaymentDateFromVendorReceiveDate = getPaymentDateFromVendorReceiveDate;
|
|
56
|
+
const updateRecurringBillDetails = (currentRecurringConfig, prevRecurringConfig, currentInstances, currentBillAmount) => {
|
|
57
|
+
var _a;
|
|
58
|
+
let updatedRecurringInstances = [];
|
|
59
|
+
const { startDate, endDate, frequency, totalPaymentCycles, endDateSelectorOptionType, } = currentRecurringConfig;
|
|
60
|
+
if (frequency == null ||
|
|
61
|
+
startDate == null ||
|
|
62
|
+
(totalPaymentCycles === 0 && endDate == null) ||
|
|
63
|
+
(prevRecurringConfig != null &&
|
|
64
|
+
prevRecurringConfig.isActive &&
|
|
65
|
+
!(0, exports.isRecurringConfigChanged)(currentRecurringConfig, prevRecurringConfig, false))) {
|
|
66
|
+
return {
|
|
67
|
+
recurringConfig: currentRecurringConfig,
|
|
68
|
+
recurringInstances: currentInstances,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
let currentEndDate = endDate;
|
|
72
|
+
let currentTotalPayments = totalPaymentCycles;
|
|
73
|
+
const currentInstance = currentInstances === null || currentInstances === void 0 ? void 0 : currentInstances.find((instance) => Boolean(instance.readonly) === false);
|
|
74
|
+
//TBR check if endDate or totalPayments to be preserved for change in frequency/startDate
|
|
75
|
+
if (prevRecurringConfig != null &&
|
|
76
|
+
endDateSelectorOptionType == null &&
|
|
77
|
+
(0, exports.isRecurringConfigChanged)(currentRecurringConfig, prevRecurringConfig, false) &&
|
|
78
|
+
endDate != null &&
|
|
79
|
+
totalPaymentCycles !== 0) {
|
|
80
|
+
currentTotalPayments = (0, exports.getTotalPayments)(startDate, endDate, frequency, currentInstance);
|
|
81
|
+
}
|
|
82
|
+
else if (endDate == null || endDateSelectorOptionType === 'payments') {
|
|
83
|
+
currentEndDate = (0, exports.getEndDate)(startDate, frequency, totalPaymentCycles, currentInstance);
|
|
84
|
+
}
|
|
85
|
+
else if (totalPaymentCycles === 0 || endDateSelectorOptionType === 'date') {
|
|
86
|
+
currentTotalPayments = (0, exports.getTotalPayments)(startDate, endDate, frequency, currentInstance);
|
|
87
|
+
}
|
|
88
|
+
//editRecurringBill
|
|
89
|
+
if (currentRecurringConfig.isActive &&
|
|
90
|
+
currentInstances != null &&
|
|
91
|
+
currentInstances.length !== 0 &&
|
|
92
|
+
currentInstance != null) {
|
|
93
|
+
const pastInstances = currentInstances.filter((bill) => bill.readonly === true);
|
|
94
|
+
const futureTotalPayments = currentTotalPayments - pastInstances.length;
|
|
95
|
+
const billAmountForFutureInstances = (_a = currentInstances[pastInstances.length + 1]) === null || _a === void 0 ? void 0 : _a.amount;
|
|
96
|
+
updatedRecurringInstances = [
|
|
97
|
+
...pastInstances,
|
|
98
|
+
currentInstance,
|
|
99
|
+
...getRecurringBillInstances(currentInstances[pastInstances.length].vendorReceiveDate, frequency, futureTotalPayments, pastInstances.length + 1, billAmountForFutureInstances !== null && billAmountForFutureInstances !== void 0 ? billAmountForFutureInstances : currentBillAmount).slice(1),
|
|
100
|
+
];
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
//createRecurringBill
|
|
104
|
+
updatedRecurringInstances = getRecurringBillInstances(startDate, frequency, currentTotalPayments, 1, currentBillAmount);
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
recurringConfig: Object.assign(Object.assign({}, currentRecurringConfig), { endDate: currentEndDate, totalPaymentCycles: currentTotalPayments }),
|
|
108
|
+
recurringInstances: updatedRecurringInstances,
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
exports.updateRecurringBillDetails = updateRecurringBillDetails;
|
|
112
|
+
const isRecurringConfigChanged = (recurringBillNewConfig, originalRecurringBillConfig, checkApprovalChange) => {
|
|
113
|
+
const { isApprovalRequired: isApprovalRequiredNew, endDate: endDateNew, frequency: frequencyNew, totalPaymentCycles: totalPaymentCyclesNew, } = recurringBillNewConfig;
|
|
114
|
+
const { isApprovalRequired, endDate, frequency, totalPaymentCycles } = originalRecurringBillConfig;
|
|
115
|
+
return ((endDateNew === null || endDateNew === void 0 ? void 0 : endDateNew.toString()) !== (endDate === null || endDate === void 0 ? void 0 : endDate.toString()) ||
|
|
116
|
+
frequencyNew !== frequency ||
|
|
117
|
+
totalPaymentCyclesNew !== totalPaymentCycles ||
|
|
118
|
+
(checkApprovalChange ? isApprovalRequiredNew !== isApprovalRequired : false));
|
|
119
|
+
};
|
|
120
|
+
exports.isRecurringConfigChanged = isRecurringConfigChanged;
|
|
121
|
+
const getTotalPayments = (startDate, endDate, frequency, currentInstance) => {
|
|
122
|
+
let currentStartDate = startDate;
|
|
123
|
+
let pastPayments = 0;
|
|
124
|
+
if ((currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.instance) != null && (currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.instance) > 1) {
|
|
125
|
+
currentStartDate = currentInstance.vendorReceiveDate;
|
|
126
|
+
pastPayments = currentInstance.instance - 1;
|
|
127
|
+
}
|
|
128
|
+
let totalPayments = 0;
|
|
129
|
+
const offSetValue = getRecurringFrequencyInDays(frequency);
|
|
130
|
+
totalPayments = endDate.diff(currentStartDate, 'day') / offSetValue;
|
|
131
|
+
return Math.floor(totalPayments + pastPayments) + 1; //+1 to include startDate
|
|
132
|
+
};
|
|
133
|
+
exports.getTotalPayments = getTotalPayments;
|
|
134
|
+
const getEndDate = (startDate, frequency, totalPayments, currentInstance) => {
|
|
135
|
+
let currentStartDate = startDate;
|
|
136
|
+
let endDate = currentStartDate;
|
|
137
|
+
let currentTotalPayments = totalPayments;
|
|
138
|
+
if ((currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.instance) != null && (currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.instance) > 1) {
|
|
139
|
+
currentStartDate = currentInstance.vendorReceiveDate;
|
|
140
|
+
currentTotalPayments = totalPayments - currentInstance.instance + 1;
|
|
141
|
+
}
|
|
142
|
+
const offSetValue = getRecurringFrequencyInDays(frequency);
|
|
143
|
+
endDate = currentStartDate.add(offSetValue * (currentTotalPayments - 1), 'day');
|
|
144
|
+
return endDate;
|
|
145
|
+
};
|
|
146
|
+
exports.getEndDate = getEndDate;
|
|
147
|
+
function getRecurringBillInstances(startDate, frequency, totalPayments, currentInstance, billAmount) {
|
|
148
|
+
const updatedInstances = [];
|
|
149
|
+
const offSetValue = getRecurringFrequencyInDays(frequency);
|
|
150
|
+
for (let i = 0; i < totalPayments; i++) {
|
|
151
|
+
updatedInstances.push(Object.assign({ instance: currentInstance + i, amount: billAmount }, checkIfHolidayAndGetNextDate(startDate.add(i * offSetValue, 'day'))));
|
|
152
|
+
}
|
|
153
|
+
return updatedInstances;
|
|
154
|
+
}
|
|
155
|
+
function getRecurringFrequencyInDays(frequency) {
|
|
156
|
+
switch (frequency) {
|
|
157
|
+
case 'weekly':
|
|
158
|
+
return 7;
|
|
159
|
+
case 'biweekly':
|
|
160
|
+
return 14;
|
|
161
|
+
case 'monthly':
|
|
162
|
+
return 30;
|
|
163
|
+
case 'quarterly':
|
|
164
|
+
return 90;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
function checkIfHolidayAndGetNextDate(date) {
|
|
168
|
+
const isHolidayMessage = 'is a holiday';
|
|
169
|
+
let newDate = date;
|
|
170
|
+
while ((0, workingDayHelper_1.isHoliday)(newDate.toDate()) === true) {
|
|
171
|
+
newDate = newDate.subtract(1, 'day');
|
|
172
|
+
}
|
|
173
|
+
if (newDate !== date) {
|
|
174
|
+
return {
|
|
175
|
+
vendorReceiveDate: newDate,
|
|
176
|
+
vendorReceiveDateNotes: `${date.format('MMM DD, YYYY')} ${isHolidayMessage}`,
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
return { vendorReceiveDate: date, vendorReceiveDateNotes: '' };
|
|
180
|
+
}
|
package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigPayload.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { AddressPayload } from '../../../../entity/address/addressPayload';
|
|
|
2
2
|
import { ZeniAPIResponse } from '../../../../responsePayload';
|
|
3
3
|
import { ZeniAccountsConfig, DepositProductConfig } from './zeniAccountsConfigState';
|
|
4
4
|
export interface ZeniAccountsConfigPayload {
|
|
5
|
+
apy: string | null;
|
|
5
6
|
bank_name: string;
|
|
6
7
|
deposit_product_config: DepositProductConfigPayload;
|
|
7
8
|
mailing_address: AddressPayload;
|
package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigPayload.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mapDepositProductConfigPayloadToDepositProductConfig = exports.mapZeniAccountsConfigPayloadToZeniAccountsConfigState = void 0;
|
|
4
4
|
const mapZeniAccountsConfigPayloadToZeniAccountsConfigState = (payload) => ({
|
|
5
|
+
annualPercentageYield: payload.apy != null ? payload.apy : '',
|
|
5
6
|
bankName: payload.bank_name,
|
|
6
7
|
mailingAddressId: payload.mailing_address.address_id,
|
|
7
8
|
bankAddressId: payload.bank_address.address_id,
|
package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigReducer.js
CHANGED
|
@@ -6,6 +6,7 @@ const toolkit_1 = require("@reduxjs/toolkit");
|
|
|
6
6
|
const zeniAccountsConfigPayload_1 = require("./zeniAccountsConfigPayload");
|
|
7
7
|
exports.initialState = {
|
|
8
8
|
zeniAccountsConfig: {
|
|
9
|
+
annualPercentageYield: '',
|
|
9
10
|
bankName: '',
|
|
10
11
|
mailingAddressId: '',
|
|
11
12
|
bankAddressId: '',
|
|
@@ -28,8 +29,9 @@ const zeniAccountsConfig = (0, toolkit_1.createSlice)({
|
|
|
28
29
|
draft.error = undefined;
|
|
29
30
|
},
|
|
30
31
|
updateZeniAccountsConfigSuccess(draft, action) {
|
|
31
|
-
const { bankName, mailingAddressId, bankAddressId, depositProductConfig } = (0, zeniAccountsConfigPayload_1.mapZeniAccountsConfigPayloadToZeniAccountsConfigState)(action.payload);
|
|
32
|
+
const { bankName, mailingAddressId, bankAddressId, depositProductConfig, annualPercentageYield, } = (0, zeniAccountsConfigPayload_1.mapZeniAccountsConfigPayloadToZeniAccountsConfigState)(action.payload);
|
|
32
33
|
draft.zeniAccountsConfig = {
|
|
34
|
+
annualPercentageYield,
|
|
33
35
|
bankName,
|
|
34
36
|
mailingAddressId,
|
|
35
37
|
bankAddressId,
|
package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigSelector.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { RootState } from '../../../../reducer';
|
|
|
4
4
|
import { DepositProductConfig } from './zeniAccountsConfigState';
|
|
5
5
|
export interface ZeniAccountsConfigSelectorView extends SelectorView {
|
|
6
6
|
zeniAccountsConfigDetail: {
|
|
7
|
+
annualPercentageYield: string;
|
|
7
8
|
bankName: string;
|
|
8
9
|
depositProductConfig: DepositProductConfig;
|
|
9
10
|
mailingAddress?: Address;
|
package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigSelector.js
CHANGED
|
@@ -4,11 +4,12 @@ exports.getZeniAccountsConfigDetail = void 0;
|
|
|
4
4
|
const addressSelector_1 = require("../../../../entity/address/addressSelector");
|
|
5
5
|
const getZeniAccountsConfigDetail = (state) => {
|
|
6
6
|
const { zeniAccountsConfigState, addressState } = state;
|
|
7
|
-
const { bankName, depositProductConfig, bankAddressId, mailingAddressId } = zeniAccountsConfigState.zeniAccountsConfig;
|
|
7
|
+
const { bankName, depositProductConfig, bankAddressId, mailingAddressId, annualPercentageYield, } = zeniAccountsConfigState.zeniAccountsConfig;
|
|
8
8
|
const mailingAddress = (0, addressSelector_1.getAddressByAddressId)(addressState, mailingAddressId);
|
|
9
9
|
const bankAddress = (0, addressSelector_1.getAddressByAddressId)(addressState, bankAddressId);
|
|
10
10
|
return {
|
|
11
11
|
zeniAccountsConfigDetail: {
|
|
12
|
+
annualPercentageYield,
|
|
12
13
|
bankName: bankName,
|
|
13
14
|
depositProductConfig: depositProductConfig,
|
|
14
15
|
mailingAddress,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../zeniAPI';
|
|
5
|
+
import { resendOtp, sendOtpSuccess, sendOtpFailure } from './twoFactorAuthenticationReducer';
|
|
6
|
+
import { resendOtpSpendManagementSetUp, sendOtpFailureSpendManagementSetUp, sendOtpSuccessSpendManagementSetUp } from '../spendManagement/commonSetup/setupViewReducer';
|
|
7
|
+
import { resendOtpVendorView, sendOtpVendorViewSuccess, sendOtpVendorViewFailure } from '../commonVendorView/vendorView/vendorViewReducer';
|
|
8
|
+
import { resendOnboardingOfficerOtp, sendOnboardingOfficerOtpFailure, sendOnboardingOfficerOtpSuccess } from '../onboardingView/customerView/onboardingCustomerViewReducer';
|
|
9
|
+
export declare type ActionType = ReturnType<typeof resendOtp> | ReturnType<typeof sendOtpSuccess> | ReturnType<typeof sendOtpFailure> | ReturnType<typeof resendOtpSpendManagementSetUp> | ReturnType<typeof sendOtpSuccessSpendManagementSetUp> | ReturnType<typeof sendOtpFailureSpendManagementSetUp> | ReturnType<typeof resendOtpVendorView> | ReturnType<typeof sendOtpVendorViewSuccess> | ReturnType<typeof sendOtpVendorViewFailure> | ReturnType<typeof resendOnboardingOfficerOtp> | ReturnType<typeof sendOnboardingOfficerOtpSuccess> | ReturnType<typeof sendOnboardingOfficerOtpFailure>;
|
|
10
|
+
export declare const resendOtpEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resendOtpEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../responsePayload");
|
|
7
|
+
const twoFactorAuthenticationReducer_1 = require("./twoFactorAuthenticationReducer");
|
|
8
|
+
const setupViewReducer_1 = require("../spendManagement/commonSetup/setupViewReducer");
|
|
9
|
+
const vendorViewReducer_1 = require("../commonVendorView/vendorView/vendorViewReducer");
|
|
10
|
+
const onboardingCustomerViewReducer_1 = require("../onboardingView/customerView/onboardingCustomerViewReducer");
|
|
11
|
+
const resendOtpEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(twoFactorAuthenticationReducer_1.resendOtp.match), (0, operators_1.mergeMap)((action) => {
|
|
12
|
+
const resendOtpActions = [];
|
|
13
|
+
const { otpChallenge, twoFASource } = action.payload;
|
|
14
|
+
const payload = {
|
|
15
|
+
otp_challenge: otpChallenge,
|
|
16
|
+
is_for_charge_cards: twoFASource === 'ChargeCard',
|
|
17
|
+
};
|
|
18
|
+
switch (twoFASource) {
|
|
19
|
+
case 'SpendManagementSetup':
|
|
20
|
+
resendOtpActions.push((0, setupViewReducer_1.resendOtpSpendManagementSetUp)());
|
|
21
|
+
break;
|
|
22
|
+
case 'BillPayVendor':
|
|
23
|
+
resendOtpActions.push((0, vendorViewReducer_1.resendOtpVendorView)());
|
|
24
|
+
break;
|
|
25
|
+
case 'CustomerOnboarding':
|
|
26
|
+
resendOtpActions.push((0, onboardingCustomerViewReducer_1.resendOnboardingOfficerOtp)());
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
const resendOtp$ = zeniAPI
|
|
30
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.authMicroServiceBaseUrl}/1.0/otp/resend`, payload)
|
|
31
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
32
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
33
|
+
const updateActions = [
|
|
34
|
+
(0, twoFactorAuthenticationReducer_1.sendOtpSuccess)({ otpChallenge: response.data.otp_challenge }),
|
|
35
|
+
];
|
|
36
|
+
switch (twoFASource) {
|
|
37
|
+
case 'SpendManagementSetup':
|
|
38
|
+
updateActions.push((0, setupViewReducer_1.sendOtpSuccessSpendManagementSetUp)({
|
|
39
|
+
otpChallenge: response.data.otp_challenge,
|
|
40
|
+
}));
|
|
41
|
+
break;
|
|
42
|
+
case 'BillPayVendor':
|
|
43
|
+
updateActions.push((0, vendorViewReducer_1.sendOtpVendorViewSuccess)({
|
|
44
|
+
otpChallenge: response.data.otp_challenge,
|
|
45
|
+
}));
|
|
46
|
+
break;
|
|
47
|
+
case 'CustomerOnboarding':
|
|
48
|
+
updateActions.push((0, onboardingCustomerViewReducer_1.sendOnboardingOfficerOtpSuccess)({
|
|
49
|
+
otpChallenge: response.data.otp_challenge,
|
|
50
|
+
}));
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
return (0, rxjs_1.from)(updateActions);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
const updateActions = [
|
|
57
|
+
(0, twoFactorAuthenticationReducer_1.sendOtpFailure)(response.status),
|
|
58
|
+
];
|
|
59
|
+
switch (twoFASource) {
|
|
60
|
+
case 'SpendManagementSetup':
|
|
61
|
+
updateActions.push((0, setupViewReducer_1.sendOtpFailureSpendManagementSetUp)(response.status));
|
|
62
|
+
break;
|
|
63
|
+
case 'BillPayVendor':
|
|
64
|
+
updateActions.push((0, vendorViewReducer_1.sendOtpVendorViewFailure)(response.status));
|
|
65
|
+
break;
|
|
66
|
+
case 'CustomerOnboarding':
|
|
67
|
+
updateActions.push((0, onboardingCustomerViewReducer_1.sendOnboardingOfficerOtpFailure)(response.status));
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
return (0, rxjs_1.from)(updateActions);
|
|
71
|
+
}
|
|
72
|
+
}), (0, operators_1.catchError)((error) => {
|
|
73
|
+
const zeniAPIStatus = (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Resend otp api errored out' + JSON.stringify(error));
|
|
74
|
+
const updateActions = [(0, twoFactorAuthenticationReducer_1.sendOtpFailure)(zeniAPIStatus)];
|
|
75
|
+
switch (twoFASource) {
|
|
76
|
+
case 'SpendManagementSetup':
|
|
77
|
+
updateActions.push((0, setupViewReducer_1.sendOtpFailureSpendManagementSetUp)(zeniAPIStatus));
|
|
78
|
+
break;
|
|
79
|
+
case 'BillPayVendor':
|
|
80
|
+
updateActions.push((0, vendorViewReducer_1.sendOtpVendorViewFailure)(zeniAPIStatus));
|
|
81
|
+
break;
|
|
82
|
+
case 'CustomerOnboarding':
|
|
83
|
+
updateActions.push((0, onboardingCustomerViewReducer_1.sendOnboardingOfficerOtpFailure)(zeniAPIStatus));
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
return (0, rxjs_1.from)(updateActions);
|
|
87
|
+
}));
|
|
88
|
+
return (0, rxjs_1.concat)((0, rxjs_1.from)(resendOtpActions), resendOtp$);
|
|
89
|
+
}));
|
|
90
|
+
exports.resendOtpEpic = resendOtpEpic;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../zeniAPI';
|
|
5
|
+
import { sendOtp, sendOtpSuccess, sendOtpFailure } from './twoFactorAuthenticationReducer';
|
|
6
|
+
import { sendOtpSpendManagementSetUp, sendOtpSuccessSpendManagementSetUp, sendOtpFailureSpendManagementSetUp } from '../spendManagement/commonSetup/setupViewReducer';
|
|
7
|
+
import { sendOtpVendorView, sendOtpVendorViewSuccess, sendOtpVendorViewFailure } from '../commonVendorView/vendorView/vendorViewReducer';
|
|
8
|
+
import { sendOnboardingOfficerOtp, sendOnboardingOfficerOtpSuccess, sendOnboardingOfficerOtpFailure } from '../onboardingView/customerView/onboardingCustomerViewReducer';
|
|
9
|
+
export declare type ActionType = ReturnType<typeof sendOtp> | ReturnType<typeof sendOtpSuccess> | ReturnType<typeof sendOtpFailure> | ReturnType<typeof sendOtpSpendManagementSetUp> | ReturnType<typeof sendOtpSuccessSpendManagementSetUp> | ReturnType<typeof sendOtpFailureSpendManagementSetUp> | ReturnType<typeof sendOtpVendorView> | ReturnType<typeof sendOtpVendorViewSuccess> | ReturnType<typeof sendOtpVendorViewFailure> | ReturnType<typeof sendOnboardingOfficerOtp> | ReturnType<typeof sendOnboardingOfficerOtpSuccess> | ReturnType<typeof sendOnboardingOfficerOtpFailure>;
|
|
10
|
+
export declare const sendOtpEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|