@tap-payments/auth-jsconnect 2.0.51 → 2.0.52
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/app.d.ts +90 -7
- package/build/@types/app.js +7 -0
- package/build/@types/form.d.ts +21 -20
- package/build/@types/theme.d.ts +1 -1
- package/build/api/account.d.ts +2 -2
- package/build/api/auth.d.ts +11 -11
- package/build/api/availabilityServices.d.ts +3 -3
- package/build/api/axios.js +1 -1
- package/build/api/board.d.ts +3 -3
- package/build/api/country.d.ts +1 -1
- package/build/api/data.d.ts +10 -10
- package/build/api/document.d.ts +2 -2
- package/build/api/entity.d.ts +12 -12
- package/build/api/file.d.ts +1 -1
- package/build/api/individual.d.ts +5 -5
- package/build/api/lead.d.ts +10 -10
- package/build/api/operator.d.ts +1 -1
- package/build/api/operator.js +1 -1
- package/build/api/user.d.ts +2 -2
- package/build/app/settings.d.ts +4 -11
- package/build/app/settings.js +13 -5
- package/build/app/store.d.ts +4 -4
- package/build/assets/locales/ar.json +3 -1
- package/build/assets/locales/en.json +3 -1
- package/build/components/DatePicker/DatePicker.js +1 -0
- package/build/components/RadioGroup/RadioGroup.d.ts +5 -2
- package/build/components/RadioGroup/RadioGroup.js +5 -9
- package/build/components/RadioGroup/index.d.ts +1 -1
- package/build/components/Slide/Slide.d.ts +1 -1
- package/build/constants/app.d.ts +3 -2
- package/build/constants/app.js +1 -0
- package/build/constants/validation.d.ts +1 -0
- package/build/constants/validation.js +1 -0
- package/build/features/app/bank/bankStore.d.ts +9 -73
- package/build/features/app/bank/bankStore.js +68 -91
- package/build/features/app/brand/brandStore.d.ts +16 -103
- package/build/features/app/brand/brandStore.js +62 -49
- package/build/features/app/business/businessStore.d.ts +18 -162
- package/build/features/app/business/businessStore.js +4 -3
- package/build/features/app/connect/connectStore.d.ts +13 -121
- package/build/features/app/connect/connectStore.js +5 -4
- package/build/features/app/connectExpress/connectExpressStore.d.ts +22 -211
- package/build/features/app/connectExpress/connectExpressStore.js +9 -10
- package/build/features/app/entity/entityStore.d.ts +9 -74
- package/build/features/app/entity/entityStore.js +129 -152
- package/build/features/app/individual/individualStore.d.ts +21 -167
- package/build/features/app/individual/individualStore.js +176 -202
- package/build/features/app/password/passwordStore.d.ts +12 -102
- package/build/features/app/password/passwordStore.js +1 -1
- package/build/features/app/signIn/signInStore.d.ts +7 -61
- package/build/features/app/signIn/signInStore.js +1 -1
- package/build/features/app/tax/taxStore.d.ts +8 -62
- package/build/features/app/tax/taxStore.js +48 -62
- package/build/features/bank/screens/BankDetails/BankDetails.js +20 -5
- package/build/features/bank/screens/BankDetails/BankName.d.ts +4 -1
- package/build/features/bank/screens/BankDetails/BankName.js +8 -7
- package/build/features/bank/screens/BankDetails/BankStatement.d.ts +5 -2
- package/build/features/bank/screens/BankDetails/BankStatement.js +3 -8
- package/build/features/bank/screens/BankDetails/Beneficiary.d.ts +2 -1
- package/build/features/bank/screens/BankDetails/Beneficiary.js +8 -7
- package/build/features/bank/screens/BankDetails/ConfirmPolicy.d.ts +4 -1
- package/build/features/bank/screens/BankDetails/ConfirmPolicy.js +12 -13
- package/build/features/bank/screens/BankDetails/IBAN.d.ts +2 -1
- package/build/features/bank/screens/BankDetails/IBAN.js +3 -3
- package/build/features/bank/screens/BankDetails/validation.d.ts +14 -14
- package/build/features/bank/screens/BankDetails/validation.js +16 -21
- package/build/features/bank/screens/Verify/OTPInput.js +5 -3
- package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +15 -18
- package/build/features/brand/screens/BrandActivities/ActivitiesList.js +14 -9
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +14 -5
- package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +12 -16
- package/build/features/brand/screens/BrandActivities/CustomerBase.js +16 -13
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.d.ts +2 -1
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +22 -9
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.d.ts +2 -1
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +20 -7
- package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +13 -6
- package/build/features/brand/screens/BrandActivities/RefundPolicy.js +23 -12
- package/build/features/brand/screens/BrandActivities/TAC.d.ts +14 -1
- package/build/features/brand/screens/BrandActivities/TAC.js +21 -12
- package/build/features/brand/screens/BrandActivities/TransactionPolicy.d.ts +4 -1
- package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +18 -4
- package/build/features/brand/screens/BrandActivities/validation.d.ts +7 -7
- package/build/features/brand/screens/BrandActivities/validation.js +10 -19
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +20 -12
- package/build/features/brand/screens/BrandInfo/BrandLogo.d.ts +9 -0
- package/build/features/brand/screens/BrandInfo/BrandLogo.js +52 -0
- package/build/features/brand/screens/BrandInfo/BrandName.d.ts +2 -1
- package/build/features/brand/screens/BrandInfo/BrandName.js +3 -3
- package/build/features/brand/screens/BrandInfo/SalesChannels.d.ts +2 -1
- package/build/features/brand/screens/BrandInfo/SalesChannels.js +2 -1
- package/build/features/brand/screens/BrandInfo/Segments.d.ts +2 -1
- package/build/features/brand/screens/BrandInfo/Segments.js +12 -2
- package/build/features/brand/screens/BrandInfo/TeamSize.d.ts +2 -1
- package/build/features/brand/screens/BrandInfo/TeamSize.js +12 -2
- package/build/features/brand/screens/BrandInfo/validation.d.ts +6 -6
- package/build/features/brand/screens/BrandInfo/validation.js +36 -42
- package/build/features/brand/screens/Verify/OTPInput.js +5 -3
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +12 -17
- package/build/features/business/screens/Activities/ActivitiesList.js +5 -5
- package/build/features/business/screens/Activities/OperationStartDate.d.ts +2 -2
- package/build/features/business/screens/Activities/OperationStartDate.js +2 -2
- package/build/features/business/screens/BusinessType/Article.d.ts +1 -1
- package/build/features/business/screens/BusinessType/LicenseList.js +1 -1
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +5 -5
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +10 -15
- package/build/features/business/screens/Customers/CustomerLocations.js +5 -5
- package/build/features/business/screens/Customers/ExpectedCustomers.js +12 -2
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +12 -2
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +5 -5
- package/build/features/business/screens/IDBOD/DOB.js +1 -1
- package/build/features/business/screens/Verify/OTPInput.js +5 -3
- package/build/features/connect/screens/Individual/Email.js +1 -1
- package/build/features/connect/screens/Merchant/BrandList.js +1 -1
- package/build/features/connect/screens/Merchant/BrandName.js +1 -1
- package/build/features/connect/screens/Merchant/Segments.js +6 -1
- package/build/features/connect/screens/Merchant/TeamSize.js +6 -1
- package/build/features/connect/screens/Merchant/validation.js +5 -5
- package/build/features/connectExpress/screens/Brand/Brand.js +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.d.ts +2 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.js +3 -3
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +5 -3
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.d.ts +2 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +7 -5
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.d.ts +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +7 -6
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.js +4 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +14 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.js +9 -10
- package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +9 -5
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.d.ts +2 -1
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +3 -3
- package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.d.ts +1 -0
- package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.js +6 -2
- package/build/features/connectExpress/screens/CollectIndividualInfo/Name.d.ts +2 -1
- package/build/features/connectExpress/screens/CollectIndividualInfo/Name.js +2 -2
- package/build/features/connectExpress/screens/Mobile/Mobile.js +4 -2
- package/build/features/connectExpress/screens/Mobile/MobileNumber.d.ts +1 -0
- package/build/features/connectExpress/screens/Mobile/MobileNumber.js +6 -2
- package/build/features/connectExpress/screens/Mobile/TAC.d.ts +2 -1
- package/build/features/connectExpress/screens/Mobile/TAC.js +3 -1
- package/build/features/connectExpress/screens/NID/DOB.d.ts +2 -1
- package/build/features/connectExpress/screens/NID/DOB.js +2 -2
- package/build/features/connectExpress/screens/NID/IDNumber.d.ts +1 -0
- package/build/features/connectExpress/screens/NID/IDNumber.js +2 -2
- package/build/features/connectExpress/screens/NID/NID.js +4 -2
- package/build/features/connectExpress/screens/NID/TAC.d.ts +14 -1
- package/build/features/connectExpress/screens/NID/TAC.js +9 -10
- package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +14 -18
- package/build/features/entity/screens/EntityCapital/ActivityList.js +20 -27
- package/build/features/entity/screens/EntityCapital/CapitalPaid.d.ts +2 -1
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +7 -3
- package/build/features/entity/screens/EntityCapital/CapitalShareCount.d.ts +2 -1
- package/build/features/entity/screens/EntityCapital/CapitalShareCount.js +7 -3
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.d.ts +2 -1
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +7 -3
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +19 -17
- package/build/features/entity/screens/EntityCapital/validation.d.ts +10 -10
- package/build/features/entity/screens/EntityCapital/validation.js +4 -10
- package/build/features/entity/screens/EntityName/Article.d.ts +5 -2
- package/build/features/entity/screens/EntityName/Article.js +9 -6
- package/build/features/entity/screens/EntityName/EntityName.js +20 -5
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +14 -18
- package/build/features/entity/screens/EntityName/EntityTypeList.js +24 -27
- package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +4 -3
- package/build/features/entity/screens/EntityName/ExpiryDate.js +2 -2
- package/build/features/entity/screens/EntityName/IssuingDate.d.ts +4 -3
- package/build/features/entity/screens/EntityName/IssuingDate.js +2 -2
- package/build/features/entity/screens/EntityName/LegalName.d.ts +2 -1
- package/build/features/entity/screens/EntityName/LegalName.js +8 -4
- package/build/features/entity/screens/EntityName/LicenseCertificate.d.ts +4 -1
- package/build/features/entity/screens/EntityName/LicenseCertificate.js +8 -9
- package/build/features/entity/screens/EntityName/LicenseNumber.d.ts +2 -1
- package/build/features/entity/screens/EntityName/LicenseNumber.js +8 -5
- package/build/features/entity/screens/EntityName/UnifiedNumber.d.ts +2 -1
- package/build/features/entity/screens/EntityName/UnifiedNumber.js +8 -5
- package/build/features/entity/screens/EntityName/validation.d.ts +35 -35
- package/build/features/entity/screens/EntityName/validation.js +68 -93
- package/build/features/entity/screens/Verify/OTPInput.js +5 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +25 -6
- package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.d.ts +7 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.js +21 -9
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +8 -6
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +25 -25
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +25 -25
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +6 -5
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +8 -6
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.js +8 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +8 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.d.ts +4 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.js +8 -9
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +25 -25
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +6 -11
- package/build/features/individual/screens/IndividualList/Email.js +1 -1
- package/build/features/individual/screens/IndividualList/IndividualList.d.ts +4 -4
- package/build/features/individual/screens/IndividualList/MobileNumber.js +0 -1
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.js +12 -2
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.js +12 -2
- package/build/features/individual/screens/IndividualPersonalInfo/DOB.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/DOB.js +3 -3
- package/build/features/individual/screens/IndividualPersonalInfo/Email.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
- package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.js +4 -5
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +7 -6
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.js +4 -2
- package/build/features/individual/screens/IndividualPersonalInfo/ID.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/ID.js +2 -7
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +2 -2
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +20 -4
- package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.js +13 -7
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +11 -10
- package/build/features/individual/screens/IndividualPersonalInfo/Name.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/Name.js +2 -2
- package/build/features/individual/screens/IndividualPersonalInfo/Nationality.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Nationality.js +13 -7
- package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.d.ts +1 -0
- package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.js +6 -3
- package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +4 -2
- package/build/features/individual/screens/Verify/OTPInput.js +5 -3
- package/build/features/password/screens/Verify/OTPInput.js +5 -3
- package/build/features/shared/Address/CountryList.d.ts +9 -9
- package/build/features/shared/Address/CountryList.js +1 -1
- package/build/features/shared/Address/InputSelect.d.ts +9 -9
- package/build/features/shared/Address/InputSelect.js +2 -2
- package/build/features/shared/Button/EmailProvidersButtons.d.ts +1 -1
- package/build/features/shared/Button/FlowsButtons.d.ts +1 -1
- package/build/features/shared/Button/FlowsButtons.js +15 -20
- package/build/features/shared/Button/IndividualActionButtons.d.ts +1 -1
- package/build/features/shared/Containers/FeatureContainer.d.ts +1 -1
- package/build/features/shared/Containers/ScreenContainer.d.ts +1 -1
- package/build/features/shared/GenericError/GenericError.js +1 -1
- package/build/features/shared/Input/Input.d.ts +3 -3
- package/build/features/shared/Input/Input.js +2 -3
- package/build/features/shared/OTP/OTP.d.ts +2 -1
- package/build/features/shared/OTP/OTP.js +2 -2
- package/build/features/shared/SalesChannels/SaleChannelIconsInput.d.ts +2 -1
- package/build/features/shared/SalesChannels/SaleChannelIconsInput.js +5 -4
- package/build/features/shared/SalesChannels/SalesChannel.d.ts +2 -1
- package/build/features/shared/SalesChannels/SalesChannel.js +5 -4
- package/build/features/shared/UploadFile/FileUpload.d.ts +6 -4
- package/build/features/shared/UploadFile/FileUpload.js +19 -15
- package/build/features/shared/UploadFile/UploadFile.d.ts +2 -2
- package/build/features/shared/UploadFile/UploadFile.js +7 -7
- package/build/features/shared/UploadFile/UploadWrapper.d.ts +5 -3
- package/build/features/shared/UploadFile/UploadWrapper.js +3 -2
- package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +5 -4
- package/build/features/shared/UploadMultipleFile/UploadFile.js +14 -10
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +4 -3
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +3 -3
- package/build/features/tax/screens/TaxDetails/ConfirmPolicy.d.ts +4 -1
- package/build/features/tax/screens/TaxDetails/ConfirmPolicy.js +12 -12
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +9 -4
- package/build/features/tax/screens/TaxDetails/TaxDocument.d.ts +4 -1
- package/build/features/tax/screens/TaxDetails/TaxDocument.js +3 -8
- package/build/features/tax/screens/TaxDetails/VATId.d.ts +4 -1
- package/build/features/tax/screens/TaxDetails/VATId.js +5 -7
- package/build/features/tax/screens/TaxDetails/validation.d.ts +4 -4
- package/build/features/tax/screens/TaxDetails/validation.js +2 -5
- package/build/features/tax/screens/Verify/OTPInput.js +5 -3
- package/build/hooks/index.d.ts +3 -0
- package/build/hooks/index.js +3 -0
- package/build/hooks/useAppConfig.d.ts +1 -1
- package/build/hooks/useAppConfig.js +4 -2
- package/build/hooks/useDataNoneEditable.d.ts +2 -0
- package/build/hooks/useDataNoneEditable.js +19 -0
- package/build/hooks/useFormErrorAndUpdateReadOnly.d.ts +6 -0
- package/build/hooks/useFormErrorAndUpdateReadOnly.js +48 -0
- package/build/hooks/useFormReadOnly.d.ts +6 -0
- package/build/hooks/useFormReadOnly.js +40 -0
- package/build/utils/error.d.ts +1 -0
- package/build/utils/error.js +3 -0
- package/build/utils/object.d.ts +4 -0
- package/build/utils/object.js +17 -0
- package/build/utils/string.d.ts +1 -1
- package/build/utils/string.js +13 -7
- package/package.json +2 -2
- package/build/features/brand/screens/BrandActivities/OperationStartDate.d.ts +0 -20
- package/build/features/brand/screens/BrandActivities/OperationStartDate.js +0 -45
|
@@ -24,7 +24,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
24
24
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
25
|
function step(op) {
|
|
26
26
|
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (
|
|
27
|
+
while (_) try {
|
|
28
28
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
29
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
30
|
switch (op[0]) {
|
|
@@ -71,14 +71,14 @@ import API from '../../../api';
|
|
|
71
71
|
import { FlowsTypes, IndividualGender, IndividualType, DocumentPurpose } from '../../../@types';
|
|
72
72
|
import { handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
|
|
73
73
|
import { defaultCountry, IDENTIFICATION_TYPE, INDIVIDUAl_STEP_NAMES } from '../../../constants';
|
|
74
|
-
import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, getUserNameObject, getUserName, sleep, isValidEmail, getRecentDocumentBasedOnPurpose } from '../../../utils';
|
|
74
|
+
import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, hasNoneEditableValue, getUserNameObject, getUserName, sleep, isValidEmail, getRecentDocumentBasedOnPurpose } from '../../../utils';
|
|
75
75
|
export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a, thunkApi) {
|
|
76
76
|
var token = _a.token, isInternally = _a.isInternally, isUpdatePhoneInfo = _a.isUpdatePhoneInfo;
|
|
77
77
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
78
|
-
var payload, settings, data, boardData, individualData, countryCode, boardInfoData,
|
|
79
|
-
var _c, _d, _e, _f, _g, _h, _j
|
|
80
|
-
return __generator(this, function (
|
|
81
|
-
switch (
|
|
78
|
+
var payload, settings, data, boardData, individualData, countryCode, boardInfoData, countries, board_id, board_info_id, notification, _b, id, type, data_1, birthCountry;
|
|
79
|
+
var _c, _d, _e, _f, _g, _h, _j;
|
|
80
|
+
return __generator(this, function (_k) {
|
|
81
|
+
switch (_k.label) {
|
|
82
82
|
case 0:
|
|
83
83
|
payload = {
|
|
84
84
|
service_name: 'tap_email',
|
|
@@ -87,8 +87,8 @@ export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a
|
|
|
87
87
|
settings = thunkApi.getState().settings;
|
|
88
88
|
return [4, API.leadService.verifyLeadToken(payload)];
|
|
89
89
|
case 1:
|
|
90
|
-
data = (
|
|
91
|
-
|
|
90
|
+
data = (_k.sent()).data;
|
|
91
|
+
boardInfoData = undefined;
|
|
92
92
|
countries = settings.data.countries;
|
|
93
93
|
if (((_c = data.errors) === null || _c === void 0 ? void 0 : _c.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
|
|
94
94
|
throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
|
|
@@ -100,70 +100,61 @@ export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a
|
|
|
100
100
|
}
|
|
101
101
|
if (!(data.step_name === INDIVIDUAl_STEP_NAMES.PHONE_INFO)) return [3, 2];
|
|
102
102
|
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PHONE_INFO_STEP'));
|
|
103
|
-
return [3,
|
|
103
|
+
return [3, 15];
|
|
104
104
|
case 2:
|
|
105
|
-
if (!(data.step_name !== INDIVIDUAl_STEP_NAMES.PHONE_AUTH)) return [3,
|
|
105
|
+
if (!(data.step_name !== INDIVIDUAl_STEP_NAMES.PHONE_AUTH)) return [3, 14];
|
|
106
106
|
board_id = data === null || data === void 0 ? void 0 : data.id;
|
|
107
107
|
board_info_id = data === null || data === void 0 ? void 0 : data.board_info_id;
|
|
108
108
|
if (!(board_id && board_info_id)) return [3, 5];
|
|
109
109
|
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
110
110
|
case 3:
|
|
111
|
-
boardInfoData =
|
|
111
|
+
boardInfoData = _k.sent();
|
|
112
112
|
notification = (boardInfoData || {}).notification;
|
|
113
113
|
_b = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _b.id, type = _b.type;
|
|
114
114
|
if (!(id && type)) return [3, 5];
|
|
115
115
|
return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
|
|
116
116
|
case 4:
|
|
117
|
-
data_1 = (
|
|
117
|
+
data_1 = (_k.sent()).data;
|
|
118
118
|
individualData = data_1 || {};
|
|
119
|
-
|
|
119
|
+
_k.label = 5;
|
|
120
120
|
case 5:
|
|
121
|
-
if (!board_id) return [3,
|
|
121
|
+
if (!board_id) return [3, 7];
|
|
122
122
|
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
123
123
|
case 6:
|
|
124
|
-
boardData =
|
|
125
|
-
|
|
124
|
+
boardData = _k.sent();
|
|
125
|
+
_k.label = 7;
|
|
126
126
|
case 7:
|
|
127
|
-
boardInfoStatus = _l.sent();
|
|
128
|
-
_l.label = 8;
|
|
129
|
-
case 8:
|
|
130
127
|
if (!countryCode) {
|
|
131
128
|
countryCode = (_d = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _d === void 0 ? void 0 : _d.country;
|
|
132
129
|
if (countryCode)
|
|
133
130
|
thunkApi.dispatch(handleSetCountryByIso2(countryCode));
|
|
134
131
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
132
|
+
if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 10];
|
|
133
|
+
if (!((_e = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _e === void 0 ? void 0 : _e.id)) return [3, 9];
|
|
134
|
+
return [4, thunkApi.dispatch(getIndividualList((_f = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _f === void 0 ? void 0 : _f.id))];
|
|
135
|
+
case 8:
|
|
136
|
+
_k.sent();
|
|
137
|
+
_k.label = 9;
|
|
140
138
|
case 9:
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
return [4, thunkApi.dispatch(getIndividualList((_g = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _g === void 0 ? void 0 : _g.id))];
|
|
139
|
+
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
|
|
140
|
+
return [3, 13];
|
|
144
141
|
case 10:
|
|
145
|
-
|
|
146
|
-
|
|
142
|
+
birthCountry = ((_g = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _g === void 0 ? void 0 : _g.country) || countryCode;
|
|
143
|
+
if (!birthCountry) return [3, 12];
|
|
144
|
+
return [4, thunkApi.dispatch(getCityList(birthCountry))];
|
|
147
145
|
case 11:
|
|
148
|
-
|
|
149
|
-
|
|
146
|
+
_k.sent();
|
|
147
|
+
_k.label = 12;
|
|
150
148
|
case 12:
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
case 13:
|
|
155
|
-
_l.sent();
|
|
156
|
-
_l.label = 14;
|
|
149
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
|
|
150
|
+
_k.label = 13;
|
|
151
|
+
case 13: return [3, 15];
|
|
157
152
|
case 14:
|
|
158
|
-
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP'));
|
|
159
|
-
_l.label = 15;
|
|
160
|
-
case 15: return [3, 17];
|
|
161
|
-
case 16:
|
|
162
153
|
if (isUpdatePhoneInfo) {
|
|
163
154
|
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_VERIFY_STEP'));
|
|
164
155
|
}
|
|
165
|
-
|
|
166
|
-
case
|
|
156
|
+
_k.label = 15;
|
|
157
|
+
case 15: return [2, {
|
|
167
158
|
data: data,
|
|
168
159
|
boardResponse: {
|
|
169
160
|
brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
|
|
@@ -171,14 +162,13 @@ export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a
|
|
|
171
162
|
entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
|
|
172
163
|
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
173
164
|
merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
|
|
174
|
-
name: (
|
|
175
|
-
contact: (
|
|
165
|
+
name: (_h = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _h === void 0 ? void 0 : _h.names,
|
|
166
|
+
contact: (_j = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _j === void 0 ? void 0 : _j.contact,
|
|
176
167
|
individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
|
|
177
168
|
countries: countries,
|
|
178
169
|
countryCode: countryCode,
|
|
179
170
|
notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
|
|
180
|
-
business: boardData === null || boardData === void 0 ? void 0 : boardData.business
|
|
181
|
-
flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
|
|
171
|
+
business: boardData === null || boardData === void 0 ? void 0 : boardData.business
|
|
182
172
|
},
|
|
183
173
|
token: token
|
|
184
174
|
}];
|
|
@@ -411,10 +401,10 @@ export var retrieveBoardDetails = createAsyncThunk('retrieveIndividualBoardDetai
|
|
|
411
401
|
});
|
|
412
402
|
}); });
|
|
413
403
|
export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
414
|
-
var _a, individual, settings, responseBody, _b, board_id, board_info_id, countries, payload, data, boardInfoData, individualData, boardData,
|
|
415
|
-
var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
|
416
|
-
return __generator(this, function (
|
|
417
|
-
switch (
|
|
404
|
+
var _a, individual, settings, responseBody, _b, board_id, board_info_id, countries, payload, data, boardInfoData, individualData, boardData, countryCode, notification, _c, id, type, data_3, birthCountry;
|
|
405
|
+
var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
406
|
+
return __generator(this, function (_p) {
|
|
407
|
+
switch (_p.label) {
|
|
418
408
|
case 0:
|
|
419
409
|
_a = thunkApi.getState(), individual = _a.individual, settings = _a.settings;
|
|
420
410
|
responseBody = individual.data.verify.responseBody;
|
|
@@ -429,62 +419,53 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
|
|
|
429
419
|
};
|
|
430
420
|
return [4, API.leadService.verifyLeadOTP(payload)];
|
|
431
421
|
case 1:
|
|
432
|
-
data = (
|
|
433
|
-
|
|
422
|
+
data = (_p.sent()).data;
|
|
423
|
+
boardData = undefined;
|
|
434
424
|
if ((_e = data.errors) === null || _e === void 0 ? void 0 : _e.length)
|
|
435
425
|
throw new Error(data.errors[0].description);
|
|
436
|
-
if (!board_id) return [3,
|
|
426
|
+
if (!board_id) return [3, 3];
|
|
437
427
|
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
438
428
|
case 2:
|
|
439
|
-
boardData =
|
|
440
|
-
|
|
429
|
+
boardData = _p.sent();
|
|
430
|
+
_p.label = 3;
|
|
441
431
|
case 3:
|
|
442
|
-
boardInfoStatus = _q.sent();
|
|
443
|
-
_q.label = 4;
|
|
444
|
-
case 4:
|
|
445
432
|
countryCode = (_f = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _f === void 0 ? void 0 : _f.country;
|
|
446
|
-
if (!(board_id && board_info_id)) return [3,
|
|
433
|
+
if (!(board_id && board_info_id)) return [3, 6];
|
|
447
434
|
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
448
|
-
case
|
|
449
|
-
boardInfoData =
|
|
435
|
+
case 4:
|
|
436
|
+
boardInfoData = _p.sent();
|
|
450
437
|
notification = (boardInfoData || {}).notification;
|
|
451
438
|
_c = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _c.id, type = _c.type;
|
|
452
|
-
if (!(id && type)) return [3,
|
|
439
|
+
if (!(id && type)) return [3, 6];
|
|
453
440
|
return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
|
|
454
|
-
case
|
|
455
|
-
data_3 = (
|
|
441
|
+
case 5:
|
|
442
|
+
data_3 = (_p.sent()).data;
|
|
456
443
|
individualData = data_3 || {};
|
|
457
|
-
|
|
458
|
-
case
|
|
444
|
+
_p.label = 6;
|
|
445
|
+
case 6:
|
|
459
446
|
if (countryCode)
|
|
460
447
|
thunkApi.dispatch(handleSetCountryByIso2(countryCode));
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
448
|
+
if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 9];
|
|
449
|
+
if (!((_g = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _g === void 0 ? void 0 : _g.id)) return [3, 8];
|
|
450
|
+
return [4, thunkApi.dispatch(getIndividualList((_h = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _h === void 0 ? void 0 : _h.id))];
|
|
451
|
+
case 7:
|
|
452
|
+
_p.sent();
|
|
453
|
+
_p.label = 8;
|
|
466
454
|
case 8:
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
return [4, thunkApi.dispatch(getIndividualList((_j = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _j === void 0 ? void 0 : _j.id))];
|
|
455
|
+
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
|
|
456
|
+
return [3, 12];
|
|
470
457
|
case 9:
|
|
471
|
-
|
|
472
|
-
|
|
458
|
+
birthCountry = ((_j = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _j === void 0 ? void 0 : _j.country) || countryCode;
|
|
459
|
+
if (!birthCountry) return [3, 11];
|
|
460
|
+
return [4, thunkApi.dispatch(getCityList(birthCountry))];
|
|
473
461
|
case 10:
|
|
474
|
-
|
|
475
|
-
|
|
462
|
+
_p.sent();
|
|
463
|
+
_p.label = 11;
|
|
476
464
|
case 11:
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
return [4, thunkApi.dispatch(getCityList(birthCountry))];
|
|
465
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
|
|
466
|
+
_p.label = 12;
|
|
480
467
|
case 12:
|
|
481
|
-
|
|
482
|
-
_q.label = 13;
|
|
483
|
-
case 13:
|
|
484
|
-
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP'));
|
|
485
|
-
_q.label = 14;
|
|
486
|
-
case 14:
|
|
487
|
-
(_m = (_l = settings.data.appConfig).onStepCompleted) === null || _m === void 0 ? void 0 : _m.call(_l, settings.data.activeScreen.name, { otp: params.otp });
|
|
468
|
+
(_l = (_k = settings.data.appConfig).onStepCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, settings.data.activeScreen.name, { otp: params.otp });
|
|
488
469
|
return [2, {
|
|
489
470
|
data: data,
|
|
490
471
|
boardResponse: {
|
|
@@ -493,14 +474,13 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
|
|
|
493
474
|
entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
|
|
494
475
|
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
495
476
|
merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
|
|
496
|
-
name: (
|
|
497
|
-
contact: (
|
|
477
|
+
name: (_m = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _m === void 0 ? void 0 : _m.names,
|
|
478
|
+
contact: (_o = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _o === void 0 ? void 0 : _o.contact,
|
|
498
479
|
individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
|
|
499
480
|
countries: countries,
|
|
500
481
|
countryCode: countryCode,
|
|
501
482
|
notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
|
|
502
|
-
business: boardData === null || boardData === void 0 ? void 0 : boardData.business
|
|
503
|
-
flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
|
|
483
|
+
business: boardData === null || boardData === void 0 ? void 0 : boardData.business
|
|
504
484
|
},
|
|
505
485
|
formData: __assign({}, params)
|
|
506
486
|
}];
|
|
@@ -538,10 +518,10 @@ export var updatePhoneInfo = createAsyncThunk('individual/updatePhoneInfo', func
|
|
|
538
518
|
});
|
|
539
519
|
}); });
|
|
540
520
|
export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateIndividualPersonalInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
541
|
-
var _a, settings, individual, _b, notification, user, entity, _c, id, type, name, email, mobile, countryCode, gender, nid, issuedCountry, expiryDate, dob, placeOfBirthCountry, placeOfBirthCity, nationality, code, data_status, userName, identification_id_type,
|
|
542
|
-
var _d, _e, _f, _g;
|
|
543
|
-
return __generator(this, function (
|
|
544
|
-
switch (
|
|
521
|
+
var _a, settings, individual, _b, notification, user, entity, _c, 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;
|
|
522
|
+
var _d, _e, _f, _g, _h, _j;
|
|
523
|
+
return __generator(this, function (_k) {
|
|
524
|
+
switch (_k.label) {
|
|
545
525
|
case 0:
|
|
546
526
|
_a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
|
|
547
527
|
_b = individual.data.verify.responseBody || {}, notification = _b.notification, user = _b.user, entity = _b.entity;
|
|
@@ -551,57 +531,52 @@ export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateInd
|
|
|
551
531
|
data_status = (user || {}).data_status;
|
|
552
532
|
userName = getUserNameObject(name);
|
|
553
533
|
identification_id_type = nid && (nid === null || nid === void 0 ? void 0 : nid.startsWith('1')) ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA;
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
534
|
+
isNameNonEditable = hasNoneEditableValue(data_status, 'name');
|
|
535
|
+
isEmailNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.contact, 'email');
|
|
536
|
+
isMobileNumberNonEditable = hasNoneEditableValue((_d = data_status === null || data_status === void 0 ? void 0 : data_status.contact) === null || _d === void 0 ? void 0 : _d.phone, 'number');
|
|
537
|
+
isMobileCountryNonEditable = hasNoneEditableValue((_e = data_status === null || data_status === void 0 ? void 0 : data_status.contact) === null || _e === void 0 ? void 0 : _e.phone, 'country_code');
|
|
538
|
+
isNidNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.identification, 'id');
|
|
539
|
+
isIssuedCountryNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.identification, 'issuer_country');
|
|
540
|
+
isExpiryNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.identification, 'expiry');
|
|
541
|
+
isIdTypeNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.identification, 'type');
|
|
542
|
+
isNationalityNonEditable = hasNoneEditableValue(data_status, 'nationality');
|
|
543
|
+
isDOBNonEditable = hasNoneEditableValue(data_status, 'birth.date');
|
|
544
|
+
isBirthCityNonEditable = hasNoneEditableValue(data_status, 'birth.city');
|
|
545
|
+
isBirthCountryNonEditable = hasNoneEditableValue(data_status, 'birth.country');
|
|
563
546
|
hasContact = email || mobile || countryCode;
|
|
564
547
|
hasPhone = mobile && (countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix);
|
|
565
548
|
hasIdentification = nid || issuedCountry || identification_id_type || expiryDate;
|
|
566
549
|
hasBirth = placeOfBirthCity || placeOfBirthCountry;
|
|
567
|
-
|
|
568
|
-
? {
|
|
550
|
+
contact = hasContact && !(isEmailNonEditable && isMobileCountryNonEditable && isMobileNumberNonEditable)
|
|
551
|
+
? __assign({ email: isEmailNonEditable ? undefined : email }, (!((isMobileCountryNonEditable && isMobileNumberNonEditable) || !hasPhone) && {
|
|
552
|
+
phone: {
|
|
553
|
+
country_code: isMobileCountryNonEditable ? undefined : (_f = countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix) === null || _f === void 0 ? void 0 : _f.toString(),
|
|
554
|
+
number: isMobileNumberNonEditable || !mobile ? undefined : mobile
|
|
555
|
+
}
|
|
556
|
+
})) : undefined;
|
|
557
|
+
requestBody = __assign(__assign(__assign(__assign(__assign(__assign(__assign({ id: id, type: type, gender: gender || undefined }, (!(isNameNonEditable || !userName.first) && {
|
|
558
|
+
names: {
|
|
569
559
|
en: userName,
|
|
570
560
|
ar: userName
|
|
571
561
|
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
number: isMobileNumberEditable ? mobile : undefined
|
|
580
|
-
}
|
|
581
|
-
: undefined
|
|
562
|
+
})), { contact: contact }), (hasIdentification &&
|
|
563
|
+
!(isNidNonEditable && isIssuedCountryNonEditable && isExpiryNonEditable && isIdTypeNonEditable) && {
|
|
564
|
+
identification: {
|
|
565
|
+
id: isNidNonEditable || !nid ? undefined : nid,
|
|
566
|
+
issued_country_code: isIssuedCountryNonEditable ? undefined : issuedCountry === null || issuedCountry === void 0 ? void 0 : issuedCountry.iso2,
|
|
567
|
+
expiry: isExpiryNonEditable || !expiryDate ? undefined : new Date(expiryDate).getTime(),
|
|
568
|
+
type: isIdTypeNonEditable || !identification_id_type ? undefined : identification_id_type
|
|
582
569
|
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
issued_country_code: isIssuedCountryEditable ? issuedCountry === null || issuedCountry === void 0 ? void 0 : issuedCountry.iso2 : undefined,
|
|
594
|
-
expiry: isExpiryEditable ? new Date(expiryDate).getTime() : undefined,
|
|
595
|
-
type: isIdTypeEditable ? identification_id_type : undefined
|
|
596
|
-
}
|
|
597
|
-
: undefined,
|
|
598
|
-
date_of_birth: dob,
|
|
599
|
-
birth: hasBirth && {
|
|
600
|
-
city: (_e = placeOfBirthCity === null || placeOfBirthCity === void 0 ? void 0 : placeOfBirthCity.name) === null || _e === void 0 ? void 0 : _e.en,
|
|
601
|
-
country: placeOfBirthCountry === null || placeOfBirthCountry === void 0 ? void 0 : placeOfBirthCountry.iso2
|
|
602
|
-
},
|
|
603
|
-
nationality: isNationalityEditable ? nationality === null || nationality === void 0 ? void 0 : nationality.iso2 : undefined,
|
|
604
|
-
encryption_contract: [
|
|
570
|
+
})), (!isDOBNonEditable && {
|
|
571
|
+
date_of_birth: dob
|
|
572
|
+
})), (!((isBirthCityNonEditable && isBirthCountryNonEditable) || !hasBirth) && {
|
|
573
|
+
birth: {
|
|
574
|
+
city: isBirthCityNonEditable ? undefined : (_g = placeOfBirthCity === null || placeOfBirthCity === void 0 ? void 0 : placeOfBirthCity.name) === null || _g === void 0 ? void 0 : _g.en,
|
|
575
|
+
country: isBirthCountryNonEditable ? undefined : placeOfBirthCountry === null || placeOfBirthCountry === void 0 ? void 0 : placeOfBirthCountry.iso2
|
|
576
|
+
}
|
|
577
|
+
})), (!isNationalityNonEditable && {
|
|
578
|
+
nationality: nationality === null || nationality === void 0 ? void 0 : nationality.iso2
|
|
579
|
+
})), { encryption_contract: [
|
|
605
580
|
'gender',
|
|
606
581
|
'contact.email',
|
|
607
582
|
'contact.phone.country_code',
|
|
@@ -614,26 +589,24 @@ export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateInd
|
|
|
614
589
|
'birth.country',
|
|
615
590
|
'date_of_birth',
|
|
616
591
|
'nationality'
|
|
617
|
-
],
|
|
618
|
-
step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_PERSONAL_INFO
|
|
619
|
-
};
|
|
592
|
+
], step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_PERSONAL_INFO });
|
|
620
593
|
return [4, API.individualService.updateIndividual(requestBody)];
|
|
621
594
|
case 1:
|
|
622
|
-
data =
|
|
595
|
+
data = _k.sent();
|
|
623
596
|
if (!(type === IndividualType.USER || type === IndividualType.BUYER)) return [3, 3];
|
|
624
597
|
return [4, thunkApi.dispatch(retrieveDataList(code))];
|
|
625
598
|
case 2:
|
|
626
|
-
|
|
627
|
-
|
|
599
|
+
_k.sent();
|
|
600
|
+
_k.label = 3;
|
|
628
601
|
case 3:
|
|
629
|
-
thunkApi.dispatch(handleNextScreenStep());
|
|
630
|
-
(
|
|
602
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
603
|
+
(_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, requestBody);
|
|
631
604
|
return [2, { data: data, formData: params }];
|
|
632
605
|
}
|
|
633
606
|
});
|
|
634
607
|
}); });
|
|
635
608
|
export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
636
|
-
var _a, settings, individual, _b, notification, user, _c, id, type,
|
|
609
|
+
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;
|
|
637
610
|
var _d, _e;
|
|
638
611
|
return __generator(this, function (_f) {
|
|
639
612
|
switch (_f.label) {
|
|
@@ -641,60 +614,18 @@ export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', funct
|
|
|
641
614
|
_a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
|
|
642
615
|
_b = individual.data.verify.responseBody || {}, notification = _b.notification, user = _b.user;
|
|
643
616
|
_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;
|
|
644
|
-
civilID = params.civilID, signatureFileId = params.signatureFileId;
|
|
645
|
-
businessCountry = settings.data.businessCountry;
|
|
646
|
-
hasCivilIdDocument = (civilID || []).length > 0;
|
|
647
|
-
hasSignatureDocument = (signatureFileId || []).length > 0;
|
|
648
|
-
isSendSignatureFile = (user === null || user === void 0 ? void 0 : user.is_authorized) && (type === IndividualType.USER || type === IndividualType.BUYER);
|
|
649
|
-
civilIdDocument = getRecentDocumentBasedOnPurpose(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.IDENTITY_DOCUMENT);
|
|
650
|
-
signatureDocument = getRecentDocumentBasedOnPurpose(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.CUSTOMER_SIGNATURE);
|
|
651
|
-
if (!((civilIdDocument === null || civilIdDocument === void 0 ? void 0 : civilIdDocument.id) && hasCivilIdDocument)) return [3, 2];
|
|
652
|
-
documentBody = {
|
|
653
|
-
id: civilIdDocument.id,
|
|
654
|
-
images: civilID
|
|
655
|
-
};
|
|
656
|
-
return [4, API.documentService.addFilesToExistingDocument(documentBody)];
|
|
657
|
-
case 1:
|
|
658
|
-
_f.sent();
|
|
659
|
-
_f.label = 2;
|
|
660
|
-
case 2:
|
|
661
|
-
if (!((signatureDocument === null || signatureDocument === void 0 ? void 0 : signatureDocument.id) && hasSignatureDocument && isSendSignatureFile)) return [3, 4];
|
|
662
|
-
documentBody = {
|
|
663
|
-
id: signatureDocument.id,
|
|
664
|
-
images: signatureFileId
|
|
665
|
-
};
|
|
666
|
-
return [4, API.documentService.addFilesToExistingDocument(documentBody)];
|
|
667
|
-
case 3:
|
|
668
|
-
_f.sent();
|
|
669
|
-
_f.label = 4;
|
|
670
|
-
case 4:
|
|
671
|
-
documentsList = [];
|
|
672
|
-
if (hasCivilIdDocument && !(civilIdDocument === null || civilIdDocument === void 0 ? void 0 : civilIdDocument.id))
|
|
673
|
-
documentsList.push({ type: 'Civil ID File', images: civilID });
|
|
674
|
-
if (isSendSignatureFile && hasSignatureDocument && !(signatureDocument === null || signatureDocument === void 0 ? void 0 : signatureDocument.id))
|
|
675
|
-
documentsList.push({ type: 'Signature File', images: signatureFileId });
|
|
676
|
-
if (!(documentsList.length > 0)) return [3, 6];
|
|
677
|
-
documentBody = {
|
|
678
|
-
individual_type_id: id || '',
|
|
679
|
-
country: businessCountry.iso2,
|
|
680
|
-
documents: documentsList
|
|
681
|
-
};
|
|
682
|
-
return [4, API.documentService.updateDocumentInfo(documentBody)];
|
|
683
|
-
case 5:
|
|
684
|
-
_f.sent();
|
|
685
|
-
_f.label = 6;
|
|
686
|
-
case 6:
|
|
687
617
|
occupation = params.occupation, sourceIncome = params.sourceIncome, monthlyIncome = params.monthlyIncome, isPEP = params.isPEP, isInfluencer = params.isInfluencer, shareCount = params.shareCount, shareValue = params.shareValue;
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
618
|
+
isOccupationNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'occupation');
|
|
619
|
+
isSourceIncomeNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'source_of_income');
|
|
620
|
+
isPEPNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'is_relative_PEP');
|
|
621
|
+
isInfluencerNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'is_influencer');
|
|
622
|
+
isMonthlyIncomeNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'monthly_income');
|
|
692
623
|
isSharesAvailable = shareCount || shareValue;
|
|
693
|
-
pepInfo =
|
|
694
|
-
influencerInfo =
|
|
695
|
-
occupationInfo =
|
|
696
|
-
sourceIncomeInfo =
|
|
697
|
-
monthlyIncomeInfo = (monthlyIncome === null || monthlyIncome === void 0 ? void 0 : monthlyIncome.id)
|
|
624
|
+
pepInfo = isPEPNonEditable ? undefined : isPEP;
|
|
625
|
+
influencerInfo = isInfluencerNonEditable ? undefined : isInfluencer;
|
|
626
|
+
occupationInfo = isOccupationNonEditable || !(occupation === null || occupation === void 0 ? void 0 : occupation.id) ? undefined : { id: occupation.id };
|
|
627
|
+
sourceIncomeInfo = isSourceIncomeNonEditable || !(sourceIncome === null || sourceIncome === void 0 ? void 0 : sourceIncome.id) ? undefined : [{ id: sourceIncome.id }];
|
|
628
|
+
monthlyIncomeInfo = isMonthlyIncomeNonEditable || !(monthlyIncome === null || monthlyIncome === void 0 ? void 0 : monthlyIncome.id) ? undefined : { id: monthlyIncome.id };
|
|
698
629
|
userPayload = {
|
|
699
630
|
occupation: occupationInfo,
|
|
700
631
|
source_income: sourceIncomeInfo,
|
|
@@ -730,8 +661,51 @@ export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', funct
|
|
|
730
661
|
payload = {};
|
|
731
662
|
requestBody = __assign(__assign({ id: id, type: type }, payload), { encryption_contract: [], step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO });
|
|
732
663
|
return [4, API.individualService.updateIndividual(requestBody)];
|
|
664
|
+
case 1:
|
|
665
|
+
data = _f.sent();
|
|
666
|
+
civilID = params.civilID, signatureFileId = params.signatureFileId;
|
|
667
|
+
businessCountry = settings.data.businessCountry;
|
|
668
|
+
hasCivilIdDocument = (civilID || []).length > 0;
|
|
669
|
+
hasSignatureDocument = (signatureFileId || []).length > 0;
|
|
670
|
+
isSendSignatureFile = (user === null || user === void 0 ? void 0 : user.is_authorized) && (type === IndividualType.USER || type === IndividualType.BUYER);
|
|
671
|
+
civilIdDocument = getRecentDocumentBasedOnPurpose(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.IDENTITY_DOCUMENT);
|
|
672
|
+
signatureDocument = getRecentDocumentBasedOnPurpose(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.CUSTOMER_SIGNATURE);
|
|
673
|
+
if (!((civilIdDocument === null || civilIdDocument === void 0 ? void 0 : civilIdDocument.id) && hasCivilIdDocument)) return [3, 3];
|
|
674
|
+
documentBody = {
|
|
675
|
+
id: civilIdDocument.id,
|
|
676
|
+
images: civilID
|
|
677
|
+
};
|
|
678
|
+
return [4, API.documentService.addFilesToExistingDocument(documentBody)];
|
|
679
|
+
case 2:
|
|
680
|
+
_f.sent();
|
|
681
|
+
_f.label = 3;
|
|
682
|
+
case 3:
|
|
683
|
+
if (!((signatureDocument === null || signatureDocument === void 0 ? void 0 : signatureDocument.id) && hasSignatureDocument && isSendSignatureFile)) return [3, 5];
|
|
684
|
+
documentBody = {
|
|
685
|
+
id: signatureDocument.id,
|
|
686
|
+
images: signatureFileId
|
|
687
|
+
};
|
|
688
|
+
return [4, API.documentService.addFilesToExistingDocument(documentBody)];
|
|
689
|
+
case 4:
|
|
690
|
+
_f.sent();
|
|
691
|
+
_f.label = 5;
|
|
692
|
+
case 5:
|
|
693
|
+
documentsList = [];
|
|
694
|
+
if (hasCivilIdDocument && !(civilIdDocument === null || civilIdDocument === void 0 ? void 0 : civilIdDocument.id))
|
|
695
|
+
documentsList.push({ type: DocumentPurpose.IDENTITY_DOCUMENT, images: civilID });
|
|
696
|
+
if (isSendSignatureFile && hasSignatureDocument && !(signatureDocument === null || signatureDocument === void 0 ? void 0 : signatureDocument.id))
|
|
697
|
+
documentsList.push({ type: DocumentPurpose.CUSTOMER_SIGNATURE, images: signatureFileId });
|
|
698
|
+
if (!(documentsList.length > 0)) return [3, 7];
|
|
699
|
+
documentBody = {
|
|
700
|
+
individual_type_id: id || '',
|
|
701
|
+
country: businessCountry.iso2,
|
|
702
|
+
documents: documentsList
|
|
703
|
+
};
|
|
704
|
+
return [4, API.documentService.updateDocumentInfo(documentBody)];
|
|
705
|
+
case 6:
|
|
706
|
+
_f.sent();
|
|
707
|
+
_f.label = 7;
|
|
733
708
|
case 7:
|
|
734
|
-
data = (_f.sent()).data;
|
|
735
709
|
thunkApi.dispatch(handleNextScreenStep());
|
|
736
710
|
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, requestBody);
|
|
737
711
|
return [2, { data: data, formData: params }];
|