@tap-payments/auth-jsconnect 2.9.11-sandbox → 2.9.12-sandbox
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
|
@@ -632,5 +632,10 @@
|
|
|
632
632
|
"year": "السنة",
|
|
633
633
|
"yes": "نعم",
|
|
634
634
|
"your_brand_details": "تفاصيل علامتك التجارية",
|
|
635
|
-
"يرجى التحقق من اسم تطبيق ابل": ""
|
|
635
|
+
"يرجى التحقق من اسم تطبيق ابل": "",
|
|
636
|
+
"mobile_ownership_title": "لتفعيل استلام الايداعات، يرجى تحديث رقم هاتفك المحمول المسجل ليتوافق مع هويتك.",
|
|
637
|
+
"current_mobile_number": "رقم الجوال الحالي",
|
|
638
|
+
"new_mobile_number": "رقم الجوال الجديد",
|
|
639
|
+
"update_mobile_number": "تحديث رقم الجوال",
|
|
640
|
+
"update_later": "سأقوم بالتحديث لاحقاً"
|
|
636
641
|
}
|
|
@@ -659,5 +659,10 @@
|
|
|
659
659
|
"website_label": "Website",
|
|
660
660
|
"year": "Year",
|
|
661
661
|
"yes": "Yes",
|
|
662
|
-
"your_brand_details": "Your brand details"
|
|
662
|
+
"your_brand_details": "Your brand details",
|
|
663
|
+
"mobile_ownership_title": "To enable bank payouts, please update your registered mobile number to match your national ID.",
|
|
664
|
+
"current_mobile_number": "Current mobile number",
|
|
665
|
+
"new_mobile_number": "New mobile number",
|
|
666
|
+
"update_mobile_number": "Update mobile number",
|
|
667
|
+
"update_later": "I'll update later"
|
|
663
668
|
}
|
|
@@ -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
|
@@ -100,6 +100,8 @@ export declare const CONNECT_STEP_NAMES: {
|
|
|
100
100
|
UPDATE_BRAND_SEGMENT_INFO: string;
|
|
101
101
|
CREATE_AUTH_PASSWORD: string;
|
|
102
102
|
VERIFY_AUTH_PASSWORD: string;
|
|
103
|
+
CONNECT_MOBILE_OWNERSHIP: string;
|
|
104
|
+
CONNECT_MOBILE_OWNERSHIP_SKIPPED: string;
|
|
103
105
|
CONNECT_SUCCESS: string;
|
|
104
106
|
};
|
|
105
107
|
export declare const AUTH_STEP_NAMES: {
|
|
@@ -128,6 +130,8 @@ export declare const CONNECT_EXPRESS_STEP_NAMES: {
|
|
|
128
130
|
CREATE_AUTH_PASSWORD: string;
|
|
129
131
|
VERIFY_AUTH_PASSWORD: string;
|
|
130
132
|
CONNECT_EXPRESS_SUCCESS: string;
|
|
133
|
+
COLLECT_MOBILE_OWNERSHIP: string;
|
|
134
|
+
COLLECT_MOBILE_OWNERSHIP_SKIPPED: string;
|
|
131
135
|
};
|
|
132
136
|
export declare const SignIn_STEP_NAMES: {
|
|
133
137
|
CREATE_AUTH_MOBILE: string;
|
|
@@ -149,6 +153,8 @@ export declare const BUSINESS_STEP_NAMES: {
|
|
|
149
153
|
BUSINESS_CR_ACTIVITIES: string;
|
|
150
154
|
BUSINESS_CUSTOMERS: string;
|
|
151
155
|
BUSINESS_SUCCESS: string;
|
|
156
|
+
BUSINESS_MOBILE_OWNERSHIP: string;
|
|
157
|
+
BUSINESS_MOBILE_OWNERSHIP_SKIPPED: string;
|
|
152
158
|
};
|
|
153
159
|
export declare const BANK_STEP_NAMES: {
|
|
154
160
|
PHONE_AUTH: string;
|
package/build/constants/app.js
CHANGED
|
@@ -81,7 +81,7 @@ export var CONNECT_SCREENS_NAVIGATION = [
|
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
83
|
name: 'CONNECT_INDIVIDUAL_STEP',
|
|
84
|
-
next: 'CONNECT_MERCHANT_INFO_STEP',
|
|
84
|
+
next: ['CONNECT_MERCHANT_INFO_STEP', 'CONNECT_MOBILE_OWNERSHIP'],
|
|
85
85
|
prev: ['CONNECT_MOBILE_STEP', 'CONNECT_NID_STEP', 'CONNECT_CIVIL_ID_STEP', 'CONNECT_DOB_STEP'],
|
|
86
86
|
order: 3
|
|
87
87
|
},
|
|
@@ -91,6 +91,12 @@ export var CONNECT_SCREENS_NAVIGATION = [
|
|
|
91
91
|
prev: ['CONNECT_INDIVIDUAL_STEP', 'CONNECT_NID_STEP', 'CONNECT_MOBILE_STEP', 'CONNECT_CIVIL_ID_STEP'],
|
|
92
92
|
order: 4
|
|
93
93
|
},
|
|
94
|
+
{
|
|
95
|
+
name: 'CONNECT_MOBILE_OWNERSHIP',
|
|
96
|
+
next: 'CONNECT_MERCHANT_INFO_STEP',
|
|
97
|
+
prev: 'CONNECT_INDIVIDUAL_STEP',
|
|
98
|
+
order: 4
|
|
99
|
+
},
|
|
94
100
|
{
|
|
95
101
|
name: 'CONNECT_BRAND_SEGMENT_INFO_STEP',
|
|
96
102
|
next: 'CONNECT_THANK_YOU_STEP',
|
|
@@ -203,7 +209,8 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
|
203
209
|
next: [
|
|
204
210
|
'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP',
|
|
205
211
|
'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP',
|
|
206
|
-
'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP'
|
|
212
|
+
'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP',
|
|
213
|
+
'COLLECT_MOBILE_OWNERSHIP'
|
|
207
214
|
],
|
|
208
215
|
prev: 'CONNECT_EXPRESS_NID_MISSED_STEP',
|
|
209
216
|
order: 4
|
|
@@ -222,7 +229,7 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
|
222
229
|
},
|
|
223
230
|
{
|
|
224
231
|
name: 'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP',
|
|
225
|
-
next: ['CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP', 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP'],
|
|
232
|
+
next: ['CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP', 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP', 'COLLECT_MOBILE_OWNERSHIP'],
|
|
226
233
|
prev: [
|
|
227
234
|
'CONNECT_EXPRESS_MOBILE_STEP',
|
|
228
235
|
'CONNECT_EXPRESS_NID_STEP',
|
|
@@ -233,6 +240,17 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
|
233
240
|
],
|
|
234
241
|
order: 5
|
|
235
242
|
},
|
|
243
|
+
{
|
|
244
|
+
name: 'COLLECT_MOBILE_OWNERSHIP',
|
|
245
|
+
next: [
|
|
246
|
+
'CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP',
|
|
247
|
+
'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP',
|
|
248
|
+
'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP',
|
|
249
|
+
'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP'
|
|
250
|
+
],
|
|
251
|
+
prev: ['CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP', 'CONNECT_EXPRESS_NID_MISSED_STEP'],
|
|
252
|
+
order: 6
|
|
253
|
+
},
|
|
236
254
|
{
|
|
237
255
|
name: 'CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP',
|
|
238
256
|
next: 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP',
|
|
@@ -485,13 +503,13 @@ export var BUSINESS_SCREENS_NAVIGATION = [
|
|
|
485
503
|
},
|
|
486
504
|
{
|
|
487
505
|
name: 'BUSINESS_VERIFY_NAFATH_STEP',
|
|
488
|
-
next: ['BUSINESS_BUSINESS_TYPE_STEP', 'BUSINESS_DOB_STEP'],
|
|
506
|
+
next: ['BUSINESS_BUSINESS_TYPE_STEP', 'BUSINESS_DOB_STEP', 'BUSINESS_MOBILE_OWNERSHIP'],
|
|
489
507
|
prev: 'BUSINESS_IDBOD_STEP',
|
|
490
508
|
order: 3
|
|
491
509
|
},
|
|
492
510
|
{
|
|
493
511
|
name: 'BUSINESS_DOB_STEP',
|
|
494
|
-
next: 'BUSINESS_BUSINESS_TYPE_STEP',
|
|
512
|
+
next: ['BUSINESS_BUSINESS_TYPE_STEP', 'BUSINESS_MOBILE_OWNERSHIP'],
|
|
495
513
|
prev: 'BUSINESS_IDBOD_STEP',
|
|
496
514
|
order: 2
|
|
497
515
|
},
|
|
@@ -507,6 +525,12 @@ export var BUSINESS_SCREENS_NAVIGATION = [
|
|
|
507
525
|
prev: 'BUSINESS_BUSINESS_TYPE_STEP',
|
|
508
526
|
order: 2
|
|
509
527
|
},
|
|
528
|
+
{
|
|
529
|
+
name: 'BUSINESS_MOBILE_OWNERSHIP',
|
|
530
|
+
next: ['BUSINESS_BUSINESS_TYPE_STEP', 'BUSINESS_DOB_STEP'],
|
|
531
|
+
prev: 'BUSINESS_IDBOD_STEP',
|
|
532
|
+
order: 3
|
|
533
|
+
},
|
|
510
534
|
{
|
|
511
535
|
name: 'BUSINESS_CONFIRM_STEP',
|
|
512
536
|
next: 'BUSINESS_ACTIVITIES_STEP',
|
|
@@ -978,6 +1002,8 @@ export var CONNECT_STEP_NAMES = {
|
|
|
978
1002
|
UPDATE_BRAND_SEGMENT_INFO: 'connect_update_brand_segment_info',
|
|
979
1003
|
CREATE_AUTH_PASSWORD: 'connect_create_auth_password',
|
|
980
1004
|
VERIFY_AUTH_PASSWORD: 'connect_verify_auth_password',
|
|
1005
|
+
CONNECT_MOBILE_OWNERSHIP: 'collect_owner_phone',
|
|
1006
|
+
CONNECT_MOBILE_OWNERSHIP_SKIPPED: 'collect_owner_phone_skipped',
|
|
981
1007
|
CONNECT_SUCCESS: 'connect_completed'
|
|
982
1008
|
};
|
|
983
1009
|
export var AUTH_STEP_NAMES = {
|
|
@@ -1005,7 +1031,9 @@ export var CONNECT_EXPRESS_STEP_NAMES = {
|
|
|
1005
1031
|
UPDATE_BRAND_INFO: 'connect_express_update_brand_info',
|
|
1006
1032
|
CREATE_AUTH_PASSWORD: 'connect_express_create_auth_password',
|
|
1007
1033
|
VERIFY_AUTH_PASSWORD: 'connect_express_verify_auth_password',
|
|
1008
|
-
CONNECT_EXPRESS_SUCCESS: 'connect_express_completed'
|
|
1034
|
+
CONNECT_EXPRESS_SUCCESS: 'connect_express_completed',
|
|
1035
|
+
COLLECT_MOBILE_OWNERSHIP: 'collect_owner_phone',
|
|
1036
|
+
COLLECT_MOBILE_OWNERSHIP_SKIPPED: 'collect_owner_phone_skipped'
|
|
1009
1037
|
};
|
|
1010
1038
|
export var SignIn_STEP_NAMES = {
|
|
1011
1039
|
CREATE_AUTH_MOBILE: 'signIn_create_auth_mobile',
|
|
@@ -1026,7 +1054,9 @@ export var BUSINESS_STEP_NAMES = {
|
|
|
1026
1054
|
BUSINESS_INFO_CONFIRM: 'business_info_confirm',
|
|
1027
1055
|
BUSINESS_CR_ACTIVITIES: 'business_cr_activities',
|
|
1028
1056
|
BUSINESS_CUSTOMERS: 'business_customers',
|
|
1029
|
-
BUSINESS_SUCCESS: 'business_completed'
|
|
1057
|
+
BUSINESS_SUCCESS: 'business_completed',
|
|
1058
|
+
BUSINESS_MOBILE_OWNERSHIP: 'collect_owner_phone',
|
|
1059
|
+
BUSINESS_MOBILE_OWNERSHIP_SKIPPED: 'collect_owner_phone_skipped'
|
|
1030
1060
|
};
|
|
1031
1061
|
export var BANK_STEP_NAMES = {
|
|
1032
1062
|
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;
|