@zeniai/client-epic-state 4.16.0 → 4.16.2
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 +26 -8
- package/lib/entity/chargeCard/chargeCard.js +25 -6
- package/lib/entity/chargeCard/chargeCardPayload.d.ts +41 -5
- package/lib/entity/chargeCard/chargeCardPayload.js +20 -8
- package/lib/entity/chargeCardTransaction/chargeCardTransaction.d.ts +1 -1
- package/lib/entity/chargeCardTransaction/chargeCardTransaction.js +5 -1
- package/lib/entity/company/companyPayload.d.ts +12 -1
- package/lib/entity/company/companyPayload.js +14 -0
- package/lib/entity/company/companyStateTypes.d.ts +11 -0
- package/lib/entity/connectedAccount/connectedAccount.d.ts +19 -0
- package/lib/entity/connectedAccount/connectedAccount.js +10 -0
- package/lib/entity/connectedAccount/connectedAccountPayload.d.ts +11 -0
- package/lib/entity/connectedAccount/connectedAccountPayload.js +15 -0
- package/lib/entity/connectedAccount/connectedAccountReducer.d.ts +6 -0
- package/lib/entity/connectedAccount/connectedAccountReducer.js +27 -0
- package/lib/entity/connectedAccount/connectedAccountSelector.d.ts +4 -0
- package/lib/entity/connectedAccount/connectedAccountSelector.js +17 -0
- package/lib/entity/depositAccount/depositAccount.d.ts +20 -2
- package/lib/entity/depositAccount/depositAccountPayload.d.ts +22 -1
- package/lib/entity/depositAccount/depositAccountPayload.js +39 -1
- package/lib/entity/depositAccount/depositAccountReducer.d.ts +2 -2
- package/lib/entity/depositAccount/depositAccountReducer.js +8 -2
- package/lib/entity/depositAccount/depositAccountSelector.d.ts +3 -1
- package/lib/entity/depositAccount/depositAccountSelector.js +10 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -1
- package/lib/entity/tenant/clearAllEpic.js +2 -0
- package/lib/entity/tenant/tenantSelector.d.ts +6 -2
- package/lib/entity/tenant/tenantSelector.js +10 -2
- package/lib/epic.d.ts +5 -1
- package/lib/epic.js +5 -1
- package/lib/index.d.ts +18 -18
- package/lib/index.js +26 -17
- package/lib/reducer.d.ts +3 -0
- package/lib/reducer.js +3 -0
- package/lib/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +8 -0
- package/lib/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +16 -0
- package/lib/view/addressView/addressViewState.d.ts +1 -1
- package/lib/view/dashboard/dashboardSelector.js +7 -6
- package/lib/view/expenseAutomationView/epics/accountRecon/updateReconcileTabLocalDataEpic.js +5 -4
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +1 -2
- package/lib/view/expenseAutomationView/epics/fluxAnalysis/fetchFluxAnalysisViewEpic.js +18 -6
- package/lib/view/expenseAutomationView/epics/fluxAnalysis/reviewFluxAnalysisEpic.js +1 -4
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +7 -1
- package/lib/view/expenseAutomationView/epics/transactionCategorization/initializeTransactionCategorizationLocalDataEpic.js +2 -2
- 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.d.ts +2 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +27 -24
- package/lib/view/expenseAutomationView/payload/fluxAnalysisPayload.d.ts +22 -9
- package/lib/view/expenseAutomationView/payload/fluxAnalysisPayload.js +2 -2
- package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.d.ts +13 -5
- package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.js +245 -115
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +4 -3
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +14 -19
- package/lib/view/expenseAutomationView/selectorTypes/fluxAnalysisViewSelectorTypes.d.ts +29 -9
- package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +108 -40
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +9 -1
- package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.d.ts +40 -15
- package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.js +1 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +1 -0
- package/lib/view/expenseAutomationView/types/transactionsViewState.js +1 -0
- package/lib/view/onboardingView/cockpitView/epic/initializeOnboardingCustomerViewUpdateDataEpic.js +4 -4
- package/lib/view/onboardingView/cockpitView/onboardingCockpitViewReducer.d.ts +2 -1
- package/lib/view/onboardingView/cockpitView/onboardingCockpitViewReducer.js +2 -2
- package/lib/view/settingsView/settingsViewHelpers.d.ts +4 -4
- package/lib/view/settingsView/settingsViewHelpers.js +9 -8
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +1 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +6 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.js +20 -2
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +5 -0
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +9 -2
- package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +1 -0
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingSelector.js +4 -3
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.d.ts +5 -3
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.js +4 -2
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +8 -3
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigState.d.ts +4 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +12 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.js +26 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailPayload.d.ts +2 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +43 -4
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +104 -9
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +15 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +70 -16
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.d.ts +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +12 -3
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardTransactionListEpic.js +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchDepositAccountLimitEpic.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchDepositAccountLimitEpic.js +41 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateChargeCardLimitEpic.js +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateDebitCardPinAttemptEpic.d.ts +11 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateDebitCardPinAttemptEpic.js +42 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +11 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +20 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListPayload.d.ts +16 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +6 -4
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +30 -4
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +5 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +26 -14
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +20 -5
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchDebitCardSummaryEpic.d.ts +7 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchDebitCardSummaryEpic.js +23 -0
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.d.ts +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.js +4 -2
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.d.ts +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.js +2 -0
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/acceptChargeCardTermsEpic.js +19 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/depositAccountWithLimitPayload.d.ts +6 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/depositAccountWithLimitPayload.js +2 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchDepositAccountListForCardsEpic.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchDepositAccountListForCardsEpic.js +31 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.js +15 -3
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +65 -25
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.d.ts +11 -3
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +45 -11
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.d.ts +6 -3
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +33 -18
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.d.ts +41 -8
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.js +0 -21
- package/lib/view/spendManagement/commonSetup/epic/setup/enableSetupEpic.js +9 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js +8 -3
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +4 -4
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +2 -1
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +3 -1
- package/lib/view/spendManagement/commonSetup/setupViewState.js +13 -1
- package/lib/view/spendManagement/helpers.d.ts +3 -0
- package/lib/view/spendManagement/helpers.js +13 -1
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/getPaymentAccountsEpic.js +2 -1
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountEpic.js +2 -1
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountLoginStatusEpic.js +2 -1
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountStatusEpic.js +2 -1
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.d.ts +2 -1
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js +6 -1
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +10 -10
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +1 -0
- 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 +4 -3
- package/lib/view/transactionDetail/epics/markTransactionAsNotMiscategorizedEpic.js +25 -1
- 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 +4 -2
- package/lib/view/transactionDetail/transactionDetailReducer.js +4 -2
- package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +3 -2
- package/lib/view/twoFactorAuthentication/resendOtpEpic.js +44 -19
- package/lib/view/twoFactorAuthentication/sendOtpEpic.d.ts +2 -1
- package/lib/view/twoFactorAuthentication/sendOtpEpic.js +45 -18
- package/lib/view/twoFactorAuthentication/twoFactorAuthentication.d.ts +17 -5
- package/lib/view/twoFactorAuthentication/twoFactorAuthentication.js +33 -0
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationPayload.d.ts +7 -7
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationPayload.js +6 -6
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationReducer.d.ts +22 -6
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationReducer.js +176 -60
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationSelector.d.ts +5 -3
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationSelector.js +13 -2
- package/lib/view/twoFactorAuthentication/verifyOtpEpic.d.ts +5 -2
- package/lib/view/twoFactorAuthentication/verifyOtpEpic.js +46 -5
- package/lib/view/userListView/fetchUserListByTypeEpic.d.ts +2 -2
- package/lib/view/userListView/fetchUserListByTypeEpic.js +4 -3
- package/lib/view/userListView/userListViewPayload.d.ts +11 -0
- package/package.json +5 -4
package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js
CHANGED
|
@@ -10,6 +10,8 @@ const paymentAccountReducer_1 = require("../../../../../entity/paymentAccount/pa
|
|
|
10
10
|
const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
|
|
11
11
|
const responsePayload_1 = require("../../../../../responsePayload");
|
|
12
12
|
const userFinancialAccountReducer_1 = require("../../../../userFinancialAccount/userFinancialAccountReducer");
|
|
13
|
+
const editBillViewReducer_1 = require("../../../billPay/editBillView/editBillViewReducer");
|
|
14
|
+
const helpers_1 = require("../../../helpers");
|
|
13
15
|
const paymentAccountListReducer_1 = require("../../../zeniAccounts/paymentAccountList/paymentAccountListReducer");
|
|
14
16
|
const plaidAccountViewReducer_1 = require("../../plaidAccountViewReducer");
|
|
15
17
|
const establishPlaidConnectionEpic = (actions$, state, zeniAPI) => actions$.pipe((0, operators_1.filter)(plaidAccountViewReducer_1.establishPlaidConnection.match), (0, operators_1.mergeMap)((action) => {
|
|
@@ -61,6 +63,9 @@ const establishPlaidConnectionEpic = (actions$, state, zeniAPI) => actions$.pipe
|
|
|
61
63
|
}),
|
|
62
64
|
(0, plaidAccountViewReducer_1.establishPlaidConnectionSuccess)(linkTokenType, plaidAccountKeyType),
|
|
63
65
|
];
|
|
66
|
+
if (plaidAccountKeyType === 'bill_pay_detail') {
|
|
67
|
+
actions.push((0, editBillViewReducer_1.updateNewAddedBillPaymentAccount)(paymentAccount.payment_account_id));
|
|
68
|
+
}
|
|
64
69
|
if (setupViewType != null) {
|
|
65
70
|
const primaryAccountForProducts = [];
|
|
66
71
|
// if the account added is primary for any product, it should be reflected on that setup page without refresh also
|
|
@@ -109,7 +114,7 @@ const establishPlaidConnectionEpic = (actions$, state, zeniAPI) => actions$.pipe
|
|
|
109
114
|
actions.push((0, bankAccountReducer_1.updateBankAccounts)(response.data.bank_accounts), (0, userFinancialAccountReducer_1.updateUserBankAccount)({ bankAccountIds, userId }));
|
|
110
115
|
}
|
|
111
116
|
if (setupViewType != null) {
|
|
112
|
-
actions.push((0, accountReducer_1.updateAccounts)(response.data.accounts, setupViewType));
|
|
117
|
+
actions.push((0, accountReducer_1.updateAccounts)(response.data.accounts, (0, helpers_1.getReportIDPlusForecastIDFromSetupViewType)(setupViewType)));
|
|
113
118
|
}
|
|
114
119
|
//show notification in case user account is added
|
|
115
120
|
else {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
2
2
|
import { PlaidAccountKeyType, PlaidAccountViewState, PlaidLinkTokenType } from './plaidAccountViewState';
|
|
3
3
|
export declare const initialState: PlaidAccountViewState;
|
|
4
|
-
export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing", plaidAccountKeyType: PlaidAccountKeyType, includeBalances?: boolean | undefined], {
|
|
5
|
-
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing";
|
|
4
|
+
export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards", plaidAccountKeyType: PlaidAccountKeyType, includeBalances?: boolean | undefined], {
|
|
5
|
+
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards";
|
|
6
6
|
includeBalances: boolean;
|
|
7
7
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
8
8
|
}, "plaidAccountView/getPaymentAccounts", never, never>, getPaymentAccountsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountIds: string[], plaidAccountKeyType: PlaidAccountKeyType], {
|
|
@@ -11,20 +11,20 @@ export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreato
|
|
|
11
11
|
}, "plaidAccountView/getPaymentAccountsSuccess", never, never>, getPaymentAccountsFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
12
12
|
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
13
13
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
14
|
-
}, "plaidAccountView/getPaymentAccountsFailure", never, never>, updatePaymentAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accountId: string, paymentAccountId: string, setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing", plaidAccountKeyType: PlaidAccountKeyType], {
|
|
14
|
+
}, "plaidAccountView/getPaymentAccountsFailure", never, never>, updatePaymentAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accountId: string, paymentAccountId: string, setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards", plaidAccountKeyType: PlaidAccountKeyType], {
|
|
15
15
|
accountId: string;
|
|
16
16
|
paymentAccountId: string;
|
|
17
|
-
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing";
|
|
17
|
+
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards";
|
|
18
18
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
19
19
|
}, "plaidAccountView/updatePaymentAccount", never, never>, updatePaymentAccountSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[plaidAccountKeyType: PlaidAccountKeyType], {
|
|
20
20
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
21
21
|
}, "plaidAccountView/updatePaymentAccountSuccess", never, never>, updatePaymentAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
22
22
|
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
23
23
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
24
|
-
}, "plaidAccountView/updatePaymentAccountFailure", never, never>, updatePaymentAccountStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[verificationStatusCode: string, paymentAccountId: string, setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing", plaidAccountKeyType: PlaidAccountKeyType, linkTokenType?: PlaidLinkTokenType | undefined], {
|
|
24
|
+
}, "plaidAccountView/updatePaymentAccountFailure", never, never>, updatePaymentAccountStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[verificationStatusCode: string, paymentAccountId: string, setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards", plaidAccountKeyType: PlaidAccountKeyType, linkTokenType?: PlaidLinkTokenType | undefined], {
|
|
25
25
|
verificationStatusCode: string;
|
|
26
26
|
paymentAccountId: string;
|
|
27
|
-
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing";
|
|
27
|
+
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards";
|
|
28
28
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
29
29
|
linkTokenType: PlaidLinkTokenType;
|
|
30
30
|
}, "plaidAccountView/updatePaymentAccountStatus", never, never>, updatePaymentAccountStatusSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
@@ -34,10 +34,10 @@ export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreato
|
|
|
34
34
|
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
35
35
|
linkTokenType: PlaidLinkTokenType;
|
|
36
36
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
37
|
-
}, "plaidAccountView/updatePaymentAccountStatusFailure", never, never>, updatePaymentAccountLoginStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[isLoginRequired: boolean, paymentAccountId: string, setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing", plaidAccountKeyType: PlaidAccountKeyType, linkTokenType?: PlaidLinkTokenType | undefined], {
|
|
37
|
+
}, "plaidAccountView/updatePaymentAccountStatusFailure", never, never>, updatePaymentAccountLoginStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[isLoginRequired: boolean, paymentAccountId: string, setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards", plaidAccountKeyType: PlaidAccountKeyType, linkTokenType?: PlaidLinkTokenType | undefined], {
|
|
38
38
|
isLoginRequired: boolean;
|
|
39
39
|
paymentAccountId: string;
|
|
40
|
-
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing";
|
|
40
|
+
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards";
|
|
41
41
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
42
42
|
linkTokenType: PlaidLinkTokenType;
|
|
43
43
|
}, "plaidAccountView/updatePaymentAccountLoginStatus", never, never>, updatePaymentAccountLoginStatusSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountIds: string[], linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
@@ -61,10 +61,10 @@ export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreato
|
|
|
61
61
|
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
62
62
|
linkTokenType: PlaidLinkTokenType;
|
|
63
63
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
64
|
-
}, "plaidAccountView/getPlaidLinkTokenFailure", never, never>, establishPlaidConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[publicToken: string, companyId: string, plaidAccountKeyType: PlaidAccountKeyType, setupViewType?: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | undefined, linkTokenType?: PlaidLinkTokenType | undefined, zeniMappedAccountId?: string | undefined], {
|
|
64
|
+
}, "plaidAccountView/getPlaidLinkTokenFailure", never, never>, establishPlaidConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[publicToken: string, companyId: string, plaidAccountKeyType: PlaidAccountKeyType, setupViewType?: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards" | undefined, linkTokenType?: PlaidLinkTokenType | undefined, zeniMappedAccountId?: string | undefined], {
|
|
65
65
|
publicToken: string;
|
|
66
66
|
companyId: string;
|
|
67
|
-
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | undefined;
|
|
67
|
+
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards" | undefined;
|
|
68
68
|
linkTokenType: PlaidLinkTokenType;
|
|
69
69
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
70
70
|
zeniMappedAccountId: string | undefined;
|
|
@@ -8,6 +8,7 @@ const plaidAccountViewState_1 = require("./plaidAccountViewState");
|
|
|
8
8
|
exports.initialState = {
|
|
9
9
|
spend_management_setup: plaidAccountViewState_1.initialPlaidAccountState,
|
|
10
10
|
bill_pay_setup: plaidAccountViewState_1.initialPlaidAccountState,
|
|
11
|
+
bill_pay_detail: plaidAccountViewState_1.initialPlaidAccountState,
|
|
11
12
|
reimbursement_setup: plaidAccountViewState_1.initialPlaidAccountState,
|
|
12
13
|
account_setup: plaidAccountViewState_1.initialPlaidAccountState,
|
|
13
14
|
charge_card_setup: plaidAccountViewState_1.initialPlaidAccountState,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
3
3
|
export type PlaidLinkTokenType = 'link_account' | 'update_account' | 'link_account_no_microdeposit' | 'link_external_account';
|
|
4
|
-
export type PlaidAccountKeyType = 'spend_management_setup' | 'bill_pay_setup' | 'reimbursement_setup' | 'account_setup' | 'charge_card_setup' | 'user_reimbursement_account' | 'external_account' | 'billing_setup' | 'expense_automation_reconcile';
|
|
4
|
+
export type PlaidAccountKeyType = 'spend_management_setup' | 'bill_pay_setup' | 'bill_pay_detail' | 'reimbursement_setup' | 'account_setup' | 'charge_card_setup' | 'user_reimbursement_account' | 'external_account' | 'billing_setup' | 'expense_automation_reconcile';
|
|
5
5
|
export type PlaidConnectionDetails = Record<PlaidLinkTokenType, {
|
|
6
6
|
linkToken?: string;
|
|
7
7
|
expiration?: ZeniDate;
|
|
@@ -9,7 +9,7 @@ const getCheckDepositDetail = (state) => {
|
|
|
9
9
|
const updateFileStatusById = {};
|
|
10
10
|
const { depositAccountState, depositAccountListState, checkDepositState, fileState, } = state;
|
|
11
11
|
const { localData, fetchState, error } = checkDepositState;
|
|
12
|
-
const depositAccountsView = (0, depositAccountListSelector_1.
|
|
12
|
+
const depositAccountsView = (0, depositAccountListSelector_1.getAllDepositAccounts)(depositAccountState, depositAccountListState);
|
|
13
13
|
localData.fileIds.forEach((fileId) => {
|
|
14
14
|
deleteFileStatusById[fileId] = (0, fileViewSelector_1.getFileDeleteStatusById)(state, fileId);
|
|
15
15
|
updateFileStatusById[fileId] = (0, fileViewSelector_1.getFileUpdateNameStatusById)(state, fileId);
|
package/lib/view/spendManagement/zeniAccounts/depositAccountList/depositAccountListSelector.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ import { DepositAccountListState } from './depositAccountList';
|
|
|
4
4
|
export interface DepositAccountListSelectorView extends SelectorView {
|
|
5
5
|
depositAccounts: DepositAccount[];
|
|
6
6
|
}
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const getAllDepositAccounts: (depositAccountState: DepositAccountState, depositAccountListState: DepositAccountListState) => DepositAccountListSelectorView;
|
package/lib/view/spendManagement/zeniAccounts/depositAccountList/depositAccountListSelector.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getAllDepositAccounts = void 0;
|
|
4
4
|
const depositAccountSelector_1 = require("../../../../entity/depositAccount/depositAccountSelector");
|
|
5
|
-
const
|
|
5
|
+
const getAllDepositAccounts = (depositAccountState, depositAccountListState) => {
|
|
6
6
|
return {
|
|
7
7
|
depositAccounts: (0, depositAccountSelector_1.getDepositAccountsByDepositAccountIds)(depositAccountState, depositAccountListState.accountIds),
|
|
8
8
|
fetchState: depositAccountListState.fetchState,
|
|
@@ -10,4 +10,4 @@ const getAllDepostAccounts = (depositAccountState, depositAccountListState) => {
|
|
|
10
10
|
version: 0,
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
-
exports.
|
|
13
|
+
exports.getAllDepositAccounts = getAllDepositAccounts;
|
|
@@ -38,7 +38,7 @@ const getExpressPayView = (state) => {
|
|
|
38
38
|
...vendorBankAccounts.map((acc) => (0, editBillViewSelector_1.toPaymentToOption)(acc)),
|
|
39
39
|
...vendorPaymentInstruments.map((pi) => (0, editBillViewSelector_1.toPaymentToOption)(pi)),
|
|
40
40
|
].sort((a, b) => { var _a; return (((_a = b.createTime) === null || _a === void 0 ? void 0 : _a.isAfter(a.createTime)) === true ? 1 : -1); });
|
|
41
|
-
const allDepositAccounts = (0, depositAccountListSelector_1.
|
|
41
|
+
const allDepositAccounts = (0, depositAccountListSelector_1.getAllDepositAccounts)(depositAccountState, depositAccountListState).depositAccounts;
|
|
42
42
|
const withdrawFromList = (0, setupViewSelector_1.getAllFundingAccounts)(allDepositAccounts, [], paymentAccountListState.paymentAccountBalanceFetchStatus).sort((a, b) => { var _a; return (((_a = a.createTime) === null || _a === void 0 ? void 0 : _a.isAfter(b.createTime)) === true ? 1 : -1); });
|
|
43
43
|
const internationalWireOnboardingStatus = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyBillPayInfo.internationalWireOnboardingStatus;
|
|
44
44
|
const fileId = (_k = expressPayState.formLocalData) === null || _k === void 0 ? void 0 : _k.receiptFileId;
|
|
@@ -8,7 +8,7 @@ const paymentAccountListSelector_1 = require("../paymentAccountList/paymentAccou
|
|
|
8
8
|
const getTransferDetail = (state) => {
|
|
9
9
|
const { transferDetailState, depositAccountState, paymentAccountState, depositAccountListState, paymentAccountListState, } = state;
|
|
10
10
|
const { localData, fetchState, error, reviewTransferDetail } = transferDetailState;
|
|
11
|
-
const depositAccountsView = (0, depositAccountListSelector_1.
|
|
11
|
+
const depositAccountsView = (0, depositAccountListSelector_1.getAllDepositAccounts)(depositAccountState, depositAccountListState);
|
|
12
12
|
const paymentAccountsView = (0, paymentAccountListSelector_1.getAllPaymentAccounts)(paymentAccountState, paymentAccountListState);
|
|
13
13
|
let transferParties = [];
|
|
14
14
|
const transferMoneyPartiesFetchState = (0, reduceFetchState_1.reduceAllFetchState)([
|
|
@@ -9,7 +9,7 @@ const zeniAccountsConfigSelector_1 = require("../zeniAccountsConfig/zeniAccounts
|
|
|
9
9
|
const getZeniAccountList = (state) => {
|
|
10
10
|
const { zeniAccountListState, depositAccountState, paymentAccountState, plaidAccountViewState, depositAccountListState, paymentAccountListState, } = state;
|
|
11
11
|
const { plaidConnectionDetails } = plaidAccountViewState['external_account'];
|
|
12
|
-
const depositAccountsSelectorView = (0, depositAccountListSelector_1.
|
|
12
|
+
const depositAccountsSelectorView = (0, depositAccountListSelector_1.getAllDepositAccounts)(depositAccountState, depositAccountListState);
|
|
13
13
|
const zeniAccountsConfig = (0, zeniAccountsConfigSelector_1.getZeniAccountsConfigDetail)(state);
|
|
14
14
|
const { paymentAccountIds } = paymentAccountListState;
|
|
15
15
|
const externalAccountsSelectorView = (0, paymentAccountListSelector_1.getAllPaymentAccounts)(paymentAccountState, paymentAccountListState);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
3
|
-
import { updateTransactionIsMiscategorized } from '../../../entity/transaction/transactionReducer';
|
|
3
|
+
import { removeTransactionCategorization, updateTransactionIsMiscategorized } from '../../../entity/transaction/transactionReducer';
|
|
4
4
|
import { RootState } from '../../../reducer';
|
|
5
5
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
6
|
+
import { updateStatusForTransactionNotMiscategorizedUpdateForCategorization, updateTotalCountForTransactionCategorization } from '../../expenseAutomationView/reducers/transactionsViewReducer';
|
|
6
7
|
import { markTransactionAsNotMiscategorized, updateStatusConsolidatedSaveTransactionDetail, updateStatusForTransactionNotMiscategorizedUpdate } from '../transactionDetailReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof updateStatusForTransactionNotMiscategorizedUpdate> | ReturnType<typeof markTransactionAsNotMiscategorized> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateStatusConsolidatedSaveTransactionDetail> | ReturnType<typeof updateTransactionIsMiscategorized>;
|
|
8
|
-
export declare const markTransactionAsNotMiscategorizedEpic: (actions$: ActionsObservable<ActionType>,
|
|
8
|
+
export type ActionType = ReturnType<typeof updateStatusForTransactionNotMiscategorizedUpdate> | ReturnType<typeof markTransactionAsNotMiscategorized> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateStatusConsolidatedSaveTransactionDetail> | ReturnType<typeof updateTransactionIsMiscategorized> | ReturnType<typeof removeTransactionCategorization> | ReturnType<typeof updateStatusForTransactionNotMiscategorizedUpdateForCategorization> | ReturnType<typeof updateTotalCountForTransactionCategorization>;
|
|
9
|
+
export declare const markTransactionAsNotMiscategorizedEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|
|
@@ -3,12 +3,15 @@ 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");
|
|
6
7
|
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
8
|
+
const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
|
|
7
9
|
const transactionReducer_1 = require("../../../entity/transaction/transactionReducer");
|
|
8
10
|
const responsePayload_1 = require("../../../responsePayload");
|
|
11
|
+
const transactionsViewReducer_1 = require("../../expenseAutomationView/reducers/transactionsViewReducer");
|
|
9
12
|
const transactionDetailReducer_1 = require("../transactionDetailReducer");
|
|
10
13
|
const transactionDetailState_1 = require("../transactionDetailState");
|
|
11
|
-
const markTransactionAsNotMiscategorizedEpic = (actions$,
|
|
14
|
+
const markTransactionAsNotMiscategorizedEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(transactionDetailReducer_1.markTransactionAsNotMiscategorized.match), (0, operators_1.mergeMap)((action) => {
|
|
12
15
|
return zeniAPI
|
|
13
16
|
.putAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/transactions/${action.payload.transactionId.id}/mark-miscategorized-as-correct`, preparePayload(action.payload.transactionId))
|
|
14
17
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
@@ -18,6 +21,27 @@ const markTransactionAsNotMiscategorizedEpic = (actions$, _state$, zeniAPI) => a
|
|
|
18
21
|
const transactionKey = (0, transactionDetailState_1.getTransactionDetailKey)(action.payload.transactionId);
|
|
19
22
|
// Mark this transaction as not miscategorized anymore
|
|
20
23
|
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
|
+
}
|
|
21
45
|
actions.push((0, transactionDetailReducer_1.updateStatusConsolidatedSaveTransactionDetail)({
|
|
22
46
|
transactionId: action.payload.transactionId,
|
|
23
47
|
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, isExpenseAutomationEnabled));
|
|
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, action.payload.isExpenseAutomationEnabled));
|
|
90
90
|
}
|
|
91
91
|
else {
|
|
92
92
|
actions.push((0, transactionDetailReducer_1.updateStatusConsolidatedSaveTransactionDetail)({
|
|
@@ -26,18 +26,20 @@ 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, isExpenseAutomationEnabled: boolean], {
|
|
30
30
|
transactionId: TransactionID;
|
|
31
31
|
transactionSaveUpdates: TransactionSaveUpdates;
|
|
32
|
+
isExpenseAutomationEnabled: boolean;
|
|
32
33
|
}, "transactionDetail/updateTransactionDetail", never, never>, updateTransactionDetailSaveStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, fetchState: FetchState, error?: ZeniAPIStatus<Record<string, unknown>> | undefined], {
|
|
33
34
|
transactionId: TransactionID;
|
|
34
35
|
fetchState: FetchState;
|
|
35
36
|
error: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
36
37
|
}, "transactionDetail/updateTransactionDetailSaveStatus", never, never>, clearTransactionDetailSaveStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID], {
|
|
37
38
|
transactionId: TransactionID;
|
|
38
|
-
}, "transactionDetail/clearTransactionDetailSaveStatus", never, never>, markTransactionAsNotMiscategorized: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, transactionSaveUpdates: TransactionSaveUpdates], {
|
|
39
|
+
}, "transactionDetail/clearTransactionDetailSaveStatus", never, never>, markTransactionAsNotMiscategorized: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, transactionSaveUpdates: TransactionSaveUpdates, isExpenseAutomationEnabled: boolean], {
|
|
39
40
|
transactionId: TransactionID;
|
|
40
41
|
transactionSaveUpdates: TransactionSaveUpdates;
|
|
42
|
+
isExpenseAutomationEnabled: boolean;
|
|
41
43
|
}, "transactionDetail/markTransactionAsNotMiscategorized", never, never>, deleteTransactionAttachment: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[attachmentFileName: string, transactionId: TransactionID], {
|
|
42
44
|
attachmentFileName: string;
|
|
43
45
|
transactionId: TransactionID;
|
|
@@ -97,11 +97,12 @@ const transactionDetail = (0, toolkit_1.createSlice)({
|
|
|
97
97
|
} }) });
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
|
-
prepare(transactionId, transactionSaveUpdates) {
|
|
100
|
+
prepare(transactionId, transactionSaveUpdates, isExpenseAutomationEnabled) {
|
|
101
101
|
return {
|
|
102
102
|
payload: {
|
|
103
103
|
transactionId,
|
|
104
104
|
transactionSaveUpdates,
|
|
105
|
+
isExpenseAutomationEnabled,
|
|
105
106
|
},
|
|
106
107
|
};
|
|
107
108
|
},
|
|
@@ -160,11 +161,12 @@ const transactionDetail = (0, toolkit_1.createSlice)({
|
|
|
160
161
|
} }) });
|
|
161
162
|
}
|
|
162
163
|
},
|
|
163
|
-
prepare(transactionId, transactionSaveUpdates) {
|
|
164
|
+
prepare(transactionId, transactionSaveUpdates, isExpenseAutomationEnabled) {
|
|
164
165
|
return {
|
|
165
166
|
payload: {
|
|
166
167
|
transactionId,
|
|
167
168
|
transactionSaveUpdates,
|
|
169
|
+
isExpenseAutomationEnabled,
|
|
168
170
|
},
|
|
169
171
|
};
|
|
170
172
|
},
|
|
@@ -6,7 +6,8 @@ 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';
|
|
9
10
|
import { resendOtpSpendManagementSetUp, sendOtpFailureSpendManagementSetUp, sendOtpSuccessSpendManagementSetUp } from '../spendManagement/commonSetup/setupViewReducer';
|
|
10
11
|
import { resendOtp, sendOtpFailure, sendOtpSuccess } from './twoFactorAuthenticationReducer';
|
|
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>,
|
|
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 resendOtpCardHolder> | ReturnType<typeof sendOtpCardHolderSuccess> | ReturnType<typeof sendOtpCardHolderFailure> | ReturnType<typeof sendOtpMyProfileFailure> | ReturnType<typeof sendOtpMyProfileSuccess>;
|
|
13
|
+
export declare const resendOtpEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -8,27 +8,14 @@ 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");
|
|
11
12
|
const setupViewReducer_1 = require("../spendManagement/commonSetup/setupViewReducer");
|
|
12
13
|
const twoFactorAuthenticationReducer_1 = require("./twoFactorAuthenticationReducer");
|
|
13
|
-
const resendOtpEpic = (actions$,
|
|
14
|
-
var _a;
|
|
14
|
+
const resendOtpEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(twoFactorAuthenticationReducer_1.resendOtp.match), (0, operators_1.mergeMap)((action) => {
|
|
15
15
|
const resendOtpActions = [];
|
|
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;
|
|
16
|
+
const { otpChallenge, twoFASource, entityId } = action.payload;
|
|
27
17
|
const payload = {
|
|
28
18
|
otp_challenge: otpChallenge,
|
|
29
|
-
is_for_charge_cards: twoFASource === 'ChargeCard' ||
|
|
30
|
-
twoFASource === 'CardUserOnboarding' ||
|
|
31
|
-
(twoFASource === 'MyProfile' && isCardsEnabled),
|
|
32
19
|
};
|
|
33
20
|
switch (twoFASource) {
|
|
34
21
|
case 'SpendManagementSetup':
|
|
@@ -52,7 +39,11 @@ const resendOtpEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators
|
|
|
52
39
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
53
40
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
54
41
|
const updateActions = [
|
|
55
|
-
(0, twoFactorAuthenticationReducer_1.sendOtpSuccess)({
|
|
42
|
+
(0, twoFactorAuthenticationReducer_1.sendOtpSuccess)({
|
|
43
|
+
otpChallenge: response.data.otp_challenge,
|
|
44
|
+
twoFASource,
|
|
45
|
+
entityId,
|
|
46
|
+
}),
|
|
56
47
|
];
|
|
57
48
|
switch (twoFASource) {
|
|
58
49
|
case 'SpendManagementSetup':
|
|
@@ -80,12 +71,24 @@ const resendOtpEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators
|
|
|
80
71
|
otpChallenge: response.data.otp_challenge,
|
|
81
72
|
}));
|
|
82
73
|
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;
|
|
83
82
|
}
|
|
84
83
|
return (0, rxjs_1.from)(updateActions);
|
|
85
84
|
}
|
|
86
85
|
else {
|
|
87
86
|
const updateActions = [
|
|
88
|
-
(0, twoFactorAuthenticationReducer_1.sendOtpFailure)(
|
|
87
|
+
(0, twoFactorAuthenticationReducer_1.sendOtpFailure)({
|
|
88
|
+
error: response.status,
|
|
89
|
+
twoFASource,
|
|
90
|
+
entityId,
|
|
91
|
+
}),
|
|
89
92
|
];
|
|
90
93
|
switch (twoFASource) {
|
|
91
94
|
case 'SpendManagementSetup':
|
|
@@ -103,12 +106,26 @@ const resendOtpEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators
|
|
|
103
106
|
case 'CardUserOnboarding':
|
|
104
107
|
updateActions.push((0, cardUserOnboardingReducer_1.sendOtpCardUserOnboardingFailure)(response.status));
|
|
105
108
|
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;
|
|
106
117
|
}
|
|
107
118
|
return (0, rxjs_1.from)(updateActions);
|
|
108
119
|
}
|
|
109
120
|
}), (0, operators_1.catchError)((error) => {
|
|
110
121
|
const zeniAPIStatus = (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Resend otp api errored out' + JSON.stringify(error));
|
|
111
|
-
const updateActions = [
|
|
122
|
+
const updateActions = [
|
|
123
|
+
(0, twoFactorAuthenticationReducer_1.sendOtpFailure)({
|
|
124
|
+
error: zeniAPIStatus,
|
|
125
|
+
twoFASource,
|
|
126
|
+
entityId,
|
|
127
|
+
}),
|
|
128
|
+
];
|
|
112
129
|
switch (twoFASource) {
|
|
113
130
|
case 'SpendManagementSetup':
|
|
114
131
|
updateActions.push((0, setupViewReducer_1.sendOtpFailureSpendManagementSetUp)(zeniAPIStatus));
|
|
@@ -125,6 +142,14 @@ const resendOtpEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators
|
|
|
125
142
|
case 'CardUserOnboarding':
|
|
126
143
|
updateActions.push((0, cardUserOnboardingReducer_1.sendOtpCardUserOnboardingFailure)(zeniAPIStatus));
|
|
127
144
|
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;
|
|
128
153
|
}
|
|
129
154
|
return (0, rxjs_1.from)(updateActions);
|
|
130
155
|
}));
|
|
@@ -6,7 +6,8 @@ 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';
|
|
9
10
|
import { sendOtpFailureSpendManagementSetUp, sendOtpSpendManagementSetUp, sendOtpSuccessSpendManagementSetUp } from '../spendManagement/commonSetup/setupViewReducer';
|
|
10
11
|
import { sendOtp, sendOtpFailure, sendOtpSuccess } from './twoFactorAuthenticationReducer';
|
|
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>;
|
|
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 sendOtpCardHolder> | ReturnType<typeof sendOtpCardHolderSuccess> | ReturnType<typeof sendOtpCardHolderFailure> | ReturnType<typeof sendOtpMyProfileFailure> | ReturnType<typeof sendOtpMyProfileSuccess>;
|
|
12
13
|
export declare const sendOtpEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -8,31 +8,23 @@ 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");
|
|
11
12
|
const setupViewReducer_1 = require("../spendManagement/commonSetup/setupViewReducer");
|
|
12
13
|
const twoFactorAuthenticationReducer_1 = require("./twoFactorAuthenticationReducer");
|
|
13
14
|
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 } = 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;
|
|
16
|
+
const { phoneNumber, twoFASource, entityId } = action.payload;
|
|
27
17
|
const queryPayload = {
|
|
28
18
|
channel_type: 'phone',
|
|
29
19
|
channel_info: {
|
|
30
20
|
phone_number: phoneNumber,
|
|
31
21
|
},
|
|
32
|
-
is_for_charge_cards: twoFASource === 'ChargeCard' ||
|
|
33
|
-
twoFASource === 'CardUserOnboarding' ||
|
|
34
|
-
(twoFASource === 'MyProfile' && isCardsEnabled),
|
|
35
22
|
};
|
|
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
|
+
}
|
|
36
28
|
switch (twoFASource) {
|
|
37
29
|
case 'SpendManagementSetup':
|
|
38
30
|
sendOtpActions.push((0, setupViewReducer_1.sendOtpSpendManagementSetUp)());
|
|
@@ -49,13 +41,22 @@ const sendOtpEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1
|
|
|
49
41
|
case 'CardUserOnboarding':
|
|
50
42
|
sendOtpActions.push((0, cardUserOnboardingReducer_1.sendOtpCardUserOnboarding)());
|
|
51
43
|
break;
|
|
44
|
+
case 'ChargeCardHolder':
|
|
45
|
+
if (entityId != null) {
|
|
46
|
+
sendOtpActions.push((0, chargeCardDetailReducer_1.sendOtpCardHolder)({ phone: phoneNumber, chargeCardId: entityId }));
|
|
47
|
+
}
|
|
48
|
+
break;
|
|
52
49
|
}
|
|
53
50
|
const setOtp$ = zeniAPI
|
|
54
51
|
.postAndGetJSON(`${zeniAPI.apiEndPoints.authMicroServiceBaseUrl}/1.0/otp/send`, queryPayload)
|
|
55
52
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
56
53
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
57
54
|
const updateActions = [
|
|
58
|
-
(0, twoFactorAuthenticationReducer_1.sendOtpSuccess)({
|
|
55
|
+
(0, twoFactorAuthenticationReducer_1.sendOtpSuccess)({
|
|
56
|
+
otpChallenge: response.data.otp_challenge,
|
|
57
|
+
twoFASource,
|
|
58
|
+
entityId,
|
|
59
|
+
}),
|
|
59
60
|
];
|
|
60
61
|
switch (twoFASource) {
|
|
61
62
|
case 'SpendManagementSetup':
|
|
@@ -83,12 +84,20 @@ const sendOtpEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1
|
|
|
83
84
|
otpChallenge: response.data.otp_challenge,
|
|
84
85
|
}));
|
|
85
86
|
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;
|
|
86
95
|
}
|
|
87
96
|
return (0, rxjs_1.from)(updateActions);
|
|
88
97
|
}
|
|
89
98
|
else {
|
|
90
99
|
const updateActions = [
|
|
91
|
-
(0, twoFactorAuthenticationReducer_1.sendOtpFailure)(response.status),
|
|
100
|
+
(0, twoFactorAuthenticationReducer_1.sendOtpFailure)({ error: response.status, twoFASource, entityId }),
|
|
92
101
|
];
|
|
93
102
|
switch (twoFASource) {
|
|
94
103
|
case 'SpendManagementSetup':
|
|
@@ -106,12 +115,22 @@ const sendOtpEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1
|
|
|
106
115
|
case 'CardUserOnboarding':
|
|
107
116
|
updateActions.push((0, cardUserOnboardingReducer_1.sendOtpCardUserOnboardingFailure)(response.status));
|
|
108
117
|
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;
|
|
109
126
|
}
|
|
110
127
|
return (0, rxjs_1.from)(updateActions);
|
|
111
128
|
}
|
|
112
129
|
}), (0, operators_1.catchError)((error) => {
|
|
113
130
|
const zeniAPIStatus = (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Send otp api errored out' + JSON.stringify(error));
|
|
114
|
-
const updateActions = [
|
|
131
|
+
const updateActions = [
|
|
132
|
+
(0, twoFactorAuthenticationReducer_1.sendOtpFailure)({ error: zeniAPIStatus, twoFASource, entityId }),
|
|
133
|
+
];
|
|
115
134
|
switch (twoFASource) {
|
|
116
135
|
case 'SpendManagementSetup':
|
|
117
136
|
updateActions.push((0, setupViewReducer_1.sendOtpFailureSpendManagementSetUp)(zeniAPIStatus));
|
|
@@ -128,6 +147,14 @@ const sendOtpEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1
|
|
|
128
147
|
case 'CardUserOnboarding':
|
|
129
148
|
updateActions.push((0, cardUserOnboardingReducer_1.sendOtpCardUserOnboardingFailure)(zeniAPIStatus));
|
|
130
149
|
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;
|
|
131
158
|
}
|
|
132
159
|
return (0, rxjs_1.from)(updateActions);
|
|
133
160
|
}));
|