@tap-payments/auth-jsconnect 2.8.93-development → 2.8.97-development
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 +3 -0
- package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +1 -1
- package/build/components/ArabicDatePicker/ArabicDatePicker.js +2 -2
- package/build/components/DatePicker/DatePicker.d.ts +1 -1
- package/build/components/DatePicker/DatePicker.js +2 -2
- package/build/constants/app.d.ts +5 -0
- package/build/constants/app.js +45 -9
- package/build/features/app/auth/authStore.d.ts +6 -1
- package/build/features/app/auth/authStore.js +86 -28
- package/build/features/app/business/businessStore.d.ts +20 -3
- package/build/features/app/business/businessStore.js +100 -35
- package/build/features/app/connect/connectStore.d.ts +11 -2
- package/build/features/app/connect/connectStore.js +52 -5
- package/build/features/app/connectExpress/connectExpressStore.d.ts +23 -4
- package/build/features/app/connectExpress/connectExpressStore.js +73 -13
- package/build/features/auth/screens/DOB/DOB.d.ts +6 -0
- package/build/features/auth/screens/DOB/DOB.js +47 -0
- package/build/features/auth/screens/DOB/DOBForm.d.ts +5 -0
- package/build/features/auth/screens/DOB/DOBForm.js +59 -0
- package/build/features/auth/screens/DOB/index.d.ts +3 -0
- package/build/features/auth/screens/DOB/index.js +2 -0
- package/build/features/auth/screens/DOB/validation.d.ts +8 -0
- package/build/features/auth/screens/DOB/validation.js +4 -0
- package/build/features/business/screens/BusinessType/BusinessType.js +2 -2
- package/build/features/business/screens/DOB/DOB.d.ts +6 -0
- package/build/features/business/screens/DOB/DOB.js +45 -0
- package/build/features/business/screens/DOB/DOBForm.d.ts +5 -0
- package/build/features/business/screens/DOB/DOBForm.js +72 -0
- package/build/features/business/screens/DOB/index.d.ts +3 -0
- package/build/features/business/screens/DOB/index.js +2 -0
- package/build/features/business/screens/DOB/validation.d.ts +8 -0
- package/build/features/business/screens/DOB/validation.js +4 -0
- package/build/features/connect/screens/DOB/DOB.d.ts +6 -0
- package/build/features/connect/screens/DOB/DOB.js +47 -0
- package/build/features/connect/screens/DOB/DOBForm.d.ts +5 -0
- package/build/features/connect/screens/DOB/DOBForm.js +59 -0
- package/build/features/connect/screens/DOB/index.d.ts +3 -0
- package/build/features/connect/screens/DOB/index.js +2 -0
- package/build/features/connect/screens/DOB/validation.d.ts +8 -0
- package/build/features/connect/screens/DOB/validation.js +4 -0
- package/build/features/connect/screens/Individual/Individual.js +10 -3
- package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +21 -4
- package/build/features/connectExpress/screens/DOB/DOB.d.ts +6 -0
- package/build/features/connectExpress/screens/DOB/DOB.js +47 -0
- package/build/features/connectExpress/screens/DOB/DOBForm.d.ts +5 -0
- package/build/features/connectExpress/screens/DOB/DOBForm.js +63 -0
- package/build/features/connectExpress/screens/DOB/index.d.ts +3 -0
- package/build/features/connectExpress/screens/DOB/index.js +2 -0
- package/build/features/connectExpress/screens/DOB/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/DOB/validation.js +4 -0
- package/build/features/entity/screens/EntityName/ExpiryDate.js +9 -2
- package/build/features/entity/screens/EntityName/IssuingDate.js +10 -1
- package/build/features/featuresScreens.js +20 -0
- package/build/features/shared/Calender/Calender.d.ts +2 -1
- package/build/features/shared/Calender/Calender.js +3 -3
- package/package.json +1 -1
package/build/@types/form.d.ts
CHANGED
|
@@ -12,5 +12,5 @@ export interface DatePickerProps extends CalendarProps {
|
|
|
12
12
|
isDob?: boolean;
|
|
13
13
|
isVerified?: boolean;
|
|
14
14
|
}
|
|
15
|
-
declare const _default: React.MemoExoticComponent<({ open, disabled, dir, readOnly, onDateChange, onClick, onDatePicked, value, isDob, isVerified, ...rest }: DatePickerProps) => JSX.Element>;
|
|
15
|
+
declare const _default: React.MemoExoticComponent<({ open, disabled, dir, readOnly, onDateChange, onClick, onDatePicked, value, isDob, isVerified, minDate, maxDate, ...rest }: DatePickerProps) => JSX.Element>;
|
|
16
16
|
export default _default;
|
|
@@ -71,7 +71,7 @@ var ArrowIcon = styled(Text, { shouldForwardProp: function (prop) { return prop
|
|
|
71
71
|
});
|
|
72
72
|
});
|
|
73
73
|
var DatePicker = function (_a) {
|
|
74
|
-
var _b = _a.open, open = _b === void 0 ? false : _b, disabled = _a.disabled, dir = _a.dir, readOnly = _a.readOnly, onDateChange = _a.onDateChange, onClick = _a.onClick, onDatePicked = _a.onDatePicked, value = _a.value, isDob = _a.isDob, isVerified = _a.isVerified, rest = __rest(_a, ["open", "disabled", "dir", "readOnly", "onDateChange", "onClick", "onDatePicked", "value", "isDob", "isVerified"]);
|
|
74
|
+
var _b = _a.open, open = _b === void 0 ? false : _b, disabled = _a.disabled, dir = _a.dir, readOnly = _a.readOnly, onDateChange = _a.onDateChange, onClick = _a.onClick, onDatePicked = _a.onDatePicked, value = _a.value, isDob = _a.isDob, isVerified = _a.isVerified, minDate = _a.minDate, maxDate = _a.maxDate, rest = __rest(_a, ["open", "disabled", "dir", "readOnly", "onDateChange", "onClick", "onDatePicked", "value", "isDob", "isVerified", "minDate", "maxDate"]);
|
|
75
75
|
var _c = React.useState(), date = _c[0], setDate = _c[1];
|
|
76
76
|
var _d = React.useState(null), anchor = _d[0], setAnchor = _d[1];
|
|
77
77
|
var _e = React.useState(open), openCalender = _e[0], setOpenCalender = _e[1];
|
|
@@ -111,6 +111,6 @@ var DatePicker = function (_a) {
|
|
|
111
111
|
return (_jsxs(Container, __assign({ openCalender: openCalender, disabled: disabled, id: 'arabic-container-calendar' }, { children: [_jsx(InputFieldStyled, { endAdornment: _jsx(ArrowIcon, __assign({ disabled: disabled }, { children: getEndAdornment() })), value: date ? formateDate(date) : '', placeholder: DATE_FORMAT, onClick: function (e) {
|
|
112
112
|
if (!disabled)
|
|
113
113
|
toggleCalender(e);
|
|
114
|
-
}, startAdornment: calenderIcon, disabled: disabled, readOnly: readOnly, dir: dir }), _jsxs(Collapse, __assign({ in: openCalender }, { children: [_jsx(Calendar, __assign({ calendar: arabic, locale: dir === 'rtl' ? arabic_ar : arabic_en, maxDate:
|
|
114
|
+
}, startAdornment: calenderIcon, disabled: disabled, readOnly: readOnly, dir: dir }), _jsxs(Collapse, __assign({ in: openCalender }, { children: [_jsx(Calendar, __assign({ calendar: arabic, locale: dir === 'rtl' ? arabic_ar : arabic_en, maxDate: maxDate || defaultMax, minDate: minDate || defaultMin, format: DATE_FORMAT, onChange: handleOnDateChange, value: date || (isDob ? new Date(getEighteenYearsAgo()) : undefined), className: 'custom-container' }, rest)), _jsx(Divider, {})] }))] })));
|
|
115
115
|
};
|
|
116
116
|
export default memo(DatePicker);
|
|
@@ -13,5 +13,5 @@ export interface DatePickerProps extends CalendarProps {
|
|
|
13
13
|
isDob?: boolean;
|
|
14
14
|
isVerified?: boolean;
|
|
15
15
|
}
|
|
16
|
-
declare const _default: React.MemoExoticComponent<({ onDateChange, disabled, readOnly, onClick, onDatePicked, dir, defaultValue, isDob, isVerified, open, ...rest }: DatePickerProps) => JSX.Element>;
|
|
16
|
+
declare const _default: React.MemoExoticComponent<({ onDateChange, disabled, readOnly, onClick, onDatePicked, dir, defaultValue, isDob, isVerified, open, minDate, maxDate, ...rest }: DatePickerProps) => JSX.Element>;
|
|
17
17
|
export default _default;
|
|
@@ -67,7 +67,7 @@ var ArrowIcon = styled(Text, { shouldForwardProp: function (prop) { return prop
|
|
|
67
67
|
});
|
|
68
68
|
});
|
|
69
69
|
var DatePicker = function (_a) {
|
|
70
|
-
var onDateChange = _a.onDateChange, disabled = _a.disabled, readOnly = _a.readOnly, onClick = _a.onClick, onDatePicked = _a.onDatePicked, dir = _a.dir, defaultValue = _a.defaultValue, isDob = _a.isDob, isVerified = _a.isVerified, open = _a.open, rest = __rest(_a, ["onDateChange", "disabled", "readOnly", "onClick", "onDatePicked", "dir", "defaultValue", "isDob", "isVerified", "open"]);
|
|
70
|
+
var onDateChange = _a.onDateChange, disabled = _a.disabled, readOnly = _a.readOnly, onClick = _a.onClick, onDatePicked = _a.onDatePicked, dir = _a.dir, defaultValue = _a.defaultValue, isDob = _a.isDob, isVerified = _a.isVerified, open = _a.open, minDate = _a.minDate, maxDate = _a.maxDate, rest = __rest(_a, ["onDateChange", "disabled", "readOnly", "onClick", "onDatePicked", "dir", "defaultValue", "isDob", "isVerified", "open", "minDate", "maxDate"]);
|
|
71
71
|
var _b = useState(), date = _b[0], setDate = _b[1];
|
|
72
72
|
var _c = React.useState(null), anchor = _c[0], setAnchor = _c[1];
|
|
73
73
|
var _d = React.useState(open), openCalender = _d[0], setOpenCalender = _d[1];
|
|
@@ -106,6 +106,6 @@ var DatePicker = function (_a) {
|
|
|
106
106
|
return (_jsxs(Container, __assign({ disabled: disabled, id: 'container-calendar' }, { children: [_jsx(InputFieldStyled, { endAdornment: _jsx(ArrowIcon, __assign({ disabled: disabled }, { children: getEndAdornment() })), value: date ? convertToEnglishDateFormat(date) : '', placeholder: 'YYYY-MM-DD', onClick: function (e) {
|
|
107
107
|
if (!disabled)
|
|
108
108
|
toggleCalender(e);
|
|
109
|
-
}, startAdornment: calenderIcon, disabled: disabled, readOnly: readOnly, dir: dir }), _jsxs(Collapse, __assign({ in: openCalender }, { children: [_jsx(Calendar, __assign({}, rest, { value: date || (isDob ? new Date(getEighteenYearsAgo()) : undefined), calendarType: 'Hebrew', onChange: handleOnDateChange, locale: rest.locale, maxDate:
|
|
109
|
+
}, startAdornment: calenderIcon, disabled: disabled, readOnly: readOnly, dir: dir }), _jsxs(Collapse, __assign({ in: openCalender }, { children: [_jsx(Calendar, __assign({}, rest, { value: date || (isDob ? new Date(getEighteenYearsAgo()) : undefined), calendarType: 'Hebrew', onChange: handleOnDateChange, locale: rest.locale, maxDate: maxDate || defaultMax, minDate: minDate || defaultMin })), _jsx(Divider, {})] }))] })));
|
|
110
110
|
};
|
|
111
111
|
export default memo(DatePicker);
|
package/build/constants/app.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare const LOCAL_STORAGE_KEYS: {
|
|
|
11
11
|
export declare const SCOPE_AUTH = "auth";
|
|
12
12
|
export declare const DEFAULT_COUNTRY_ISO2 = "KW";
|
|
13
13
|
export declare const NAFATH_VERIFICATION_FAILED = "nafath_verification_failed";
|
|
14
|
+
export declare const COLLECT_DOB_INFO_NAFATH = "collect_date_of_birth";
|
|
14
15
|
export declare const EXTERNAL_LINKS: {
|
|
15
16
|
TOS_EN: string;
|
|
16
17
|
TOS_AR: string;
|
|
@@ -90,6 +91,7 @@ export declare const CONNECT_STEP_NAMES: {
|
|
|
90
91
|
VERIFY_AUTH_MOBILE: string;
|
|
91
92
|
CREATE_AUTH_NID: string;
|
|
92
93
|
VERIFY_AUTH_NID: string;
|
|
94
|
+
UPDATE_LEAD_DOB: string;
|
|
93
95
|
UPDATE_LEAD_INDIVIDUAL: string;
|
|
94
96
|
UPDATE_LEAD_BRAND: string;
|
|
95
97
|
UPDATE_BRAND_INFO: string;
|
|
@@ -106,6 +108,7 @@ export declare const AUTH_STEP_NAMES: {
|
|
|
106
108
|
VERIFY_AUTH_EMAIL: string;
|
|
107
109
|
CREATE_AUTH_NID: string;
|
|
108
110
|
VERIFY_AUTH_NID: string;
|
|
111
|
+
UPDATE_DOB_INFO: string;
|
|
109
112
|
};
|
|
110
113
|
export declare const CONNECT_EXPRESS_STEP_NAMES: {
|
|
111
114
|
CREATE_AUTH_MOBILE: string;
|
|
@@ -116,6 +119,7 @@ export declare const CONNECT_EXPRESS_STEP_NAMES: {
|
|
|
116
119
|
VERIFY_AUTH_NID: string;
|
|
117
120
|
IDENTITY_AUTH: string;
|
|
118
121
|
VERIFY_IDENTITY_AUTH: string;
|
|
122
|
+
UPDATE_LEAD_DOB: string;
|
|
119
123
|
UPDATE_LEAD_INDIVIDUAL: string;
|
|
120
124
|
UPDATE_LEAD_BRAND_BUSINESS: string;
|
|
121
125
|
UPDATE_BRAND_INFO: string;
|
|
@@ -137,6 +141,7 @@ export declare const BUSINESS_STEP_NAMES: {
|
|
|
137
141
|
IDENTITY_AUTH: string;
|
|
138
142
|
CREATE_AUTH_CIVIL_ID: string;
|
|
139
143
|
IDENTITY_VERIFY_AUTH: string;
|
|
144
|
+
BUSINESS_DOB_INFO: string;
|
|
140
145
|
BUSINESS_CR_INFO: string;
|
|
141
146
|
BUSINESS_INFO_CONFIRM: string;
|
|
142
147
|
BUSINESS_CR_ACTIVITIES: string;
|
package/build/constants/app.js
CHANGED
|
@@ -11,6 +11,7 @@ export var LOCAL_STORAGE_KEYS = {
|
|
|
11
11
|
export var SCOPE_AUTH = 'auth';
|
|
12
12
|
export var DEFAULT_COUNTRY_ISO2 = 'KW';
|
|
13
13
|
export var NAFATH_VERIFICATION_FAILED = 'nafath_verification_failed';
|
|
14
|
+
export var COLLECT_DOB_INFO_NAFATH = 'collect_date_of_birth';
|
|
14
15
|
export var EXTERNAL_LINKS = {
|
|
15
16
|
TOS_EN: '/en/terms-conditions',
|
|
16
17
|
TOS_AR: '/ar/terms-conditions',
|
|
@@ -60,7 +61,7 @@ export var CONNECT_SCREENS_NAVIGATION = [
|
|
|
60
61
|
},
|
|
61
62
|
{
|
|
62
63
|
name: 'CONNECT_VERIFY_NAFATH_STEP',
|
|
63
|
-
next: 'CONNECT_INDIVIDUAL_STEP',
|
|
64
|
+
next: ['CONNECT_INDIVIDUAL_STEP', 'CONNECT_DOB_STEP'],
|
|
64
65
|
prev: 'CONNECT_NID_STEP',
|
|
65
66
|
order: 2
|
|
66
67
|
},
|
|
@@ -70,10 +71,16 @@ export var CONNECT_SCREENS_NAVIGATION = [
|
|
|
70
71
|
prev: ['CONNECT_MOBILE_STEP', 'CONNECT_NID_STEP'],
|
|
71
72
|
order: 2
|
|
72
73
|
},
|
|
74
|
+
{
|
|
75
|
+
name: 'CONNECT_DOB_STEP',
|
|
76
|
+
next: 'CONNECT_INDIVIDUAL_STEP',
|
|
77
|
+
prev: 'CONNECT_NID_STEP',
|
|
78
|
+
order: 2
|
|
79
|
+
},
|
|
73
80
|
{
|
|
74
81
|
name: 'CONNECT_INDIVIDUAL_STEP',
|
|
75
82
|
next: 'CONNECT_MERCHANT_INFO_STEP',
|
|
76
|
-
prev: ['CONNECT_MOBILE_STEP', 'CONNECT_NID_STEP', 'CONNECT_CIVIL_ID_STEP'],
|
|
83
|
+
prev: ['CONNECT_MOBILE_STEP', 'CONNECT_NID_STEP', 'CONNECT_CIVIL_ID_STEP', 'CONNECT_DOB_STEP'],
|
|
77
84
|
order: 3
|
|
78
85
|
},
|
|
79
86
|
{
|
|
@@ -130,6 +137,7 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
|
130
137
|
name: 'CONNECT_EXPRESS_VERIFY_NAFATH_STEP',
|
|
131
138
|
next: [
|
|
132
139
|
'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP',
|
|
140
|
+
'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP',
|
|
133
141
|
'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP',
|
|
134
142
|
'CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP'
|
|
135
143
|
],
|
|
@@ -190,7 +198,11 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
|
190
198
|
},
|
|
191
199
|
{
|
|
192
200
|
name: 'CONNECT_EXPRESS_IDENTITY_VERIFY_NAFATH_STEP',
|
|
193
|
-
next: [
|
|
201
|
+
next: [
|
|
202
|
+
'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP',
|
|
203
|
+
'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP',
|
|
204
|
+
'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP'
|
|
205
|
+
],
|
|
194
206
|
prev: 'CONNECT_EXPRESS_NID_MISSED_STEP',
|
|
195
207
|
order: 4
|
|
196
208
|
},
|
|
@@ -200,6 +212,12 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
|
200
212
|
prev: 'CONNECT_EXPRESS_CIVIL_ID_MISSED_STEP',
|
|
201
213
|
order: 4
|
|
202
214
|
},
|
|
215
|
+
{
|
|
216
|
+
name: 'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP',
|
|
217
|
+
next: ['CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP', 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP'],
|
|
218
|
+
prev: ['CONNECT_EXPRESS_NID_STEP', 'CONNECT_EXPRESS_NID_MISSED_STEP'],
|
|
219
|
+
order: 5
|
|
220
|
+
},
|
|
203
221
|
{
|
|
204
222
|
name: 'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP',
|
|
205
223
|
next: ['CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP', 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP'],
|
|
@@ -208,7 +226,8 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
|
208
226
|
'CONNECT_EXPRESS_NID_STEP',
|
|
209
227
|
'CONNECT_EXPRESS_CIVIL_ID_STEP',
|
|
210
228
|
'CONNECT_EXPRESS_CIVIL_ID_MISSED_STEP',
|
|
211
|
-
'CONNECT_EXPRESS_NID_MISSED_STEP'
|
|
229
|
+
'CONNECT_EXPRESS_NID_MISSED_STEP',
|
|
230
|
+
'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP'
|
|
212
231
|
],
|
|
213
232
|
order: 5
|
|
214
233
|
},
|
|
@@ -294,7 +313,7 @@ export var AUTH_SCREENS_NAVIGATION = [
|
|
|
294
313
|
},
|
|
295
314
|
{
|
|
296
315
|
name: 'AUTH_NAFATH_VERIFY_STEP',
|
|
297
|
-
next: 'AUTH_PREPARING_DATA_STEP',
|
|
316
|
+
next: ['AUTH_PREPARING_DATA_STEP', 'AUTH_DOB_STEP'],
|
|
298
317
|
prev: 'AUTH_NID_STEP',
|
|
299
318
|
order: 2
|
|
300
319
|
},
|
|
@@ -316,6 +335,12 @@ export var AUTH_SCREENS_NAVIGATION = [
|
|
|
316
335
|
prev: 'AUTH_CIVIL_ID_STEP',
|
|
317
336
|
order: 2
|
|
318
337
|
},
|
|
338
|
+
{
|
|
339
|
+
name: 'AUTH_DOB_STEP',
|
|
340
|
+
next: 'AUTH_PREPARING_DATA_STEP',
|
|
341
|
+
prev: 'AUTH_NID_STEP',
|
|
342
|
+
order: 2
|
|
343
|
+
},
|
|
319
344
|
{
|
|
320
345
|
name: 'AUTH_PREPARING_DATA_STEP',
|
|
321
346
|
next: ['AUTH_AUTHENTICATION_LIST_STEP', 'AUTH_ACCOUNT_NOT_FOUND_STEP'],
|
|
@@ -370,7 +395,8 @@ export var BUSINESS_SCREENS_NAVIGATION = [
|
|
|
370
395
|
'BUSINESS_ACTIVITIES_STEP',
|
|
371
396
|
'BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
|
|
372
397
|
'BUSINESS_CIVIL_ID_STEP',
|
|
373
|
-
'BUSINESS_VERIFY_BRAND_INFO'
|
|
398
|
+
'BUSINESS_VERIFY_BRAND_INFO',
|
|
399
|
+
'BUSINESS_DOB_STEP'
|
|
374
400
|
],
|
|
375
401
|
prev: '',
|
|
376
402
|
order: 1
|
|
@@ -401,14 +427,20 @@ export var BUSINESS_SCREENS_NAVIGATION = [
|
|
|
401
427
|
},
|
|
402
428
|
{
|
|
403
429
|
name: 'BUSINESS_VERIFY_NAFATH_STEP',
|
|
404
|
-
next: 'BUSINESS_BUSINESS_TYPE_STEP',
|
|
430
|
+
next: ['BUSINESS_BUSINESS_TYPE_STEP', 'BUSINESS_DOB_STEP'],
|
|
405
431
|
prev: 'BUSINESS_IDBOD_STEP',
|
|
406
432
|
order: 3
|
|
407
433
|
},
|
|
434
|
+
{
|
|
435
|
+
name: 'BUSINESS_DOB_STEP',
|
|
436
|
+
next: 'BUSINESS_BUSINESS_TYPE_STEP',
|
|
437
|
+
prev: 'BUSINESS_IDBOD_STEP',
|
|
438
|
+
order: 2
|
|
439
|
+
},
|
|
408
440
|
{
|
|
409
441
|
name: 'BUSINESS_BUSINESS_TYPE_STEP',
|
|
410
442
|
next: ['BUSINESS_ACTIVITIES_STEP', 'BUSINESS_VERIFY_BRAND_INFO'],
|
|
411
|
-
prev: 'BUSINESS_IDBOD_STEP',
|
|
443
|
+
prev: ['BUSINESS_IDBOD_STEP', 'BUSINESS_DOB_STEP'],
|
|
412
444
|
order: 2
|
|
413
445
|
},
|
|
414
446
|
{
|
|
@@ -881,6 +913,7 @@ export var CONNECT_STEP_NAMES = {
|
|
|
881
913
|
VERIFY_AUTH_MOBILE: 'connect_verify_auth_mobile',
|
|
882
914
|
CREATE_AUTH_NID: 'connect_create_auth_nid',
|
|
883
915
|
VERIFY_AUTH_NID: 'connect_verify_auth_nid',
|
|
916
|
+
UPDATE_LEAD_DOB: 'connect_update_lead_dob',
|
|
884
917
|
UPDATE_LEAD_INDIVIDUAL: 'connect_update_lead_individual',
|
|
885
918
|
UPDATE_LEAD_BRAND: 'connect_update_lead_brand',
|
|
886
919
|
UPDATE_BRAND_INFO: 'connect_update_brand_info',
|
|
@@ -896,7 +929,8 @@ export var AUTH_STEP_NAMES = {
|
|
|
896
929
|
VERIFY_AUTH_MOBILE: 'auth_verify_auth_mobile',
|
|
897
930
|
VERIFY_AUTH_EMAIL: 'auth_verify_auth_email',
|
|
898
931
|
CREATE_AUTH_NID: 'auth_create_auth_nid',
|
|
899
|
-
VERIFY_AUTH_NID: 'auth_verify_auth_nid'
|
|
932
|
+
VERIFY_AUTH_NID: 'auth_verify_auth_nid',
|
|
933
|
+
UPDATE_DOB_INFO: 'auth_update_dob_info'
|
|
900
934
|
};
|
|
901
935
|
export var CONNECT_EXPRESS_STEP_NAMES = {
|
|
902
936
|
CREATE_AUTH_MOBILE: 'connect_express_create_auth_mobile',
|
|
@@ -907,6 +941,7 @@ export var CONNECT_EXPRESS_STEP_NAMES = {
|
|
|
907
941
|
VERIFY_AUTH_NID: 'connect_express_verify_auth_nid',
|
|
908
942
|
IDENTITY_AUTH: 'connect_express_identity_auth',
|
|
909
943
|
VERIFY_IDENTITY_AUTH: 'connect_express_verify_identity_auth',
|
|
944
|
+
UPDATE_LEAD_DOB: 'connect_express_update_lead_dob',
|
|
910
945
|
UPDATE_LEAD_INDIVIDUAL: 'connect_express_update_lead_individual',
|
|
911
946
|
UPDATE_LEAD_BRAND_BUSINESS: 'connect_express_update_lead_brand_business',
|
|
912
947
|
UPDATE_BRAND_INFO: 'connect_express_update_brand_info',
|
|
@@ -928,6 +963,7 @@ export var BUSINESS_STEP_NAMES = {
|
|
|
928
963
|
IDENTITY_AUTH: 'business_identity_auth',
|
|
929
964
|
CREATE_AUTH_CIVIL_ID: 'business_create_auth_civil_id',
|
|
930
965
|
IDENTITY_VERIFY_AUTH: 'business_identity_auth_verify',
|
|
966
|
+
BUSINESS_DOB_INFO: 'business_dob_info',
|
|
931
967
|
BUSINESS_CR_INFO: 'business_cr_info',
|
|
932
968
|
BUSINESS_INFO_CONFIRM: 'business_info_confirm',
|
|
933
969
|
BUSINESS_CR_ACTIVITIES: 'business_cr_activities',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RootState } from '../../../app/store';
|
|
2
|
-
import { ActionState, AuthEmailFormValues, AuthForType, AuthMerchantFormValues, AuthenticationListFormValues, CivilFormValues, CountryCode, FlowsTypes, MobileFormValues, NIDFormValues, OTPFormValues, PasswordFormValues, SharedState } from '../../../@types';
|
|
2
|
+
import { ActionState, AuthEmailFormValues, AuthForType, AuthMerchantFormValues, AuthenticationListFormValues, CivilFormValues, CountryCode, DOBFormValues, FlowsTypes, MobileFormValues, NIDFormValues, OTPFormValues, PasswordFormValues, SharedState } from '../../../@types';
|
|
3
3
|
export declare const updateBusinessCountry: import("@reduxjs/toolkit").AsyncThunk<any, string, {}>;
|
|
4
4
|
export declare const retrieveLeadIdentityByIdAsync: import("@reduxjs/toolkit").AsyncThunk<{
|
|
5
5
|
data: any;
|
|
@@ -33,6 +33,10 @@ interface verifyNafathParams {
|
|
|
33
33
|
onFailure?: () => void;
|
|
34
34
|
}
|
|
35
35
|
export declare const verifyNafath: import("@reduxjs/toolkit").AsyncThunk<any, verifyNafathParams, {}>;
|
|
36
|
+
export declare const updateLeadDOB: import("@reduxjs/toolkit").AsyncThunk<{
|
|
37
|
+
data: any;
|
|
38
|
+
formData: DOBFormValues;
|
|
39
|
+
}, DOBFormValues, {}>;
|
|
36
40
|
export declare const createCivilIdAuth: import("@reduxjs/toolkit").AsyncThunk<{
|
|
37
41
|
response: any;
|
|
38
42
|
formData: CivilFormValues;
|
|
@@ -67,6 +71,7 @@ export interface authData {
|
|
|
67
71
|
nidData: NIDFormValues;
|
|
68
72
|
civilIdData: CivilFormValues;
|
|
69
73
|
emailData: AuthEmailFormValues;
|
|
74
|
+
dobData: DOBFormValues;
|
|
70
75
|
otpData: OTPFormValues & {
|
|
71
76
|
authFor?: AuthForType;
|
|
72
77
|
};
|
|
@@ -57,7 +57,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
57
57
|
var _a;
|
|
58
58
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
59
59
|
import { AuthForType, AuthTypeNumber, FlowsTypes, MigrationStatus } from '../../../@types';
|
|
60
|
-
import { ADD_NEW_ENTITY, AUTH_STEP_NAMES, IDENTIFICATION_TYPE, NAFATH_VERIFICATION_FAILED, SCOPE_AUTH, defaultCountry } from '../../../constants';
|
|
60
|
+
import { ADD_NEW_ENTITY, AUTH_STEP_NAMES, COLLECT_DOB_INFO_NAFATH, IDENTIFICATION_TYPE, NAFATH_VERIFICATION_FAILED, SCOPE_AUTH, defaultCountry } from '../../../constants';
|
|
61
61
|
import API from '../../../api';
|
|
62
62
|
import { handleCurrentActiveScreen, handleNextScreenStep, handleOpen, handlePrevScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
|
|
63
63
|
import { findCountryByIddPrefix, openConnect, sendCustomEventToGTM, sleep } from '../../../utils';
|
|
@@ -397,7 +397,7 @@ export var createNafathAuth = createAsyncThunk('auth/createNafathAuth', function
|
|
|
397
397
|
});
|
|
398
398
|
}); });
|
|
399
399
|
export var verifyNafath = createAsyncThunk('auth/verifyNafath', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
400
|
-
var _a, settings, auth, authResponse, expiry, scope, interval, maxCalls,
|
|
400
|
+
var _a, settings, auth, authResponse, expiry, scope, interval, maxCalls, _loop_1, count, state_1;
|
|
401
401
|
var _b, _c, _d, _e, _f;
|
|
402
402
|
return __generator(this, function (_g) {
|
|
403
403
|
switch (_g.label) {
|
|
@@ -408,39 +408,79 @@ export var verifyNafath = createAsyncThunk('auth/verifyNafath', function (params
|
|
|
408
408
|
scope = settings.data.appConfig.scope;
|
|
409
409
|
interval = 3;
|
|
410
410
|
maxCalls = Math.floor(expiry / interval);
|
|
411
|
+
_loop_1 = function (count) {
|
|
412
|
+
var data, isSuccess, isFailed, screen_1;
|
|
413
|
+
return __generator(this, function (_h) {
|
|
414
|
+
switch (_h.label) {
|
|
415
|
+
case 0:
|
|
416
|
+
if (thunkApi.signal.aborted) {
|
|
417
|
+
return [2, "break"];
|
|
418
|
+
}
|
|
419
|
+
return [4, API.authService.getVerifyAuth(authResponse === null || authResponse === void 0 ? void 0 : authResponse.auth_token)];
|
|
420
|
+
case 1:
|
|
421
|
+
data = _h.sent();
|
|
422
|
+
isSuccess = ((_b = data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
|
|
423
|
+
isFailed = ((_c = data === null || data === void 0 ? void 0 : data.status) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'failed';
|
|
424
|
+
if (isFailed) {
|
|
425
|
+
(_d = params.onFailure) === null || _d === void 0 ? void 0 : _d.call(params);
|
|
426
|
+
return [2, { value: data }];
|
|
427
|
+
}
|
|
428
|
+
if (isSuccess) {
|
|
429
|
+
if (scope === 'merchant') {
|
|
430
|
+
openConnect(settings.data.appConfig.publicKey, settings.data.businessCountry.iso2);
|
|
431
|
+
return [2, { value: data }];
|
|
432
|
+
}
|
|
433
|
+
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, params);
|
|
434
|
+
screen_1 = data.step_name === COLLECT_DOB_INFO_NAFATH ? 'AUTH_DOB_STEP' : 'AUTH_PREPARING_DATA_STEP';
|
|
435
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep(screen_1)); });
|
|
436
|
+
return [2, { value: data }];
|
|
437
|
+
}
|
|
438
|
+
return [4, sleep(interval * 1000)];
|
|
439
|
+
case 2:
|
|
440
|
+
_h.sent();
|
|
441
|
+
return [2];
|
|
442
|
+
}
|
|
443
|
+
});
|
|
444
|
+
};
|
|
411
445
|
count = 1;
|
|
412
446
|
_g.label = 1;
|
|
413
447
|
case 1:
|
|
414
|
-
if (!(count <= maxCalls)) return [3,
|
|
415
|
-
|
|
416
|
-
return [3, 5];
|
|
417
|
-
}
|
|
418
|
-
return [4, API.authService.getVerifyAuth(authResponse === null || authResponse === void 0 ? void 0 : authResponse.auth_token)];
|
|
448
|
+
if (!(count <= maxCalls)) return [3, 4];
|
|
449
|
+
return [5, _loop_1(count)];
|
|
419
450
|
case 2:
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
if (
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
}
|
|
427
|
-
if (isSuccess) {
|
|
428
|
-
if (scope === 'merchant') {
|
|
429
|
-
openConnect(settings.data.appConfig.publicKey, settings.data.businessCountry.iso2);
|
|
430
|
-
return [2, data];
|
|
431
|
-
}
|
|
432
|
-
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, params);
|
|
433
|
-
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('AUTH_PREPARING_DATA_STEP')); });
|
|
434
|
-
return [2, data];
|
|
435
|
-
}
|
|
436
|
-
return [4, sleep(interval * 1000)];
|
|
451
|
+
state_1 = _g.sent();
|
|
452
|
+
if (typeof state_1 === "object")
|
|
453
|
+
return [2, state_1.value];
|
|
454
|
+
if (state_1 === "break")
|
|
455
|
+
return [3, 4];
|
|
456
|
+
_g.label = 3;
|
|
437
457
|
case 3:
|
|
438
|
-
_g.sent();
|
|
439
|
-
_g.label = 4;
|
|
440
|
-
case 4:
|
|
441
458
|
count++;
|
|
442
459
|
return [3, 1];
|
|
443
|
-
case
|
|
460
|
+
case 4: throw new Error(NAFATH_VERIFICATION_FAILED);
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
}); });
|
|
464
|
+
export var updateLeadDOB = createAsyncThunk('auth/updateLeadDOB', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
465
|
+
var _a, settings, auth, leadId, requestBody, data;
|
|
466
|
+
var _b, _c, _d, _e;
|
|
467
|
+
return __generator(this, function (_f) {
|
|
468
|
+
switch (_f.label) {
|
|
469
|
+
case 0:
|
|
470
|
+
_a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
|
|
471
|
+
leadId = ((_c = (_b = auth.data.responseData) === null || _b === void 0 ? void 0 : _b.authResponse) === null || _c === void 0 ? void 0 : _c.lead_id) || '';
|
|
472
|
+
requestBody = {
|
|
473
|
+
id: leadId,
|
|
474
|
+
date_of_birth: params.dob,
|
|
475
|
+
step_name: AUTH_STEP_NAMES.UPDATE_DOB_INFO,
|
|
476
|
+
encryption_contract: ['date_of_birth']
|
|
477
|
+
};
|
|
478
|
+
return [4, API.leadService.updateLead(requestBody)];
|
|
479
|
+
case 1:
|
|
480
|
+
data = _f.sent();
|
|
481
|
+
thunkApi.dispatch(handleNextScreenStep());
|
|
482
|
+
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, requestBody);
|
|
483
|
+
return [2, { data: data, formData: params }];
|
|
444
484
|
}
|
|
445
485
|
});
|
|
446
486
|
}); });
|
|
@@ -777,6 +817,9 @@ var initialState = {
|
|
|
777
817
|
emailData: {
|
|
778
818
|
email: ''
|
|
779
819
|
},
|
|
820
|
+
dobData: {
|
|
821
|
+
dob: ''
|
|
822
|
+
},
|
|
780
823
|
otpData: {
|
|
781
824
|
otp: '',
|
|
782
825
|
authFor: AuthForType.MOBILE
|
|
@@ -989,6 +1032,21 @@ export var authSlice = createSlice({
|
|
|
989
1032
|
if (error !== 'Aborted') {
|
|
990
1033
|
state.error = error;
|
|
991
1034
|
}
|
|
1035
|
+
})
|
|
1036
|
+
.addCase(updateLeadDOB.pending, function (state, action) {
|
|
1037
|
+
state.loading = true;
|
|
1038
|
+
state.error = null;
|
|
1039
|
+
})
|
|
1040
|
+
.addCase(updateLeadDOB.fulfilled, function (state, action) {
|
|
1041
|
+
var _a;
|
|
1042
|
+
state.loading = false;
|
|
1043
|
+
var _b = action.payload, data = _b.data, formData = _b.formData;
|
|
1044
|
+
state.data.dobData = formData;
|
|
1045
|
+
state.data.responseData = __assign(__assign({}, state.data.responseData), { leadResponse: __assign(__assign({}, (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.leadResponse), data) });
|
|
1046
|
+
})
|
|
1047
|
+
.addCase(updateLeadDOB.rejected, function (state, action) {
|
|
1048
|
+
state.loading = false;
|
|
1049
|
+
state.error = action.error.message;
|
|
992
1050
|
})
|
|
993
1051
|
.addCase(createCivilIdAuth.pending, function (state) {
|
|
994
1052
|
state.loading = true;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { RootState } from '../../../app/store';
|
|
2
|
-
import { ActivitiesFormValues, CustomersFormValues, BusinessTypeFormValues, NIDFormValues, OTPFormValues, ResponseData, SharedState, FlowsTypes, CivilFormValues, ActionState, AsyncThunkParams } from '../../../@types';
|
|
2
|
+
import { ActivitiesFormValues, CustomersFormValues, BusinessTypeFormValues, NIDFormValues, OTPFormValues, ResponseData, SharedState, FlowsTypes, CivilFormValues, ActionState, AsyncThunkParams, DOBFormValues } from '../../../@types';
|
|
3
3
|
export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
4
4
|
data: any;
|
|
5
|
+
verifyNextStepName: any;
|
|
5
6
|
isicActivityList: any;
|
|
6
7
|
leadData: any;
|
|
7
8
|
token: string;
|
|
@@ -12,6 +13,7 @@ export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
12
13
|
data: any;
|
|
13
14
|
isRequireOTP: boolean;
|
|
14
15
|
token: string;
|
|
16
|
+
verifyNextStepName: any;
|
|
15
17
|
isicActivityList?: undefined;
|
|
16
18
|
leadData?: undefined;
|
|
17
19
|
brandData?: undefined;
|
|
@@ -19,9 +21,11 @@ export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
19
21
|
}, string, {}>;
|
|
20
22
|
export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
21
23
|
data: any;
|
|
24
|
+
verifyNextStepName: any;
|
|
22
25
|
}, void, {}>;
|
|
23
26
|
export declare const verifyLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
24
27
|
data: any;
|
|
28
|
+
verifyNextStepName: any;
|
|
25
29
|
isicActivityList: any;
|
|
26
30
|
formData: {
|
|
27
31
|
isNID: boolean;
|
|
@@ -34,7 +38,13 @@ interface verifyNafathParams {
|
|
|
34
38
|
onSuccess?: () => void;
|
|
35
39
|
onFailure?: () => void;
|
|
36
40
|
}
|
|
37
|
-
export declare const verifyNafath: import("@reduxjs/toolkit").AsyncThunk<
|
|
41
|
+
export declare const verifyNafath: import("@reduxjs/toolkit").AsyncThunk<{
|
|
42
|
+
response: any;
|
|
43
|
+
isNextScreenDob?: undefined;
|
|
44
|
+
} | {
|
|
45
|
+
response: any;
|
|
46
|
+
isNextScreenDob: boolean;
|
|
47
|
+
}, verifyNafathParams, {}>;
|
|
38
48
|
interface verifyPACIParams {
|
|
39
49
|
onSuccess?: () => void;
|
|
40
50
|
}
|
|
@@ -54,6 +64,10 @@ export declare const updateLeadIdentity: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
54
64
|
termAndConditionChecked?: boolean | undefined;
|
|
55
65
|
};
|
|
56
66
|
}, NIDFormValues, {}>;
|
|
67
|
+
export declare const updateLeadDOB: import("@reduxjs/toolkit").AsyncThunk<{
|
|
68
|
+
data: any;
|
|
69
|
+
formData: DOBFormValues;
|
|
70
|
+
}, DOBFormValues, {}>;
|
|
57
71
|
export declare const retrieveEntityList: import("@reduxjs/toolkit").AsyncThunk<any, {
|
|
58
72
|
leadId: string;
|
|
59
73
|
}, {}>;
|
|
@@ -109,7 +123,10 @@ export interface BusinessData {
|
|
|
109
123
|
type: string;
|
|
110
124
|
};
|
|
111
125
|
civilIdData: CivilFormValues & ResponseData;
|
|
112
|
-
|
|
126
|
+
dobData: DOBFormValues & ResponseData;
|
|
127
|
+
businessTypeData: BusinessTypeFormValues & ResponseData & {
|
|
128
|
+
isPrevDob?: boolean;
|
|
129
|
+
};
|
|
113
130
|
activitiesData: ActivitiesFormValues & ResponseData;
|
|
114
131
|
customersData: CustomersFormValues & ResponseData;
|
|
115
132
|
flowName: FlowsTypes;
|