@tap-payments/auth-jsconnect 2.6.7 → 2.6.8
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/build/@types/form.d.ts +4 -0
- package/build/assets/locales/ar.json +6 -1
- package/build/assets/locales/en.json +6 -1
- package/build/components/AnimationFlow/BottomSheet.js +3 -3
- package/build/constants/app.d.ts +6 -0
- package/build/constants/app.js +37 -7
- package/build/features/app/business/businessStore.d.ts +10 -1
- package/build/features/app/business/businessStore.js +113 -9
- package/build/features/app/connect/connectStore.d.ts +8 -1
- package/build/features/app/connect/connectStore.js +127 -30
- package/build/features/app/connectExpress/connectExpressStore.d.ts +8 -1
- package/build/features/app/connectExpress/connectExpressStore.js +135 -2
- package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
- package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.js +105 -0
- package/build/features/business/screens/MobileOwnership/MobileNumber.d.ts +3 -0
- package/build/features/business/screens/MobileOwnership/MobileNumber.js +72 -0
- package/build/features/business/screens/MobileOwnership/index.d.ts +2 -0
- package/build/features/business/screens/MobileOwnership/index.js +2 -0
- package/build/features/business/screens/MobileOwnership/validation.d.ts +8 -0
- package/build/features/business/screens/MobileOwnership/validation.js +38 -0
- package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
- package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.js +106 -0
- package/build/features/connect/screens/MobileOwnership/MobileNumber.d.ts +3 -0
- package/build/features/connect/screens/MobileOwnership/MobileNumber.js +72 -0
- package/build/features/connect/screens/MobileOwnership/index.d.ts +2 -0
- package/build/features/connect/screens/MobileOwnership/index.js +2 -0
- package/build/features/connect/screens/MobileOwnership/validation.d.ts +8 -0
- package/build/features/connect/screens/MobileOwnership/validation.js +38 -0
- package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
- package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.js +108 -0
- package/build/features/connectExpress/screens/MobileOwnership/MobileNumber.d.ts +3 -0
- package/build/features/connectExpress/screens/MobileOwnership/MobileNumber.js +72 -0
- package/build/features/connectExpress/screens/MobileOwnership/index.d.ts +2 -0
- package/build/features/connectExpress/screens/MobileOwnership/index.js +2 -0
- package/build/features/connectExpress/screens/MobileOwnership/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/MobileOwnership/validation.js +38 -0
- package/build/features/featuresScreens.js +15 -0
- package/build/features/shared/Button/FlowsButtons.js +1 -1
- package/build/features/shared/Dialog/DialogContainer.js +3 -3
- package/package.json +1 -1
package/build/@types/form.d.ts
CHANGED
|
@@ -631,5 +631,10 @@
|
|
|
631
631
|
"year": "السنة",
|
|
632
632
|
"yes": "نعم",
|
|
633
633
|
"your_brand_details": "تفاصيل علامتك التجارية",
|
|
634
|
-
"يرجى التحقق من اسم تطبيق ابل": ""
|
|
634
|
+
"يرجى التحقق من اسم تطبيق ابل": "",
|
|
635
|
+
"mobile_ownership_title": "لتفعيل استلام الايداعات، يرجى تحديث رقم هاتفك المحمول المسجل ليتوافق مع هويتك.",
|
|
636
|
+
"current_mobile_number": "رقم الجوال الحالي",
|
|
637
|
+
"new_mobile_number": "رقم الجوال الجديد",
|
|
638
|
+
"update_mobile_number": "تحديث رقم الجوال",
|
|
639
|
+
"update_later": "سأقوم بالتحديث لاحقاً"
|
|
635
640
|
}
|
|
@@ -658,5 +658,10 @@
|
|
|
658
658
|
"website_label": "Website",
|
|
659
659
|
"year": "Year",
|
|
660
660
|
"yes": "Yes",
|
|
661
|
-
"your_brand_details": "Your brand details"
|
|
661
|
+
"your_brand_details": "Your brand details",
|
|
662
|
+
"mobile_ownership_title": "To enable bank payouts, please update your registered mobile number to match your national ID.",
|
|
663
|
+
"current_mobile_number": "Current mobile number",
|
|
664
|
+
"new_mobile_number": "New mobile number",
|
|
665
|
+
"update_mobile_number": "Update mobile number",
|
|
666
|
+
"update_later": "I'll update later"
|
|
662
667
|
}
|
|
@@ -79,7 +79,8 @@ var CloseIconStyled = styled(Icon)(function (_a) {
|
|
|
79
79
|
var theme = _a.theme;
|
|
80
80
|
return ({
|
|
81
81
|
width: theme.spacing(3.75),
|
|
82
|
-
height: theme.spacing(3.75)
|
|
82
|
+
height: theme.spacing(3.75),
|
|
83
|
+
cursor: 'pointer'
|
|
83
84
|
});
|
|
84
85
|
});
|
|
85
86
|
var CloseBox = styled(Box)(function (_a) {
|
|
@@ -89,7 +90,6 @@ var CloseBox = styled(Box)(function (_a) {
|
|
|
89
90
|
justifyContent: 'end',
|
|
90
91
|
marginBlockStart: theme.spacing(2),
|
|
91
92
|
marginInlineEnd: theme.spacing(2),
|
|
92
|
-
cursor: 'pointer',
|
|
93
93
|
direction: theme.direction,
|
|
94
94
|
position: 'absolute',
|
|
95
95
|
right: 0,
|
|
@@ -134,6 +134,6 @@ var BottomSheetComponent = function (_a) {
|
|
|
134
134
|
return (_jsxs(BottomSheetStyled, __assign({ languageBarHeight: getLanguageBarHeight(), dialogEdgeFormat: dialogEdgeFormat, sibling: hideFooter ? (_jsx(_Fragment, {})) : (open && (_jsx(LanguageFooterStyled, { children: _jsx(CustomFooter, {}) }))), isMaturityExpress: isMaturityExpress, showPoweredBy: !hidePoweredBy, sx: { pointerEvents: pointerEvents }, ref: sheetRef, open: open, snapPoints: function (_a) {
|
|
135
135
|
var maxHeight = _a.maxHeight;
|
|
136
136
|
return [getMinHeight(maxHeight), maxHeight * 0.95];
|
|
137
|
-
} }, rest, { children: [isMaturityExpress && !hideMerchantLogo && (_jsx(LogoBadge, { src: isMaturityExpress ? logo || ICONS_NAMES.LOGO_ICON : ICONS_NAMES.LOGO_ICON })), onClose && (_jsx(CloseBox, __assign({ id: 'close-container'
|
|
137
|
+
} }, rest, { children: [isMaturityExpress && !hideMerchantLogo && (_jsx(LogoBadge, { src: isMaturityExpress ? logo || ICONS_NAMES.LOGO_ICON : ICONS_NAMES.LOGO_ICON })), onClose && (_jsx(CloseBox, __assign({ id: 'close-container' }, { children: _jsx(CloseIconStyled, { src: ICONS_NAMES.CLOSE_ICON, onClick: handleOnCloseButton }) }))), children, isMaturityExpress && !hidePoweredBy && (_jsx(FooterStyled, { children: _jsx(PoweredByFooter, { id: 'bottom-sheet-powered_by_footer', sx: { margin: '0px' }, textSx: { color: 'rgba(63, 66, 77, 0.6)' }, icon: isAr ? ICONS_NAMES.LOGO_WITH_NAME_DARK_AR_ICON : ICONS_NAMES.LOGO_WITH_NAME_DARK_EN_ICON }) }))] })));
|
|
138
138
|
};
|
|
139
139
|
export default React.memo(BottomSheetComponent);
|
package/build/constants/app.d.ts
CHANGED
|
@@ -101,6 +101,8 @@ export declare const CONNECT_STEP_NAMES: {
|
|
|
101
101
|
UPDATE_BRAND_SEGMENT_INFO: string;
|
|
102
102
|
CREATE_AUTH_PASSWORD: string;
|
|
103
103
|
VERIFY_AUTH_PASSWORD: string;
|
|
104
|
+
CONNECT_MOBILE_OWNERSHIP: string;
|
|
105
|
+
CONNECT_MOBILE_OWNERSHIP_SKIPPED: string;
|
|
104
106
|
CONNECT_SUCCESS: string;
|
|
105
107
|
};
|
|
106
108
|
export declare const AUTH_STEP_NAMES: {
|
|
@@ -129,6 +131,8 @@ export declare const CONNECT_EXPRESS_STEP_NAMES: {
|
|
|
129
131
|
CREATE_AUTH_PASSWORD: string;
|
|
130
132
|
VERIFY_AUTH_PASSWORD: string;
|
|
131
133
|
CONNECT_EXPRESS_SUCCESS: string;
|
|
134
|
+
COLLECT_MOBILE_OWNERSHIP: string;
|
|
135
|
+
COLLECT_MOBILE_OWNERSHIP_SKIPPED: string;
|
|
132
136
|
};
|
|
133
137
|
export declare const SignIn_STEP_NAMES: {
|
|
134
138
|
CREATE_AUTH_MOBILE: string;
|
|
@@ -150,6 +154,8 @@ export declare const BUSINESS_STEP_NAMES: {
|
|
|
150
154
|
BUSINESS_CR_ACTIVITIES: string;
|
|
151
155
|
BUSINESS_CUSTOMERS: string;
|
|
152
156
|
BUSINESS_SUCCESS: string;
|
|
157
|
+
BUSINESS_MOBILE_OWNERSHIP: string;
|
|
158
|
+
BUSINESS_MOBILE_OWNERSHIP_SKIPPED: string;
|
|
153
159
|
};
|
|
154
160
|
export declare const BANK_STEP_NAMES: {
|
|
155
161
|
PHONE_AUTH: string;
|
package/build/constants/app.js
CHANGED
|
@@ -82,7 +82,7 @@ export var CONNECT_SCREENS_NAVIGATION = [
|
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
name: 'CONNECT_INDIVIDUAL_STEP',
|
|
85
|
-
next: 'CONNECT_MERCHANT_INFO_STEP',
|
|
85
|
+
next: ['CONNECT_MERCHANT_INFO_STEP', 'CONNECT_MOBILE_OWNERSHIP'],
|
|
86
86
|
prev: ['CONNECT_MOBILE_STEP', 'CONNECT_NID_STEP', 'CONNECT_CIVIL_ID_STEP', 'CONNECT_DOB_STEP'],
|
|
87
87
|
order: 3
|
|
88
88
|
},
|
|
@@ -92,6 +92,12 @@ export var CONNECT_SCREENS_NAVIGATION = [
|
|
|
92
92
|
prev: ['CONNECT_INDIVIDUAL_STEP', 'CONNECT_NID_STEP', 'CONNECT_MOBILE_STEP', 'CONNECT_CIVIL_ID_STEP'],
|
|
93
93
|
order: 4
|
|
94
94
|
},
|
|
95
|
+
{
|
|
96
|
+
name: 'CONNECT_MOBILE_OWNERSHIP',
|
|
97
|
+
next: 'CONNECT_MERCHANT_INFO_STEP',
|
|
98
|
+
prev: 'CONNECT_INDIVIDUAL_STEP',
|
|
99
|
+
order: 4
|
|
100
|
+
},
|
|
95
101
|
{
|
|
96
102
|
name: 'CONNECT_BRAND_SEGMENT_INFO_STEP',
|
|
97
103
|
next: 'CONNECT_THANK_YOU_STEP',
|
|
@@ -204,7 +210,8 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
|
204
210
|
next: [
|
|
205
211
|
'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP',
|
|
206
212
|
'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP',
|
|
207
|
-
'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP'
|
|
213
|
+
'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP',
|
|
214
|
+
'COLLECT_MOBILE_OWNERSHIP'
|
|
208
215
|
],
|
|
209
216
|
prev: 'CONNECT_EXPRESS_NID_MISSED_STEP',
|
|
210
217
|
order: 4
|
|
@@ -229,7 +236,7 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
|
229
236
|
},
|
|
230
237
|
{
|
|
231
238
|
name: 'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP',
|
|
232
|
-
next: ['CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP', 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP'],
|
|
239
|
+
next: ['CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP', 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP', 'COLLECT_MOBILE_OWNERSHIP'],
|
|
233
240
|
prev: [
|
|
234
241
|
'CONNECT_EXPRESS_MOBILE_STEP',
|
|
235
242
|
'CONNECT_EXPRESS_NID_STEP',
|
|
@@ -240,6 +247,17 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
|
240
247
|
],
|
|
241
248
|
order: 5
|
|
242
249
|
},
|
|
250
|
+
{
|
|
251
|
+
name: 'COLLECT_MOBILE_OWNERSHIP',
|
|
252
|
+
next: [
|
|
253
|
+
'CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP',
|
|
254
|
+
'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP',
|
|
255
|
+
'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP',
|
|
256
|
+
'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP'
|
|
257
|
+
],
|
|
258
|
+
prev: ['CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP', 'CONNECT_EXPRESS_NID_MISSED_STEP'],
|
|
259
|
+
order: 6
|
|
260
|
+
},
|
|
243
261
|
{
|
|
244
262
|
name: 'CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP',
|
|
245
263
|
next: 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP',
|
|
@@ -486,13 +504,13 @@ export var BUSINESS_SCREENS_NAVIGATION = [
|
|
|
486
504
|
},
|
|
487
505
|
{
|
|
488
506
|
name: 'BUSINESS_VERIFY_NAFATH_STEP',
|
|
489
|
-
next: ['BUSINESS_BUSINESS_TYPE_STEP', 'BUSINESS_DOB_STEP'],
|
|
507
|
+
next: ['BUSINESS_BUSINESS_TYPE_STEP', 'BUSINESS_DOB_STEP', 'BUSINESS_MOBILE_OWNERSHIP'],
|
|
490
508
|
prev: 'BUSINESS_IDBOD_STEP',
|
|
491
509
|
order: 3
|
|
492
510
|
},
|
|
493
511
|
{
|
|
494
512
|
name: 'BUSINESS_DOB_STEP',
|
|
495
|
-
next: 'BUSINESS_BUSINESS_TYPE_STEP',
|
|
513
|
+
next: ['BUSINESS_BUSINESS_TYPE_STEP', 'BUSINESS_MOBILE_OWNERSHIP'],
|
|
496
514
|
prev: 'BUSINESS_IDBOD_STEP',
|
|
497
515
|
order: 2
|
|
498
516
|
},
|
|
@@ -508,6 +526,12 @@ export var BUSINESS_SCREENS_NAVIGATION = [
|
|
|
508
526
|
prev: 'BUSINESS_BUSINESS_TYPE_STEP',
|
|
509
527
|
order: 2
|
|
510
528
|
},
|
|
529
|
+
{
|
|
530
|
+
name: 'BUSINESS_MOBILE_OWNERSHIP',
|
|
531
|
+
next: ['BUSINESS_BUSINESS_TYPE_STEP', 'BUSINESS_DOB_STEP'],
|
|
532
|
+
prev: 'BUSINESS_IDBOD_STEP',
|
|
533
|
+
order: 3
|
|
534
|
+
},
|
|
511
535
|
{
|
|
512
536
|
name: 'BUSINESS_CONFIRM_STEP',
|
|
513
537
|
next: 'BUSINESS_ACTIVITIES_STEP',
|
|
@@ -979,6 +1003,8 @@ export var CONNECT_STEP_NAMES = {
|
|
|
979
1003
|
UPDATE_BRAND_SEGMENT_INFO: 'connect_update_brand_segment_info',
|
|
980
1004
|
CREATE_AUTH_PASSWORD: 'connect_create_auth_password',
|
|
981
1005
|
VERIFY_AUTH_PASSWORD: 'connect_verify_auth_password',
|
|
1006
|
+
CONNECT_MOBILE_OWNERSHIP: 'collect_owner_phone',
|
|
1007
|
+
CONNECT_MOBILE_OWNERSHIP_SKIPPED: 'collect_owner_phone_skipped',
|
|
982
1008
|
CONNECT_SUCCESS: 'connect_completed'
|
|
983
1009
|
};
|
|
984
1010
|
export var AUTH_STEP_NAMES = {
|
|
@@ -1006,7 +1032,9 @@ export var CONNECT_EXPRESS_STEP_NAMES = {
|
|
|
1006
1032
|
UPDATE_BRAND_INFO: 'connect_express_update_brand_info',
|
|
1007
1033
|
CREATE_AUTH_PASSWORD: 'connect_express_create_auth_password',
|
|
1008
1034
|
VERIFY_AUTH_PASSWORD: 'connect_express_verify_auth_password',
|
|
1009
|
-
CONNECT_EXPRESS_SUCCESS: 'connect_express_completed'
|
|
1035
|
+
CONNECT_EXPRESS_SUCCESS: 'connect_express_completed',
|
|
1036
|
+
COLLECT_MOBILE_OWNERSHIP: 'collect_owner_phone',
|
|
1037
|
+
COLLECT_MOBILE_OWNERSHIP_SKIPPED: 'collect_owner_phone_skipped'
|
|
1010
1038
|
};
|
|
1011
1039
|
export var SignIn_STEP_NAMES = {
|
|
1012
1040
|
CREATE_AUTH_MOBILE: 'signIn_create_auth_mobile',
|
|
@@ -1027,7 +1055,9 @@ export var BUSINESS_STEP_NAMES = {
|
|
|
1027
1055
|
BUSINESS_INFO_CONFIRM: 'business_info_confirm',
|
|
1028
1056
|
BUSINESS_CR_ACTIVITIES: 'business_cr_activities',
|
|
1029
1057
|
BUSINESS_CUSTOMERS: 'business_customers',
|
|
1030
|
-
BUSINESS_SUCCESS: 'business_completed'
|
|
1058
|
+
BUSINESS_SUCCESS: 'business_completed',
|
|
1059
|
+
BUSINESS_MOBILE_OWNERSHIP: 'collect_owner_phone',
|
|
1060
|
+
BUSINESS_MOBILE_OWNERSHIP_SKIPPED: 'collect_owner_phone_skipped'
|
|
1031
1061
|
};
|
|
1032
1062
|
export var BANK_STEP_NAMES = {
|
|
1033
1063
|
PHONE_AUTH: 'bank_phone_auth',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RootState } from '../../../app/store';
|
|
2
|
-
import { ActivitiesFormValues, CustomersFormValues, BusinessTypeFormValues, NIDFormValues, OTPFormValues, ResponseData, SharedState, FlowsTypes, CivilFormValues, ActionState, AsyncThunkParams, DOBFormValues } from '../../../@types';
|
|
2
|
+
import { ActivitiesFormValues, CustomersFormValues, BusinessTypeFormValues, NIDFormValues, OTPFormValues, ResponseData, SharedState, FlowsTypes, CivilFormValues, ActionState, AsyncThunkParams, DOBFormValues, MobileFormValues, MobileOwnershipFormValues } from '../../../@types';
|
|
3
3
|
export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
4
4
|
data: any;
|
|
5
5
|
verifyNextStepName: any;
|
|
@@ -45,6 +45,13 @@ export declare const verifyNafath: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
45
45
|
response: any;
|
|
46
46
|
isNextScreenDob: boolean;
|
|
47
47
|
}, verifyNafathParams, {}>;
|
|
48
|
+
export declare const updateLeadMobile: import("@reduxjs/toolkit").AsyncThunk<{
|
|
49
|
+
leadResponse: any;
|
|
50
|
+
formData: MobileOwnershipFormValues;
|
|
51
|
+
}, MobileOwnershipFormValues, {}>;
|
|
52
|
+
export declare const skipUpdateLeadMobile: import("@reduxjs/toolkit").AsyncThunk<{
|
|
53
|
+
leadResponse: any;
|
|
54
|
+
}, void, {}>;
|
|
48
55
|
interface verifyPACIParams {
|
|
49
56
|
onSuccess?: () => void;
|
|
50
57
|
}
|
|
@@ -63,6 +70,7 @@ export declare const updateLeadIdentity: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
63
70
|
dob?: any;
|
|
64
71
|
termAndConditionChecked?: boolean | undefined;
|
|
65
72
|
};
|
|
73
|
+
countryCode: import("../../../@types").CountryCode;
|
|
66
74
|
}, NIDFormValues, {}>;
|
|
67
75
|
export declare const updateLeadDOB: import("@reduxjs/toolkit").AsyncThunk<{
|
|
68
76
|
data: any;
|
|
@@ -130,6 +138,7 @@ export interface BusinessData {
|
|
|
130
138
|
activitiesData: ActivitiesFormValues & ResponseData;
|
|
131
139
|
customersData: CustomersFormValues & ResponseData;
|
|
132
140
|
flowName: FlowsTypes;
|
|
141
|
+
mobileData: (MobileFormValues | undefined) & ResponseData;
|
|
133
142
|
}
|
|
134
143
|
export interface BusinessState extends SharedState<BusinessData> {
|
|
135
144
|
customLoading?: boolean;
|
|
@@ -58,8 +58,8 @@ var _a;
|
|
|
58
58
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
59
59
|
import API from '../../../api';
|
|
60
60
|
import { BusinessType, FlowsTypes, DocumentPurpose, LicenseType } from '../../../@types';
|
|
61
|
-
import { BUSINESS_STEP_NAMES, COLLECT_DOB_INFO_NAFATH, EXPECTED_SALES_LIST, IDENTIFICATION_TYPE, NAFATH_VERIFICATION_FAILED, OTHER_CR_LICENSE, OTHER_ENTITY_LICENSE, OTHER_FL_LICENSE } from '../../../constants';
|
|
62
|
-
import { convertNumbers2English, hasKey, sleep, isKW, isSA, dateFormat, isOtherLicense, isOtherThanKWOrSA, hasNoneEditableValue, sendCustomEventToGTM } from '../../../utils';
|
|
61
|
+
import { BUSINESS_STEP_NAMES, COLLECT_DOB_INFO_NAFATH, EXPECTED_SALES_LIST, IDENTIFICATION_TYPE, NAFATH_VERIFICATION_FAILED, OTHER_CR_LICENSE, OTHER_ENTITY_LICENSE, OTHER_FL_LICENSE, defaultCountry } from '../../../constants';
|
|
62
|
+
import { convertNumbers2English, hasKey, sleep, isKW, isSA, dateFormat, isOtherLicense, isOtherThanKWOrSA, hasNoneEditableValue, sendCustomEventToGTM, findCountryByIddPrefix } from '../../../utils';
|
|
63
63
|
import { handleNextScreenStep, handlePublicKey, handleSetCountryByIso2 } from '../../../app/settings';
|
|
64
64
|
export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
65
65
|
var payload, data, publicKey, countryIso2, boardData, brandData, isicActivityList, leadData, _a, steps, brand, board_id, business_id, entity, brandID, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted, list, list;
|
|
@@ -316,7 +316,7 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
|
|
|
316
316
|
});
|
|
317
317
|
}); });
|
|
318
318
|
export var verifyNafath = createAsyncThunk('business/verifyNafathParams', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
319
|
-
var _a, settings, business, responseBody, expiry, interval, maxCalls, count, data, isSuccess, isFailed, isNextScreenDob, screen_1;
|
|
319
|
+
var _a, settings, business, responseBody, expiry, interval, maxCalls, count, data, isSuccess, isFailed, isNextScreenDob, isNextScreenCollectMobileOwnership, screen_1;
|
|
320
320
|
var _b, _c, _d, _e, _f, _g;
|
|
321
321
|
return __generator(this, function (_h) {
|
|
322
322
|
switch (_h.label) {
|
|
@@ -352,8 +352,14 @@ export var verifyNafath = createAsyncThunk('business/verifyNafathParams', functi
|
|
|
352
352
|
case 4:
|
|
353
353
|
_h.sent();
|
|
354
354
|
isNextScreenDob = data.step_name === COLLECT_DOB_INFO_NAFATH;
|
|
355
|
-
|
|
356
|
-
|
|
355
|
+
isNextScreenCollectMobileOwnership = data.step_name === BUSINESS_STEP_NAMES.BUSINESS_MOBILE_OWNERSHIP;
|
|
356
|
+
if (isNextScreenCollectMobileOwnership) {
|
|
357
|
+
thunkApi.dispatch(handleNextScreenStep('BUSINESS_MOBILE_OWNERSHIP'));
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
screen_1 = isNextScreenDob ? 'BUSINESS_DOB_STEP' : 'BUSINESS_BUSINESS_TYPE_STEP';
|
|
361
|
+
thunkApi.dispatch(handleNextScreenStep(screen_1));
|
|
362
|
+
}
|
|
357
363
|
return [2, { response: data, isNextScreenDob: isNextScreenDob }];
|
|
358
364
|
case 5: return [4, sleep(interval * 1000)];
|
|
359
365
|
case 6:
|
|
@@ -366,6 +372,63 @@ export var verifyNafath = createAsyncThunk('business/verifyNafathParams', functi
|
|
|
366
372
|
}
|
|
367
373
|
});
|
|
368
374
|
}); });
|
|
375
|
+
export var updateLeadMobile = createAsyncThunk('connect/updateLeadMobile', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
376
|
+
var _a, settings, business, lead_id, payload, leadResponse, isNextScreenDob, screen;
|
|
377
|
+
var _b, _c;
|
|
378
|
+
return __generator(this, function (_d) {
|
|
379
|
+
switch (_d.label) {
|
|
380
|
+
case 0:
|
|
381
|
+
_a = thunkApi.getState(), settings = _a.settings, business = _a.business;
|
|
382
|
+
lead_id = (business.data.verify.responseBody || {}).lead_id;
|
|
383
|
+
payload = {
|
|
384
|
+
id: lead_id || '',
|
|
385
|
+
contact: {
|
|
386
|
+
phone: {
|
|
387
|
+
country_code: params.countryCode.idd_prefix.toString(),
|
|
388
|
+
number: params.mobile
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
step_name: BUSINESS_STEP_NAMES.BUSINESS_MOBILE_OWNERSHIP,
|
|
392
|
+
encryption_contract: ['contact.phone.country_code', 'contact.phone.number']
|
|
393
|
+
};
|
|
394
|
+
return [4, API.leadService.updateLead(payload)];
|
|
395
|
+
case 1:
|
|
396
|
+
leadResponse = _d.sent();
|
|
397
|
+
if (leadResponse.step_name === BUSINESS_STEP_NAMES.BUSINESS_MOBILE_OWNERSHIP) {
|
|
398
|
+
throw new Error("The new mobile number doesn't match the national ID, please update the mobile to the correct one");
|
|
399
|
+
}
|
|
400
|
+
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, params);
|
|
401
|
+
isNextScreenDob = leadResponse.step_name === COLLECT_DOB_INFO_NAFATH;
|
|
402
|
+
screen = isNextScreenDob ? 'BUSINESS_DOB_STEP' : 'BUSINESS_BUSINESS_TYPE_STEP';
|
|
403
|
+
thunkApi.dispatch(handleNextScreenStep(screen));
|
|
404
|
+
return [2, { leadResponse: leadResponse, formData: params }];
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
}); });
|
|
408
|
+
export var skipUpdateLeadMobile = createAsyncThunk('connect/skipUpdateLeadMobile', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
409
|
+
var _a, settings, business, lead_id, payload, leadResponse, isNextScreenDob, screen;
|
|
410
|
+
var _b, _c;
|
|
411
|
+
return __generator(this, function (_d) {
|
|
412
|
+
switch (_d.label) {
|
|
413
|
+
case 0:
|
|
414
|
+
_a = thunkApi.getState(), settings = _a.settings, business = _a.business;
|
|
415
|
+
lead_id = (business.data.verify.responseBody || {}).lead_id;
|
|
416
|
+
payload = {
|
|
417
|
+
id: lead_id || '',
|
|
418
|
+
step_name: BUSINESS_STEP_NAMES.BUSINESS_MOBILE_OWNERSHIP_SKIPPED,
|
|
419
|
+
encryption_contract: []
|
|
420
|
+
};
|
|
421
|
+
return [4, API.leadService.updateLead(payload)];
|
|
422
|
+
case 1:
|
|
423
|
+
leadResponse = _d.sent();
|
|
424
|
+
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, {});
|
|
425
|
+
isNextScreenDob = leadResponse.step_name === COLLECT_DOB_INFO_NAFATH;
|
|
426
|
+
screen = isNextScreenDob ? 'BUSINESS_DOB_STEP' : 'BUSINESS_BUSINESS_TYPE_STEP';
|
|
427
|
+
thunkApi.dispatch(handleNextScreenStep(screen));
|
|
428
|
+
return [2, { leadResponse: leadResponse }];
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
}); });
|
|
369
432
|
export var verifyPACI = createAsyncThunk('businessVerifyPACI', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
370
433
|
var _a, settings, business, responseBody, _b, business_id, entity, expiry, interval, maxCalls, count, data, isSuccess;
|
|
371
434
|
var _c, _d, _e, _f;
|
|
@@ -440,7 +503,7 @@ export var createCivilIdAuth = createAsyncThunk('createCivilIdAuth', function (p
|
|
|
440
503
|
});
|
|
441
504
|
}); });
|
|
442
505
|
export var updateLeadIdentity = createAsyncThunk('updateLeadIdentity', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
443
|
-
var _a, settings, business, identification_id_type, stepName, lead_id, countryIso2, dob, requestBody, data, business_id, entity, screen;
|
|
506
|
+
var _a, settings, business, identification_id_type, stepName, lead_id, countryIso2, dob, requestBody, data, business_id, entity, screen, countryCode;
|
|
444
507
|
var _b, _c;
|
|
445
508
|
return __generator(this, function (_d) {
|
|
446
509
|
switch (_d.label) {
|
|
@@ -479,7 +542,10 @@ export var updateLeadIdentity = createAsyncThunk('updateLeadIdentity', function
|
|
|
479
542
|
case 3:
|
|
480
543
|
thunkApi.dispatch(handleNextScreenStep(screen));
|
|
481
544
|
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody);
|
|
482
|
-
|
|
545
|
+
countryCode = settings.data.businessCountry;
|
|
546
|
+
if (data.contact.phone.country_code)
|
|
547
|
+
countryCode = findCountryByIddPrefix(settings.data.countries, data.contact.phone.country_code);
|
|
548
|
+
return [2, { data: data, formData: __assign(__assign({}, params), { type: identification_id_type }), countryCode: countryCode }];
|
|
483
549
|
}
|
|
484
550
|
});
|
|
485
551
|
}); });
|
|
@@ -511,7 +577,12 @@ export var updateLeadDOB = createAsyncThunk('business/updateLeadDOB', function (
|
|
|
511
577
|
_g.sent();
|
|
512
578
|
_g.label = 4;
|
|
513
579
|
case 4:
|
|
514
|
-
|
|
580
|
+
if (data.step_name === BUSINESS_STEP_NAMES.BUSINESS_MOBILE_OWNERSHIP) {
|
|
581
|
+
thunkApi.dispatch(handleNextScreenStep('BUSINESS_MOBILE_OWNERSHIP'));
|
|
582
|
+
}
|
|
583
|
+
else {
|
|
584
|
+
thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
|
|
585
|
+
}
|
|
515
586
|
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, requestBody);
|
|
516
587
|
return [2, { data: data, formData: params }];
|
|
517
588
|
}
|
|
@@ -871,6 +942,10 @@ var initialState = {
|
|
|
871
942
|
verify: {
|
|
872
943
|
token: ''
|
|
873
944
|
},
|
|
945
|
+
mobileData: {
|
|
946
|
+
countryCode: defaultCountry,
|
|
947
|
+
mobile: ''
|
|
948
|
+
},
|
|
874
949
|
otpData: {
|
|
875
950
|
otp: '',
|
|
876
951
|
isNID: false
|
|
@@ -1083,7 +1158,7 @@ export var businessSlice = createSlice({
|
|
|
1083
1158
|
var _a;
|
|
1084
1159
|
state.loading = false;
|
|
1085
1160
|
state.error = null;
|
|
1086
|
-
var _b = action.payload, data = _b.data, formData = _b.formData;
|
|
1161
|
+
var _b = action.payload, data = _b.data, formData = _b.formData, countryCode = _b.countryCode;
|
|
1087
1162
|
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
1088
1163
|
if (description) {
|
|
1089
1164
|
state.error = description;
|
|
@@ -1093,10 +1168,39 @@ export var businessSlice = createSlice({
|
|
|
1093
1168
|
state.data.nidData.responseBody = data;
|
|
1094
1169
|
state.data.otpData.otp = '';
|
|
1095
1170
|
state.data.otpData.isNID = true;
|
|
1171
|
+
state.data.mobileData.countryCode = countryCode;
|
|
1172
|
+
state.data.mobileData.mobile = data.contact.phone.number;
|
|
1096
1173
|
})
|
|
1097
1174
|
.addCase(updateLeadIdentity.rejected, function (state, action) {
|
|
1098
1175
|
state.loading = false;
|
|
1099
1176
|
state.error = action.error.message;
|
|
1177
|
+
})
|
|
1178
|
+
.addCase(updateLeadMobile.pending, function (state) {
|
|
1179
|
+
state.loading = true;
|
|
1180
|
+
state.error = null;
|
|
1181
|
+
})
|
|
1182
|
+
.addCase(updateLeadMobile.fulfilled, function (state, action) {
|
|
1183
|
+
state.loading = false;
|
|
1184
|
+
state.error = null;
|
|
1185
|
+
state.data.mobileData.mobile = action.payload.leadResponse.contact.phone.number;
|
|
1186
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), action.payload.leadResponse);
|
|
1187
|
+
})
|
|
1188
|
+
.addCase(updateLeadMobile.rejected, function (state, action) {
|
|
1189
|
+
state.loading = false;
|
|
1190
|
+
state.error = action.error.message;
|
|
1191
|
+
})
|
|
1192
|
+
.addCase(skipUpdateLeadMobile.pending, function (state) {
|
|
1193
|
+
state.loading = true;
|
|
1194
|
+
state.error = null;
|
|
1195
|
+
})
|
|
1196
|
+
.addCase(skipUpdateLeadMobile.fulfilled, function (state, action) {
|
|
1197
|
+
state.loading = false;
|
|
1198
|
+
state.error = null;
|
|
1199
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), action.payload.leadResponse);
|
|
1200
|
+
})
|
|
1201
|
+
.addCase(skipUpdateLeadMobile.rejected, function (state, action) {
|
|
1202
|
+
state.loading = false;
|
|
1203
|
+
state.error = action.error.message;
|
|
1100
1204
|
})
|
|
1101
1205
|
.addCase(verifyNafath.pending, function (state) {
|
|
1102
1206
|
state.loading = true;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RootState } from '../../../app/store';
|
|
2
|
-
import { ActionState, AuthForType, CivilFormValues, CountryCode, FlowsTypes, IndividualFormValues, MobileFormValues, NIDFormValues, OTPFormValues, ResponseData, SharedState, BrandFormValues, BrandSegmentFormValues, DOBFormValues } from '../../../@types';
|
|
2
|
+
import { ActionState, AuthForType, CivilFormValues, CountryCode, FlowsTypes, IndividualFormValues, MobileFormValues, NIDFormValues, OTPFormValues, ResponseData, SharedState, BrandFormValues, BrandSegmentFormValues, DOBFormValues, MobileOwnershipFormValues } from '../../../@types';
|
|
3
3
|
import { CancelToken } from 'axios';
|
|
4
4
|
export declare const updateBusinessCountry: import("@reduxjs/toolkit").AsyncThunk<any, string, {}>;
|
|
5
5
|
export declare const createMobileAuth: import("@reduxjs/toolkit").AsyncThunk<{
|
|
@@ -75,6 +75,13 @@ export declare const updateLeadBrandSegment: import("@reduxjs/toolkit").AsyncThu
|
|
|
75
75
|
response: any;
|
|
76
76
|
formData: Pick<BrandSegmentFormValues, "teamSize">;
|
|
77
77
|
}, Pick<BrandSegmentFormValues, "teamSize">, {}>;
|
|
78
|
+
export declare const updateLeadMobile: import("@reduxjs/toolkit").AsyncThunk<{
|
|
79
|
+
leadResponse: any;
|
|
80
|
+
formData: MobileOwnershipFormValues;
|
|
81
|
+
}, MobileOwnershipFormValues, {}>;
|
|
82
|
+
export declare const skipUpdateLeadMobile: import("@reduxjs/toolkit").AsyncThunk<{
|
|
83
|
+
leadResponse: any;
|
|
84
|
+
}, void, {}>;
|
|
78
85
|
export declare const checkEmailAvailability: import("@reduxjs/toolkit").AsyncThunk<{
|
|
79
86
|
response: any;
|
|
80
87
|
formData: string;
|