@zeniai/client-epic-state 4.15.98 → 4.15.99
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/animations.d.ts +1 -1
- package/lib/commonStateTypes/animations.js +1 -1
- package/lib/entity/chargeCard/chargeCard.d.ts +8 -26
- package/lib/entity/chargeCard/chargeCard.js +6 -25
- package/lib/entity/chargeCard/chargeCardPayload.d.ts +5 -41
- package/lib/entity/chargeCard/chargeCardPayload.js +8 -20
- package/lib/entity/chargeCardTransaction/chargeCardTransaction.d.ts +1 -1
- package/lib/entity/chargeCardTransaction/chargeCardTransaction.js +1 -5
- package/lib/entity/company/companyPayload.d.ts +1 -12
- package/lib/entity/company/companyPayload.js +0 -14
- package/lib/entity/company/companyStateTypes.d.ts +0 -11
- package/lib/entity/depositAccount/depositAccount.d.ts +2 -20
- package/lib/entity/depositAccount/depositAccountPayload.d.ts +1 -22
- package/lib/entity/depositAccount/depositAccountPayload.js +1 -39
- package/lib/entity/depositAccount/depositAccountReducer.d.ts +2 -2
- package/lib/entity/depositAccount/depositAccountReducer.js +2 -8
- package/lib/entity/depositAccount/depositAccountSelector.d.ts +1 -3
- package/lib/entity/depositAccount/depositAccountSelector.js +0 -10
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -2
- package/lib/entity/tenant/clearAllEpic.d.ts +1 -2
- package/lib/entity/tenant/clearAllEpic.js +0 -2
- package/lib/entity/tenant/tenantSelector.d.ts +2 -6
- package/lib/entity/tenant/tenantSelector.js +2 -10
- package/lib/epic.d.ts +1 -5
- package/lib/epic.js +1 -5
- package/lib/index.d.ts +18 -18
- package/lib/index.js +17 -26
- package/lib/reducer.d.ts +0 -3
- package/lib/reducer.js +0 -3
- package/lib/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +0 -8
- package/lib/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +0 -16
- package/lib/view/addressView/addressViewState.d.ts +1 -1
- package/lib/view/cashBalance/cashBalancePayload.d.ts +1 -1
- package/lib/view/cashBalance/cashBalanceReducer.js +1 -1
- package/lib/view/dashboard/dashboardSelector.js +6 -7
- package/lib/view/expenseAutomationView/epics/accountRecon/updateReconcileTabLocalDataEpic.js +4 -5
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +2 -1
- package/lib/view/expenseAutomationView/epics/fluxAnalysis/fetchFluxAnalysisViewEpic.js +6 -18
- package/lib/view/expenseAutomationView/epics/fluxAnalysis/reviewFluxAnalysisEpic.js +4 -1
- package/lib/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscatgorizedEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscatgorizedEpic.js +3 -3
- package/lib/view/expenseAutomationView/helpers/helpers.js +4 -4
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +23 -25
- package/lib/view/expenseAutomationView/payload/fluxAnalysisPayload.d.ts +9 -22
- package/lib/view/expenseAutomationView/payload/fluxAnalysisPayload.js +2 -2
- package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.d.ts +5 -13
- package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.js +115 -245
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +18 -12
- package/lib/view/expenseAutomationView/selectorTypes/fluxAnalysisViewSelectorTypes.d.ts +9 -29
- package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +40 -108
- package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.d.ts +15 -40
- package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.js +1 -1
- package/lib/view/onboardingView/cockpitView/epic/initializeOnboardingCustomerViewUpdateDataEpic.js +4 -4
- package/lib/view/onboardingView/cockpitView/onboardingCockpitViewReducer.d.ts +1 -2
- package/lib/view/onboardingView/cockpitView/onboardingCockpitViewReducer.js +2 -2
- package/lib/view/settingsView/settingsViewHelpers.d.ts +4 -4
- package/lib/view/settingsView/settingsViewHelpers.js +8 -9
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +1 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +1 -6
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.js +2 -20
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +0 -5
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +2 -9
- package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +0 -1
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingSelector.js +3 -4
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.d.ts +3 -5
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.js +2 -4
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +3 -8
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigState.d.ts +2 -4
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +0 -12
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.js +0 -26
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailPayload.d.ts +0 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +4 -43
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +9 -104
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +0 -15
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +16 -70
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.d.ts +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +3 -12
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardTransactionListEpic.js +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateChargeCardLimitEpic.js +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -11
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -20
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListPayload.d.ts +1 -16
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +4 -6
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +4 -30
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +2 -5
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +14 -26
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +5 -20
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.d.ts +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.js +2 -4
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.d.ts +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.js +0 -2
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/acceptChargeCardTermsEpic.js +2 -19
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.js +3 -15
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +25 -65
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.d.ts +3 -11
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +11 -45
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.d.ts +3 -6
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +18 -33
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.d.ts +8 -41
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.js +21 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/enableSetupEpic.js +0 -9
- package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js +3 -8
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +4 -4
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +1 -2
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +1 -3
- package/lib/view/spendManagement/commonSetup/setupViewState.js +1 -13
- package/lib/view/spendManagement/helpers.d.ts +0 -3
- package/lib/view/spendManagement/helpers.js +1 -13
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/getPaymentAccountsEpic.js +1 -2
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountEpic.js +1 -2
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountLoginStatusEpic.js +1 -2
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountStatusEpic.js +1 -2
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.d.ts +1 -2
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js +1 -6
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +10 -10
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +0 -1
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +1 -1
- package/lib/view/spendManagement/zeniAccounts/checkDeposit/checkDepositSelector.js +1 -1
- package/lib/view/spendManagement/zeniAccounts/depositAccountList/depositAccountListSelector.d.ts +1 -1
- package/lib/view/spendManagement/zeniAccounts/depositAccountList/depositAccountListSelector.js +3 -3
- package/lib/view/spendManagement/zeniAccounts/expressPay/expressPaySelector.js +1 -1
- package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailSelector.js +1 -1
- package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.js +1 -1
- package/lib/view/transactionDetail/epics/markTransactionAsNotMiscategorizedEpic.d.ts +3 -4
- package/lib/view/transactionDetail/epics/markTransactionAsNotMiscategorizedEpic.js +1 -25
- package/lib/view/transactionDetail/epics/saveTransactionDetailEpic.js +1 -1
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +1 -1
- package/lib/view/transactionDetail/transactionDetailReducer.d.ts +2 -4
- package/lib/view/transactionDetail/transactionDetailReducer.js +2 -4
- package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +2 -3
- package/lib/view/twoFactorAuthentication/resendOtpEpic.js +19 -44
- package/lib/view/twoFactorAuthentication/sendOtpEpic.d.ts +1 -2
- package/lib/view/twoFactorAuthentication/sendOtpEpic.js +18 -45
- package/lib/view/twoFactorAuthentication/twoFactorAuthentication.d.ts +5 -17
- package/lib/view/twoFactorAuthentication/twoFactorAuthentication.js +0 -33
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationPayload.d.ts +7 -7
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationPayload.js +6 -6
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationReducer.d.ts +6 -22
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationReducer.js +60 -176
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationSelector.d.ts +3 -5
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationSelector.js +2 -13
- package/lib/view/twoFactorAuthentication/verifyOtpEpic.d.ts +2 -5
- package/lib/view/twoFactorAuthentication/verifyOtpEpic.js +5 -46
- package/lib/view/userListView/fetchUserListByTypeEpic.d.ts +2 -2
- package/lib/view/userListView/fetchUserListByTypeEpic.js +3 -4
- package/lib/view/userListView/userListViewPayload.d.ts +0 -11
- package/package.json +4 -5
- package/lib/entity/connectedAccount/connectedAccount.d.ts +0 -19
- package/lib/entity/connectedAccount/connectedAccount.js +0 -10
- package/lib/entity/connectedAccount/connectedAccountPayload.d.ts +0 -11
- package/lib/entity/connectedAccount/connectedAccountPayload.js +0 -15
- package/lib/entity/connectedAccount/connectedAccountReducer.d.ts +0 -6
- package/lib/entity/connectedAccount/connectedAccountReducer.js +0 -27
- package/lib/entity/connectedAccount/connectedAccountSelector.d.ts +0 -4
- package/lib/entity/connectedAccount/connectedAccountSelector.js +0 -17
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchDepositAccountLimitEpic.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchDepositAccountLimitEpic.js +0 -41
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateDebitCardPinAttemptEpic.d.ts +0 -11
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateDebitCardPinAttemptEpic.js +0 -42
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchDebitCardSummaryEpic.d.ts +0 -7
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchDebitCardSummaryEpic.js +0 -23
- package/lib/view/spendManagement/chargeCards/issueChargeCard/depositAccountWithLimitPayload.d.ts +0 -6
- package/lib/view/spendManagement/chargeCards/issueChargeCard/depositAccountWithLimitPayload.js +0 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchDepositAccountListForCardsEpic.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchDepositAccountListForCardsEpic.js +0 -31
|
@@ -3,15 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.markTransactionAsNotMiscategorizedEpic = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
7
6
|
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
8
|
-
const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
|
|
9
7
|
const transactionReducer_1 = require("../../../entity/transaction/transactionReducer");
|
|
10
8
|
const responsePayload_1 = require("../../../responsePayload");
|
|
11
|
-
const transactionsViewReducer_1 = require("../../expenseAutomationView/reducers/transactionsViewReducer");
|
|
12
9
|
const transactionDetailReducer_1 = require("../transactionDetailReducer");
|
|
13
10
|
const transactionDetailState_1 = require("../transactionDetailState");
|
|
14
|
-
const markTransactionAsNotMiscategorizedEpic = (actions$,
|
|
11
|
+
const markTransactionAsNotMiscategorizedEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(transactionDetailReducer_1.markTransactionAsNotMiscategorized.match), (0, operators_1.mergeMap)((action) => {
|
|
15
12
|
return zeniAPI
|
|
16
13
|
.putAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/transactions/${action.payload.transactionId.id}/mark-miscategorized-as-correct`, preparePayload(action.payload.transactionId))
|
|
17
14
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
@@ -21,27 +18,6 @@ const markTransactionAsNotMiscategorizedEpic = (actions$, state$, zeniAPI) => ac
|
|
|
21
18
|
const transactionKey = (0, transactionDetailState_1.getTransactionDetailKey)(action.payload.transactionId);
|
|
22
19
|
// Mark this transaction as not miscategorized anymore
|
|
23
20
|
actions.push((0, transactionReducer_1.updateTransactionIsMiscategorized)(transactionKey, false));
|
|
24
|
-
if (action.payload.isExpenseAutomationEnabled === true) {
|
|
25
|
-
const { expenseAutomationViewState, expenseAutomationTransactionsViewState, } = state$.value;
|
|
26
|
-
const { transactionCategorizationView, selectedTransactionCategorizationTab, } = expenseAutomationTransactionsViewState;
|
|
27
|
-
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state$.value);
|
|
28
|
-
const { selectedPeriodByTenantId } = expenseAutomationViewState;
|
|
29
|
-
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
30
|
-
const { uiState } = transactionCategorizationView[selectedTransactionCategorizationTab];
|
|
31
|
-
const totalCountByPeriod = uiState.totalCount[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)];
|
|
32
|
-
const updatedTotalCount = totalCountByPeriod === 0
|
|
33
|
-
? totalCountByPeriod
|
|
34
|
-
: totalCountByPeriod - 1;
|
|
35
|
-
actions.push((0, transactionsViewReducer_1.updateStatusForTransactionNotMiscategorizedUpdateForCategorization)(selectedTransactionCategorizationTab, [action.payload.transactionId.id], selectedPeriod, 'Completed'));
|
|
36
|
-
actions.push((0, transactionReducer_1.removeTransactionCategorization)({
|
|
37
|
-
transactionIds: [action.payload.transactionId.id],
|
|
38
|
-
}));
|
|
39
|
-
actions.push((0, transactionsViewReducer_1.updateTotalCountForTransactionCategorization)({
|
|
40
|
-
selectedPeriod,
|
|
41
|
-
selectedTab: selectedTransactionCategorizationTab,
|
|
42
|
-
totalCount: updatedTotalCount,
|
|
43
|
-
}));
|
|
44
|
-
}
|
|
45
21
|
actions.push((0, transactionDetailReducer_1.updateStatusConsolidatedSaveTransactionDetail)({
|
|
46
22
|
transactionId: action.payload.transactionId,
|
|
47
23
|
fetchState: 'Completed',
|
|
@@ -23,7 +23,7 @@ const saveTransactionDetailEpic = (actions$, state$) => actions$.pipe((0, operat
|
|
|
23
23
|
if (detail != null && transaction != null) {
|
|
24
24
|
const localData = detail.transactionDetailLocalData;
|
|
25
25
|
const transactionSaveUpdates = (0, saveTransactionHelper_1.toTransactionUpdatesFromTransactionDetailLocalData)(localData, transaction, isExpenseAutomationEnabled);
|
|
26
|
-
fetchActions.push((0, transactionDetailReducer_1.updateTransactionDetail)(transactionId, transactionSaveUpdates
|
|
26
|
+
fetchActions.push((0, transactionDetailReducer_1.updateTransactionDetail)(transactionId, transactionSaveUpdates));
|
|
27
27
|
return (0, rxjs_1.from)(fetchActions);
|
|
28
28
|
}
|
|
29
29
|
return (0, rxjs_1.from)(fetchActions);
|
|
@@ -86,7 +86,7 @@ const updateTransactionDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe
|
|
|
86
86
|
true &&
|
|
87
87
|
callMarkTransactionAsNotMiscategorized === true &&
|
|
88
88
|
isTransactionUnCategorized === false) {
|
|
89
|
-
actions.push((0, transactionDetailReducer_1.markTransactionAsNotMiscategorized)(transactionIdResp, action.payload.transactionSaveUpdates
|
|
89
|
+
actions.push((0, transactionDetailReducer_1.markTransactionAsNotMiscategorized)(transactionIdResp, action.payload.transactionSaveUpdates));
|
|
90
90
|
}
|
|
91
91
|
else {
|
|
92
92
|
actions.push((0, transactionDetailReducer_1.updateStatusConsolidatedSaveTransactionDetail)({
|
|
@@ -26,20 +26,18 @@ export declare const downloadAccountingProviderAttachment: import("@reduxjs/tool
|
|
|
26
26
|
payload: SupportedTransactionPayload;
|
|
27
27
|
}, "transactionDetail/uploadMissingAttachmentSuccess", never, {
|
|
28
28
|
updateType: UpdateType;
|
|
29
|
-
}>, updateTransactionDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, transactionSaveUpdates: TransactionSaveUpdates
|
|
29
|
+
}>, updateTransactionDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, transactionSaveUpdates: TransactionSaveUpdates], {
|
|
30
30
|
transactionId: TransactionID;
|
|
31
31
|
transactionSaveUpdates: TransactionSaveUpdates;
|
|
32
|
-
isExpenseAutomationEnabled: boolean;
|
|
33
32
|
}, "transactionDetail/updateTransactionDetail", never, never>, updateTransactionDetailSaveStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, fetchState: FetchState, error?: ZeniAPIStatus<Record<string, unknown>> | undefined], {
|
|
34
33
|
transactionId: TransactionID;
|
|
35
34
|
fetchState: FetchState;
|
|
36
35
|
error: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
37
36
|
}, "transactionDetail/updateTransactionDetailSaveStatus", never, never>, clearTransactionDetailSaveStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID], {
|
|
38
37
|
transactionId: TransactionID;
|
|
39
|
-
}, "transactionDetail/clearTransactionDetailSaveStatus", never, never>, markTransactionAsNotMiscategorized: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, transactionSaveUpdates: TransactionSaveUpdates
|
|
38
|
+
}, "transactionDetail/clearTransactionDetailSaveStatus", never, never>, markTransactionAsNotMiscategorized: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, transactionSaveUpdates: TransactionSaveUpdates], {
|
|
40
39
|
transactionId: TransactionID;
|
|
41
40
|
transactionSaveUpdates: TransactionSaveUpdates;
|
|
42
|
-
isExpenseAutomationEnabled: boolean;
|
|
43
41
|
}, "transactionDetail/markTransactionAsNotMiscategorized", never, never>, deleteTransactionAttachment: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[attachmentFileName: string, transactionId: TransactionID], {
|
|
44
42
|
attachmentFileName: string;
|
|
45
43
|
transactionId: TransactionID;
|
|
@@ -97,12 +97,11 @@ const transactionDetail = (0, toolkit_1.createSlice)({
|
|
|
97
97
|
} }) });
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
|
-
prepare(transactionId, transactionSaveUpdates
|
|
100
|
+
prepare(transactionId, transactionSaveUpdates) {
|
|
101
101
|
return {
|
|
102
102
|
payload: {
|
|
103
103
|
transactionId,
|
|
104
104
|
transactionSaveUpdates,
|
|
105
|
-
isExpenseAutomationEnabled,
|
|
106
105
|
},
|
|
107
106
|
};
|
|
108
107
|
},
|
|
@@ -161,12 +160,11 @@ const transactionDetail = (0, toolkit_1.createSlice)({
|
|
|
161
160
|
} }) });
|
|
162
161
|
}
|
|
163
162
|
},
|
|
164
|
-
prepare(transactionId, transactionSaveUpdates
|
|
163
|
+
prepare(transactionId, transactionSaveUpdates) {
|
|
165
164
|
return {
|
|
166
165
|
payload: {
|
|
167
166
|
transactionId,
|
|
168
167
|
transactionSaveUpdates,
|
|
169
|
-
isExpenseAutomationEnabled,
|
|
170
168
|
},
|
|
171
169
|
};
|
|
172
170
|
},
|
|
@@ -6,8 +6,7 @@ import { resendOtpVendorView, sendOtpVendorViewFailure, sendOtpVendorViewSuccess
|
|
|
6
6
|
import { resendOnboardingOfficerOtp, sendOnboardingOfficerOtpFailure, sendOnboardingOfficerOtpSuccess } from '../onboardingView/customerView/onboardingCustomerViewReducer';
|
|
7
7
|
import { resendOtpMyProfile, sendOtpMyProfileFailure, sendOtpMyProfileSuccess } from '../settingsView/settingsViewReducer';
|
|
8
8
|
import { resendOtpCardUserOnboarding, sendOtpCardUserOnboardingFailure, sendOtpCardUserOnboardingSuccess } from '../spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingReducer';
|
|
9
|
-
import { resendOtpCardHolder, sendOtpCardHolderFailure, sendOtpCardHolderSuccess } from '../spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer';
|
|
10
9
|
import { resendOtpSpendManagementSetUp, sendOtpFailureSpendManagementSetUp, sendOtpSuccessSpendManagementSetUp } from '../spendManagement/commonSetup/setupViewReducer';
|
|
11
10
|
import { resendOtp, sendOtpFailure, sendOtpSuccess } from './twoFactorAuthenticationReducer';
|
|
12
|
-
export 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> | ReturnType<typeof resendOtpCardUserOnboarding> | ReturnType<typeof sendOtpCardUserOnboardingSuccess> | ReturnType<typeof sendOtpCardUserOnboardingFailure> | ReturnType<typeof resendOtpMyProfile> | ReturnType<typeof
|
|
13
|
-
export declare const resendOtpEpic: (actions$: ActionsObservable<ActionType>,
|
|
11
|
+
export 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> | ReturnType<typeof resendOtpCardUserOnboarding> | ReturnType<typeof sendOtpCardUserOnboardingSuccess> | ReturnType<typeof sendOtpCardUserOnboardingFailure> | ReturnType<typeof resendOtpMyProfile> | ReturnType<typeof sendOtpMyProfileFailure> | ReturnType<typeof sendOtpMyProfileSuccess>;
|
|
12
|
+
export declare const resendOtpEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -8,14 +8,27 @@ const vendorViewReducer_1 = require("../commonVendorView/vendorView/vendorViewRe
|
|
|
8
8
|
const onboardingCustomerViewReducer_1 = require("../onboardingView/customerView/onboardingCustomerViewReducer");
|
|
9
9
|
const settingsViewReducer_1 = require("../settingsView/settingsViewReducer");
|
|
10
10
|
const cardUserOnboardingReducer_1 = require("../spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingReducer");
|
|
11
|
-
const chargeCardDetailReducer_1 = require("../spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer");
|
|
12
11
|
const setupViewReducer_1 = require("../spendManagement/commonSetup/setupViewReducer");
|
|
13
12
|
const twoFactorAuthenticationReducer_1 = require("./twoFactorAuthenticationReducer");
|
|
14
|
-
const resendOtpEpic = (actions$,
|
|
13
|
+
const resendOtpEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(twoFactorAuthenticationReducer_1.resendOtp.match), (0, operators_1.mergeMap)((action) => {
|
|
14
|
+
var _a;
|
|
15
15
|
const resendOtpActions = [];
|
|
16
|
-
const { otpChallenge, twoFASource
|
|
16
|
+
const { otpChallenge, twoFASource } = action.payload;
|
|
17
|
+
const tenantState = state$.value.tenantState;
|
|
18
|
+
const companyState = state$.value.companyState;
|
|
19
|
+
const { currentTenantId } = tenantState;
|
|
20
|
+
const companyId = currentTenantId != null
|
|
21
|
+
? (_a = tenantState.tenantsById[currentTenantId]) === null || _a === void 0 ? void 0 : _a.companyId
|
|
22
|
+
: undefined;
|
|
23
|
+
const isCardsEnabled = companyId != null
|
|
24
|
+
? companyState.companiesById[companyId].companyChargeCardInfo
|
|
25
|
+
.isChargeCardEnabled
|
|
26
|
+
: false;
|
|
17
27
|
const payload = {
|
|
18
28
|
otp_challenge: otpChallenge,
|
|
29
|
+
is_for_charge_cards: twoFASource === 'ChargeCard' ||
|
|
30
|
+
twoFASource === 'CardUserOnboarding' ||
|
|
31
|
+
(twoFASource === 'MyProfile' && isCardsEnabled),
|
|
19
32
|
};
|
|
20
33
|
switch (twoFASource) {
|
|
21
34
|
case 'SpendManagementSetup':
|
|
@@ -39,11 +52,7 @@ const resendOtpEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operator
|
|
|
39
52
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
40
53
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
41
54
|
const updateActions = [
|
|
42
|
-
(0, twoFactorAuthenticationReducer_1.sendOtpSuccess)({
|
|
43
|
-
otpChallenge: response.data.otp_challenge,
|
|
44
|
-
twoFASource,
|
|
45
|
-
entityId,
|
|
46
|
-
}),
|
|
55
|
+
(0, twoFactorAuthenticationReducer_1.sendOtpSuccess)({ otpChallenge: response.data.otp_challenge }),
|
|
47
56
|
];
|
|
48
57
|
switch (twoFASource) {
|
|
49
58
|
case 'SpendManagementSetup':
|
|
@@ -71,24 +80,12 @@ const resendOtpEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operator
|
|
|
71
80
|
otpChallenge: response.data.otp_challenge,
|
|
72
81
|
}));
|
|
73
82
|
break;
|
|
74
|
-
case 'ChargeCardHolder':
|
|
75
|
-
if (entityId != null) {
|
|
76
|
-
updateActions.push((0, chargeCardDetailReducer_1.sendOtpCardHolderSuccess)({
|
|
77
|
-
otpChallenge: response.data.otp_challenge,
|
|
78
|
-
chargeCardId: entityId,
|
|
79
|
-
}));
|
|
80
|
-
}
|
|
81
|
-
break;
|
|
82
83
|
}
|
|
83
84
|
return (0, rxjs_1.from)(updateActions);
|
|
84
85
|
}
|
|
85
86
|
else {
|
|
86
87
|
const updateActions = [
|
|
87
|
-
(0, twoFactorAuthenticationReducer_1.sendOtpFailure)(
|
|
88
|
-
error: response.status,
|
|
89
|
-
twoFASource,
|
|
90
|
-
entityId,
|
|
91
|
-
}),
|
|
88
|
+
(0, twoFactorAuthenticationReducer_1.sendOtpFailure)(response.status),
|
|
92
89
|
];
|
|
93
90
|
switch (twoFASource) {
|
|
94
91
|
case 'SpendManagementSetup':
|
|
@@ -106,26 +103,12 @@ const resendOtpEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operator
|
|
|
106
103
|
case 'CardUserOnboarding':
|
|
107
104
|
updateActions.push((0, cardUserOnboardingReducer_1.sendOtpCardUserOnboardingFailure)(response.status));
|
|
108
105
|
break;
|
|
109
|
-
case 'ChargeCardHolder':
|
|
110
|
-
if (entityId != null) {
|
|
111
|
-
updateActions.push((0, chargeCardDetailReducer_1.sendOtpCardHolderFailure)({
|
|
112
|
-
error: response.status,
|
|
113
|
-
chargeCardId: entityId,
|
|
114
|
-
}));
|
|
115
|
-
}
|
|
116
|
-
break;
|
|
117
106
|
}
|
|
118
107
|
return (0, rxjs_1.from)(updateActions);
|
|
119
108
|
}
|
|
120
109
|
}), (0, operators_1.catchError)((error) => {
|
|
121
110
|
const zeniAPIStatus = (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Resend otp api errored out' + JSON.stringify(error));
|
|
122
|
-
const updateActions = [
|
|
123
|
-
(0, twoFactorAuthenticationReducer_1.sendOtpFailure)({
|
|
124
|
-
error: zeniAPIStatus,
|
|
125
|
-
twoFASource,
|
|
126
|
-
entityId,
|
|
127
|
-
}),
|
|
128
|
-
];
|
|
111
|
+
const updateActions = [(0, twoFactorAuthenticationReducer_1.sendOtpFailure)(zeniAPIStatus)];
|
|
129
112
|
switch (twoFASource) {
|
|
130
113
|
case 'SpendManagementSetup':
|
|
131
114
|
updateActions.push((0, setupViewReducer_1.sendOtpFailureSpendManagementSetUp)(zeniAPIStatus));
|
|
@@ -142,14 +125,6 @@ const resendOtpEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operator
|
|
|
142
125
|
case 'CardUserOnboarding':
|
|
143
126
|
updateActions.push((0, cardUserOnboardingReducer_1.sendOtpCardUserOnboardingFailure)(zeniAPIStatus));
|
|
144
127
|
break;
|
|
145
|
-
case 'ChargeCardHolder':
|
|
146
|
-
if (entityId != null) {
|
|
147
|
-
updateActions.push((0, chargeCardDetailReducer_1.sendOtpCardHolderFailure)({
|
|
148
|
-
error: zeniAPIStatus,
|
|
149
|
-
chargeCardId: entityId,
|
|
150
|
-
}));
|
|
151
|
-
}
|
|
152
|
-
break;
|
|
153
128
|
}
|
|
154
129
|
return (0, rxjs_1.from)(updateActions);
|
|
155
130
|
}));
|
|
@@ -6,8 +6,7 @@ import { sendOtpVendorView, sendOtpVendorViewFailure, sendOtpVendorViewSuccess }
|
|
|
6
6
|
import { sendOnboardingOfficerOtp, sendOnboardingOfficerOtpFailure, sendOnboardingOfficerOtpSuccess } from '../onboardingView/customerView/onboardingCustomerViewReducer';
|
|
7
7
|
import { sendOtpMyProfile, sendOtpMyProfileFailure, sendOtpMyProfileSuccess } from '../settingsView/settingsViewReducer';
|
|
8
8
|
import { sendOtpCardUserOnboarding, sendOtpCardUserOnboardingFailure, sendOtpCardUserOnboardingSuccess } from '../spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingReducer';
|
|
9
|
-
import { sendOtpCardHolder, sendOtpCardHolderFailure, sendOtpCardHolderSuccess } from '../spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer';
|
|
10
9
|
import { sendOtpFailureSpendManagementSetUp, sendOtpSpendManagementSetUp, sendOtpSuccessSpendManagementSetUp } from '../spendManagement/commonSetup/setupViewReducer';
|
|
11
10
|
import { sendOtp, sendOtpFailure, sendOtpSuccess } from './twoFactorAuthenticationReducer';
|
|
12
|
-
export 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> | ReturnType<typeof sendOtpCardUserOnboarding> | ReturnType<typeof sendOtpCardUserOnboardingSuccess> | ReturnType<typeof sendOtpCardUserOnboardingFailure> | ReturnType<typeof sendOtpMyProfile> | ReturnType<typeof
|
|
11
|
+
export 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> | ReturnType<typeof sendOtpCardUserOnboarding> | ReturnType<typeof sendOtpCardUserOnboardingSuccess> | ReturnType<typeof sendOtpCardUserOnboardingFailure> | ReturnType<typeof sendOtpMyProfile> | ReturnType<typeof sendOtpMyProfileFailure> | ReturnType<typeof sendOtpMyProfileSuccess>;
|
|
13
12
|
export declare const sendOtpEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -8,23 +8,31 @@ const vendorViewReducer_1 = require("../commonVendorView/vendorView/vendorViewRe
|
|
|
8
8
|
const onboardingCustomerViewReducer_1 = require("../onboardingView/customerView/onboardingCustomerViewReducer");
|
|
9
9
|
const settingsViewReducer_1 = require("../settingsView/settingsViewReducer");
|
|
10
10
|
const cardUserOnboardingReducer_1 = require("../spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingReducer");
|
|
11
|
-
const chargeCardDetailReducer_1 = require("../spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer");
|
|
12
11
|
const setupViewReducer_1 = require("../spendManagement/commonSetup/setupViewReducer");
|
|
13
12
|
const twoFactorAuthenticationReducer_1 = require("./twoFactorAuthenticationReducer");
|
|
14
13
|
const sendOtpEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(twoFactorAuthenticationReducer_1.sendOtp.match), (0, operators_1.mergeMap)((action) => {
|
|
14
|
+
var _a;
|
|
15
15
|
const sendOtpActions = [];
|
|
16
|
-
const { phoneNumber, twoFASource
|
|
16
|
+
const { phoneNumber, twoFASource } = action.payload;
|
|
17
|
+
const tenantState = state$.value.tenantState;
|
|
18
|
+
const companyState = state$.value.companyState;
|
|
19
|
+
const { currentTenantId } = tenantState;
|
|
20
|
+
const companyId = currentTenantId != null
|
|
21
|
+
? (_a = tenantState.tenantsById[currentTenantId]) === null || _a === void 0 ? void 0 : _a.companyId
|
|
22
|
+
: undefined;
|
|
23
|
+
const isCardsEnabled = companyId != null
|
|
24
|
+
? companyState.companiesById[companyId].companyChargeCardInfo
|
|
25
|
+
.isChargeCardEnabled
|
|
26
|
+
: false;
|
|
17
27
|
const queryPayload = {
|
|
18
28
|
channel_type: 'phone',
|
|
19
29
|
channel_info: {
|
|
20
30
|
phone_number: phoneNumber,
|
|
21
31
|
},
|
|
32
|
+
is_for_charge_cards: twoFASource === 'ChargeCard' ||
|
|
33
|
+
twoFASource === 'CardUserOnboarding' ||
|
|
34
|
+
(twoFASource === 'MyProfile' && isCardsEnabled),
|
|
22
35
|
};
|
|
23
|
-
if (twoFASource === 'ChargeCardHolder' && entityId != null) {
|
|
24
|
-
const chargeCardProviderId = state$.value.chargeCardState.chargeCardByID[entityId].cardProviderID;
|
|
25
|
-
queryPayload.provider_card_id = chargeCardProviderId;
|
|
26
|
-
queryPayload.is_for_charge_cards = true;
|
|
27
|
-
}
|
|
28
36
|
switch (twoFASource) {
|
|
29
37
|
case 'SpendManagementSetup':
|
|
30
38
|
sendOtpActions.push((0, setupViewReducer_1.sendOtpSpendManagementSetUp)());
|
|
@@ -41,22 +49,13 @@ const sendOtpEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1
|
|
|
41
49
|
case 'CardUserOnboarding':
|
|
42
50
|
sendOtpActions.push((0, cardUserOnboardingReducer_1.sendOtpCardUserOnboarding)());
|
|
43
51
|
break;
|
|
44
|
-
case 'ChargeCardHolder':
|
|
45
|
-
if (entityId != null) {
|
|
46
|
-
sendOtpActions.push((0, chargeCardDetailReducer_1.sendOtpCardHolder)({ phone: phoneNumber, chargeCardId: entityId }));
|
|
47
|
-
}
|
|
48
|
-
break;
|
|
49
52
|
}
|
|
50
53
|
const setOtp$ = zeniAPI
|
|
51
54
|
.postAndGetJSON(`${zeniAPI.apiEndPoints.authMicroServiceBaseUrl}/1.0/otp/send`, queryPayload)
|
|
52
55
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
53
56
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
54
57
|
const updateActions = [
|
|
55
|
-
(0, twoFactorAuthenticationReducer_1.sendOtpSuccess)({
|
|
56
|
-
otpChallenge: response.data.otp_challenge,
|
|
57
|
-
twoFASource,
|
|
58
|
-
entityId,
|
|
59
|
-
}),
|
|
58
|
+
(0, twoFactorAuthenticationReducer_1.sendOtpSuccess)({ otpChallenge: response.data.otp_challenge }),
|
|
60
59
|
];
|
|
61
60
|
switch (twoFASource) {
|
|
62
61
|
case 'SpendManagementSetup':
|
|
@@ -84,20 +83,12 @@ const sendOtpEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1
|
|
|
84
83
|
otpChallenge: response.data.otp_challenge,
|
|
85
84
|
}));
|
|
86
85
|
break;
|
|
87
|
-
case 'ChargeCardHolder':
|
|
88
|
-
if (entityId != null) {
|
|
89
|
-
updateActions.push((0, chargeCardDetailReducer_1.sendOtpCardHolderSuccess)({
|
|
90
|
-
otpChallenge: response.data.otp_challenge,
|
|
91
|
-
chargeCardId: entityId,
|
|
92
|
-
}));
|
|
93
|
-
}
|
|
94
|
-
break;
|
|
95
86
|
}
|
|
96
87
|
return (0, rxjs_1.from)(updateActions);
|
|
97
88
|
}
|
|
98
89
|
else {
|
|
99
90
|
const updateActions = [
|
|
100
|
-
(0, twoFactorAuthenticationReducer_1.sendOtpFailure)(
|
|
91
|
+
(0, twoFactorAuthenticationReducer_1.sendOtpFailure)(response.status),
|
|
101
92
|
];
|
|
102
93
|
switch (twoFASource) {
|
|
103
94
|
case 'SpendManagementSetup':
|
|
@@ -115,22 +106,12 @@ const sendOtpEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1
|
|
|
115
106
|
case 'CardUserOnboarding':
|
|
116
107
|
updateActions.push((0, cardUserOnboardingReducer_1.sendOtpCardUserOnboardingFailure)(response.status));
|
|
117
108
|
break;
|
|
118
|
-
case 'ChargeCardHolder':
|
|
119
|
-
if (entityId != null) {
|
|
120
|
-
updateActions.push((0, chargeCardDetailReducer_1.sendOtpCardHolderFailure)({
|
|
121
|
-
error: response.status,
|
|
122
|
-
chargeCardId: entityId,
|
|
123
|
-
}));
|
|
124
|
-
}
|
|
125
|
-
break;
|
|
126
109
|
}
|
|
127
110
|
return (0, rxjs_1.from)(updateActions);
|
|
128
111
|
}
|
|
129
112
|
}), (0, operators_1.catchError)((error) => {
|
|
130
113
|
const zeniAPIStatus = (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Send otp api errored out' + JSON.stringify(error));
|
|
131
|
-
const updateActions = [
|
|
132
|
-
(0, twoFactorAuthenticationReducer_1.sendOtpFailure)({ error: zeniAPIStatus, twoFASource, entityId }),
|
|
133
|
-
];
|
|
114
|
+
const updateActions = [(0, twoFactorAuthenticationReducer_1.sendOtpFailure)(zeniAPIStatus)];
|
|
134
115
|
switch (twoFASource) {
|
|
135
116
|
case 'SpendManagementSetup':
|
|
136
117
|
updateActions.push((0, setupViewReducer_1.sendOtpFailureSpendManagementSetUp)(zeniAPIStatus));
|
|
@@ -147,14 +128,6 @@ const sendOtpEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1
|
|
|
147
128
|
case 'CardUserOnboarding':
|
|
148
129
|
updateActions.push((0, cardUserOnboardingReducer_1.sendOtpCardUserOnboardingFailure)(zeniAPIStatus));
|
|
149
130
|
break;
|
|
150
|
-
case 'ChargeCardHolder':
|
|
151
|
-
if (entityId != null) {
|
|
152
|
-
updateActions.push((0, chargeCardDetailReducer_1.sendOtpCardHolderFailure)({
|
|
153
|
-
error: zeniAPIStatus,
|
|
154
|
-
chargeCardId: entityId,
|
|
155
|
-
}));
|
|
156
|
-
}
|
|
157
|
-
break;
|
|
158
131
|
}
|
|
159
132
|
return (0, rxjs_1.from)(updateActions);
|
|
160
133
|
}));
|
|
@@ -1,28 +1,16 @@
|
|
|
1
|
-
import { FetchStateAndError
|
|
1
|
+
import { FetchStateAndError } from '../../commonStateTypes/common';
|
|
2
2
|
import { ZeniDate } from '../../zeniDayJS';
|
|
3
|
-
export interface
|
|
3
|
+
export interface TwoFactorAuthenticationState {
|
|
4
4
|
sendOtpStatus: FetchStateAndError;
|
|
5
5
|
otpVerificationStatus: FetchStateAndError;
|
|
6
|
-
|
|
6
|
+
customerToken?: CustomerToken;
|
|
7
7
|
phone?: string;
|
|
8
8
|
otpChallenge?: string;
|
|
9
9
|
}
|
|
10
|
-
export type
|
|
11
|
-
export
|
|
12
|
-
export interface TwoFactorAuthenticationState {
|
|
13
|
-
common: TwoFactorAuthentication;
|
|
14
|
-
chargeCardHolder: Record<ID, TwoFactorAuthentication>;
|
|
15
|
-
cardUserOnboarding: TwoFactorAuthenticationWithoutToken;
|
|
16
|
-
}
|
|
17
|
-
export declare const COMMON_TWO_FA_SOURCE: readonly ["BillPayVendor", "SpendManagementSetup", "MyProfile", "CustomerOnboarding"];
|
|
18
|
-
export declare const toCommonTwoFASource: (v: string) => "MyProfile" | "BillPayVendor" | "SpendManagementSetup" | "CustomerOnboarding";
|
|
19
|
-
export type CommonTwoFASource = ReturnType<typeof toCommonTwoFASource>;
|
|
20
|
-
export type TwoFASourceView = CommonTwoFASource | 'ChargeCardHolder' | 'CardUserOnboarding';
|
|
21
|
-
export interface Token {
|
|
10
|
+
export type TwoFASourceView = 'BillPayVendor' | 'ChargeCard' | 'SpendManagementSetup' | 'CardUserOnboarding' | 'MyProfile' | 'CustomerOnboarding';
|
|
11
|
+
export interface CustomerToken {
|
|
22
12
|
provider: string;
|
|
23
13
|
token: string;
|
|
24
14
|
expiry: ZeniDate;
|
|
25
15
|
message: string;
|
|
26
16
|
}
|
|
27
|
-
export declare const initialTwoFactorAuthenticationWithoutToken: TwoFactorAuthenticationWithoutToken;
|
|
28
|
-
export declare const initialTwoFactorAuthentication: TwoFactorAuthentication;
|
|
@@ -1,35 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initialTwoFactorAuthentication = exports.initialTwoFactorAuthenticationWithoutToken = exports.toCommonTwoFASource = exports.COMMON_TWO_FA_SOURCE = exports.defaultTwoFactorAuthenticationState = void 0;
|
|
4
|
-
const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
|
|
5
|
-
exports.defaultTwoFactorAuthenticationState = {
|
|
6
|
-
sendOtpStatus: {
|
|
7
|
-
fetchState: 'Not-Started',
|
|
8
|
-
error: undefined,
|
|
9
|
-
},
|
|
10
|
-
otpVerificationStatus: {
|
|
11
|
-
fetchState: 'Not-Started',
|
|
12
|
-
error: undefined,
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
exports.COMMON_TWO_FA_SOURCE = [
|
|
16
|
-
'BillPayVendor',
|
|
17
|
-
'SpendManagementSetup',
|
|
18
|
-
'MyProfile',
|
|
19
|
-
'CustomerOnboarding',
|
|
20
|
-
];
|
|
21
|
-
const toCommonTwoFASource = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.COMMON_TWO_FA_SOURCE);
|
|
22
|
-
exports.toCommonTwoFASource = toCommonTwoFASource;
|
|
23
|
-
exports.initialTwoFactorAuthenticationWithoutToken = {
|
|
24
|
-
sendOtpStatus: {
|
|
25
|
-
fetchState: 'Not-Started',
|
|
26
|
-
error: undefined,
|
|
27
|
-
},
|
|
28
|
-
otpVerificationStatus: {
|
|
29
|
-
fetchState: 'Not-Started',
|
|
30
|
-
error: undefined,
|
|
31
|
-
},
|
|
32
|
-
phone: undefined,
|
|
33
|
-
otpChallenge: undefined,
|
|
34
|
-
};
|
|
35
|
-
exports.initialTwoFactorAuthentication = Object.assign(Object.assign({}, exports.initialTwoFactorAuthenticationWithoutToken), { token: undefined });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ZeniAPIResponse } from '../../responsePayload';
|
|
2
|
-
import {
|
|
2
|
+
import { CustomerToken } from './twoFactorAuthentication';
|
|
3
3
|
interface SendOtpPayload {
|
|
4
4
|
otp_challenge: string;
|
|
5
5
|
}
|
|
@@ -7,14 +7,14 @@ export type SendOtpResponse = ZeniAPIResponse<SendOtpPayload>;
|
|
|
7
7
|
interface VerifyOtpPayload {
|
|
8
8
|
is_verified: boolean;
|
|
9
9
|
message: string;
|
|
10
|
-
|
|
10
|
+
customer_token_info?: CustomerTokenPayload;
|
|
11
11
|
}
|
|
12
|
-
export interface
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
export interface CustomerTokenPayload {
|
|
13
|
+
customer_token_provider: string;
|
|
14
|
+
customer_token: string;
|
|
15
|
+
customer_token_expiration_time: string;
|
|
16
16
|
message: string;
|
|
17
17
|
}
|
|
18
18
|
export type VerifyOtpResponse = ZeniAPIResponse<VerifyOtpPayload>;
|
|
19
|
-
export declare const
|
|
19
|
+
export declare const toCustomerToken: (payload: CustomerTokenPayload) => CustomerToken;
|
|
20
20
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.toCustomerToken = void 0;
|
|
4
4
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
5
|
-
const
|
|
6
|
-
provider: payload.
|
|
7
|
-
token: payload.
|
|
8
|
-
expiry: (0, zeniDayJS_1.date)(payload.
|
|
5
|
+
const toCustomerToken = (payload) => ({
|
|
6
|
+
provider: payload.customer_token_provider,
|
|
7
|
+
token: payload.customer_token,
|
|
8
|
+
expiry: (0, zeniDayJS_1.date)(payload.customer_token_expiration_time),
|
|
9
9
|
message: payload.message,
|
|
10
10
|
});
|
|
11
|
-
exports.
|
|
11
|
+
exports.toCustomerToken = toCustomerToken;
|
|
@@ -1,37 +1,21 @@
|
|
|
1
|
-
import { ID } from '../../commonStateTypes/common';
|
|
2
1
|
import { ZeniAPIStatus } from '../../responsePayload';
|
|
3
2
|
import { TwoFASourceView, TwoFactorAuthenticationState } from './twoFactorAuthentication';
|
|
4
|
-
import {
|
|
3
|
+
import { CustomerTokenPayload } from './twoFactorAuthenticationPayload';
|
|
5
4
|
export declare const initialState: TwoFactorAuthenticationState;
|
|
6
|
-
export declare const sendOtp: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[phoneNumber: string, twoFASource: TwoFASourceView
|
|
5
|
+
export declare const sendOtp: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[phoneNumber: string, twoFASource: TwoFASourceView], {
|
|
7
6
|
phoneNumber: string;
|
|
8
7
|
twoFASource: TwoFASourceView;
|
|
9
|
-
|
|
10
|
-
}, "twoFactorAuthentication/sendOtp", never, never>, resendOtp: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[otpChallenge: string, twoFASource: TwoFASourceView, entityId?: string | undefined], {
|
|
8
|
+
}, "twoFactorAuthentication/sendOtp", never, never>, resendOtp: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[otpChallenge: string, twoFASource: TwoFASourceView], {
|
|
11
9
|
otpChallenge: string;
|
|
12
10
|
twoFASource: TwoFASourceView;
|
|
13
|
-
entityId: string | undefined;
|
|
14
11
|
}, "twoFactorAuthentication/resendOtp", never, never>, sendOtpSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
15
12
|
otpChallenge: string;
|
|
16
|
-
|
|
17
|
-
entityId?: ID;
|
|
18
|
-
}, "twoFactorAuthentication/sendOtpSuccess">, sendOtpFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
19
|
-
error: ZeniAPIStatus;
|
|
20
|
-
twoFASource: TwoFASourceView;
|
|
21
|
-
entityId?: ID;
|
|
22
|
-
}, "twoFactorAuthentication/sendOtpFailure">, verifyOtp: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[otpCode: string, otpChallenge: string, twoFASource: TwoFASourceView, entityId?: string | undefined], {
|
|
13
|
+
}, "twoFactorAuthentication/sendOtpSuccess">, sendOtpFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "twoFactorAuthentication/sendOtpFailure">, verifyOtp: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[otpCode: string, otpChallenge: string, twoFASource: TwoFASourceView], {
|
|
23
14
|
otpCode: string;
|
|
24
15
|
otpChallenge: string;
|
|
25
16
|
twoFASource: TwoFASourceView;
|
|
26
|
-
entityId: string | undefined;
|
|
27
17
|
}, "twoFactorAuthentication/verifyOtp", never, never>, verifyOtpSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
entityId?: ID;
|
|
31
|
-
}, "twoFactorAuthentication/verifyOtpSuccess">, verifyOtpFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
32
|
-
error: ZeniAPIStatus;
|
|
33
|
-
twoFASource: TwoFASourceView;
|
|
34
|
-
entityId?: ID;
|
|
35
|
-
}, "twoFactorAuthentication/verifyOtpFailure">, clearTwoFactorAuthentication: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"twoFactorAuthentication/clearTwoFactorAuthentication">;
|
|
18
|
+
customerTokenPayload: CustomerTokenPayload | undefined;
|
|
19
|
+
}, "twoFactorAuthentication/verifyOtpSuccess">, verifyOtpFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "twoFactorAuthentication/verifyOtpFailure">, clearTwoFactorAuthentication: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"twoFactorAuthentication/clearTwoFactorAuthentication">;
|
|
36
20
|
declare const _default: import("redux").Reducer<TwoFactorAuthenticationState>;
|
|
37
21
|
export default _default;
|