@tap-payments/auth-jsconnect 2.3.80-test → 2.3.85-test
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/features/app/brand/brandStore.d.ts +3 -3
- package/build/features/app/brand/brandStore.js +133 -114
- package/build/features/app/connectExpress/connectExpressStore.d.ts +3 -3
- package/build/features/app/connectExpress/connectExpressStore.js +80 -76
- package/build/features/app/entity/entityStore.d.ts +3 -3
- package/build/features/app/entity/entityStore.js +130 -120
- package/build/features/app/individual/individualStore.d.ts +4 -4
- package/build/features/app/individual/individualStore.js +227 -219
- package/build/features/app/tax/taxStore.d.ts +2 -2
- package/build/features/app/tax/taxStore.js +59 -55
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +3 -2
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +7 -6
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +5 -4
- package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +5 -4
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +3 -9
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +3 -2
- package/build/features/entity/screens/EntityName/EntityName.js +3 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +19 -18
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +3 -2
- package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +3 -2
- package/build/features/shared/Button/IndividualActionButtons.js +2 -2
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +4 -3
- package/package.json +1 -1
|
@@ -508,230 +508,238 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
|
|
|
508
508
|
}
|
|
509
509
|
});
|
|
510
510
|
}); });
|
|
511
|
-
export var updatePhoneInfo = createAsyncThunk('individual/updatePhoneInfo', function (
|
|
512
|
-
var
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
511
|
+
export var updatePhoneInfo = createAsyncThunk('individual/updatePhoneInfo', function (_a, thunkApi) {
|
|
512
|
+
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
513
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
514
|
+
var individual, _b, token, responseBody, _c, id, type, mobile, countryCode, requestBody, data;
|
|
515
|
+
var _d;
|
|
516
|
+
return __generator(this, function (_e) {
|
|
517
|
+
switch (_e.label) {
|
|
518
|
+
case 0:
|
|
519
|
+
individual = thunkApi.getState().individual;
|
|
520
|
+
_b = individual.data.verify, token = _b.token, responseBody = _b.responseBody;
|
|
521
|
+
_c = (responseBody === null || responseBody === void 0 ? void 0 : responseBody.source) || {}, id = _c.id, type = _c.type;
|
|
522
|
+
mobile = formData.mobile, countryCode = formData.countryCode;
|
|
523
|
+
requestBody = {
|
|
524
|
+
id: id,
|
|
525
|
+
type: type,
|
|
526
|
+
contact: {
|
|
527
|
+
phone: {
|
|
528
|
+
country_code: (_d = countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix) === null || _d === void 0 ? void 0 : _d.toString(),
|
|
529
|
+
number: mobile || ''
|
|
530
|
+
}
|
|
528
531
|
}
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
}
|
|
532
|
+
};
|
|
533
|
+
return [4, API.individualService.updateIndividual(requestBody)];
|
|
534
|
+
case 1:
|
|
535
|
+
data = _e.sent();
|
|
536
|
+
return [4, thunkApi.dispatch(verifyToken({ token: token, isUpdatePhoneInfo: true }))];
|
|
537
|
+
case 2:
|
|
538
|
+
_e.sent();
|
|
539
|
+
return [2, { data: data, formData: originalFormData }];
|
|
540
|
+
}
|
|
541
|
+
});
|
|
539
542
|
});
|
|
540
|
-
});
|
|
541
|
-
export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateIndividualPersonalInfo', function (
|
|
542
|
-
var
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
543
|
+
});
|
|
544
|
+
export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateIndividualPersonalInfo', function (_a, thunkApi) {
|
|
545
|
+
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
546
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
547
|
+
var _b, settings, individual, _c, notification, user, entity, _d, id, type, name, email, mobile, countryCode, gender, nid, issuedCountry, expiryDate, dob, placeOfBirthCountry, placeOfBirthCity, nationality, code, data_status, userName, identification_id_type, isNameNonEditable, isEmailNonEditable, isMobileNumberNonEditable, isMobileCountryNonEditable, isNidNonEditable, isIssuedCountryNonEditable, isExpiryNonEditable, isIdTypeNonEditable, isNationalityNonEditable, isDOBNonEditable, isBirthCityNonEditable, isBirthCountryNonEditable, hasContact, hasPhone, hasIdentification, hasBirth, contact, requestBody, data;
|
|
548
|
+
var _e, _f, _g, _h, _j;
|
|
549
|
+
return __generator(this, function (_k) {
|
|
550
|
+
switch (_k.label) {
|
|
551
|
+
case 0:
|
|
552
|
+
_b = thunkApi.getState(), settings = _b.settings, individual = _b.individual;
|
|
553
|
+
_c = individual.data.verify.responseBody || {}, notification = _c.notification, user = _c.user, entity = _c.entity;
|
|
554
|
+
_d = ((user === null || user === void 0 ? void 0 : user.is_authorized) ? user : notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _d.id, type = _d.type;
|
|
555
|
+
name = formData.name, email = formData.email, mobile = formData.mobile, countryCode = formData.countryCode, gender = formData.gender, nid = formData.nid, issuedCountry = formData.issuedCountry, expiryDate = formData.expiryDate, dob = formData.dob, placeOfBirthCountry = formData.placeOfBirthCountry, placeOfBirthCity = formData.placeOfBirthCity, nationality = formData.nationality;
|
|
556
|
+
code = entity === null || entity === void 0 ? void 0 : entity.country;
|
|
557
|
+
data_status = (user || {}).data_status;
|
|
558
|
+
userName = getUserNameObject(name);
|
|
559
|
+
identification_id_type = nid ? (nid.startsWith('1') ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA) : undefined;
|
|
560
|
+
isNameNonEditable = hasNoneEditableValue(data_status, 'name');
|
|
561
|
+
isEmailNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.contact, 'email');
|
|
562
|
+
isMobileNumberNonEditable = hasNoneEditableValue((_e = data_status === null || data_status === void 0 ? void 0 : data_status.contact) === null || _e === void 0 ? void 0 : _e.phone, 'number');
|
|
563
|
+
isMobileCountryNonEditable = hasNoneEditableValue((_f = data_status === null || data_status === void 0 ? void 0 : data_status.contact) === null || _f === void 0 ? void 0 : _f.phone, 'country_code');
|
|
564
|
+
isNidNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.identification, 'id');
|
|
565
|
+
isIssuedCountryNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.identification, 'issuer_country');
|
|
566
|
+
isExpiryNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.identification, 'expiry');
|
|
567
|
+
isIdTypeNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.identification, 'type');
|
|
568
|
+
isNationalityNonEditable = hasNoneEditableValue(data_status, 'nationality');
|
|
569
|
+
isDOBNonEditable = hasNoneEditableValue(data_status, 'birth.date');
|
|
570
|
+
isBirthCityNonEditable = hasNoneEditableValue(data_status, 'birth.city');
|
|
571
|
+
isBirthCountryNonEditable = hasNoneEditableValue(data_status, 'birth.country');
|
|
572
|
+
hasContact = email || mobile || countryCode;
|
|
573
|
+
hasPhone = mobile && (countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix);
|
|
574
|
+
hasIdentification = nid || issuedCountry || identification_id_type || expiryDate;
|
|
575
|
+
hasBirth = placeOfBirthCity || placeOfBirthCountry;
|
|
576
|
+
contact = hasContact && !(isEmailNonEditable && isMobileCountryNonEditable && isMobileNumberNonEditable)
|
|
577
|
+
? __assign({ email: isEmailNonEditable ? undefined : email }, (!((isMobileCountryNonEditable && isMobileNumberNonEditable) || !hasPhone) && {
|
|
578
|
+
phone: {
|
|
579
|
+
country_code: isMobileCountryNonEditable ? undefined : (_g = countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix) === null || _g === void 0 ? void 0 : _g.toString(),
|
|
580
|
+
number: isMobileNumberNonEditable || !mobile ? undefined : mobile
|
|
581
|
+
}
|
|
582
|
+
})) : undefined;
|
|
583
|
+
requestBody = __assign(__assign(__assign(__assign(__assign(__assign(__assign({ id: id, type: type, gender: gender || undefined }, (!(isNameNonEditable || !userName.first) && {
|
|
584
|
+
names: {
|
|
585
|
+
en: userName,
|
|
586
|
+
ar: userName
|
|
576
587
|
}
|
|
577
|
-
})) :
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
!(isNidNonEditable && isIssuedCountryNonEditable && isExpiryNonEditable && isIdTypeNonEditable) && {
|
|
585
|
-
identification: {
|
|
586
|
-
id: isNidNonEditable || !nid ? undefined : nid,
|
|
587
|
-
issued_country_code: isIssuedCountryNonEditable ? undefined : issuedCountry === null || issuedCountry === void 0 ? void 0 : issuedCountry.iso2,
|
|
588
|
-
expiry: isExpiryNonEditable || !expiryDate ? undefined : new Date(expiryDate).getTime(),
|
|
589
|
-
type: isIdTypeNonEditable || !identification_id_type ? undefined : identification_id_type
|
|
590
|
-
}
|
|
591
|
-
})), (!isDOBNonEditable && {
|
|
592
|
-
date_of_birth: dob
|
|
593
|
-
})), (!((isBirthCityNonEditable && isBirthCountryNonEditable) || !hasBirth) && {
|
|
594
|
-
birth: {
|
|
595
|
-
city: isBirthCityNonEditable ? undefined : placeOfBirthCity === null || placeOfBirthCity === void 0 ? void 0 : placeOfBirthCity.id,
|
|
596
|
-
country: isBirthCountryNonEditable ? undefined : placeOfBirthCountry === null || placeOfBirthCountry === void 0 ? void 0 : placeOfBirthCountry.iso2
|
|
597
|
-
}
|
|
598
|
-
})), (!isNationalityNonEditable && {
|
|
599
|
-
nationality: nationality === null || nationality === void 0 ? void 0 : nationality.iso2
|
|
600
|
-
})), { encryption_contract: [
|
|
601
|
-
'gender',
|
|
602
|
-
'contact.email',
|
|
603
|
-
'contact.phone.country_code',
|
|
604
|
-
'contact.phone.number',
|
|
605
|
-
'identification.id',
|
|
606
|
-
'identification.issued_country_code',
|
|
607
|
-
'identification.expiry',
|
|
608
|
-
'identification.type',
|
|
609
|
-
'birth.country',
|
|
610
|
-
'date_of_birth',
|
|
611
|
-
'nationality'
|
|
612
|
-
], step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_PERSONAL_INFO });
|
|
613
|
-
return [4, API.individualService.updateIndividual(requestBody)];
|
|
614
|
-
case 1:
|
|
615
|
-
data = _j.sent();
|
|
616
|
-
if (!(type === IndividualType.USER || type === IndividualType.BUYER)) return [3, 3];
|
|
617
|
-
return [4, thunkApi.dispatch(retrieveDataList(code))];
|
|
618
|
-
case 2:
|
|
619
|
-
_j.sent();
|
|
620
|
-
_j.label = 3;
|
|
621
|
-
case 3:
|
|
622
|
-
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
623
|
-
(_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, requestBody);
|
|
624
|
-
return [2, { data: data, formData: params }];
|
|
625
|
-
}
|
|
626
|
-
});
|
|
627
|
-
}); });
|
|
628
|
-
export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
629
|
-
var _a, settings, individual, _b, notification, user, _c, id, type, occupation, sourceIncome, monthlyIncome, isPEP, isInfluencer, shareCount, shareValue, isOccupationNonEditable, isSourceIncomeNonEditable, isPEPNonEditable, isInfluencerNonEditable, isMonthlyIncomeNonEditable, isSharesAvailable, pepInfo, influencerInfo, occupationInfo, sourceIncomeInfo, monthlyIncomeInfo, userPayload, shareHolderPayload, boardMemberPayload, buyerMemberPayload, payload, requestBody, data, civilID, signatureFileId, businessCountry, hasCivilIdDocument, hasSignatureDocument, isSendSignatureFile, civilIdDocument, signatureDocument, documentBody, documentBody, documentsList, documentBody;
|
|
630
|
-
var _d, _e;
|
|
631
|
-
return __generator(this, function (_f) {
|
|
632
|
-
switch (_f.label) {
|
|
633
|
-
case 0:
|
|
634
|
-
_a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
|
|
635
|
-
_b = individual.data.verify.responseBody || {}, notification = _b.notification, user = _b.user;
|
|
636
|
-
_c = ((user === null || user === void 0 ? void 0 : user.is_authorized) ? user : notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _c.id, type = _c.type;
|
|
637
|
-
occupation = params.occupation, sourceIncome = params.sourceIncome, monthlyIncome = params.monthlyIncome, isPEP = params.isPEP, isInfluencer = params.isInfluencer, shareCount = params.shareCount, shareValue = params.shareValue;
|
|
638
|
-
isOccupationNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'occupation');
|
|
639
|
-
isSourceIncomeNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'source_of_income');
|
|
640
|
-
isPEPNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'is_relative_PEP');
|
|
641
|
-
isInfluencerNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'is_influencer');
|
|
642
|
-
isMonthlyIncomeNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'monthly_income');
|
|
643
|
-
isSharesAvailable = shareCount || shareValue;
|
|
644
|
-
pepInfo = isPEPNonEditable ? undefined : isPEP;
|
|
645
|
-
influencerInfo = isInfluencerNonEditable ? undefined : isInfluencer;
|
|
646
|
-
occupationInfo = isOccupationNonEditable || !(occupation === null || occupation === void 0 ? void 0 : occupation.id) ? undefined : { id: occupation.id };
|
|
647
|
-
sourceIncomeInfo = isSourceIncomeNonEditable || !(sourceIncome === null || sourceIncome === void 0 ? void 0 : sourceIncome.id) ? undefined : [{ id: sourceIncome.id }];
|
|
648
|
-
monthlyIncomeInfo = isMonthlyIncomeNonEditable || !(monthlyIncome === null || monthlyIncome === void 0 ? void 0 : monthlyIncome.id) ? undefined : { id: monthlyIncome.id };
|
|
649
|
-
userPayload = {
|
|
650
|
-
occupation: occupationInfo,
|
|
651
|
-
source_income: sourceIncomeInfo,
|
|
652
|
-
monthly_income: monthlyIncomeInfo,
|
|
653
|
-
is_relative_PEP: pepInfo,
|
|
654
|
-
is_influencer: influencerInfo
|
|
655
|
-
};
|
|
656
|
-
shareHolderPayload = {
|
|
657
|
-
shares: isSharesAvailable
|
|
658
|
-
? {
|
|
659
|
-
count: shareCount && Number(shareCount),
|
|
660
|
-
value: shareValue && Number(shareValue)
|
|
588
|
+
})), { contact: contact }), (hasIdentification &&
|
|
589
|
+
!(isNidNonEditable && isIssuedCountryNonEditable && isExpiryNonEditable && isIdTypeNonEditable) && {
|
|
590
|
+
identification: {
|
|
591
|
+
id: isNidNonEditable || !nid ? undefined : nid,
|
|
592
|
+
issued_country_code: isIssuedCountryNonEditable ? undefined : issuedCountry === null || issuedCountry === void 0 ? void 0 : issuedCountry.iso2,
|
|
593
|
+
expiry: isExpiryNonEditable || !expiryDate ? undefined : new Date(expiryDate).getTime(),
|
|
594
|
+
type: isIdTypeNonEditable || !identification_id_type ? undefined : identification_id_type
|
|
661
595
|
}
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
return [4, API.documentService.addFilesToExistingDocument(documentBody)];
|
|
699
|
-
case 2:
|
|
700
|
-
_f.sent();
|
|
701
|
-
_f.label = 3;
|
|
702
|
-
case 3:
|
|
703
|
-
if (!((signatureDocument === null || signatureDocument === void 0 ? void 0 : signatureDocument.id) && hasSignatureDocument && isSendSignatureFile)) return [3, 5];
|
|
704
|
-
documentBody = {
|
|
705
|
-
id: signatureDocument.id,
|
|
706
|
-
images: signatureFileId
|
|
707
|
-
};
|
|
708
|
-
return [4, API.documentService.addFilesToExistingDocument(documentBody)];
|
|
709
|
-
case 4:
|
|
710
|
-
_f.sent();
|
|
711
|
-
_f.label = 5;
|
|
712
|
-
case 5:
|
|
713
|
-
documentsList = [];
|
|
714
|
-
if (hasCivilIdDocument && !(civilIdDocument === null || civilIdDocument === void 0 ? void 0 : civilIdDocument.id))
|
|
715
|
-
documentsList.push({ type: DocumentPurpose.IDENTITY_DOCUMENT, images: civilID });
|
|
716
|
-
if (isSendSignatureFile && hasSignatureDocument && !(signatureDocument === null || signatureDocument === void 0 ? void 0 : signatureDocument.id))
|
|
717
|
-
documentsList.push({ type: DocumentPurpose.CUSTOMER_SIGNATURE, images: signatureFileId });
|
|
718
|
-
if (!(documentsList.length > 0)) return [3, 7];
|
|
719
|
-
documentBody = {
|
|
720
|
-
individual_type_id: id || '',
|
|
721
|
-
country: businessCountry.iso2,
|
|
722
|
-
documents: documentsList
|
|
723
|
-
};
|
|
724
|
-
return [4, API.documentService.updateDocumentInfo(documentBody)];
|
|
725
|
-
case 6:
|
|
726
|
-
_f.sent();
|
|
727
|
-
_f.label = 7;
|
|
728
|
-
case 7:
|
|
729
|
-
thunkApi.dispatch(handleNextScreenStep());
|
|
730
|
-
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, requestBody);
|
|
731
|
-
return [2, { data: data, formData: params }];
|
|
732
|
-
}
|
|
596
|
+
})), (!isDOBNonEditable && {
|
|
597
|
+
date_of_birth: dob
|
|
598
|
+
})), (!((isBirthCityNonEditable && isBirthCountryNonEditable) || !hasBirth) && {
|
|
599
|
+
birth: {
|
|
600
|
+
city: isBirthCityNonEditable ? undefined : placeOfBirthCity === null || placeOfBirthCity === void 0 ? void 0 : placeOfBirthCity.id,
|
|
601
|
+
country: isBirthCountryNonEditable ? undefined : placeOfBirthCountry === null || placeOfBirthCountry === void 0 ? void 0 : placeOfBirthCountry.iso2
|
|
602
|
+
}
|
|
603
|
+
})), (!isNationalityNonEditable && {
|
|
604
|
+
nationality: nationality === null || nationality === void 0 ? void 0 : nationality.iso2
|
|
605
|
+
})), { encryption_contract: [
|
|
606
|
+
'gender',
|
|
607
|
+
'contact.email',
|
|
608
|
+
'contact.phone.country_code',
|
|
609
|
+
'contact.phone.number',
|
|
610
|
+
'identification.id',
|
|
611
|
+
'identification.issued_country_code',
|
|
612
|
+
'identification.expiry',
|
|
613
|
+
'identification.type',
|
|
614
|
+
'birth.country',
|
|
615
|
+
'date_of_birth',
|
|
616
|
+
'nationality'
|
|
617
|
+
], step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_PERSONAL_INFO });
|
|
618
|
+
return [4, API.individualService.updateIndividual(requestBody)];
|
|
619
|
+
case 1:
|
|
620
|
+
data = _k.sent();
|
|
621
|
+
if (!(type === IndividualType.USER || type === IndividualType.BUYER)) return [3, 3];
|
|
622
|
+
return [4, thunkApi.dispatch(retrieveDataList(code))];
|
|
623
|
+
case 2:
|
|
624
|
+
_k.sent();
|
|
625
|
+
_k.label = 3;
|
|
626
|
+
case 3:
|
|
627
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
628
|
+
(_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, requestBody);
|
|
629
|
+
return [2, { data: data, formData: originalFormData }];
|
|
630
|
+
}
|
|
631
|
+
});
|
|
733
632
|
});
|
|
734
|
-
});
|
|
633
|
+
});
|
|
634
|
+
export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', function (_a, thunkApi) {
|
|
635
|
+
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
636
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
637
|
+
var _b, settings, individual, _c, notification, user, _d, id, type, occupation, sourceIncome, monthlyIncome, isPEP, isInfluencer, shareCount, shareValue, civilID, signatureFileId, isOccupationNonEditable, isSourceIncomeNonEditable, isPEPNonEditable, isInfluencerNonEditable, isMonthlyIncomeNonEditable, isSharesAvailable, pepInfo, influencerInfo, occupationInfo, sourceIncomeInfo, monthlyIncomeInfo, userPayload, shareHolderPayload, boardMemberPayload, buyerMemberPayload, payload, requestBody, data, businessCountry, hasCivilIdDocument, hasSignatureDocument, isSendSignatureFile, civilIdDocument, signatureDocument, documentBody, documentBody, documentsList, documentBody;
|
|
638
|
+
var _e, _f;
|
|
639
|
+
return __generator(this, function (_g) {
|
|
640
|
+
switch (_g.label) {
|
|
641
|
+
case 0:
|
|
642
|
+
_b = thunkApi.getState(), settings = _b.settings, individual = _b.individual;
|
|
643
|
+
_c = individual.data.verify.responseBody || {}, notification = _c.notification, user = _c.user;
|
|
644
|
+
_d = ((user === null || user === void 0 ? void 0 : user.is_authorized) ? user : notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _d.id, type = _d.type;
|
|
645
|
+
occupation = formData.occupation, sourceIncome = formData.sourceIncome, monthlyIncome = formData.monthlyIncome, isPEP = formData.isPEP, isInfluencer = formData.isInfluencer, shareCount = formData.shareCount, shareValue = formData.shareValue, civilID = formData.civilID, signatureFileId = formData.signatureFileId;
|
|
646
|
+
isOccupationNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'occupation');
|
|
647
|
+
isSourceIncomeNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'source_of_income');
|
|
648
|
+
isPEPNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'is_relative_PEP');
|
|
649
|
+
isInfluencerNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'is_influencer');
|
|
650
|
+
isMonthlyIncomeNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'monthly_income');
|
|
651
|
+
isSharesAvailable = shareCount || shareValue;
|
|
652
|
+
pepInfo = isPEPNonEditable ? undefined : isPEP;
|
|
653
|
+
influencerInfo = isInfluencerNonEditable ? undefined : isInfluencer;
|
|
654
|
+
occupationInfo = isOccupationNonEditable || !(occupation === null || occupation === void 0 ? void 0 : occupation.id) ? undefined : { id: occupation.id };
|
|
655
|
+
sourceIncomeInfo = isSourceIncomeNonEditable || !(sourceIncome === null || sourceIncome === void 0 ? void 0 : sourceIncome.id) ? undefined : [{ id: sourceIncome.id }];
|
|
656
|
+
monthlyIncomeInfo = isMonthlyIncomeNonEditable || !(monthlyIncome === null || monthlyIncome === void 0 ? void 0 : monthlyIncome.id) ? undefined : { id: monthlyIncome.id };
|
|
657
|
+
userPayload = {
|
|
658
|
+
occupation: occupationInfo,
|
|
659
|
+
source_income: sourceIncomeInfo,
|
|
660
|
+
monthly_income: monthlyIncomeInfo,
|
|
661
|
+
is_relative_PEP: pepInfo,
|
|
662
|
+
is_influencer: influencerInfo
|
|
663
|
+
};
|
|
664
|
+
shareHolderPayload = {
|
|
665
|
+
shares: isSharesAvailable
|
|
666
|
+
? {
|
|
667
|
+
count: shareCount && Number(shareCount),
|
|
668
|
+
value: shareValue && Number(shareValue)
|
|
669
|
+
}
|
|
670
|
+
: undefined
|
|
671
|
+
};
|
|
672
|
+
boardMemberPayload = {
|
|
673
|
+
is_relative_PEP: pepInfo,
|
|
674
|
+
is_influencer: influencerInfo
|
|
675
|
+
};
|
|
676
|
+
buyerMemberPayload = {
|
|
677
|
+
occupation: occupationInfo,
|
|
678
|
+
source_income: sourceIncomeInfo,
|
|
679
|
+
monthly_income: monthlyIncomeInfo
|
|
680
|
+
};
|
|
681
|
+
payload = userPayload;
|
|
682
|
+
if (type === IndividualType.SHARE_HOLDER)
|
|
683
|
+
payload = shareHolderPayload;
|
|
684
|
+
if (type === IndividualType.BOARD_MEMBER)
|
|
685
|
+
payload = boardMemberPayload;
|
|
686
|
+
if (type === IndividualType.BUYER)
|
|
687
|
+
payload = buyerMemberPayload;
|
|
688
|
+
if (type === IndividualType.CUSTOMER)
|
|
689
|
+
payload = {};
|
|
690
|
+
requestBody = __assign(__assign({ id: id, type: type }, payload), { encryption_contract: [], step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO });
|
|
691
|
+
return [4, API.individualService.updateIndividual(requestBody)];
|
|
692
|
+
case 1:
|
|
693
|
+
data = _g.sent();
|
|
694
|
+
businessCountry = settings.data.businessCountry;
|
|
695
|
+
hasCivilIdDocument = (civilID || []).length > 0;
|
|
696
|
+
hasSignatureDocument = (signatureFileId || []).length > 0;
|
|
697
|
+
isSendSignatureFile = (user === null || user === void 0 ? void 0 : user.is_authorized) && (type === IndividualType.USER || type === IndividualType.BUYER);
|
|
698
|
+
civilIdDocument = getRecentDocumentBasedOnPurpose(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.IDENTITY_DOCUMENT);
|
|
699
|
+
signatureDocument = getRecentDocumentBasedOnPurpose(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.CUSTOMER_SIGNATURE);
|
|
700
|
+
if (!((civilIdDocument === null || civilIdDocument === void 0 ? void 0 : civilIdDocument.id) && hasCivilIdDocument)) return [3, 3];
|
|
701
|
+
documentBody = {
|
|
702
|
+
id: civilIdDocument.id,
|
|
703
|
+
images: civilID
|
|
704
|
+
};
|
|
705
|
+
return [4, API.documentService.addFilesToExistingDocument(documentBody)];
|
|
706
|
+
case 2:
|
|
707
|
+
_g.sent();
|
|
708
|
+
_g.label = 3;
|
|
709
|
+
case 3:
|
|
710
|
+
if (!((signatureDocument === null || signatureDocument === void 0 ? void 0 : signatureDocument.id) && hasSignatureDocument && isSendSignatureFile)) return [3, 5];
|
|
711
|
+
documentBody = {
|
|
712
|
+
id: signatureDocument.id,
|
|
713
|
+
images: signatureFileId
|
|
714
|
+
};
|
|
715
|
+
return [4, API.documentService.addFilesToExistingDocument(documentBody)];
|
|
716
|
+
case 4:
|
|
717
|
+
_g.sent();
|
|
718
|
+
_g.label = 5;
|
|
719
|
+
case 5:
|
|
720
|
+
documentsList = [];
|
|
721
|
+
if (hasCivilIdDocument && !(civilIdDocument === null || civilIdDocument === void 0 ? void 0 : civilIdDocument.id))
|
|
722
|
+
documentsList.push({ type: DocumentPurpose.IDENTITY_DOCUMENT, images: civilID });
|
|
723
|
+
if (isSendSignatureFile && hasSignatureDocument && !(signatureDocument === null || signatureDocument === void 0 ? void 0 : signatureDocument.id))
|
|
724
|
+
documentsList.push({ type: DocumentPurpose.CUSTOMER_SIGNATURE, images: signatureFileId });
|
|
725
|
+
if (!(documentsList.length > 0)) return [3, 7];
|
|
726
|
+
documentBody = {
|
|
727
|
+
individual_type_id: id || '',
|
|
728
|
+
country: businessCountry.iso2,
|
|
729
|
+
documents: documentsList
|
|
730
|
+
};
|
|
731
|
+
return [4, API.documentService.updateDocumentInfo(documentBody)];
|
|
732
|
+
case 6:
|
|
733
|
+
_g.sent();
|
|
734
|
+
_g.label = 7;
|
|
735
|
+
case 7:
|
|
736
|
+
thunkApi.dispatch(handleNextScreenStep());
|
|
737
|
+
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, requestBody);
|
|
738
|
+
return [2, { data: data, formData: originalFormData }];
|
|
739
|
+
}
|
|
740
|
+
});
|
|
741
|
+
});
|
|
742
|
+
});
|
|
735
743
|
export var checkEmailAvailability = createAsyncThunk('checkEmailAvailability', function (_a) {
|
|
736
744
|
var email = _a.email, cancelToken = _a.cancelToken, onSuccess = _a.onSuccess;
|
|
737
745
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RootState } from '../../../app/store';
|
|
2
|
-
import { ActionState, FlowsTypes, OTPFormValues, ResponseData, SharedState, TaxFormValues } from '../../../@types';
|
|
2
|
+
import { ActionState, AsyncThunkParams, FlowsTypes, OTPFormValues, ResponseData, SharedState, TaxFormValues } from '../../../@types';
|
|
3
3
|
interface VerifyLeadTokenProps {
|
|
4
4
|
token: string;
|
|
5
5
|
isInternally?: boolean;
|
|
@@ -25,7 +25,7 @@ export declare const verifyTaxLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
25
25
|
export declare const updateTaxInfo: import("@reduxjs/toolkit").AsyncThunk<{
|
|
26
26
|
data: any;
|
|
27
27
|
formData: TaxFormValues;
|
|
28
|
-
}, TaxFormValues
|
|
28
|
+
}, AsyncThunkParams<TaxFormValues>, {}>;
|
|
29
29
|
export declare const updateLeadSuccess: import("@reduxjs/toolkit").AsyncThunk<{
|
|
30
30
|
response: any;
|
|
31
31
|
formData: void;
|
|
@@ -165,62 +165,66 @@ export var verifyTaxLeadOTP = createAsyncThunk('verifyTaxLeadOTP', function (par
|
|
|
165
165
|
}
|
|
166
166
|
});
|
|
167
167
|
}); });
|
|
168
|
-
export var updateTaxInfo = createAsyncThunk('updateTaxInfo', function (
|
|
169
|
-
var
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
168
|
+
export var updateTaxInfo = createAsyncThunk('updateTaxInfo', function (_a, thunkApi) {
|
|
169
|
+
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
170
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
171
|
+
var _b, settings, tax, _c, id, data_status, documents, isTaxNumberNonEditable, isConfirmPolicyNonEditable, isDocumentsNonEditable, document, vatId, confirmPolicy, documentId, requestBody, data, documentBody, _d, documentBody, _e;
|
|
172
|
+
var _f, _g, _h, _j;
|
|
173
|
+
return __generator(this, function (_k) {
|
|
174
|
+
switch (_k.label) {
|
|
175
|
+
case 0:
|
|
176
|
+
_b = thunkApi.getState(), settings = _b.settings, tax = _b.tax;
|
|
177
|
+
_c = ((_f = tax.data.verify.responseBody) === null || _f === void 0 ? void 0 : _f.entity) || {}, id = _c.id, data_status = _c.data_status, documents = _c.documents;
|
|
178
|
+
isTaxNumberNonEditable = hasNoneEditableValue(data_status, 'tax_number');
|
|
179
|
+
isConfirmPolicyNonEditable = hasNoneEditableValue(data_status, 'is_vat_acknowledged');
|
|
180
|
+
isDocumentsNonEditable = hasNoneEditableValue(data_status, 'documents');
|
|
181
|
+
document = getRecentDocumentBasedOnPurpose(documents, DocumentPurpose.TAX_DOCUMENT);
|
|
182
|
+
vatId = formData.vatId, confirmPolicy = formData.confirmPolicy, documentId = formData.documentId;
|
|
183
|
+
requestBody = {
|
|
184
|
+
id: id,
|
|
185
|
+
vat_id: isTaxNumberNonEditable ? undefined : vatId,
|
|
186
|
+
step_name: TAX_STEP_NAMES.TAX_INFO,
|
|
187
|
+
is_vat_acknowledged: isConfirmPolicyNonEditable ? undefined : confirmPolicy
|
|
188
|
+
};
|
|
189
|
+
return [4, API.entityService.updateEntityInfo(requestBody)];
|
|
190
|
+
case 1:
|
|
191
|
+
data = (_k.sent()).data;
|
|
192
|
+
if ((_g = data.errors) === null || _g === void 0 ? void 0 : _g.length)
|
|
193
|
+
throw new Error(data.errors[0].description);
|
|
194
|
+
if (!(!isDocumentsNonEditable && (documentId || []).length > 0)) return [3, 5];
|
|
195
|
+
if (!(document === null || document === void 0 ? void 0 : document.id)) return [3, 3];
|
|
196
|
+
documentBody = {
|
|
197
|
+
id: document === null || document === void 0 ? void 0 : document.id,
|
|
198
|
+
images: documentId
|
|
199
|
+
};
|
|
200
|
+
_d = data;
|
|
201
|
+
return [4, API.documentService.addFilesToExistingDocument(documentBody)];
|
|
202
|
+
case 2:
|
|
203
|
+
_d.documentData = _k.sent();
|
|
204
|
+
return [3, 5];
|
|
205
|
+
case 3:
|
|
206
|
+
documentBody = {
|
|
207
|
+
entity_id: id || '',
|
|
208
|
+
documents: [
|
|
209
|
+
{
|
|
210
|
+
type: DocumentPurpose.TAX_DOCUMENT,
|
|
211
|
+
images: documentId
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
};
|
|
215
|
+
_e = data;
|
|
216
|
+
return [4, API.documentService.updateDocumentInfo(documentBody)];
|
|
217
|
+
case 4:
|
|
218
|
+
_e.documentData = _k.sent();
|
|
219
|
+
_k.label = 5;
|
|
220
|
+
case 5:
|
|
221
|
+
thunkApi.dispatch(handleNextScreenStep());
|
|
222
|
+
(_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, requestBody);
|
|
223
|
+
return [2, { data: data, formData: originalFormData }];
|
|
224
|
+
}
|
|
225
|
+
});
|
|
222
226
|
});
|
|
223
|
-
});
|
|
227
|
+
});
|
|
224
228
|
export var updateLeadSuccess = createAsyncThunk('taxUpdateLeadSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
225
229
|
var _a, settings, tax, _b, id, infoId, payload, data, boardInfoData, boardData;
|
|
226
230
|
var _c, _d, _e, _f, _g;
|