@zeniai/client-epic-state 4.12.75 → 4.12.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,4 +9,4 @@ import { resendOnboardingOfficerOtp, sendOnboardingOfficerOtpFailure, sendOnboar
|
|
|
9
9
|
import { sendOtpMyProfileFailure, sendOtpMyProfileSuccess, resendOtpMyProfile } from '../settingsView/settingsViewReducer';
|
|
10
10
|
import { resendOtpCardUserOnboarding, sendOtpCardUserOnboardingFailure, sendOtpCardUserOnboardingSuccess } from '../spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingReducer';
|
|
11
11
|
export declare type ActionType = ReturnType<typeof resendOtp> | ReturnType<typeof sendOtpSuccess> | ReturnType<typeof sendOtpFailure> | ReturnType<typeof resendOtpSpendManagementSetUp> | ReturnType<typeof sendOtpSuccessSpendManagementSetUp> | ReturnType<typeof sendOtpFailureSpendManagementSetUp> | ReturnType<typeof resendOtpVendorView> | ReturnType<typeof sendOtpVendorViewSuccess> | ReturnType<typeof sendOtpVendorViewFailure> | ReturnType<typeof resendOnboardingOfficerOtp> | ReturnType<typeof sendOnboardingOfficerOtpSuccess> | ReturnType<typeof sendOnboardingOfficerOtpFailure> | 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 declare const resendOtpEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -10,12 +10,24 @@ const vendorViewReducer_1 = require("../commonVendorView/vendorView/vendorViewRe
|
|
|
10
10
|
const onboardingCustomerViewReducer_1 = require("../onboardingView/customerView/onboardingCustomerViewReducer");
|
|
11
11
|
const settingsViewReducer_1 = require("../settingsView/settingsViewReducer");
|
|
12
12
|
const cardUserOnboardingReducer_1 = require("../spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingReducer");
|
|
13
|
-
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;
|
|
14
15
|
const resendOtpActions = [];
|
|
15
16
|
const { otpChallenge, twoFASource } = action.payload;
|
|
17
|
+
const tenantState = state$.value.tenantState;
|
|
18
|
+
const { currentTenantId } = tenantState;
|
|
19
|
+
const productSettings = currentTenantId != null
|
|
20
|
+
? (_a = tenantState.tenantsById[currentTenantId]) === null || _a === void 0 ? void 0 : _a.productSettings
|
|
21
|
+
: undefined;
|
|
22
|
+
const isCardsEnabled = productSettings != null
|
|
23
|
+
? productSettings.isBookkeepingEnabled ||
|
|
24
|
+
productSettings.isCardsEnabled
|
|
25
|
+
: false;
|
|
16
26
|
const payload = {
|
|
17
27
|
otp_challenge: otpChallenge,
|
|
18
|
-
is_for_charge_cards: twoFASource === 'ChargeCard'
|
|
28
|
+
is_for_charge_cards: twoFASource === 'ChargeCard' ||
|
|
29
|
+
twoFASource === 'CardUserOnboarding' ||
|
|
30
|
+
(twoFASource === 'MyProfile' && isCardsEnabled),
|
|
19
31
|
};
|
|
20
32
|
switch (twoFASource) {
|
|
21
33
|
case 'SpendManagementSetup':
|
|
@@ -172,12 +172,12 @@ const vendorFiling1099UploadDetails = (0, toolkit_1.createSlice)({
|
|
|
172
172
|
draft.vendor1099DetailsLocalData = Object.assign(Object.assign({}, draft.vendor1099DetailsLocalData), action.payload);
|
|
173
173
|
},
|
|
174
174
|
updateW9FormOCRDataToLocalData(draft, action) {
|
|
175
|
-
var _a, _b, _c, _d, _e;
|
|
175
|
+
var _a, _b, _c, _d, _e, _f;
|
|
176
176
|
const tin = (_a = action.payload.ocrData) === null || _a === void 0 ? void 0 : _a.tin;
|
|
177
177
|
const vendorName = (_b = action.payload.ocrData) === null || _b === void 0 ? void 0 : _b.legal_name;
|
|
178
178
|
const vendorType = (_c = action.payload.ocrData) === null || _c === void 0 ? void 0 : _c.vendor_type;
|
|
179
179
|
const tinType = (_d = tin === null || tin === void 0 ? void 0 : tin.type) !== null && _d !== void 0 ? _d : null;
|
|
180
|
-
const tinValue = (_e = tin === null || tin === void 0 ? void 0 : tin.value) !== null &&
|
|
180
|
+
const tinValue = (_f = (_e = tin === null || tin === void 0 ? void 0 : tin.value) === null || _e === void 0 ? void 0 : _e.replace(/\D/g, '')) !== null && _f !== void 0 ? _f : null;
|
|
181
181
|
// TODO: Add billing address to the local state
|
|
182
182
|
draft.vendor1099DetailsLocalData = Object.assign(Object.assign({}, draft.vendor1099DetailsLocalData), { tin: {
|
|
183
183
|
type: tinType,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.12.
|
|
3
|
+
"version": "4.12.76",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|