@tap-payments/auth-jsconnect 2.0.55 → 2.0.56
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/redux.d.ts +4 -0
- package/build/constants/app.js +9 -9
- package/build/features/app/bank/bankStore.d.ts +2 -2
- package/build/features/app/bank/bankStore.js +54 -51
- package/build/features/app/brand/brandStore.d.ts +3 -3
- package/build/features/app/brand/brandStore.js +133 -114
- package/build/features/app/business/businessStore.js +3 -4
- package/build/features/app/connect/connectStore.js +3 -2
- 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/password/passwordStore.d.ts +2 -0
- package/build/features/app/password/passwordStore.js +24 -12
- package/build/features/app/tax/taxStore.d.ts +2 -2
- package/build/features/app/tax/taxStore.js +59 -55
- package/build/features/bank/screens/BankDetails/BankDetails.js +7 -6
- package/build/features/bank/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +3 -2
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +3 -11
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +7 -6
- package/build/features/brand/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
- package/build/features/business/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +7 -2
- package/build/features/connect/screens/Merchant/Merchant.js +2 -1
- package/build/features/connect/screens/Merchant/validation.d.ts +3 -0
- package/build/features/connect/screens/Merchant/validation.js +2 -1
- 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/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
- 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/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +7 -2
- package/build/features/password/screens/CreatePassword/CreatePassword.js +9 -16
- package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +7 -2
- package/build/features/password/screens/Verify/Verify.js +7 -20
- package/build/features/shared/Button/IndividualActionButtons.js +2 -2
- package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +3 -1
- package/build/features/shared/SuccessScreen/SuccessScreen.js +3 -2
- package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +4 -3
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useExcludeReadOnlyFelids.d.ts +11 -0
- package/build/hooks/useExcludeReadOnlyFelids.js +33 -0
- package/build/utils/string.d.ts +1 -1
- package/build/utils/string.js +3 -1
- package/package.json +1 -1
|
@@ -639,84 +639,88 @@ export var createAccountAsync = createAsyncThunk('connectExpress/createAccountAs
|
|
|
639
639
|
}
|
|
640
640
|
});
|
|
641
641
|
}); });
|
|
642
|
-
export var updateLeadIndividualAsync = createAsyncThunk('connectExpress/updateLeadIndividualAsync', function (
|
|
643
|
-
var
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
encryption_contract: ['name.first', 'name.middle', 'name.last', 'contact.email', 'contact.phone.country_code', 'contact.phone.number']
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP')); });
|
|
667
|
-
}
|
|
668
|
-
if (!needToCollectMoreInfo) return [3, 4];
|
|
669
|
-
isSaudi = isSA(settings.data.businessCountry.iso2);
|
|
670
|
-
if (!isSaudi) return [3, 3];
|
|
671
|
-
return [4, thunkApi.dispatch(retrieveEntityListAsync(data.lead.id)).unwrap()];
|
|
672
|
-
case 2:
|
|
673
|
-
_h.sent();
|
|
674
|
-
_h.label = 3;
|
|
675
|
-
case 3:
|
|
676
|
-
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP')); });
|
|
677
|
-
_h.label = 4;
|
|
678
|
-
case 4: return [2, { response: data, formData: params }];
|
|
679
|
-
}
|
|
680
|
-
});
|
|
681
|
-
}); });
|
|
682
|
-
export var updateLeadBusinessDataAsync = createAsyncThunk('updateLeadBusinessDataAsync ', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
683
|
-
var _a, settings, connectExpress, isNonSA, isFL, _b, responseData, isLeadIdPassed, id, brandNameBody, payload, data;
|
|
684
|
-
var _c, _d, _e, _f;
|
|
685
|
-
return __generator(this, function (_g) {
|
|
686
|
-
switch (_g.label) {
|
|
687
|
-
case 0:
|
|
688
|
-
_a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
|
|
689
|
-
isNonSA = !isSA(settings.data.businessCountry.iso2);
|
|
690
|
-
isFL = ((_c = params.selectedLicense) === null || _c === void 0 ? void 0 : _c.type) === BusinessType.FL;
|
|
691
|
-
_b = connectExpress.data, responseData = _b.responseData, isLeadIdPassed = _b.isLeadIdPassed;
|
|
692
|
-
id = ((responseData === null || responseData === void 0 ? void 0 : responseData.leadData) || {}).id;
|
|
693
|
-
brandNameBody = {
|
|
694
|
-
name: {
|
|
695
|
-
en: params.brandName,
|
|
696
|
-
ar: params.brandName,
|
|
697
|
-
zh: params.brandName
|
|
642
|
+
export var updateLeadIndividualAsync = createAsyncThunk('connectExpress/updateLeadIndividualAsync', function (_a, thunkApi) {
|
|
643
|
+
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
644
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
645
|
+
var _b, settings, connectExpress, id, countryCode, name, email, mobile, phoneCountry, isContactAvailable, payload, data, needToCollectMoreInfo, creatingAccount, isSaudi;
|
|
646
|
+
var _c, _d, _e, _f, _g;
|
|
647
|
+
return __generator(this, function (_h) {
|
|
648
|
+
switch (_h.label) {
|
|
649
|
+
case 0:
|
|
650
|
+
_b = thunkApi.getState(), settings = _b.settings, connectExpress = _b.connectExpress;
|
|
651
|
+
id = (((_c = connectExpress.data.responseData) === null || _c === void 0 ? void 0 : _c.leadData) || {}).id;
|
|
652
|
+
countryCode = formData.countryCode, name = formData.name, email = formData.email, mobile = formData.mobile;
|
|
653
|
+
phoneCountry = (_d = countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix) === null || _d === void 0 ? void 0 : _d.toString();
|
|
654
|
+
isContactAvailable = email || mobile;
|
|
655
|
+
payload = __assign(__assign({ id: id || '', country_code: (_e = settings.data.businessCountry) === null || _e === void 0 ? void 0 : _e.iso2, name: getIndividualName(name) }, (isContactAvailable && {
|
|
656
|
+
contact: __assign({ email: email }, (mobile && { phone: { country_code: phoneCountry, number: mobile } }))
|
|
657
|
+
})), { step_name: CONNECT_EXPRESS_STEP_NAMES.UPDATE_LEAD_INDIVIDUAL, encryption_contract: ['name.first', 'name.middle', 'name.last', 'contact.email', 'contact.phone.country_code', 'contact.phone.number'] });
|
|
658
|
+
return [4, API.leadService.updateLeadExpress(payload)];
|
|
659
|
+
case 1:
|
|
660
|
+
data = _h.sent();
|
|
661
|
+
(_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, formData);
|
|
662
|
+
needToCollectMoreInfo = data.step_name === 'collect_info';
|
|
663
|
+
creatingAccount = data.step_name === 'create_account';
|
|
664
|
+
if (creatingAccount) {
|
|
665
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP')); });
|
|
698
666
|
}
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
case 1:
|
|
713
|
-
data = _g.sent();
|
|
714
|
-
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, params);
|
|
715
|
-
thunkApi.dispatch(handleNextScreenStep());
|
|
716
|
-
return [2, { response: data, formData: params }];
|
|
717
|
-
}
|
|
667
|
+
if (!needToCollectMoreInfo) return [3, 4];
|
|
668
|
+
isSaudi = isSA(settings.data.businessCountry.iso2);
|
|
669
|
+
if (!isSaudi) return [3, 3];
|
|
670
|
+
return [4, thunkApi.dispatch(retrieveEntityListAsync(data.lead.id)).unwrap()];
|
|
671
|
+
case 2:
|
|
672
|
+
_h.sent();
|
|
673
|
+
_h.label = 3;
|
|
674
|
+
case 3:
|
|
675
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP')); });
|
|
676
|
+
_h.label = 4;
|
|
677
|
+
case 4: return [2, { response: data, formData: originalFormData }];
|
|
678
|
+
}
|
|
679
|
+
});
|
|
718
680
|
});
|
|
719
|
-
});
|
|
681
|
+
});
|
|
682
|
+
export var updateLeadBusinessDataAsync = createAsyncThunk('updateLeadBusinessDataAsync ', function (_a, thunkApi) {
|
|
683
|
+
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
684
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
685
|
+
var _b, settings, connectExpress, selectedLicense, brandName, licenseNumber, termAndConditionChecked, isNonSA, isFL, _c, responseData, isLeadIdPassed, id, brandNameBody, payload, data;
|
|
686
|
+
var _d, _e;
|
|
687
|
+
return __generator(this, function (_f) {
|
|
688
|
+
switch (_f.label) {
|
|
689
|
+
case 0:
|
|
690
|
+
_b = thunkApi.getState(), settings = _b.settings, connectExpress = _b.connectExpress;
|
|
691
|
+
selectedLicense = formData.selectedLicense, brandName = formData.brandName, licenseNumber = formData.licenseNumber, termAndConditionChecked = formData.termAndConditionChecked;
|
|
692
|
+
isNonSA = !isSA(settings.data.businessCountry.iso2);
|
|
693
|
+
isFL = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.FL;
|
|
694
|
+
_c = connectExpress.data, responseData = _c.responseData, isLeadIdPassed = _c.isLeadIdPassed;
|
|
695
|
+
id = ((responseData === null || responseData === void 0 ? void 0 : responseData.leadData) || {}).id;
|
|
696
|
+
brandNameBody = {
|
|
697
|
+
name: {
|
|
698
|
+
en: brandName,
|
|
699
|
+
ar: brandName,
|
|
700
|
+
zh: brandName
|
|
701
|
+
}
|
|
702
|
+
};
|
|
703
|
+
payload = {
|
|
704
|
+
id: id || '',
|
|
705
|
+
brand: brandNameBody,
|
|
706
|
+
license_number: isNonSA && isFL ? '' : licenseNumber,
|
|
707
|
+
license_type: (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) ? (isFL ? LicenseType.FL : LicenseType.CR) : undefined,
|
|
708
|
+
business_type: selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type,
|
|
709
|
+
is_acknowledged: true,
|
|
710
|
+
terms_conditions_accepted: !isLeadIdPassed ? termAndConditionChecked : undefined,
|
|
711
|
+
step_name: CONNECT_EXPRESS_STEP_NAMES.UPDATE_LEAD_BRAND_BUSINESS,
|
|
712
|
+
encryption_contract: ['license_number', 'business_type', 'license_type']
|
|
713
|
+
};
|
|
714
|
+
return [4, API.leadService.updateLeadExpress(payload)];
|
|
715
|
+
case 1:
|
|
716
|
+
data = _f.sent();
|
|
717
|
+
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, formData);
|
|
718
|
+
thunkApi.dispatch(handleNextScreenStep());
|
|
719
|
+
return [2, { response: data, formData: originalFormData }];
|
|
720
|
+
}
|
|
721
|
+
});
|
|
722
|
+
});
|
|
723
|
+
});
|
|
720
724
|
var initialState = {
|
|
721
725
|
error: null,
|
|
722
726
|
loading: false,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RootState } from '../../../app/store';
|
|
2
|
-
import { ActionState, EntityCapitalFormValues, EntityNameFormValues, FlowsTypes, OTPFormValues, ResponseData, SharedState } from '../../../@types';
|
|
2
|
+
import { ActionState, AsyncThunkParams, EntityCapitalFormValues, EntityNameFormValues, FlowsTypes, OTPFormValues, ResponseData, SharedState } from '../../../@types';
|
|
3
3
|
interface VerifyLeadTokenProps {
|
|
4
4
|
token: string;
|
|
5
5
|
isInternally?: boolean;
|
|
@@ -48,11 +48,11 @@ export declare const retrieveBoardDetails: import("@reduxjs/toolkit").AsyncThunk
|
|
|
48
48
|
export declare const updateEntityName: import("@reduxjs/toolkit").AsyncThunk<{
|
|
49
49
|
data: any;
|
|
50
50
|
formData: EntityNameFormValues;
|
|
51
|
-
}, EntityNameFormValues
|
|
51
|
+
}, AsyncThunkParams<EntityNameFormValues>, {}>;
|
|
52
52
|
export declare const updateEntityCapital: import("@reduxjs/toolkit").AsyncThunk<{
|
|
53
53
|
data: any;
|
|
54
54
|
formData: EntityCapitalFormValues;
|
|
55
|
-
}, EntityCapitalFormValues
|
|
55
|
+
}, AsyncThunkParams<EntityCapitalFormValues>, {}>;
|
|
56
56
|
export declare const updateBoardSuccess: import("@reduxjs/toolkit").AsyncThunk<{
|
|
57
57
|
response: any;
|
|
58
58
|
formData: void;
|
|
@@ -238,129 +238,139 @@ export var retrieveBoardDetails = createAsyncThunk('entityRetrieveEntityInfo', f
|
|
|
238
238
|
}
|
|
239
239
|
});
|
|
240
240
|
}); });
|
|
241
|
-
export var updateEntityName = createAsyncThunk('entityUpdateEntityName', function (
|
|
242
|
-
var
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
'license.type',
|
|
280
|
-
'license.issuing_date',
|
|
281
|
-
'license.expiry_date',
|
|
282
|
-
'license.additional_info.unified_number',
|
|
283
|
-
'type'
|
|
284
|
-
] });
|
|
285
|
-
return [4, API.entityService.updateEntity(payload)];
|
|
286
|
-
case 1:
|
|
287
|
-
data = _f.sent();
|
|
288
|
-
documentResponse = undefined;
|
|
289
|
-
document = getRecentDocumentBasedOnPurpose(documents, DocumentPurpose.CR);
|
|
290
|
-
if (!(!isDocumentsNonEditable && (params.certificateId || []).length > 0)) return [3, 7];
|
|
291
|
-
if (!(document === null || document === void 0 ? void 0 : document.id)) return [3, 3];
|
|
292
|
-
documentBody = {
|
|
293
|
-
id: document.id,
|
|
294
|
-
images: params.certificateId
|
|
295
|
-
};
|
|
296
|
-
return [4, API.documentService.addFilesToExistingDocument(documentBody)];
|
|
297
|
-
case 2:
|
|
298
|
-
documentResponse = _f.sent();
|
|
299
|
-
return [3, 5];
|
|
300
|
-
case 3:
|
|
301
|
-
documentBody = {
|
|
302
|
-
entity_id: id || '',
|
|
303
|
-
documents: [
|
|
304
|
-
{
|
|
305
|
-
type: DocumentPurpose.CR,
|
|
306
|
-
images: params.certificateId
|
|
241
|
+
export var updateEntityName = createAsyncThunk('entityUpdateEntityName', function (_a, thunkApi) {
|
|
242
|
+
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
243
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
244
|
+
var _b, settings, entity, _c, id, data_status, data_verification, documents, issuingDate, expiryDate, licenseType, licenseNumber, articleId, unifiedNumber, legalName, certificateId, entityType, issueDate, expDate, isFL, isLegalNameENNonEditable, isLegalNameARNonEditable, isLicenseTypeNonEditable, isEntityTypeNonEditable, isLicenseNumberNonEditable, isUnifiedNumberNonEditable, isIssuingDateNonEditable, isExpiryDateNonEditable, isDocumentsNonEditable, isAOAFileNonEditable, isEntityTypeVerified, isLicenseNonEditable, isLicenseAvailable, payload, data, documentResponse, document, documentBody, documentBody, list;
|
|
245
|
+
var _d, _e, _f;
|
|
246
|
+
return __generator(this, function (_g) {
|
|
247
|
+
switch (_g.label) {
|
|
248
|
+
case 0:
|
|
249
|
+
_b = thunkApi.getState(), settings = _b.settings, entity = _b.entity;
|
|
250
|
+
_c = ((_d = entity.data.verify.responseBody) === null || _d === void 0 ? void 0 : _d.entity) || {}, id = _c.id, data_status = _c.data_status, data_verification = _c.data_verification, documents = _c.documents;
|
|
251
|
+
issuingDate = formData.issuingDate, expiryDate = formData.expiryDate, licenseType = formData.licenseType, licenseNumber = formData.licenseNumber, articleId = formData.articleId, unifiedNumber = formData.unifiedNumber, legalName = formData.legalName, certificateId = formData.certificateId, entityType = formData.entityType;
|
|
252
|
+
issueDate = issuingDate && new Date(issuingDate).getTime();
|
|
253
|
+
expDate = expiryDate && new Date(expiryDate).getTime();
|
|
254
|
+
isFL = licenseType === BusinessType.FL;
|
|
255
|
+
isLegalNameENNonEditable = hasNoneEditableValue(data_status, 'legal_name.en');
|
|
256
|
+
isLegalNameARNonEditable = hasNoneEditableValue(data_status, 'legal_name.ar');
|
|
257
|
+
isLicenseTypeNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.license, 'type');
|
|
258
|
+
isEntityTypeNonEditable = hasNoneEditableValue(data_status, 'type');
|
|
259
|
+
isLicenseNumberNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.license, 'number');
|
|
260
|
+
isUnifiedNumberNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.license, 'additional_info');
|
|
261
|
+
isIssuingDateNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.license, 'issuing_date');
|
|
262
|
+
isExpiryDateNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.license, 'expiry_date');
|
|
263
|
+
isDocumentsNonEditable = hasNoneEditableValue(data_status, 'documents');
|
|
264
|
+
isAOAFileNonEditable = hasNoneEditableValue(data_status, 'AOA_file_id');
|
|
265
|
+
isEntityTypeVerified = hasVerifiedValue(data_verification, 'type');
|
|
266
|
+
isLicenseNonEditable = isLicenseNumberNonEditable && isLicenseTypeNonEditable && isIssuingDateNonEditable && isExpiryDateNonEditable && isUnifiedNumberNonEditable;
|
|
267
|
+
isLicenseAvailable = licenseNumber || licenseType || issueDate || expDate || unifiedNumber;
|
|
268
|
+
payload = __assign(__assign(__assign(__assign({ id: id, AOA_file_id: isAOAFileNonEditable ? undefined : articleId }, (!isLicenseNonEditable &&
|
|
269
|
+
isLicenseAvailable && {
|
|
270
|
+
license: __assign({ number: isLicenseNumberNonEditable || !licenseNumber ? undefined : licenseNumber, type: isLicenseTypeNonEditable || !licenseType ? undefined : isFL ? LicenseType.FL : LicenseType.CR, issuing_date: isIssuingDateNonEditable || !issueDate ? undefined : issueDate === null || issueDate === void 0 ? void 0 : issueDate.toString(), expiry_date: isExpiryDateNonEditable || !expDate ? undefined : expDate === null || expDate === void 0 ? void 0 : expDate.toString() }, (!(isUnifiedNumberNonEditable || !unifiedNumber) && {
|
|
271
|
+
additional_info: {
|
|
272
|
+
unified_number: unifiedNumber
|
|
273
|
+
}
|
|
274
|
+
}))
|
|
275
|
+
})), (!(isEntityTypeVerified || isEntityTypeNonEditable) && { type: entityType })), (!((isLegalNameENNonEditable && isLegalNameARNonEditable) || !legalName) && {
|
|
276
|
+
legal_name: {
|
|
277
|
+
en: isLegalNameENNonEditable ? undefined : legalName,
|
|
278
|
+
ar: isLegalNameARNonEditable ? undefined : legalName
|
|
307
279
|
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
280
|
+
})), { encryption_contract: [
|
|
281
|
+
'license.number',
|
|
282
|
+
'legal_name.ar',
|
|
283
|
+
'legal_name.en',
|
|
284
|
+
'license.type',
|
|
285
|
+
'license.issuing_date',
|
|
286
|
+
'license.expiry_date',
|
|
287
|
+
'license.additional_info.unified_number',
|
|
288
|
+
'type'
|
|
289
|
+
] });
|
|
290
|
+
return [4, API.entityService.updateEntity(payload)];
|
|
291
|
+
case 1:
|
|
292
|
+
data = _g.sent();
|
|
293
|
+
documentResponse = undefined;
|
|
294
|
+
document = getRecentDocumentBasedOnPurpose(documents, DocumentPurpose.CR);
|
|
295
|
+
if (!(!isDocumentsNonEditable && (certificateId || []).length > 0)) return [3, 7];
|
|
296
|
+
if (!(document === null || document === void 0 ? void 0 : document.id)) return [3, 3];
|
|
297
|
+
documentBody = {
|
|
298
|
+
id: document.id,
|
|
299
|
+
images: certificateId
|
|
300
|
+
};
|
|
301
|
+
return [4, API.documentService.addFilesToExistingDocument(documentBody)];
|
|
302
|
+
case 2:
|
|
303
|
+
documentResponse = _g.sent();
|
|
304
|
+
return [3, 5];
|
|
305
|
+
case 3:
|
|
306
|
+
documentBody = {
|
|
307
|
+
entity_id: id || '',
|
|
308
|
+
documents: [
|
|
309
|
+
{
|
|
310
|
+
type: DocumentPurpose.CR,
|
|
311
|
+
images: certificateId
|
|
312
|
+
}
|
|
313
|
+
]
|
|
314
|
+
};
|
|
315
|
+
return [4, API.documentService.updateDocumentInfo(documentBody)];
|
|
316
|
+
case 4:
|
|
317
|
+
documentResponse = _g.sent();
|
|
318
|
+
_g.label = 5;
|
|
319
|
+
case 5: return [4, API.entityService.retrieveEntity(id)];
|
|
320
|
+
case 6:
|
|
321
|
+
data = _g.sent();
|
|
322
|
+
data.documentData = documentResponse;
|
|
323
|
+
_g.label = 7;
|
|
324
|
+
case 7: return [4, API.dataService.getActivities()];
|
|
325
|
+
case 8:
|
|
326
|
+
list = (_g.sent()).list;
|
|
327
|
+
data.activityList = list;
|
|
328
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
329
|
+
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, id);
|
|
330
|
+
return [2, { data: data, formData: originalFormData }];
|
|
331
|
+
}
|
|
332
|
+
});
|
|
327
333
|
});
|
|
328
|
-
});
|
|
329
|
-
export var updateEntityCapital = createAsyncThunk('entityUpdateEntityCapital', function (
|
|
330
|
-
var
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
334
|
+
});
|
|
335
|
+
export var updateEntityCapital = createAsyncThunk('entityUpdateEntityCapital', function (_a, thunkApi) {
|
|
336
|
+
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
337
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
338
|
+
var _b, settings, entity, _c, id, data_status, isCapitalPaidNonEditable, isCapitalShareCountNonEditable, isCapitalShareValueNonEditable, isActivitiesNonEditable, capitalShareCount, capitalShareValue, activities, capitalPaid, hasCapitalShares, isCapitalNonEditable, activityIds, payload, data;
|
|
339
|
+
var _d, _e, _f, _g;
|
|
340
|
+
return __generator(this, function (_h) {
|
|
341
|
+
switch (_h.label) {
|
|
342
|
+
case 0:
|
|
343
|
+
_b = thunkApi.getState(), settings = _b.settings, entity = _b.entity;
|
|
344
|
+
_c = ((_d = entity.data.verify.responseBody) === null || _d === void 0 ? void 0 : _d.entity) || {}, id = _c.id, data_status = _c.data_status;
|
|
345
|
+
isCapitalPaidNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.capital, 'paid');
|
|
346
|
+
isCapitalShareCountNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.capital, 'shares.count');
|
|
347
|
+
isCapitalShareValueNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.capital, 'shares.value');
|
|
348
|
+
isActivitiesNonEditable = hasNoneEditableValue(data_status, 'activities');
|
|
349
|
+
capitalShareCount = formData.capitalShareCount, capitalShareValue = formData.capitalShareValue, activities = formData.activities, capitalPaid = formData.capitalPaid;
|
|
350
|
+
hasCapitalShares = capitalShareCount || capitalShareValue;
|
|
351
|
+
isCapitalNonEditable = (isCapitalPaidNonEditable && isCapitalShareCountNonEditable && isCapitalShareValueNonEditable) || (!capitalPaid && !hasCapitalShares);
|
|
352
|
+
activityIds = (_e = (activities || [])) === null || _e === void 0 ? void 0 : _e.map(function (_a) {
|
|
353
|
+
var id = _a.id;
|
|
354
|
+
return ({ id: id, action: 'add' });
|
|
355
|
+
});
|
|
356
|
+
payload = __assign({ id: id, activities: isActivitiesNonEditable || (activityIds === null || activityIds === void 0 ? void 0 : activityIds.length) === 0 ? undefined : activityIds }, (!isCapitalNonEditable && {
|
|
357
|
+
capital: __assign({ paid: isCapitalPaidNonEditable ? undefined : capitalPaid }, (!((isCapitalShareCountNonEditable && isCapitalShareValueNonEditable) || !hasCapitalShares) && {
|
|
358
|
+
shares: {
|
|
359
|
+
count: isCapitalShareCountNonEditable ? undefined : capitalShareCount,
|
|
360
|
+
value: isCapitalShareValueNonEditable ? undefined : capitalShareValue
|
|
361
|
+
}
|
|
362
|
+
}))
|
|
363
|
+
}));
|
|
364
|
+
return [4, API.entityService.updateEntity(payload)];
|
|
365
|
+
case 1:
|
|
366
|
+
data = _h.sent();
|
|
367
|
+
thunkApi.dispatch(handleNextScreenStep());
|
|
368
|
+
(_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, id);
|
|
369
|
+
return [2, { data: data, formData: originalFormData }];
|
|
370
|
+
}
|
|
371
|
+
});
|
|
362
372
|
});
|
|
363
|
-
});
|
|
373
|
+
});
|
|
364
374
|
export var updateBoardSuccess = createAsyncThunk('updateBoardEntitySuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
365
375
|
var _a, settings, entity, _b, id, infoId, payload, data, boardInfoData;
|
|
366
376
|
var _c, _d, _e, _f;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RootState } from '../../../app/store';
|
|
2
|
-
import { CountryCode, FlowsTypes, IndividualExtraFormValues, OTPFormValues, ResponseData, SharedState, ActionState, User, IndividualPersonalInfoFormValues, IndividualEmailMobileFormValues, IndividualMobileFormValues } from '../../../@types';
|
|
2
|
+
import { CountryCode, FlowsTypes, IndividualExtraFormValues, OTPFormValues, ResponseData, SharedState, ActionState, User, IndividualPersonalInfoFormValues, IndividualEmailMobileFormValues, IndividualMobileFormValues, AsyncThunkParams } from '../../../@types';
|
|
3
3
|
import { CancelToken } from 'axios';
|
|
4
4
|
interface VerifyLeadTokenProps {
|
|
5
5
|
token: string;
|
|
@@ -91,15 +91,15 @@ export declare const verifyLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
91
91
|
export declare const updatePhoneInfo: import("@reduxjs/toolkit").AsyncThunk<{
|
|
92
92
|
data: any;
|
|
93
93
|
formData: IndividualMobileFormValues;
|
|
94
|
-
}, IndividualMobileFormValues
|
|
94
|
+
}, AsyncThunkParams<IndividualMobileFormValues>, {}>;
|
|
95
95
|
export declare const updateIndividualPersonalInfo: import("@reduxjs/toolkit").AsyncThunk<{
|
|
96
96
|
data: any;
|
|
97
97
|
formData: IndividualPersonalInfoFormValues;
|
|
98
|
-
}, IndividualPersonalInfoFormValues
|
|
98
|
+
}, AsyncThunkParams<IndividualPersonalInfoFormValues>, {}>;
|
|
99
99
|
export declare const updateIndividualInfo: import("@reduxjs/toolkit").AsyncThunk<{
|
|
100
100
|
data: any;
|
|
101
101
|
formData: IndividualExtraFormValues;
|
|
102
|
-
}, IndividualExtraFormValues
|
|
102
|
+
}, AsyncThunkParams<IndividualExtraFormValues>, {}>;
|
|
103
103
|
export declare const checkEmailAvailability: import("@reduxjs/toolkit").AsyncThunk<{
|
|
104
104
|
response: any;
|
|
105
105
|
formData: string;
|