@tap-payments/auth-jsconnect 2.8.99-development → 2.9.0
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/README.md +2 -2
- package/build/@types/app.d.ts +11 -3
- package/build/@types/app.js +7 -0
- package/build/@types/config.d.ts +4 -0
- package/build/@types/form.d.ts +7 -0
- package/build/api/account.d.ts +3 -1
- package/build/api/account.js +7 -0
- package/build/api/auth.d.ts +16 -1
- package/build/api/index.d.ts +4 -3
- package/build/app/settings.d.ts +1 -0
- package/build/app/settings.js +14 -8
- package/build/assets/currencies/AEDSymbol.d.ts +7 -0
- package/build/assets/currencies/AEDSymbol.js +28 -0
- package/build/assets/currencies/SARSymbol.d.ts +7 -0
- package/build/assets/currencies/SARSymbol.js +28 -0
- package/build/assets/currencies/index.d.ts +2 -0
- package/build/assets/currencies/index.js +2 -0
- package/build/assets/currencies/utils.d.ts +4 -0
- package/build/assets/currencies/utils.js +6 -0
- package/build/assets/locales/ar.json +18 -1
- package/build/assets/locales/en.json +44 -1
- package/build/components/AnimationFlow/BottomSheet.js +16 -12
- package/build/components/AnimationFlow/Dialog.js +3 -1
- package/build/components/Input/Input.js +1 -1
- package/build/components/TextWithCurrency/TextWithCurrency.d.ts +7 -0
- package/build/components/TextWithCurrency/TextWithCurrency.js +14 -0
- package/build/components/TextWithCurrency/index.d.ts +2 -0
- package/build/components/TextWithCurrency/index.js +2 -0
- package/build/components/Tooltip/Tooltip.js +1 -1
- package/build/constants/api.d.ts +2 -0
- package/build/constants/api.js +4 -0
- package/build/constants/app.d.ts +17 -0
- package/build/constants/app.js +97 -17
- package/build/constants/assets.d.ts +12 -3
- package/build/constants/assets.js +123 -105
- package/build/constants/dummy.js +27 -20
- package/build/constants/flows.d.ts +4 -0
- package/build/constants/flows.js +4 -0
- package/build/constants/validation.d.ts +1 -0
- package/build/constants/validation.js +1 -0
- package/build/features/app/auth/authStore.d.ts +24 -5
- package/build/features/app/auth/authStore.js +197 -95
- package/build/features/app/board/boardStore.d.ts +5 -1
- package/build/features/app/board/boardStore.js +40 -35
- package/build/features/app/business/businessStore.d.ts +10 -1
- package/build/features/app/business/businessStore.js +164 -35
- package/build/features/app/connect/connectStore.d.ts +8 -1
- package/build/features/app/connect/connectStore.js +181 -68
- package/build/features/app/connectExpress/connectExpressStore.d.ts +21 -3
- package/build/features/app/connectExpress/connectExpressStore.js +448 -117
- package/build/features/app/individual/individualStore.js +2 -4
- package/build/features/app/kyc/kycStore.js +88 -66
- package/build/features/app/signIn/signInStore.js +19 -15
- package/build/features/auth/Auth.d.ts +1 -1
- package/build/features/auth/screens/Mobile/MobileNumber.js +5 -7
- package/build/features/auth/screens/Mobile/validation.js +5 -2
- package/build/features/auth/screens/OTP/OTP.d.ts +13 -2
- package/build/features/auth/screens/OTP/OTP.js +15 -3
- package/build/features/auth/screens/OTP/index.d.ts +1 -2
- package/build/features/auth/screens/Passcode/Passcode.d.ts +16 -0
- package/build/features/auth/screens/Passcode/Passcode.js +82 -0
- package/build/features/auth/screens/Passcode/PasscodeInput.d.ts +6 -0
- package/build/features/auth/screens/Passcode/PasscodeInput.js +42 -0
- package/build/features/auth/screens/Passcode/index.d.ts +2 -0
- package/build/features/auth/screens/Passcode/index.js +2 -0
- package/build/features/auth/screens/Passcode/validation.d.ts +8 -0
- package/build/features/auth/screens/Passcode/validation.js +4 -0
- package/build/features/bank/Bank.d.ts +5 -1
- package/build/features/bank/Bank.js +15 -7
- package/build/features/board/Board.js +1 -1
- package/build/features/brand/Brand.d.ts +5 -1
- package/build/features/brand/Brand.js +15 -7
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -8
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -8
- package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
- package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.js +103 -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/Connect.js +1 -1
- package/build/features/connect/screens/Individual/MobileNumber.js +5 -7
- package/build/features/connect/screens/Individual/validation.js +5 -2
- package/build/features/connect/screens/Mobile/MobileNumber.js +5 -7
- package/build/features/connect/screens/Mobile/validation.js +5 -2
- package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
- package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.js +104 -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/ConnectExpress.js +1 -1
- package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.js +5 -7
- package/build/features/connectExpress/screens/CollectIndividualInfo/validation.js +5 -2
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.d.ts +3 -0
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.js +9 -0
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.d.ts +2 -0
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.js +2 -0
- package/build/features/connectExpress/screens/Mobile/MobileNumber.js +5 -7
- package/build/features/connectExpress/screens/Mobile/validation.js +9 -4
- package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
- package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.js +106 -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/connectExpress/screens/VerifyMobileAuthOTP/OTPInput.d.ts +5 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/OTPInput.js +49 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/VerifyMobileAuthOTP.d.ts +5 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/VerifyMobileAuthOTP.js +88 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.d.ts +3 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.js +2 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/validation.js +4 -0
- package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.js +9 -3
- package/build/features/entity/Entity.d.ts +4 -1
- package/build/features/entity/Entity.js +15 -7
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +3 -7
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +3 -7
- package/build/features/featuresScreens.js +35 -0
- package/build/features/individual/Individual.d.ts +4 -1
- package/build/features/individual/Individual.js +15 -7
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +3 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
- package/build/features/individual/screens/IndividualList/MobileNumber.js +5 -10
- package/build/features/individual/screens/IndividualList/validation.js +5 -3
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +3 -5
- package/build/features/individual/screens/IndividualPersonalInfo/validation.js +5 -2
- package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.js +5 -10
- package/build/features/individual/screens/IndividualPhoneInfo/validation.js +5 -2
- package/build/features/kyc/KYC.js +5 -1
- package/build/features/kyc/screens/AlreadySubmitted/AlreadySubmitted.d.ts +5 -0
- package/build/features/kyc/screens/AlreadySubmitted/AlreadySubmitted.js +19 -0
- package/build/features/kyc/screens/AlreadySubmitted/index.d.ts +2 -0
- package/build/features/kyc/screens/AlreadySubmitted/index.js +2 -0
- package/build/features/kyc/screens/Success/Success.js +18 -5
- package/build/features/kyc/screens/Terms/Terms.js +19 -4
- package/build/features/kyc/screens/TokenError/TokenError.d.ts +5 -0
- package/build/features/kyc/screens/TokenError/TokenError.js +9 -0
- package/build/features/kyc/screens/TokenError/index.d.ts +2 -0
- package/build/features/kyc/screens/TokenError/index.js +2 -0
- package/build/features/kyc/screens/Users/Users.js +6 -3
- package/build/features/password/Password.d.ts +4 -1
- package/build/features/password/Password.js +13 -6
- package/build/features/shared/Background/LogoBackground.js +5 -17
- package/build/features/shared/Button/Button.js +1 -2
- package/build/features/shared/Button/FlowsButtons.js +5 -2
- package/build/features/shared/Containers/FeatureContainer.d.ts +2 -1
- package/build/features/shared/Containers/FeatureContainer.js +5 -3
- package/build/features/shared/Dialog/DialogContainer.js +5 -4
- package/build/features/shared/Input/Input.d.ts +1 -1
- package/build/features/signIn/screens/Mobile/MobileNumber.js +5 -7
- package/build/features/signIn/screens/Mobile/validation.js +5 -2
- package/build/features/tax/Tax.d.ts +4 -1
- package/build/features/tax/Tax.js +15 -7
- package/build/hooks/useAppConfig.js +1 -1
- package/build/utils/common.d.ts +1 -1
- package/build/utils/common.js +6 -5
- package/build/utils/error.d.ts +1 -0
- package/build/utils/error.js +3 -0
- package/build/utils/string.d.ts +4 -2
- package/build/utils/string.js +12 -2
- package/package.json +3 -4
|
@@ -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_PACI_TIMEOUT_DURATION, 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, isNetworkError, isTimeoutError } 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, error_1, 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) {
|
|
@@ -332,42 +332,117 @@ export var verifyNafath = createAsyncThunk('business/verifyNafathParams', functi
|
|
|
332
332
|
count = 1;
|
|
333
333
|
_h.label = 1;
|
|
334
334
|
case 1:
|
|
335
|
-
if (!(count <= maxCalls)) return [3,
|
|
336
|
-
|
|
335
|
+
if (!(count <= maxCalls)) return [3, 11];
|
|
336
|
+
data = undefined;
|
|
337
|
+
_h.label = 2;
|
|
337
338
|
case 2:
|
|
339
|
+
_h.trys.push([2, 4, , 5]);
|
|
340
|
+
return [4, API.authService.getTokenVerify(responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token, { timeout: NAFATH_PACI_TIMEOUT_DURATION })];
|
|
341
|
+
case 3:
|
|
338
342
|
data = _h.sent();
|
|
339
|
-
|
|
340
|
-
|
|
343
|
+
return [3, 5];
|
|
344
|
+
case 4:
|
|
345
|
+
error_1 = _h.sent();
|
|
346
|
+
if (!isNetworkError(error_1.message) && !isTimeoutError(error_1.message)) {
|
|
347
|
+
throw new Error(error_1);
|
|
348
|
+
}
|
|
349
|
+
return [3, 5];
|
|
350
|
+
case 5:
|
|
351
|
+
isSuccess = ((_b = data === null || data === void 0 ? void 0 : data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
|
|
352
|
+
isFailed = ((_c = data === null || data === void 0 ? void 0 : data.status) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'failed';
|
|
341
353
|
if (isFailed) {
|
|
342
354
|
(_d = params.onFailure) === null || _d === void 0 ? void 0 : _d.call(params);
|
|
343
355
|
return [2, { response: data }];
|
|
344
356
|
}
|
|
345
|
-
if (!isSuccess) return [3,
|
|
357
|
+
if (!isSuccess) return [3, 8];
|
|
346
358
|
return [4, thunkApi.dispatch(retrieveEntityList({ leadId: responseBody === null || responseBody === void 0 ? void 0 : responseBody.id }))];
|
|
347
|
-
case
|
|
359
|
+
case 6:
|
|
348
360
|
_h.sent();
|
|
349
361
|
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, {});
|
|
350
362
|
(_g = params === null || params === void 0 ? void 0 : params.onSuccess) === null || _g === void 0 ? void 0 : _g.call(params);
|
|
351
363
|
return [4, sleep(3000)];
|
|
352
|
-
case
|
|
364
|
+
case 7:
|
|
353
365
|
_h.sent();
|
|
354
366
|
isNextScreenDob = data.step_name === COLLECT_DOB_INFO_NAFATH;
|
|
355
|
-
|
|
356
|
-
|
|
367
|
+
isNextScreenCollectMobileOwnership = data.step_name === BUSINESS_STEP_NAMES.BUSINESS_MOBILE_OWNERSHIP;
|
|
368
|
+
if (isNextScreenCollectMobileOwnership) {
|
|
369
|
+
thunkApi.dispatch(handleNextScreenStep('BUSINESS_MOBILE_OWNERSHIP'));
|
|
370
|
+
}
|
|
371
|
+
else {
|
|
372
|
+
screen_1 = isNextScreenDob ? 'BUSINESS_DOB_STEP' : 'BUSINESS_BUSINESS_TYPE_STEP';
|
|
373
|
+
thunkApi.dispatch(handleNextScreenStep(screen_1));
|
|
374
|
+
}
|
|
357
375
|
return [2, { response: data, isNextScreenDob: isNextScreenDob }];
|
|
358
|
-
case
|
|
359
|
-
case
|
|
376
|
+
case 8: return [4, sleep(interval * 1000)];
|
|
377
|
+
case 9:
|
|
360
378
|
_h.sent();
|
|
361
|
-
_h.label =
|
|
362
|
-
case
|
|
379
|
+
_h.label = 10;
|
|
380
|
+
case 10:
|
|
363
381
|
count++;
|
|
364
382
|
return [3, 1];
|
|
365
|
-
case
|
|
383
|
+
case 11: throw new Error(NAFATH_VERIFICATION_FAILED);
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
}); });
|
|
387
|
+
export var updateLeadMobile = createAsyncThunk('business/updateLeadMobile', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
388
|
+
var _a, settings, business, lead_id, payload, leadResponse, isNextScreenDob, screen;
|
|
389
|
+
var _b, _c;
|
|
390
|
+
return __generator(this, function (_d) {
|
|
391
|
+
switch (_d.label) {
|
|
392
|
+
case 0:
|
|
393
|
+
_a = thunkApi.getState(), settings = _a.settings, business = _a.business;
|
|
394
|
+
lead_id = (business.data.verify.responseBody || {}).lead_id;
|
|
395
|
+
payload = {
|
|
396
|
+
id: lead_id || '',
|
|
397
|
+
contact: {
|
|
398
|
+
phone: {
|
|
399
|
+
country_code: params.countryCode.idd_prefix.toString(),
|
|
400
|
+
number: params.mobile
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
step_name: BUSINESS_STEP_NAMES.BUSINESS_MOBILE_OWNERSHIP,
|
|
404
|
+
encryption_contract: ['contact.phone.country_code', 'contact.phone.number']
|
|
405
|
+
};
|
|
406
|
+
return [4, API.leadService.updateLead(payload)];
|
|
407
|
+
case 1:
|
|
408
|
+
leadResponse = _d.sent();
|
|
409
|
+
if (leadResponse.step_name === BUSINESS_STEP_NAMES.BUSINESS_MOBILE_OWNERSHIP) {
|
|
410
|
+
throw new Error("The new mobile number doesn't match the national ID, please update the mobile to the correct one");
|
|
411
|
+
}
|
|
412
|
+
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, params);
|
|
413
|
+
isNextScreenDob = leadResponse.step_name === COLLECT_DOB_INFO_NAFATH;
|
|
414
|
+
screen = isNextScreenDob ? 'BUSINESS_DOB_STEP' : 'BUSINESS_BUSINESS_TYPE_STEP';
|
|
415
|
+
thunkApi.dispatch(handleNextScreenStep(screen));
|
|
416
|
+
return [2, { leadResponse: leadResponse, formData: params }];
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
}); });
|
|
420
|
+
export var skipUpdateLeadMobile = createAsyncThunk('business/skipUpdateLeadMobile', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
421
|
+
var _a, settings, business, lead_id, payload, leadResponse, isNextScreenDob, screen;
|
|
422
|
+
var _b, _c;
|
|
423
|
+
return __generator(this, function (_d) {
|
|
424
|
+
switch (_d.label) {
|
|
425
|
+
case 0:
|
|
426
|
+
_a = thunkApi.getState(), settings = _a.settings, business = _a.business;
|
|
427
|
+
lead_id = (business.data.verify.responseBody || {}).lead_id;
|
|
428
|
+
payload = {
|
|
429
|
+
id: lead_id || '',
|
|
430
|
+
step_name: BUSINESS_STEP_NAMES.BUSINESS_MOBILE_OWNERSHIP_SKIPPED,
|
|
431
|
+
encryption_contract: []
|
|
432
|
+
};
|
|
433
|
+
return [4, API.leadService.updateLead(payload)];
|
|
434
|
+
case 1:
|
|
435
|
+
leadResponse = _d.sent();
|
|
436
|
+
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, {});
|
|
437
|
+
isNextScreenDob = leadResponse.step_name === COLLECT_DOB_INFO_NAFATH;
|
|
438
|
+
screen = isNextScreenDob ? 'BUSINESS_DOB_STEP' : 'BUSINESS_BUSINESS_TYPE_STEP';
|
|
439
|
+
thunkApi.dispatch(handleNextScreenStep(screen));
|
|
440
|
+
return [2, { leadResponse: leadResponse }];
|
|
366
441
|
}
|
|
367
442
|
});
|
|
368
443
|
}); });
|
|
369
444
|
export var verifyPACI = createAsyncThunk('businessVerifyPACI', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
370
|
-
var _a, settings, business, responseBody, _b, business_id, entity, expiry, interval, maxCalls, count, data, isSuccess;
|
|
445
|
+
var _a, settings, business, responseBody, _b, business_id, entity, expiry, interval, maxCalls, count, data, error_2, isSuccess;
|
|
371
446
|
var _c, _d, _e, _f;
|
|
372
447
|
return __generator(this, function (_g) {
|
|
373
448
|
switch (_g.label) {
|
|
@@ -384,30 +459,42 @@ export var verifyPACI = createAsyncThunk('businessVerifyPACI', function (params,
|
|
|
384
459
|
count = 1;
|
|
385
460
|
_g.label = 1;
|
|
386
461
|
case 1:
|
|
387
|
-
if (!(count <= maxCalls)) return [3,
|
|
388
|
-
|
|
462
|
+
if (!(count <= maxCalls)) return [3, 11];
|
|
463
|
+
data = undefined;
|
|
464
|
+
_g.label = 2;
|
|
389
465
|
case 2:
|
|
466
|
+
_g.trys.push([2, 4, , 5]);
|
|
467
|
+
return [4, API.authService.getTokenVerify(responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token, { timeout: NAFATH_PACI_TIMEOUT_DURATION })];
|
|
468
|
+
case 3:
|
|
390
469
|
data = _g.sent();
|
|
391
|
-
|
|
392
|
-
|
|
470
|
+
return [3, 5];
|
|
471
|
+
case 4:
|
|
472
|
+
error_2 = _g.sent();
|
|
473
|
+
if (!isNetworkError(error_2.message) && !isTimeoutError(error_2.message)) {
|
|
474
|
+
throw new Error(error_2);
|
|
475
|
+
}
|
|
476
|
+
return [3, 5];
|
|
477
|
+
case 5:
|
|
478
|
+
isSuccess = ((_c = data === null || data === void 0 ? void 0 : data.status) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'success';
|
|
479
|
+
if (!isSuccess) return [3, 8];
|
|
393
480
|
return [4, thunkApi.dispatch(retrieveAllEntityList({ businessId: business_id, entityId: entity === null || entity === void 0 ? void 0 : entity.id }))];
|
|
394
|
-
case
|
|
481
|
+
case 6:
|
|
395
482
|
_g.sent();
|
|
396
483
|
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, {});
|
|
397
484
|
(_f = params === null || params === void 0 ? void 0 : params.onSuccess) === null || _f === void 0 ? void 0 : _f.call(params);
|
|
398
485
|
return [4, sleep(3000)];
|
|
399
|
-
case
|
|
486
|
+
case 7:
|
|
400
487
|
_g.sent();
|
|
401
488
|
thunkApi.dispatch(handleNextScreenStep());
|
|
402
489
|
return [2, { response: data }];
|
|
403
|
-
case
|
|
404
|
-
case
|
|
490
|
+
case 8: return [4, sleep(interval * 1000)];
|
|
491
|
+
case 9:
|
|
405
492
|
_g.sent();
|
|
406
|
-
_g.label =
|
|
407
|
-
case
|
|
493
|
+
_g.label = 10;
|
|
494
|
+
case 10:
|
|
408
495
|
count++;
|
|
409
496
|
return [3, 1];
|
|
410
|
-
case
|
|
497
|
+
case 11: throw new Error('paci_verification_failed');
|
|
411
498
|
}
|
|
412
499
|
});
|
|
413
500
|
}); });
|
|
@@ -440,7 +527,7 @@ export var createCivilIdAuth = createAsyncThunk('createCivilIdAuth', function (p
|
|
|
440
527
|
});
|
|
441
528
|
}); });
|
|
442
529
|
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;
|
|
530
|
+
var _a, settings, business, identification_id_type, stepName, lead_id, countryIso2, dob, requestBody, data, business_id, entity, screen, countryCode;
|
|
444
531
|
var _b, _c;
|
|
445
532
|
return __generator(this, function (_d) {
|
|
446
533
|
switch (_d.label) {
|
|
@@ -479,7 +566,10 @@ export var updateLeadIdentity = createAsyncThunk('updateLeadIdentity', function
|
|
|
479
566
|
case 3:
|
|
480
567
|
thunkApi.dispatch(handleNextScreenStep(screen));
|
|
481
568
|
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody);
|
|
482
|
-
|
|
569
|
+
countryCode = settings.data.businessCountry;
|
|
570
|
+
if (data.contact.phone.country_code)
|
|
571
|
+
countryCode = findCountryByIddPrefix(settings.data.countries, data.contact.phone.country_code);
|
|
572
|
+
return [2, { data: data, formData: __assign(__assign({}, params), { type: identification_id_type }), countryCode: countryCode }];
|
|
483
573
|
}
|
|
484
574
|
});
|
|
485
575
|
}); });
|
|
@@ -511,7 +601,12 @@ export var updateLeadDOB = createAsyncThunk('business/updateLeadDOB', function (
|
|
|
511
601
|
_g.sent();
|
|
512
602
|
_g.label = 4;
|
|
513
603
|
case 4:
|
|
514
|
-
|
|
604
|
+
if (data.step_name === BUSINESS_STEP_NAMES.BUSINESS_MOBILE_OWNERSHIP) {
|
|
605
|
+
thunkApi.dispatch(handleNextScreenStep('BUSINESS_MOBILE_OWNERSHIP'));
|
|
606
|
+
}
|
|
607
|
+
else {
|
|
608
|
+
thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
|
|
609
|
+
}
|
|
515
610
|
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, requestBody);
|
|
516
611
|
return [2, { data: data, formData: params }];
|
|
517
612
|
}
|
|
@@ -556,7 +651,7 @@ export var retrieveBoardDetails = createAsyncThunk('retrieveBoardDetails', funct
|
|
|
556
651
|
});
|
|
557
652
|
}); });
|
|
558
653
|
export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
559
|
-
var _a, settings, business, isKWCountry, selectedLicense, licenseNumber, entityLegalName, certificateId, articleId, selectedEntityLicense, isFL, _b, lead_id, brand, stepName, payload, data, accountBody, accountData, brandData, data_1, brandRes, _c, message, error, list,
|
|
654
|
+
var _a, settings, business, isKWCountry, selectedLicense, licenseNumber, entityLegalName, certificateId, articleId, selectedEntityLicense, isFL, _b, lead_id, brand, stepName, payload, data, accountBody, accountData, documentData, entityData, brandData, data_1, brandRes, _c, message, error, list, entityId, documentBody, payload_1;
|
|
560
655
|
var _d, _e, _f;
|
|
561
656
|
return __generator(this, function (_g) {
|
|
562
657
|
switch (_g.label) {
|
|
@@ -617,6 +712,8 @@ export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', f
|
|
|
617
712
|
error = message;
|
|
618
713
|
if ((error === null || error === void 0 ? void 0 : error.toLowerCase()) === 'entity with license already exist') {
|
|
619
714
|
stepName = 'BUSINESS_VERIFY_BRAND_INFO';
|
|
715
|
+
sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep(stepName)); });
|
|
716
|
+
return [2, { data: data, formData: params, accountData: accountData, documentData: documentData, entityData: entityData, isicActivityList: [] }];
|
|
620
717
|
}
|
|
621
718
|
else
|
|
622
719
|
throw new Error(error);
|
|
@@ -624,7 +721,6 @@ export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', f
|
|
|
624
721
|
case 8: return [4, API.dataService.getActivitiesIsIc()];
|
|
625
722
|
case 9:
|
|
626
723
|
list = (_g.sent()).list;
|
|
627
|
-
entityData = undefined;
|
|
628
724
|
entityId = accountData === null || accountData === void 0 ? void 0 : accountData.entity_id;
|
|
629
725
|
if (!((certificateId || []).length > 0)) return [3, 11];
|
|
630
726
|
documentBody = {
|
|
@@ -870,6 +966,10 @@ var initialState = {
|
|
|
870
966
|
verify: {
|
|
871
967
|
token: ''
|
|
872
968
|
},
|
|
969
|
+
mobileData: {
|
|
970
|
+
countryCode: defaultCountry,
|
|
971
|
+
mobile: ''
|
|
972
|
+
},
|
|
873
973
|
otpData: {
|
|
874
974
|
otp: '',
|
|
875
975
|
isNID: false
|
|
@@ -1082,7 +1182,7 @@ export var businessSlice = createSlice({
|
|
|
1082
1182
|
var _a;
|
|
1083
1183
|
state.loading = false;
|
|
1084
1184
|
state.error = null;
|
|
1085
|
-
var _b = action.payload, data = _b.data, formData = _b.formData;
|
|
1185
|
+
var _b = action.payload, data = _b.data, formData = _b.formData, countryCode = _b.countryCode;
|
|
1086
1186
|
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
1087
1187
|
if (description) {
|
|
1088
1188
|
state.error = description;
|
|
@@ -1092,10 +1192,39 @@ export var businessSlice = createSlice({
|
|
|
1092
1192
|
state.data.nidData.responseBody = data;
|
|
1093
1193
|
state.data.otpData.otp = '';
|
|
1094
1194
|
state.data.otpData.isNID = true;
|
|
1195
|
+
state.data.mobileData.countryCode = countryCode;
|
|
1196
|
+
state.data.mobileData.mobile = data.contact.phone.number;
|
|
1095
1197
|
})
|
|
1096
1198
|
.addCase(updateLeadIdentity.rejected, function (state, action) {
|
|
1097
1199
|
state.loading = false;
|
|
1098
1200
|
state.error = action.error.message;
|
|
1201
|
+
})
|
|
1202
|
+
.addCase(updateLeadMobile.pending, function (state) {
|
|
1203
|
+
state.loading = true;
|
|
1204
|
+
state.error = null;
|
|
1205
|
+
})
|
|
1206
|
+
.addCase(updateLeadMobile.fulfilled, function (state, action) {
|
|
1207
|
+
state.loading = false;
|
|
1208
|
+
state.error = null;
|
|
1209
|
+
state.data.mobileData.mobile = action.payload.leadResponse.contact.phone.number;
|
|
1210
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), action.payload.leadResponse);
|
|
1211
|
+
})
|
|
1212
|
+
.addCase(updateLeadMobile.rejected, function (state, action) {
|
|
1213
|
+
state.loading = false;
|
|
1214
|
+
state.error = action.error.message;
|
|
1215
|
+
})
|
|
1216
|
+
.addCase(skipUpdateLeadMobile.pending, function (state) {
|
|
1217
|
+
state.loading = true;
|
|
1218
|
+
state.error = null;
|
|
1219
|
+
})
|
|
1220
|
+
.addCase(skipUpdateLeadMobile.fulfilled, function (state, action) {
|
|
1221
|
+
state.loading = false;
|
|
1222
|
+
state.error = null;
|
|
1223
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), action.payload.leadResponse);
|
|
1224
|
+
})
|
|
1225
|
+
.addCase(skipUpdateLeadMobile.rejected, function (state, action) {
|
|
1226
|
+
state.loading = false;
|
|
1227
|
+
state.error = action.error.message;
|
|
1099
1228
|
})
|
|
1100
1229
|
.addCase(verifyNafath.pending, function (state) {
|
|
1101
1230
|
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;
|