@zeniai/client-epic-state 4.12.97 → 4.12.98
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/commonPayloadTypes/commonPayload.d.ts +0 -7
- package/lib/commonPayloadTypes/v2/getSumOfBalancesGroupedByPeriod.d.ts +0 -0
- package/lib/commonPayloadTypes/v2/getSumOfBalancesGroupedByPeriod.js +1 -0
- package/lib/commonStateTypes/selectorTypes/pickAndMergeForecastSectionWithAcOnly.d.ts +0 -0
- package/lib/commonStateTypes/selectorTypes/pickAndMergeForecastSectionWithAcOnly.js +1 -0
- package/lib/entity/company/companyPayload.d.ts +0 -4
- package/lib/entity/company/companyPayload.js +3 -6
- package/lib/entity/company/companyReducer.d.ts +1 -4
- package/lib/entity/company/companyReducer.js +2 -6
- package/lib/entity/company/companyStateTypes.d.ts +0 -4
- package/lib/entity/file/fileState.d.ts +3 -3
- package/lib/entity/file/fileState.js +0 -2
- package/lib/entity/tenant/clearAllEpic.d.ts +1 -3
- package/lib/entity/tenant/clearAllEpic.js +0 -4
- package/lib/entity/user/userPayload.d.ts +0 -1
- package/lib/entity/user/userReducer.js +8 -9
- package/lib/entity/user/userState.d.ts +0 -1
- package/lib/epic.d.ts +1 -6
- package/lib/epic.js +1 -6
- package/lib/index.d.ts +5 -12
- package/lib/index.js +6 -15
- package/lib/reducer.d.ts +0 -6
- package/lib/reducer.js +0 -6
- package/lib/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +1 -7
- package/lib/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +1 -7
- package/lib/view/addressView/addressViewState.d.ts +1 -1
- package/lib/view/addressView/toAddressViewLocalData.js +0 -5
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +1 -1
- package/lib/view/companyView/epic/companyPassport/updateCompanyPassportLocalStoreDataEpic.js +6 -1
- package/lib/view/companyView/selectorHelpers/getCompanyView.js +0 -4
- package/lib/view/companyView/types/companyPassport/companyUsersLocalData.d.ts +0 -2
- package/lib/view/companyView/types/companyPassport/companyUsersLocalData.js +1 -7
- package/lib/view/companyView/types/companyView.d.ts +0 -1
- package/lib/view/onboardingView/customerView/epic/customerDetails/fetchOnboardingCustomerViewEpic.d.ts +1 -8
- package/lib/view/onboardingView/customerView/epic/customerDetails/fetchOnboardingCustomerViewEpic.js +1 -3
- package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +4 -5
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +0 -2
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +3 -6
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.d.ts +4 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +0 -2
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +0 -3
- package/lib/view/spendManagement/billPay/internationalWire/internationalWireSelector.d.ts +1 -2
- package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.d.ts +1 -1
- package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js +6 -31
- package/lib/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.d.ts +2 -2
- package/lib/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.js +2 -5
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +1 -4
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +2 -6
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +0 -1
- package/lib/view/spendManagement/commonSetup/types/businessVerification.d.ts +0 -4
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +3 -1
- package/package.json +1 -1
- package/lib/view/countryList/countryListReducer.d.ts +0 -17
- package/lib/view/countryList/countryListReducer.js +0 -58
- package/lib/view/countryList/countryListSelector.d.ts +0 -7
- package/lib/view/countryList/countryListSelector.js +0 -13
- package/lib/view/countryList/countryListState.d.ts +0 -12
- package/lib/view/countryList/countryListState.js +0 -2
- package/lib/view/countryList/epics/fetchCountryListEpic.d.ts +0 -6
- package/lib/view/countryList/epics/fetchCountryListEpic.js +0 -19
- package/lib/view/countryList/epics/fetchNationalityCountryListEpic.d.ts +0 -7
- package/lib/view/countryList/epics/fetchNationalityCountryListEpic.js +0 -38
- package/lib/view/countryList/payloads/countryListPayload.d.ts +0 -6
- package/lib/view/countryList/payloads/countryListPayload.js +0 -10
- package/lib/view/countryList/payloads/nationalityCountryListPayload.d.ts +0 -11
- package/lib/view/countryList/payloads/nationalityCountryListPayload.js +0 -2
- package/lib/view/spendManagement/billPay/internationalWireVerification/epics/fetchIntlVerificationFormEpic.d.ts +0 -7
- package/lib/view/spendManagement/billPay/internationalWireVerification/epics/fetchIntlVerificationFormEpic.js +0 -36
- package/lib/view/spendManagement/billPay/internationalWireVerification/epics/initializeIntlVerificationFormEpic.d.ts +0 -6
- package/lib/view/spendManagement/billPay/internationalWireVerification/epics/initializeIntlVerificationFormEpic.js +0 -40
- package/lib/view/spendManagement/billPay/internationalWireVerification/epics/submitIntlVerificationEpic.d.ts +0 -9
- package/lib/view/spendManagement/billPay/internationalWireVerification/epics/submitIntlVerificationEpic.js +0 -67
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationPayload.d.ts +0 -26
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationPayload.js +0 -22
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationReducer.d.ts +0 -22
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationReducer.js +0 -89
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSelector.d.ts +0 -15
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSelector.js +0 -30
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationState.d.ts +0 -20
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationState.js +0 -2
|
@@ -315,8 +315,6 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
315
315
|
const classHierarchyList = (0, classListSelector_1.getNestedClassListHierarchy)(classListState);
|
|
316
316
|
const duplicateBills = (0, billPayReviewSelector_1.getDuplicateBills)(state, billId);
|
|
317
317
|
const isProcessing = (0, helpers_1.isBulkProcessing)((_1 = transaction === null || transaction === void 0 ? void 0 : transaction.bulkProcessingDetail) === null || _1 === void 0 ? void 0 : _1.type);
|
|
318
|
-
const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId !== null && companyId !== void 0 ? companyId : '', []);
|
|
319
|
-
const internationalWireOnboardingStatus = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyBillPayInfo.internationalWireOnboardingStatus;
|
|
320
318
|
return {
|
|
321
319
|
showVendorGptRecommendationText,
|
|
322
320
|
recommendedVendor,
|
|
@@ -366,7 +364,6 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
366
364
|
recurringConfig,
|
|
367
365
|
isProcessing,
|
|
368
366
|
isBillMarkedForRetry,
|
|
369
|
-
internationalWireOnboardingStatus,
|
|
370
367
|
};
|
|
371
368
|
};
|
|
372
369
|
exports.getEditBillDetail = getEditBillDetail;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
2
2
|
import { RootState } from '../../../../reducer';
|
|
3
|
-
import { Country } from '
|
|
4
|
-
import { VendorCurrency } from '../billPayConfig/billPayConfigState';
|
|
3
|
+
import { Country, VendorCurrency } from '../billPayConfig/billPayConfigState';
|
|
5
4
|
import { CreateInternationalWireDetails, DynamicFormField, SupportedAccountType } from './internationalWire';
|
|
6
5
|
export interface InternationalWireSelectorView extends SelectorView {
|
|
7
6
|
dynamicForm: DynamicFormField[];
|
package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.d.ts
CHANGED
|
@@ -16,6 +16,6 @@ import { CompanyDetailsVerificationPayload, CompanyOfficerVerificationPayload, N
|
|
|
16
16
|
import { CompanyDetailsLocalData, CompanyOfficerLocalData, PrimaryContactLocalData } from '../../setupViewState';
|
|
17
17
|
export declare type ActionType = ReturnType<typeof updateBusinessVerificationDetails> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateCompanies> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateFiles> | ReturnType<typeof updateAccounts> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof updateSetupViewLocalStoreData> | ReturnType<typeof updateSelectedCompanyOfficer> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateBusinessVerificationDetailsSuccess> | ReturnType<typeof updateBusinessVerificationDetailsFailure>;
|
|
18
18
|
export declare const updateBusinessVerificationDetailsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
19
|
-
export declare const toBusinessVerificationCompanyDataPayload: (companyLocalData: CompanyDetailsLocalData, sendForVerification: boolean, companyAddressData?: AddressUpdatableInfo | undefined
|
|
19
|
+
export declare const toBusinessVerificationCompanyDataPayload: (companyLocalData: CompanyDetailsLocalData, sendForVerification: boolean, companyAddressData?: AddressUpdatableInfo | undefined) => Partial<CompanyDetailsVerificationPayload>;
|
|
20
20
|
export declare const toBusinessVerificationPrimaryContactDataPayload: (primaryContact: PrimaryContactLocalData, isNewPrimaryContactUser: boolean) => Partial<PrimaryContactVerificationPayload>;
|
|
21
21
|
export declare const toBusinessVerificationOfficerDataPayload: (companyOfficer: CompanyOfficerLocalData, isSubmittingAdditionalDocuments: boolean, companyOfficerAddressData?: AddressUpdatableInfo | undefined) => Partial<CompanyOfficerVerificationPayload> | Partial<NewCompanyOfficerVerificationPayload>;
|
package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.toBusinessVerificationOfficerDataPayload = exports.toBusinessVerificationPrimaryContactDataPayload = exports.toBusinessVerificationCompanyDataPayload = exports.updateBusinessVerificationDetailsEpic = void 0;
|
|
7
4
|
const rxjs_1 = require("rxjs");
|
|
@@ -18,10 +15,8 @@ const paymentAccountReducer_1 = require("../../../../../entity/paymentAccount/pa
|
|
|
18
15
|
const addressViewPayload_1 = require("../../../../addressView/addressViewPayload");
|
|
19
16
|
const getCompanyView_1 = require("../../../../companyView/selectorHelpers/getCompanyView");
|
|
20
17
|
const setupViewReducer_1 = require("../../setupViewReducer");
|
|
21
|
-
const addressViewSelector_1 = require("../../../../addressView/addressViewSelector");
|
|
22
|
-
const isEqual_1 = __importDefault(require("lodash/isEqual"));
|
|
23
18
|
const updateBusinessVerificationDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(setupViewReducer_1.updateBusinessVerificationDetails.match), (0, operators_1.mergeMap)((action) => {
|
|
24
|
-
var _a, _b, _c
|
|
19
|
+
var _a, _b, _c;
|
|
25
20
|
const { companyId, officerType, setupViewType, sendForVerification, fromBillListScreen, isSubmittingAdditionalDocuments, } = action.payload;
|
|
26
21
|
const { setupViewState } = state$.value;
|
|
27
22
|
const companyLocalData = setupViewState.companyDetails.localData;
|
|
@@ -31,15 +26,14 @@ const updateBusinessVerificationDetailsEpic = (actions$, state$, zeniAPI) => act
|
|
|
31
26
|
const companyView = (0, getCompanyView_1.getCompanyView)(state$.value, companyId, []);
|
|
32
27
|
const { newAddressState } = state$.value.addressViewState;
|
|
33
28
|
const companyAddressToCreate = (_a = newAddressState === null || newAddressState === void 0 ? void 0 : newAddressState.company_address) === null || _a === void 0 ? void 0 : _a.addressToCreate;
|
|
34
|
-
const registeredAddressToCreate = (_b = newAddressState === null || newAddressState === void 0 ? void 0 : newAddressState.company_registered_address) === null || _b === void 0 ? void 0 : _b.addressToCreate;
|
|
35
29
|
const addressType = officerType
|
|
36
30
|
.toLowerCase()
|
|
37
31
|
.concat('_address');
|
|
38
|
-
const companyOfficerAddressToCreate = (
|
|
32
|
+
const companyOfficerAddressToCreate = (_b = newAddressState === null || newAddressState === void 0 ? void 0 : newAddressState[addressType]) === null || _b === void 0 ? void 0 : _b.addressToCreate;
|
|
39
33
|
const isNewPrimaryContactUser = (primaryContactLocalData === null || primaryContactLocalData === void 0 ? void 0 : primaryContactLocalData.userId) == null ||
|
|
40
34
|
(primaryContactLocalData === null || primaryContactLocalData === void 0 ? void 0 : primaryContactLocalData.email) !==
|
|
41
|
-
((
|
|
42
|
-
const company = (0, exports.toBusinessVerificationCompanyDataPayload)(companyLocalData, sendForVerification, companyAddressToCreate
|
|
35
|
+
((_c = companyView === null || companyView === void 0 ? void 0 : companyView.primaryContact) === null || _c === void 0 ? void 0 : _c.user.email);
|
|
36
|
+
const company = (0, exports.toBusinessVerificationCompanyDataPayload)(companyLocalData, sendForVerification, companyAddressToCreate);
|
|
43
37
|
const primary_contact_user = primaryContactLocalData != null &&
|
|
44
38
|
Boolean(primaryContactLocalData.email) === true // Don't save Empty Primary Contact details
|
|
45
39
|
? (0, exports.toBusinessVerificationPrimaryContactDataPayload)(primaryContactLocalData, isNewPrimaryContactUser)
|
|
@@ -110,7 +104,7 @@ const updateBusinessVerificationDetailsEpic = (actions$, state$, zeniAPI) => act
|
|
|
110
104
|
}
|
|
111
105
|
}));
|
|
112
106
|
exports.updateBusinessVerificationDetailsEpic = updateBusinessVerificationDetailsEpic;
|
|
113
|
-
const toBusinessVerificationCompanyDataPayload = (companyLocalData, sendForVerification, companyAddressData
|
|
107
|
+
const toBusinessVerificationCompanyDataPayload = (companyLocalData, sendForVerification, companyAddressData) => {
|
|
114
108
|
const { companyDescription, companyLegalName, companyIndustry, website, incDate, taxIdOrEIN, phone, syncToken, fileIds, typeOfIncorporation, } = companyLocalData;
|
|
115
109
|
const company = {
|
|
116
110
|
is_ready_for_verification: sendForVerification,
|
|
@@ -119,19 +113,6 @@ const toBusinessVerificationCompanyDataPayload = (companyLocalData, sendForVerif
|
|
|
119
113
|
const companyAddressPayload = companyAddressData != null
|
|
120
114
|
? (0, addressViewPayload_1.toAddressUpdatableInfoPayload)(companyAddressData)
|
|
121
115
|
: undefined;
|
|
122
|
-
const registeredAddressPayload = registeredAddressData != null
|
|
123
|
-
? (0, addressViewPayload_1.toAddressUpdatableInfoPayload)(registeredAddressData)
|
|
124
|
-
: undefined;
|
|
125
|
-
if ((0, isEqual_1.default)(companyAddressData != null
|
|
126
|
-
? (0, addressViewSelector_1.getFormattedAddress)(companyAddressData)
|
|
127
|
-
: companyAddressData, registeredAddressData != null
|
|
128
|
-
? (0, addressViewSelector_1.getFormattedAddress)(registeredAddressData)
|
|
129
|
-
: registeredAddressData)) {
|
|
130
|
-
company['is_registered_address_same_as_company_address'] = true;
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
company['is_registered_address_same_as_company_address'] = false;
|
|
134
|
-
}
|
|
135
116
|
if (companyDescription != null) {
|
|
136
117
|
company['company_description'] = companyDescription;
|
|
137
118
|
}
|
|
@@ -156,9 +137,6 @@ const toBusinessVerificationCompanyDataPayload = (companyLocalData, sendForVerif
|
|
|
156
137
|
if (companyAddressPayload != null) {
|
|
157
138
|
company['address'] = companyAddressPayload;
|
|
158
139
|
}
|
|
159
|
-
if (registeredAddressPayload != null) {
|
|
160
|
-
company['registered_address'] = registeredAddressPayload;
|
|
161
|
-
}
|
|
162
140
|
if (typeOfIncorporation != null) {
|
|
163
141
|
company['company_inc_type'] = typeOfIncorporation;
|
|
164
142
|
}
|
|
@@ -185,7 +163,7 @@ const toBusinessVerificationPrimaryContactDataPayload = (primaryContact, isNewPr
|
|
|
185
163
|
};
|
|
186
164
|
exports.toBusinessVerificationPrimaryContactDataPayload = toBusinessVerificationPrimaryContactDataPayload;
|
|
187
165
|
const toBusinessVerificationOfficerDataPayload = (companyOfficer, isSubmittingAdditionalDocuments, companyOfficerAddressData) => {
|
|
188
|
-
const { firstName, lastName, userId, email, syncToken: userSyncToken, ssn, birthday,
|
|
166
|
+
const { firstName, lastName, userId, email, syncToken: userSyncToken, ssn, birthday, phone: userPhone, otpChallenge, isPhoneVerified, titleAtCompany, ownershipInCompany, documentTypeSelectedForVerification, fileIds: userFileIds, additionalSubmittedDocumentsForVerificationFileIds, } = companyOfficer;
|
|
189
167
|
const company_officer = {
|
|
190
168
|
first_name: firstName,
|
|
191
169
|
last_name: lastName,
|
|
@@ -216,9 +194,6 @@ const toBusinessVerificationOfficerDataPayload = (companyOfficer, isSubmittingAd
|
|
|
216
194
|
if (birthday != null) {
|
|
217
195
|
company_officer['birthday'] = birthday.format('YYYY-MM-DD');
|
|
218
196
|
}
|
|
219
|
-
if (nationalityCountryCode != null) {
|
|
220
|
-
company_officer['nationality_country_code'] = nationalityCountryCode;
|
|
221
|
-
}
|
|
222
197
|
if (userPhone != null) {
|
|
223
198
|
company_officer['phone'] = userPhone;
|
|
224
199
|
}
|
package/lib/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ import { Company } from '../../../../../entity/company/companyStateTypes';
|
|
|
5
5
|
import { clearSetupViewDataInLocalStore, saveSetupViewDataInLocalStore, updateSetupViewLocalStoreData } from '../../setupViewReducer';
|
|
6
6
|
import { SetupViewLocalData } from '../../setupViewState';
|
|
7
7
|
import { UserRole } from '../../../../../entity/userRole/userRoleState';
|
|
8
|
-
import { newAddressInLocalStore,
|
|
9
|
-
export declare type ActionType = ReturnType<typeof updateSetupViewLocalStoreData> | ReturnType<typeof saveSetupViewDataInLocalStore> | ReturnType<typeof clearSetupViewDataInLocalStore> | ReturnType<typeof
|
|
8
|
+
import { newAddressInLocalStore, resetNewAddressesInLocalStore } from '../../../../addressView/addressViewReducer';
|
|
9
|
+
export declare type ActionType = ReturnType<typeof updateSetupViewLocalStoreData> | ReturnType<typeof saveSetupViewDataInLocalStore> | ReturnType<typeof clearSetupViewDataInLocalStore> | ReturnType<typeof resetNewAddressesInLocalStore> | ReturnType<typeof newAddressInLocalStore>;
|
|
10
10
|
export declare const updateSetupViewLocalStoreDataEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => import("rxjs").Observable<ActionType>;
|
|
11
11
|
/**
|
|
12
12
|
* Helpers
|
package/lib/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.js
CHANGED
|
@@ -29,8 +29,7 @@ const updateSetupViewLocalStoreDataEpic = (actions$, state$) => actions$.pipe((0
|
|
|
29
29
|
const fetchActions = [];
|
|
30
30
|
if (company != null) {
|
|
31
31
|
const setupViewLocalData = toSetupViewLocalData(company, companyOfficers, companyOfficerRoles, primaryContact);
|
|
32
|
-
fetchActions.push((0, setupViewReducer_1.clearSetupViewDataInLocalStore)(), (0, setupViewReducer_1.saveSetupViewDataInLocalStore)(setupViewLocalData));
|
|
33
|
-
fetchActions.push((0, addressViewReducer_1.resetNewAddressDataInLocalStoreForAddressTypes)(companyUsersLocalData_1.AllCompanyPassportAddressTypes));
|
|
32
|
+
fetchActions.push((0, setupViewReducer_1.clearSetupViewDataInLocalStore)(), (0, setupViewReducer_1.saveSetupViewDataInLocalStore)(setupViewLocalData), (0, addressViewReducer_1.resetNewAddressesInLocalStore)());
|
|
34
33
|
}
|
|
35
34
|
if (companyView != null) {
|
|
36
35
|
const addresses = (0, toAddressViewLocalData_1.toAddressViewLocalData)(companyView);
|
|
@@ -91,7 +90,7 @@ function toSetupViewLocalData(company, users, userRoles, primaryContact) {
|
|
|
91
90
|
}
|
|
92
91
|
const officers = companyOfficers.map((user, index) => {
|
|
93
92
|
var _a, _b, _c, _d, _e;
|
|
94
|
-
const { userId, firstName, lastName, birthday, email,
|
|
93
|
+
const { userId, firstName, lastName, birthday, email, phone: userPhone, isPhoneVerified, ssn, syncToken, } = user;
|
|
95
94
|
const userRole = userRoles.find((userRole) => userRole.userId === userId);
|
|
96
95
|
return {
|
|
97
96
|
officerType: `Officer_${index + 1}`,
|
|
@@ -100,7 +99,6 @@ function toSetupViewLocalData(company, users, userRoles, primaryContact) {
|
|
|
100
99
|
lastName,
|
|
101
100
|
birthday,
|
|
102
101
|
email,
|
|
103
|
-
nationalityCountryCode,
|
|
104
102
|
phone: userPhone,
|
|
105
103
|
isPhoneVerified,
|
|
106
104
|
ssn,
|
|
@@ -124,7 +122,6 @@ function toSetupViewLocalData(company, users, userRoles, primaryContact) {
|
|
|
124
122
|
firstName: '',
|
|
125
123
|
lastName: '',
|
|
126
124
|
email: '',
|
|
127
|
-
nationalityCountryCode: undefined,
|
|
128
125
|
fileIds: [],
|
|
129
126
|
isSelectedForVerification: false,
|
|
130
127
|
additionalDocumentTypesRequestedForVerification: [],
|
|
@@ -16,7 +16,6 @@ import { DepositAccount } from '../../../entity/depositAccount/depositAccount';
|
|
|
16
16
|
import { AllowedValueWithCode } from '../../../commonStateTypes/allowedValue';
|
|
17
17
|
import { Amount } from '../../../commonStateTypes/amount';
|
|
18
18
|
import { BalanceChange } from '../../../commonStateTypes/balance';
|
|
19
|
-
import { Country } from '../../countryList/countryListState';
|
|
20
19
|
export interface SetupView {
|
|
21
20
|
allFundingAccounts: FundingAccount[];
|
|
22
21
|
allBankAccounts: AccountBase[];
|
|
@@ -73,7 +72,6 @@ export interface CompanyDetails {
|
|
|
73
72
|
incDate?: ZeniDate;
|
|
74
73
|
syncToken?: string;
|
|
75
74
|
addressStatus?: NewAddressData;
|
|
76
|
-
registeredAddressStatus?: NewAddressData;
|
|
77
75
|
primaryContactLocalData?: PrimaryContactLocalData;
|
|
78
76
|
typeOfIncorporation?: string;
|
|
79
77
|
}
|
|
@@ -82,9 +80,8 @@ interface CompanyAndOfficerLocalData {
|
|
|
82
80
|
companyOfficerLocalData: Record<CompanyOfficerType, CompanyOfficersDetails | undefined>;
|
|
83
81
|
}
|
|
84
82
|
export interface BusinessVerificationDetails extends CompanyAndOfficerLocalData {
|
|
85
|
-
updateStatus: FetchStateAndError;
|
|
86
|
-
allNationalityCountries: Country[];
|
|
87
83
|
companyView?: CompanyView;
|
|
84
|
+
updateStatus: FetchStateAndError;
|
|
88
85
|
}
|
|
89
86
|
export declare function getCommonSetupViewDetails(state: RootState, companyId: ID, setupViewType: SetupViewType, plaidAccountKeyType: PlaidAccountKeyType): SetupView;
|
|
90
87
|
export declare function getBusinessVerificationDetails(state: RootState, companyId: ID): BusinessVerificationDetails;
|
|
@@ -82,7 +82,7 @@ function getPrimaryAccountForTheProduct(state, companyId, setupViewType) {
|
|
|
82
82
|
return primaryFundingAccount;
|
|
83
83
|
}
|
|
84
84
|
function getBusinessVerificationDetails(state, companyId) {
|
|
85
|
-
const { setupViewState
|
|
85
|
+
const { setupViewState } = state;
|
|
86
86
|
const { companyDetails, companyOfficerUpdateStatus, primaryContactDetails, updateStatus, } = setupViewState;
|
|
87
87
|
const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
|
|
88
88
|
const { companyDetailsLocalData, companyOfficerLocalData } = (0, exports.getCompanyAndIdentityDetails)(state, companyId, {
|
|
@@ -90,18 +90,16 @@ function getBusinessVerificationDetails(state, companyId) {
|
|
|
90
90
|
companyOfficerUpdateStatus,
|
|
91
91
|
primaryContactDetails,
|
|
92
92
|
});
|
|
93
|
-
const allNationalityCountries = countryListState.byCountryListCode.nationalityCountryList.countries;
|
|
94
93
|
return {
|
|
95
94
|
companyDetailsLocalData,
|
|
96
95
|
companyOfficerLocalData,
|
|
97
96
|
companyView,
|
|
98
97
|
updateStatus,
|
|
99
|
-
allNationalityCountries,
|
|
100
98
|
};
|
|
101
99
|
}
|
|
102
100
|
exports.getBusinessVerificationDetails = getBusinessVerificationDetails;
|
|
103
101
|
const getCompanyAndIdentityDetails = (state, companyId, companyAndIdentityDetails) => {
|
|
104
|
-
var _a
|
|
102
|
+
var _a;
|
|
105
103
|
const { companyDetails, companyOfficerUpdateStatus, primaryContactDetails } = companyAndIdentityDetails;
|
|
106
104
|
const { fileState, addressViewState } = state;
|
|
107
105
|
const { localData: primaryContactLocalData } = primaryContactDetails;
|
|
@@ -117,7 +115,6 @@ const getCompanyAndIdentityDetails = (state, companyId, companyAndIdentityDetail
|
|
|
117
115
|
updateFileStatusById[fileId] = (0, fileViewSelector_1.getFileUpdateNameStatusById)(state, fileId);
|
|
118
116
|
});
|
|
119
117
|
const companyAddress = (_a = addressViewState.newAddressState) === null || _a === void 0 ? void 0 : _a.company_address;
|
|
120
|
-
const registeredCompanyAddress = (_b = addressViewState.newAddressState) === null || _b === void 0 ? void 0 : _b.company_registered_address;
|
|
121
118
|
companyDetailsLocalData = {
|
|
122
119
|
companyId,
|
|
123
120
|
companyDescription,
|
|
@@ -132,7 +129,6 @@ const getCompanyAndIdentityDetails = (state, companyId, companyAndIdentityDetail
|
|
|
132
129
|
deleteFileStatusById,
|
|
133
130
|
updateFileStatusById,
|
|
134
131
|
addressStatus: companyAddress,
|
|
135
|
-
registeredAddressStatus: registeredCompanyAddress,
|
|
136
132
|
primaryContactLocalData,
|
|
137
133
|
typeOfIncorporation,
|
|
138
134
|
};
|
|
@@ -8,7 +8,6 @@ export interface CompanyOfficerVerificationPayload {
|
|
|
8
8
|
sync_token: string;
|
|
9
9
|
ssn: string;
|
|
10
10
|
birthday: string;
|
|
11
|
-
nationality_country_code: string;
|
|
12
11
|
title_at_company: string;
|
|
13
12
|
company_ownership: number;
|
|
14
13
|
document_type_for_verification: string;
|
|
@@ -32,7 +31,6 @@ export interface NewCompanyOfficerVerificationPayload {
|
|
|
32
31
|
title_at_company: string;
|
|
33
32
|
company_ownership: number;
|
|
34
33
|
document_type_for_verification: string;
|
|
35
|
-
nationality_country_code: string;
|
|
36
34
|
file_ids: ID[];
|
|
37
35
|
address: AddressUpdatableInfoPayload;
|
|
38
36
|
phone_verification?: {
|
|
@@ -57,8 +55,6 @@ export interface CompanyDetailsVerificationPayload {
|
|
|
57
55
|
file_ids: ID[];
|
|
58
56
|
sync_token: string;
|
|
59
57
|
address: AddressUpdatableInfoPayload;
|
|
60
|
-
registered_address: AddressUpdatableInfoPayload;
|
|
61
|
-
is_registered_address_same_as_company_address: boolean;
|
|
62
58
|
company_inc_type: string;
|
|
63
59
|
company_inc_date: string | null;
|
|
64
60
|
is_new_company_industry_verified: boolean;
|
|
@@ -39,7 +39,9 @@ const zeniAccountsPromoCard = (0, toolkit_1.createSlice)({
|
|
|
39
39
|
promoPayload.max_cash_balance_available != null
|
|
40
40
|
? promoPayload.max_cash_balance_available
|
|
41
41
|
: undefined;
|
|
42
|
-
|
|
42
|
+
// TODO https://app.clickup.com/t/86cxgce6m - hardcoding this fix for now until
|
|
43
|
+
// platform can fix this value
|
|
44
|
+
draft.maxInsuredAmount = 3000000; ///promoPayload.max_insured_amount;
|
|
43
45
|
draft.depositAccountId =
|
|
44
46
|
promoPayload.primary_deposit_account_id != null
|
|
45
47
|
? promoPayload.primary_deposit_account_id
|
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.98",
|
|
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",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { CountryList, CountryListKeyType, CountryListState } from './countryListState';
|
|
2
|
-
import { CountryListPayload } from './payloads/countryListPayload';
|
|
3
|
-
import { ZeniAPIStatus } from '../../responsePayload';
|
|
4
|
-
export declare const initialCountryList: CountryList;
|
|
5
|
-
export declare const initialState: CountryListState;
|
|
6
|
-
export declare const fetchCountryList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[countryListKey: "nationalityCountryList", cacheOverride?: any], {
|
|
7
|
-
countryListKey: "nationalityCountryList";
|
|
8
|
-
cacheOverride: any;
|
|
9
|
-
}, string, never, never>, fetchNationalityCountryList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateCountryList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
10
|
-
countryListKey: CountryListKeyType;
|
|
11
|
-
countryListPayload: CountryListPayload[];
|
|
12
|
-
}, string>, updateCountryListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
13
|
-
countryListKey: CountryListKeyType;
|
|
14
|
-
status: ZeniAPIStatus;
|
|
15
|
-
}, string>, clearCountryList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
16
|
-
declare const _default: import("@reduxjs/toolkit").Reducer<CountryListState, import("@reduxjs/toolkit").AnyAction>;
|
|
17
|
-
export default _default;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearCountryList = exports.updateCountryListFailure = exports.updateCountryList = exports.fetchNationalityCountryList = exports.fetchCountryList = exports.initialState = exports.initialCountryList = void 0;
|
|
5
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const countryListPayload_1 = require("./payloads/countryListPayload");
|
|
7
|
-
exports.initialCountryList = {
|
|
8
|
-
fetchState: 'Not-Started',
|
|
9
|
-
error: undefined,
|
|
10
|
-
countries: [],
|
|
11
|
-
hasValidState() {
|
|
12
|
-
return this.fetchState == 'Completed';
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
exports.initialState = {
|
|
16
|
-
byCountryListCode: {
|
|
17
|
-
nationalityCountryList: exports.initialCountryList,
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
const countryList = (0, toolkit_1.createSlice)({
|
|
21
|
-
name: 'countryList',
|
|
22
|
-
initialState: exports.initialState,
|
|
23
|
-
reducers: {
|
|
24
|
-
fetchCountryList: {
|
|
25
|
-
reducer(draft, action) {
|
|
26
|
-
if (action.payload.cacheOverride ||
|
|
27
|
-
draft.byCountryListCode[action.payload.countryListKey].fetchState !==
|
|
28
|
-
'Completed') {
|
|
29
|
-
draft.byCountryListCode[action.payload.countryListKey] = Object.assign(Object.assign({}, exports.initialCountryList), { fetchState: 'In-Progress', error: undefined });
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
prepare(countryListKey, cacheOverride = false) {
|
|
33
|
-
return {
|
|
34
|
-
payload: {
|
|
35
|
-
countryListKey,
|
|
36
|
-
cacheOverride,
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
42
|
-
fetchNationalityCountryList(_draft) {
|
|
43
|
-
// do nothing
|
|
44
|
-
},
|
|
45
|
-
updateCountryList(draft, action) {
|
|
46
|
-
const countryList = action.payload.countryListPayload.map((nCountry) => (0, countryListPayload_1.toCountry)(nCountry));
|
|
47
|
-
draft.byCountryListCode[action.payload.countryListKey] = Object.assign(Object.assign({}, exports.initialCountryList), { fetchState: 'Completed', error: undefined, countries: countryList });
|
|
48
|
-
},
|
|
49
|
-
updateCountryListFailure(draft, action) {
|
|
50
|
-
draft.byCountryListCode[action.payload.countryListKey] = Object.assign(Object.assign({}, exports.initialCountryList), { fetchState: 'Error', error: action.payload.status });
|
|
51
|
-
},
|
|
52
|
-
clearCountryList(draft) {
|
|
53
|
-
Object.assign(draft, exports.initialState);
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
_a = countryList.actions, exports.fetchCountryList = _a.fetchCountryList, exports.fetchNationalityCountryList = _a.fetchNationalityCountryList, exports.updateCountryList = _a.updateCountryList, exports.updateCountryListFailure = _a.updateCountryListFailure, exports.clearCountryList = _a.clearCountryList;
|
|
58
|
-
exports.default = countryList.reducer;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
2
|
-
import { CountryListKeyType, CountryListState, Country } from './countryListState';
|
|
3
|
-
export interface CountryListSelectorView extends SelectorView {
|
|
4
|
-
countries: Country[];
|
|
5
|
-
countryListKey: CountryListKeyType;
|
|
6
|
-
}
|
|
7
|
-
export declare const getCountryList: (countryListState: CountryListState, countryListKey: CountryListKeyType) => CountryListSelectorView;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCountryList = void 0;
|
|
4
|
-
const getCountryList = (countryListState, countryListKey) => {
|
|
5
|
-
return {
|
|
6
|
-
countries: countryListState.byCountryListCode[countryListKey].countries,
|
|
7
|
-
fetchState: countryListState.byCountryListCode[countryListKey].fetchState,
|
|
8
|
-
error: countryListState.byCountryListCode[countryListKey].error,
|
|
9
|
-
countryListKey: countryListKey,
|
|
10
|
-
version: 1,
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
exports.getCountryList = getCountryList;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { FetchedState } from '../../commonStateTypes/common';
|
|
2
|
-
export declare type CountryListKeyType = 'nationalityCountryList';
|
|
3
|
-
export interface Country {
|
|
4
|
-
countryCode: string;
|
|
5
|
-
countryName: string;
|
|
6
|
-
}
|
|
7
|
-
export interface CountryList extends FetchedState {
|
|
8
|
-
countries: Country[];
|
|
9
|
-
}
|
|
10
|
-
export interface CountryListState {
|
|
11
|
-
byCountryListCode: Record<CountryListKeyType, CountryList>;
|
|
12
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { RootState } from '../../../reducer';
|
|
4
|
-
import { fetchCountryList, fetchNationalityCountryList } from '../countryListReducer';
|
|
5
|
-
export declare type ActionType = ReturnType<typeof fetchCountryList> | ReturnType<typeof fetchNationalityCountryList>;
|
|
6
|
-
export declare const fetchCountryListEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchCountryListEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const countryListReducer_1 = require("../countryListReducer");
|
|
7
|
-
const fetchCountryListEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(countryListReducer_1.fetchCountryList.match), (0, operators_1.mergeMap)((action) => {
|
|
8
|
-
const actions = [];
|
|
9
|
-
const draft = state$.value.countryListState;
|
|
10
|
-
if (action.payload.cacheOverride === true ||
|
|
11
|
-
draft.byCountryListCode[action.payload.countryListKey].fetchState !==
|
|
12
|
-
'Completed') {
|
|
13
|
-
if (action.payload.countryListKey === 'nationalityCountryList') {
|
|
14
|
-
actions.push((0, countryListReducer_1.fetchNationalityCountryList)());
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return (0, rxjs_1.from)(actions);
|
|
18
|
-
}));
|
|
19
|
-
exports.fetchCountryListEpic = fetchCountryListEpic;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { ZeniAPI } from '../../../zeniAPI';
|
|
4
|
-
import { RootState } from '../../../reducer';
|
|
5
|
-
import { fetchNationalityCountryList, updateCountryList, updateCountryListFailure } from '../countryListReducer';
|
|
6
|
-
export declare type ActionType = ReturnType<typeof fetchNationalityCountryList> | ReturnType<typeof updateCountryList> | ReturnType<typeof updateCountryListFailure>;
|
|
7
|
-
export declare const fetchNationalityCountryListEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchNationalityCountryListEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
-
const countryListReducer_1 = require("../countryListReducer");
|
|
8
|
-
const fetchNationalityCountryListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(countryListReducer_1.fetchNationalityCountryList.match), (0, operators_1.switchMap)(() => {
|
|
9
|
-
const queryValue = {
|
|
10
|
-
region: 'US',
|
|
11
|
-
legal_type: 'BUSINESS',
|
|
12
|
-
onboarding_fields: ['nationality'],
|
|
13
|
-
};
|
|
14
|
-
return zeniAPI
|
|
15
|
-
.getJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/international-wire/onboarding-fields?query=${encodeURIComponent(JSON.stringify(queryValue))}`)
|
|
16
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
17
|
-
var _a, _b;
|
|
18
|
-
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
19
|
-
return (0, rxjs_1.of)((0, countryListReducer_1.updateCountryList)({
|
|
20
|
-
countryListKey: 'nationalityCountryList',
|
|
21
|
-
countryListPayload: (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.labels.nationality.field_values) !== null && _b !== void 0 ? _b : [],
|
|
22
|
-
}));
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
return (0, rxjs_1.of)((0, countryListReducer_1.updateCountryListFailure)({
|
|
26
|
-
countryListKey: 'nationalityCountryList',
|
|
27
|
-
status: response.status,
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
}), (0, operators_1.catchError)((error) => {
|
|
31
|
-
return (0, rxjs_1.of)((0, countryListReducer_1.updateCountryListFailure)({
|
|
32
|
-
countryListKey: 'nationalityCountryList',
|
|
33
|
-
status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch Nationality Country List REST API call errored out' +
|
|
34
|
-
JSON.stringify(error)),
|
|
35
|
-
}));
|
|
36
|
-
}));
|
|
37
|
-
}));
|
|
38
|
-
exports.fetchNationalityCountryListEpic = fetchNationalityCountryListEpic;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
2
|
-
import { CountryListPayload } from './countryListPayload';
|
|
3
|
-
export interface NationalityCountryPayload {
|
|
4
|
-
labels: {
|
|
5
|
-
nationality: {
|
|
6
|
-
field_hint_text: string;
|
|
7
|
-
field_values: CountryListPayload[];
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
export declare type NationalityCountryPayloadResponse = ZeniAPIResponse<NationalityCountryPayload>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
4
|
-
import { RootState } from '../../../../../reducer';
|
|
5
|
-
import { fetchInternationalVerificationForm, updateInternationalVerificationForm, updateVerificationFormFailure, initializeIntlVerificationForm } from '../internationalWireVerificationReducer';
|
|
6
|
-
export declare type ActionType = ReturnType<typeof fetchInternationalVerificationForm> | ReturnType<typeof updateInternationalVerificationForm> | ReturnType<typeof updateVerificationFormFailure> | ReturnType<typeof initializeIntlVerificationForm>;
|
|
7
|
-
export declare const fetchIntlVerificationFormEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchIntlVerificationFormEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../../../responsePayload");
|
|
7
|
-
const internationalWireVerificationReducer_1 = require("../internationalWireVerificationReducer");
|
|
8
|
-
const fetchIntlVerificationFormEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(internationalWireVerificationReducer_1.fetchInternationalVerificationForm.match), (0, operators_1.switchMap)((action) => {
|
|
9
|
-
const query = {
|
|
10
|
-
region: 'US',
|
|
11
|
-
legal_type: 'BUSINESS',
|
|
12
|
-
};
|
|
13
|
-
return zeniAPI
|
|
14
|
-
.getJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/international-wire/onboarding-fields?query=${encodeURIComponent(JSON.stringify(query))}`)
|
|
15
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
16
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
17
|
-
return (0, rxjs_1.from)([
|
|
18
|
-
(0, internationalWireVerificationReducer_1.updateInternationalVerificationForm)({
|
|
19
|
-
internationalWireFormPayload: response.data.labels,
|
|
20
|
-
}),
|
|
21
|
-
(0, internationalWireVerificationReducer_1.initializeIntlVerificationForm)(action.payload.companyId, response.data.labels),
|
|
22
|
-
]);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
return (0, rxjs_1.of)((0, internationalWireVerificationReducer_1.updateVerificationFormFailure)({
|
|
26
|
-
error: response.status,
|
|
27
|
-
}));
|
|
28
|
-
}
|
|
29
|
-
}), (0, operators_1.catchError)((error) => {
|
|
30
|
-
return (0, rxjs_1.of)((0, internationalWireVerificationReducer_1.updateVerificationFormFailure)({
|
|
31
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch international verification form REST API call errored out' +
|
|
32
|
-
JSON.stringify(error)),
|
|
33
|
-
}));
|
|
34
|
-
}));
|
|
35
|
-
}));
|
|
36
|
-
exports.fetchIntlVerificationFormEpic = fetchIntlVerificationFormEpic;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { updateVerificationFormLocalData, initializeIntlVerificationForm } from '../internationalWireVerificationReducer';
|
|
4
|
-
import { RootState } from '../../../../../reducer';
|
|
5
|
-
export declare type ActionType = ReturnType<typeof updateVerificationFormLocalData> | ReturnType<typeof initializeIntlVerificationForm>;
|
|
6
|
-
export declare const initializeIntlVerificationFormEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|