@tap-payments/auth-jsconnect 2.1.100-test → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/@types/app.d.ts +298 -7
- package/build/@types/app.js +12 -0
- package/build/@types/form.d.ts +29 -26
- package/build/@types/redux.d.ts +4 -0
- package/build/@types/theme.d.ts +1 -1
- package/build/@types/user.d.ts +39 -3
- 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/brand.d.ts +7 -0
- package/build/api/brand.js +10 -1
- package/build/api/country.d.ts +1 -1
- package/build/api/data.d.ts +18 -10
- package/build/api/data.js +34 -2
- package/build/api/document.d.ts +25 -0
- package/build/api/document.js +38 -0
- package/build/api/entity.d.ts +24 -24
- package/build/api/entity.js +22 -5
- package/build/api/file.d.ts +2 -1
- package/build/api/file.js +14 -1
- package/build/api/index.d.ts +36 -6
- package/build/api/index.js +5 -1
- package/build/api/individual.d.ts +32 -14
- package/build/api/individual.js +9 -1
- package/build/api/init.d.ts +16 -0
- package/build/api/init.js +13 -0
- package/build/api/lead.d.ts +18 -11
- package/build/api/lead.js +9 -1
- 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 +19 -9
- package/build/app/settings.js +69 -24
- package/build/app/store.d.ts +4 -4
- package/build/assets/locales/ar.json +27 -1
- package/build/assets/locales/en.json +27 -1
- package/build/components/AnimationFlow/AnimationFlow.d.ts +4 -2
- package/build/components/AnimationFlow/AnimationFlow.js +4 -4
- package/build/components/AnimationFlow/BottomSheet.d.ts +4 -1
- package/build/components/AnimationFlow/BottomSheet.js +43 -19
- package/build/components/AnimationFlow/Dialog.d.ts +4 -2
- package/build/components/AnimationFlow/Dialog.js +30 -7
- package/build/components/DatePicker/DatePicker.d.ts +3 -1
- package/build/components/DatePicker/DatePicker.js +20 -15
- package/build/components/LogoBadge/LogoBadge.js +3 -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/SimpleList/SimpleList.d.ts +5 -2
- package/build/components/SimpleList/SimpleList.js +31 -11
- package/build/components/Slide/Slide.d.ts +1 -1
- package/build/constants/api.d.ts +7 -0
- package/build/constants/api.js +14 -1
- package/build/constants/app.d.ts +45 -0
- package/build/constants/app.js +101 -52
- package/build/constants/assets.d.ts +7 -0
- package/build/constants/assets.js +7 -0
- package/build/constants/validation.d.ts +1 -0
- package/build/constants/validation.js +1 -0
- package/build/features/app/bank/bankStore.d.ts +88 -12
- package/build/features/app/bank/bankStore.js +153 -107
- package/build/features/app/brand/brandStore.d.ts +158 -21
- package/build/features/app/brand/brandStore.js +401 -221
- package/build/features/app/business/businessStore.d.ts +176 -29
- package/build/features/app/business/businessStore.js +343 -282
- package/build/features/app/connect/connectStore.d.ts +150 -14
- package/build/features/app/connect/connectStore.js +185 -67
- package/build/features/app/connectExpress/connectExpressStore.d.ts +223 -20
- package/build/features/app/connectExpress/connectExpressStore.js +234 -101
- package/build/features/app/entity/entityStore.d.ts +93 -23
- package/build/features/app/entity/entityStore.js +273 -237
- package/build/features/app/individual/individualStore.d.ts +192 -27
- package/build/features/app/individual/individualStore.js +504 -380
- package/build/features/app/password/passwordStore.d.ts +106 -12
- package/build/features/app/password/passwordStore.js +84 -36
- package/build/features/app/signIn/signInStore.d.ts +61 -7
- package/build/features/app/signIn/signInStore.js +1 -1
- package/build/features/app/tax/taxStore.d.ts +76 -9
- package/build/features/app/tax/taxStore.js +136 -89
- package/build/features/bank/Bank.js +10 -6
- package/build/features/bank/screens/BankDetails/BankDetails.js +43 -17
- package/build/features/bank/screens/BankDetails/BankName.d.ts +5 -1
- package/build/features/bank/screens/BankDetails/BankName.js +9 -9
- package/build/features/bank/screens/BankDetails/BankStatement.d.ts +6 -2
- package/build/features/bank/screens/BankDetails/BankStatement.js +7 -10
- package/build/features/bank/screens/BankDetails/Beneficiary.d.ts +3 -1
- package/build/features/bank/screens/BankDetails/Beneficiary.js +6 -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 +3 -1
- package/build/features/bank/screens/BankDetails/IBAN.js +4 -6
- package/build/features/bank/screens/BankDetails/validation.d.ts +8 -8
- package/build/features/bank/screens/BankDetails/validation.js +6 -17
- package/build/features/bank/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -4
- package/build/features/bank/screens/Verify/OTPInput.js +5 -3
- package/build/features/bank/screens/Verify/Verify.js +1 -5
- package/build/features/brand/Brand.js +10 -6
- package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +13 -30
- package/build/features/brand/screens/BrandActivities/ActivitiesList.js +50 -34
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +41 -9
- package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +14 -41
- package/build/features/brand/screens/BrandActivities/CustomerBase.js +21 -32
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.d.ts +3 -1
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +22 -19
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.d.ts +3 -1
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +28 -19
- package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +15 -8
- package/build/features/brand/screens/BrandActivities/RefundPolicy.js +23 -12
- package/build/features/brand/screens/BrandActivities/TAC.d.ts +14 -2
- 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 +40 -33
- package/build/features/brand/screens/BrandInfo/BrandLogo.d.ts +9 -0
- package/build/features/brand/screens/BrandInfo/BrandLogo.js +41 -0
- package/build/features/brand/screens/BrandInfo/BrandName.d.ts +3 -2
- package/build/features/brand/screens/BrandInfo/BrandName.js +5 -8
- package/build/features/brand/screens/BrandInfo/SalesChannels.d.ts +2 -1
- package/build/features/brand/screens/BrandInfo/SalesChannels.js +20 -26
- package/build/features/brand/screens/BrandInfo/validation.d.ts +7 -13
- package/build/features/brand/screens/BrandInfo/validation.js +37 -47
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.d.ts +5 -0
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +102 -0
- package/build/features/brand/screens/BrandSegmentInfo/SegmentLocations.d.ts +10 -0
- package/build/features/brand/screens/BrandSegmentInfo/SegmentLocations.js +69 -0
- package/build/features/brand/screens/BrandSegmentInfo/SegmentProfits.d.ts +10 -0
- package/build/features/brand/screens/BrandSegmentInfo/SegmentProfits.js +69 -0
- package/build/features/brand/screens/BrandSegmentInfo/SegmentTechs.d.ts +10 -0
- package/build/features/brand/screens/BrandSegmentInfo/SegmentTechs.js +69 -0
- package/build/features/{connect/screens/Merchant → brand/screens/BrandSegmentInfo}/TeamSize.d.ts +3 -1
- package/build/features/brand/screens/{BrandInfo → BrandSegmentInfo}/TeamSize.js +20 -25
- package/build/features/brand/screens/BrandSegmentInfo/index.d.ts +2 -0
- package/build/features/brand/screens/BrandSegmentInfo/index.js +2 -0
- package/build/features/brand/screens/BrandSegmentInfo/validation.d.ts +17 -0
- package/build/features/brand/screens/BrandSegmentInfo/validation.js +9 -0
- package/build/features/brand/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -4
- package/build/features/brand/screens/Verify/OTPInput.js +5 -3
- package/build/features/brand/screens/Verify/Verify.js +7 -20
- package/build/features/business/Business.js +7 -5
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +17 -70
- package/build/features/business/screens/Activities/ActivitiesList.js +226 -98
- package/build/features/business/screens/Activities/OperationStartDate.d.ts +3 -3
- package/build/features/business/screens/Activities/OperationStartDate.js +2 -2
- package/build/features/business/screens/Activities/validation.d.ts +165 -30
- package/build/features/business/screens/Activities/validation.js +5 -2
- package/build/features/business/screens/BrandDetails/BrandDetails.d.ts +5 -0
- package/build/features/business/screens/BrandDetails/BrandDetails.js +39 -0
- package/build/features/business/screens/BrandDetails/BrandName.d.ts +5 -0
- package/build/features/business/screens/BrandDetails/BrandName.js +36 -0
- package/build/features/business/screens/BrandDetails/Header.d.ts +5 -0
- package/build/features/business/screens/BrandDetails/Header.js +49 -0
- package/build/features/business/screens/BrandDetails/LicenseInfo.d.ts +5 -0
- package/build/features/business/screens/BrandDetails/LicenseInfo.js +38 -0
- package/build/features/{brand/screens/BrandActivities/OperationStartDate.d.ts → business/screens/BrandDetails/SalesChannel.d.ts} +6 -8
- package/build/features/business/screens/BrandDetails/SalesChannel.js +48 -0
- package/build/features/business/screens/BrandDetails/index.d.ts +3 -0
- package/build/features/business/screens/BrandDetails/index.js +2 -0
- package/build/features/business/screens/BusinessType/Article.d.ts +4 -2
- package/build/features/business/screens/BusinessType/Article.js +19 -54
- package/build/features/business/screens/BusinessType/BusinessType.js +35 -11
- package/build/features/business/screens/BusinessType/EntityLicenseList.d.ts +9 -0
- package/build/features/business/screens/BusinessType/EntityLicenseList.js +129 -0
- package/build/features/business/screens/BusinessType/EntityName.js +6 -7
- package/build/features/business/screens/BusinessType/LicenseCertificate.js +2 -1
- package/build/features/business/screens/BusinessType/LicenseList.d.ts +1 -0
- package/build/features/business/screens/BusinessType/LicenseList.js +7 -22
- package/build/features/business/screens/BusinessType/LicenseNumber.d.ts +1 -2
- package/build/features/business/screens/BusinessType/LicenseNumber.js +4 -2
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +3 -3
- package/build/features/business/screens/CivilID/IDNumber.js +2 -3
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +47 -40
- package/build/features/business/screens/Customers/CustomerLocations.js +35 -19
- package/build/features/business/screens/Customers/Customers.js +27 -16
- package/build/features/business/screens/Customers/ExpectedCustomers.js +12 -4
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +14 -6
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +7 -7
- package/build/features/business/screens/Customers/RefundPolicy.js +15 -4
- package/build/features/business/screens/Customers/TransactionPolicy.js +19 -9
- package/build/features/business/screens/IDBOD/DOB.js +2 -2
- package/build/features/business/screens/IDBOD/ID.js +2 -3
- package/build/features/business/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
- package/build/features/business/screens/Verify/OTPInput.js +5 -3
- package/build/features/connect/Connect.js +28 -8
- package/build/features/connect/screens/BrandSegment/BrandSegment.d.ts +5 -0
- package/build/features/connect/screens/BrandSegment/BrandSegment.js +84 -0
- package/build/features/connect/screens/BrandSegment/SegmentLocations.d.ts +8 -0
- package/build/features/connect/screens/{Merchant/Segments.js → BrandSegment/SegmentLocations.js} +17 -25
- package/build/features/connect/screens/BrandSegment/SegmentProfits.d.ts +8 -0
- package/build/features/{brand/screens/BrandInfo/Segments.js → connect/screens/BrandSegment/SegmentProfits.js} +18 -26
- package/build/features/connect/screens/BrandSegment/SegmentTechs.d.ts +8 -0
- package/build/features/connect/screens/BrandSegment/SegmentTechs.js +66 -0
- package/build/features/connect/screens/{Merchant → BrandSegment}/TeamSize.js +12 -20
- package/build/features/connect/screens/BrandSegment/index.d.ts +3 -0
- package/build/features/connect/screens/BrandSegment/index.js +2 -0
- package/build/features/connect/screens/BrandSegment/validation.d.ts +17 -0
- package/build/features/connect/screens/BrandSegment/validation.js +9 -0
- package/build/features/connect/screens/CivilID/CivilID.js +5 -13
- package/build/features/connect/screens/CivilID/IDNumber.js +5 -6
- package/build/features/connect/screens/Individual/Email.js +18 -28
- package/build/features/connect/screens/Individual/Individual.js +8 -1
- package/build/features/connect/screens/Individual/MobileNumber.js +16 -15
- package/build/features/connect/screens/Individual/Name.js +11 -15
- package/build/features/connect/screens/Merchant/BrandList.js +4 -22
- package/build/features/connect/screens/Merchant/BrandName.js +5 -8
- package/build/features/connect/screens/Merchant/Merchant.js +13 -15
- package/build/features/connect/screens/Merchant/validation.d.ts +3 -6
- package/build/features/connect/screens/Merchant/validation.js +6 -9
- package/build/features/connect/screens/Mobile/Mobile.js +13 -16
- package/build/features/connect/screens/Mobile/MobileNumber.js +14 -10
- package/build/features/connect/screens/NID/DOB.js +1 -1
- package/build/features/connect/screens/NID/IDNumber.js +6 -7
- package/build/features/connect/screens/NID/NID.js +6 -0
- package/build/features/connect/screens/OTP/OTP.js +13 -15
- package/build/features/connect/screens/OTP/OTPInput.js +10 -0
- package/build/features/connect/screens/ThankYou/ThankYou.js +17 -2
- package/build/features/connectExpress/ConnectExpress.d.ts +1 -0
- package/build/features/connectExpress/ConnectExpress.js +78 -13
- package/build/features/connectExpress/screens/Brand/Brand.js +1 -1
- package/build/features/connectExpress/screens/CivilID/IDNumber.js +6 -7
- package/build/features/connectExpress/screens/CivilIDMissed/IDNumber.js +6 -7
- package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.d.ts +2 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.js +6 -8
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +7 -4
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.d.ts +2 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +9 -14
- 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 +5 -4
- 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 +11 -6
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.d.ts +2 -1
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +7 -15
- 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 +3 -4
- package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +2 -2
- package/build/features/connectExpress/screens/Mobile/Mobile.js +4 -3
- 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 +3 -4
- 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/connectExpress/screens/NIDMissed/DOB.js +1 -1
- package/build/features/connectExpress/screens/NIDMissed/IDNumber.js +2 -3
- package/build/features/connectExpress/screens/OTP/OTPInput.js +3 -3
- package/build/features/entity/Entity.js +10 -6
- package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +17 -70
- package/build/features/entity/screens/EntityCapital/ActivityList.js +219 -108
- package/build/features/entity/screens/EntityCapital/CapitalPaid.d.ts +3 -1
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +14 -16
- package/build/features/entity/screens/EntityCapital/CapitalShareCount.d.ts +3 -1
- package/build/features/entity/screens/EntityCapital/CapitalShareCount.js +10 -12
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.d.ts +3 -1
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +15 -17
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +31 -20
- package/build/features/entity/screens/EntityCapital/validation.d.ts +175 -40
- package/build/features/entity/screens/EntityCapital/validation.js +9 -12
- package/build/features/entity/screens/EntityName/Article.d.ts +6 -2
- package/build/features/entity/screens/EntityName/Article.js +20 -54
- package/build/features/entity/screens/EntityName/EntityName.js +60 -16
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +13 -30
- package/build/features/entity/screens/EntityName/EntityTypeList.js +28 -45
- package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +6 -4
- package/build/features/entity/screens/EntityName/ExpiryDate.js +6 -8
- package/build/features/entity/screens/EntityName/IssuingDate.d.ts +6 -4
- package/build/features/entity/screens/EntityName/IssuingDate.js +5 -8
- package/build/features/entity/screens/EntityName/LegalName.d.ts +3 -1
- package/build/features/entity/screens/EntityName/LegalName.js +10 -9
- package/build/features/entity/screens/EntityName/LicenseCertificate.d.ts +4 -1
- package/build/features/entity/screens/EntityName/LicenseCertificate.js +13 -7
- package/build/features/entity/screens/EntityName/LicenseNumber.d.ts +3 -1
- package/build/features/entity/screens/EntityName/LicenseNumber.js +13 -11
- package/build/features/entity/screens/EntityName/UnifiedNumber.d.ts +3 -1
- package/build/features/entity/screens/EntityName/UnifiedNumber.js +11 -10
- 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/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -4
- package/build/features/entity/screens/Verify/OTPInput.js +5 -3
- package/build/features/entity/screens/Verify/Verify.js +7 -20
- package/build/features/featuresScreens.js +13 -1
- package/build/features/individual/Individual.js +10 -6
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +3 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +54 -23
- package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.d.ts +7 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.js +29 -10
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.d.ts +3 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +18 -15
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +30 -42
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.d.ts +3 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +94 -56
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +5 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +18 -15
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.js +9 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +13 -7
- package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.d.ts +4 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.js +14 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +32 -43
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +8 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +7 -11
- package/build/features/individual/screens/IndividualList/CollectPhoneEmail.js +1 -1
- package/build/features/individual/screens/IndividualList/Email.js +1 -1
- package/build/features/individual/screens/IndividualList/IndividualList.d.ts +6 -6
- package/build/features/individual/screens/IndividualList/MobileNumber.js +0 -1
- package/build/features/individual/screens/IndividualList/UserList.js +15 -6
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.d.ts +2 -0
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.js +14 -20
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.d.ts +2 -0
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.js +8 -14
- package/build/features/individual/screens/IndividualPersonalInfo/DOB.d.ts +3 -1
- package/build/features/individual/screens/IndividualPersonalInfo/DOB.js +3 -3
- package/build/features/individual/screens/IndividualPersonalInfo/Email.d.ts +3 -1
- package/build/features/individual/screens/IndividualPersonalInfo/Email.js +4 -12
- package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.d.ts +3 -1
- package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.js +5 -8
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +6 -4
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.js +5 -2
- package/build/features/individual/screens/IndividualPersonalInfo/ID.d.ts +3 -1
- package/build/features/individual/screens/IndividualPersonalInfo/ID.js +4 -12
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +3 -3
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +79 -36
- package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.d.ts +2 -0
- package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.js +14 -26
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.d.ts +2 -0
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +18 -21
- package/build/features/individual/screens/IndividualPersonalInfo/Name.d.ts +3 -1
- package/build/features/individual/screens/IndividualPersonalInfo/Name.js +4 -12
- package/build/features/individual/screens/IndividualPersonalInfo/Nationality.d.ts +2 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Nationality.js +14 -26
- 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 +6 -3
- package/build/features/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
- package/build/features/individual/screens/Verify/OTPInput.js +5 -3
- package/build/features/individual/screens/Verify/Verify.js +1 -5
- package/build/features/password/Password.js +7 -5
- package/build/features/password/screens/CreatePassword/CreatePassword.js +9 -16
- package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
- package/build/features/password/screens/Verify/OTPInput.js +5 -3
- package/build/features/password/screens/Verify/Verify.js +7 -20
- package/build/features/shared/Address/CountryList.d.ts +10 -10
- package/build/features/shared/Address/CountryList.js +1 -1
- package/build/features/shared/Address/InputSelect.d.ts +10 -10
- package/build/features/shared/Address/InputSelect.js +2 -2
- package/build/features/shared/Button/Button.d.ts +3 -1
- package/build/features/shared/Button/Button.js +3 -3
- package/build/features/shared/Button/EmailProvidersButtons.d.ts +1 -1
- package/build/features/shared/Button/EmailProvidersButtons.js +9 -2
- package/build/features/shared/Button/FlowsButtons.d.ts +1 -1
- package/build/features/shared/Button/FlowsButtons.js +23 -21
- package/build/features/shared/Button/IndividualActionButtons.d.ts +21 -0
- package/build/features/shared/Button/IndividualActionButtons.js +156 -0
- package/build/features/shared/Button/index.d.ts +1 -1
- package/build/features/shared/Button/index.js +1 -1
- package/build/features/shared/CheckIcon/CheckIcon.d.ts +7 -1
- package/build/features/shared/CheckIcon/CheckIcon.js +7 -6
- package/build/features/shared/Chip/Chip.d.ts +3 -0
- package/build/features/shared/Chip/Chip.js +21 -0
- package/build/features/shared/Chip/index.d.ts +2 -0
- package/build/features/shared/Chip/index.js +2 -0
- package/build/features/shared/Containers/FeatureContainer.d.ts +4 -1
- package/build/features/shared/Containers/FeatureContainer.js +5 -4
- package/build/features/shared/Containers/ScreenContainer.d.ts +1 -1
- package/build/features/shared/Dot/Dot.d.ts +8 -0
- package/build/features/shared/Dot/Dot.js +29 -0
- package/build/features/shared/Dot/index.d.ts +2 -0
- package/build/features/shared/Dot/index.js +2 -0
- package/build/features/shared/EndAdornment/EndAdornment.d.ts +10 -0
- package/build/features/shared/EndAdornment/EndAdornment.js +17 -0
- package/build/features/shared/EndAdornment/EndAdornmentExpanded.d.ts +7 -0
- package/build/features/shared/EndAdornment/EndAdornmentExpanded.js +13 -0
- package/build/features/shared/EndAdornment/index.d.ts +3 -0
- package/build/features/shared/EndAdornment/index.js +3 -0
- package/build/features/shared/Footer/Footer.js +8 -0
- package/build/features/shared/Footer/PoweredByFooter.d.ts +9 -0
- package/build/features/shared/Footer/PoweredByFooter.js +36 -0
- package/build/features/shared/Footer/index.d.ts +3 -2
- package/build/features/shared/Footer/index.js +3 -2
- package/build/features/shared/GenericError/GenericError.js +1 -1
- package/build/features/shared/Input/Input.d.ts +6 -7
- package/build/features/shared/Input/Input.js +2 -3
- package/build/features/shared/Input/index.d.ts +2 -1
- package/build/features/shared/InputSelect/InputSelect.d.ts +4 -0
- package/build/features/shared/InputSelect/InputSelect.js +33 -0
- package/build/features/shared/InputSelect/index.d.ts +2 -0
- package/build/features/shared/InputSelect/index.js +2 -0
- 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 +3 -1
- package/build/features/shared/SalesChannels/SaleChannelIconsInput.js +8 -6
- package/build/features/shared/SalesChannels/SalesChannel.d.ts +3 -1
- package/build/features/shared/SalesChannels/SalesChannel.js +9 -4
- package/build/features/shared/Search/Search.d.ts +2 -1
- package/build/features/shared/Search/Search.js +2 -2
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +14 -5
- package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +3 -1
- package/build/features/shared/SuccessScreen/SuccessScreen.js +3 -2
- package/build/features/shared/UploadFile/FileUpload.d.ts +32 -0
- package/build/features/shared/UploadFile/FileUpload.js +267 -0
- 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 +36 -0
- package/build/features/shared/UploadFile/UploadWrapper.js +115 -0
- package/build/features/shared/UploadFile/index.d.ts +2 -1
- package/build/features/shared/UploadFile/index.js +2 -1
- package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +11 -20
- package/build/features/shared/UploadMultipleFile/UploadFile.js +119 -30
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +8 -4
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +28 -21
- package/build/features/signIn/SignIn.js +3 -4
- package/build/features/tax/Tax.js +10 -6
- package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -4
- 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 +23 -10
- package/build/features/tax/screens/TaxDetails/TaxDocument.d.ts +4 -1
- package/build/features/tax/screens/TaxDetails/TaxDocument.js +7 -5
- package/build/features/tax/screens/TaxDetails/VATId.d.ts +5 -1
- package/build/features/tax/screens/TaxDetails/VATId.js +5 -10
- 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/features/tax/screens/Verify/Verify.js +6 -22
- package/build/hooks/index.d.ts +5 -0
- package/build/hooks/index.js +5 -0
- package/build/hooks/useAppConfig.d.ts +4 -2
- package/build/hooks/useAppConfig.js +10 -5
- package/build/hooks/useDataNoneEditable.d.ts +2 -0
- package/build/hooks/useDataNoneEditable.js +19 -0
- package/build/hooks/useDataVerified.d.ts +6 -0
- package/build/hooks/useDataVerified.js +19 -0
- package/build/hooks/useErrorListener.d.ts +2 -1
- package/build/hooks/useErrorListener.js +16 -1
- package/build/hooks/useExcludeReadOnlyFelids.d.ts +11 -0
- package/build/hooks/useExcludeReadOnlyFelids.js +33 -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/hooks/useVerifyToken.js +1 -1
- package/build/index.d.ts +2 -2
- package/build/index.js +4 -3
- package/build/theme/shadows.js +1 -1
- package/build/utils/array.d.ts +17 -3
- package/build/utils/array.js +220 -6
- package/build/utils/date.d.ts +1 -0
- package/build/utils/date.js +6 -0
- package/build/utils/error.d.ts +1 -0
- package/build/utils/error.js +3 -0
- package/build/utils/gtm.d.ts +6 -0
- package/build/utils/gtm.js +29 -0
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +1 -0
- package/build/utils/object.d.ts +4 -0
- package/build/utils/object.js +17 -0
- package/build/utils/string.d.ts +5 -2
- package/build/utils/string.js +28 -7
- package/package.json +4 -2
- package/build/features/brand/screens/BrandActivities/OperationStartDate.js +0 -45
- package/build/features/brand/screens/BrandInfo/Segments.d.ts +0 -8
- package/build/features/connect/screens/Merchant/Segments.d.ts +0 -8
- package/build/features/shared/Button/ListButton.d.ts +0 -18
- package/build/features/shared/Button/ListButton.js +0 -125
- /package/build/features/{brand/screens/BrandInfo → connect/screens/BrandSegment}/TeamSize.d.ts +0 -0
|
@@ -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 (_) try {
|
|
27
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) 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]) {
|
|
@@ -68,15 +68,15 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
68
68
|
var _a;
|
|
69
69
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
70
70
|
import API from '../../../api';
|
|
71
|
-
import { FlowsTypes, IndividualGender,
|
|
72
|
-
import { handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
|
|
71
|
+
import { FlowsTypes, IndividualGender, DocumentPurpose } from '../../../@types';
|
|
72
|
+
import { handleNextScreenStep, handlePrevScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
|
|
73
73
|
import { defaultCountry, IDENTIFICATION_TYPE, INDIVIDUAl_STEP_NAMES } from '../../../constants';
|
|
74
|
-
import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2,
|
|
74
|
+
import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, hasNoneEditableValue, getUserNameObject, getUserName, sleep, isValidEmail, getRecentDocumentBasedOnPurpose, formatNumberAsCurrency, removeAllCharsFromNumber, mapUserList, sortUserList, getIndividualType } 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, boardInfoStatus, countries, board_id, board_info_id, notification, _b, id, type,
|
|
79
|
-
var
|
|
78
|
+
var payload, settings, data, boardData, individualData, countryCode, boardInfoData, boardInfoStatus, countries, board_id, board_info_id, notification, _b, id, type, data_1, birthCountry, individuals, _c, is_authorized, data_state;
|
|
79
|
+
var _d, _e, _f, _g, _h, _j, _k;
|
|
80
80
|
return __generator(this, function (_l) {
|
|
81
81
|
switch (_l.label) {
|
|
82
82
|
case 0:
|
|
@@ -90,7 +90,7 @@ export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a
|
|
|
90
90
|
data = (_l.sent()).data;
|
|
91
91
|
boardInfoStatus = undefined;
|
|
92
92
|
countries = settings.data.countries;
|
|
93
|
-
if (((
|
|
93
|
+
if (((_d = data.errors) === null || _d === void 0 ? void 0 : _d.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));
|
|
95
95
|
if (isInternally)
|
|
96
96
|
data.step_name = INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO;
|
|
@@ -100,9 +100,9 @@ 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, 16];
|
|
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, 15];
|
|
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];
|
|
@@ -112,75 +112,72 @@ export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a
|
|
|
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
|
-
return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode }))];
|
|
115
|
+
return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
|
|
116
116
|
case 4:
|
|
117
|
-
|
|
118
|
-
individualData =
|
|
117
|
+
data_1 = (_l.sent()).data;
|
|
118
|
+
individualData = data_1 || {};
|
|
119
119
|
_l.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
124
|
boardData = _l.sent();
|
|
125
|
-
|
|
125
|
+
_l.label = 7;
|
|
126
126
|
case 7:
|
|
127
|
-
boardInfoStatus = _l.sent();
|
|
128
|
-
_l.label = 8;
|
|
129
|
-
case 8:
|
|
130
127
|
if (!countryCode) {
|
|
131
|
-
countryCode = (
|
|
128
|
+
countryCode = (_e = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _e === void 0 ? void 0 : _e.country;
|
|
132
129
|
if (countryCode)
|
|
133
130
|
thunkApi.dispatch(handleSetCountryByIso2(countryCode));
|
|
134
131
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
if (!hasIndividualCompleted) return [3, 9];
|
|
138
|
-
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
139
|
-
return [3, 15];
|
|
140
|
-
case 9:
|
|
141
|
-
if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 12];
|
|
142
|
-
if (!((_f = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _f === void 0 ? void 0 : _f.id)) return [3, 11];
|
|
132
|
+
if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 11];
|
|
133
|
+
if (!((_f = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _f === void 0 ? void 0 : _f.id)) return [3, 9];
|
|
143
134
|
return [4, thunkApi.dispatch(getIndividualList((_g = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _g === void 0 ? void 0 : _g.id))];
|
|
144
|
-
case
|
|
135
|
+
case 8:
|
|
145
136
|
_l.sent();
|
|
146
|
-
_l.label =
|
|
147
|
-
case
|
|
137
|
+
_l.label = 9;
|
|
138
|
+
case 9: return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
139
|
+
case 10:
|
|
140
|
+
boardInfoStatus = _l.sent();
|
|
148
141
|
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
|
|
149
|
-
return [3,
|
|
150
|
-
case
|
|
142
|
+
return [3, 14];
|
|
143
|
+
case 11:
|
|
151
144
|
birthCountry = ((_h = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _h === void 0 ? void 0 : _h.country) || countryCode;
|
|
152
|
-
if (!birthCountry) return [3,
|
|
145
|
+
if (!birthCountry) return [3, 13];
|
|
153
146
|
return [4, thunkApi.dispatch(getCityList(birthCountry))];
|
|
154
|
-
case
|
|
147
|
+
case 12:
|
|
155
148
|
_l.sent();
|
|
156
|
-
_l.label =
|
|
157
|
-
case
|
|
149
|
+
_l.label = 13;
|
|
150
|
+
case 13:
|
|
158
151
|
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP'));
|
|
159
|
-
_l.label =
|
|
160
|
-
case
|
|
161
|
-
case
|
|
152
|
+
_l.label = 14;
|
|
153
|
+
case 14: return [3, 16];
|
|
154
|
+
case 15:
|
|
162
155
|
if (isUpdatePhoneInfo) {
|
|
163
156
|
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_VERIFY_STEP'));
|
|
164
157
|
}
|
|
165
|
-
_l.label =
|
|
166
|
-
case
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
158
|
+
_l.label = 16;
|
|
159
|
+
case 16:
|
|
160
|
+
individuals = (boardData || {}).individuals;
|
|
161
|
+
_c = individualData || {}, is_authorized = _c.is_authorized, data_state = _c.data_state;
|
|
162
|
+
return [2, {
|
|
163
|
+
data: data,
|
|
164
|
+
boardResponse: {
|
|
165
|
+
brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
|
|
166
|
+
bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
|
|
167
|
+
entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
|
|
168
|
+
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
169
|
+
merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
|
|
170
|
+
name: (_j = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _j === void 0 ? void 0 : _j.names,
|
|
171
|
+
contact: (_k = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _k === void 0 ? void 0 : _k.contact,
|
|
172
|
+
individuals: is_authorized ? individuals : __assign(__assign({}, individuals), (!!data_state && { data_state: data_state })),
|
|
173
|
+
countries: countries,
|
|
174
|
+
countryCode: countryCode,
|
|
175
|
+
notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
|
|
176
|
+
business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
|
|
177
|
+
flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
|
|
178
|
+
},
|
|
179
|
+
token: token
|
|
180
|
+
}];
|
|
184
181
|
}
|
|
185
182
|
});
|
|
186
183
|
});
|
|
@@ -190,7 +187,12 @@ export var verifyLeadToken = createAsyncThunk('individualVerifyLeadToken', funct
|
|
|
190
187
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
191
188
|
return __generator(this, function (_b) {
|
|
192
189
|
switch (_b.label) {
|
|
193
|
-
case 0: return [4, thunkApi
|
|
190
|
+
case 0: return [4, thunkApi
|
|
191
|
+
.dispatch(verifyToken({ token: token, isInternally: isInternally }))
|
|
192
|
+
.unwrap()
|
|
193
|
+
.catch(function (err) {
|
|
194
|
+
throw new Error(err.message);
|
|
195
|
+
})];
|
|
194
196
|
case 1:
|
|
195
197
|
_b.sent();
|
|
196
198
|
return [2];
|
|
@@ -216,29 +218,27 @@ export var resendOTP = createAsyncThunk('resendOTPIndividual', function (params,
|
|
|
216
218
|
});
|
|
217
219
|
}); });
|
|
218
220
|
export var addDetailsAsync = createAsyncThunk('individual/addDetailsAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
219
|
-
var settings, user, userList,
|
|
221
|
+
var settings, user, userList, birth, individual_id, countryCode;
|
|
220
222
|
return __generator(this, function (_a) {
|
|
221
223
|
switch (_a.label) {
|
|
222
224
|
case 0:
|
|
223
225
|
settings = thunkApi.getState().settings;
|
|
224
226
|
user = params.user, userList = params.userList;
|
|
225
|
-
|
|
227
|
+
birth = user.birth, individual_id = user.individual_id;
|
|
226
228
|
countryCode = (birth === null || birth === void 0 ? void 0 : birth.country) || settings.data.businessCountry.iso2;
|
|
227
229
|
if (!countryCode) return [3, 2];
|
|
228
230
|
return [4, thunkApi.dispatch(getCityList(countryCode))];
|
|
229
231
|
case 1:
|
|
230
232
|
_a.sent();
|
|
231
233
|
_a.label = 2;
|
|
232
|
-
case 2:
|
|
233
|
-
case 3:
|
|
234
|
-
_a.sent();
|
|
234
|
+
case 2:
|
|
235
235
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
|
|
236
|
-
return [2, { userList: userList }];
|
|
236
|
+
return [2, { userList: userList, individualId: individual_id, countryCode: settings.data.businessCountry.iso2, countries: settings.data.countries }];
|
|
237
237
|
}
|
|
238
238
|
});
|
|
239
239
|
}); });
|
|
240
240
|
export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsByEmail', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
241
|
-
var individual, _a, merchant_id, board_id, user, collectInfo, id,
|
|
241
|
+
var individual, _a, merchant_id, board_id, user, collectInfo, id, objects, ids, _b, resEmail, resPhone, isPhoneAndEmailAvailable, email, mobile, countryCode, hasContact, individualData, hasPhone, requestBody, data_2, user_1, payload, data;
|
|
242
242
|
var _c;
|
|
243
243
|
return __generator(this, function (_d) {
|
|
244
244
|
switch (_d.label) {
|
|
@@ -246,7 +246,7 @@ export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsBy
|
|
|
246
246
|
individual = thunkApi.getState().individual;
|
|
247
247
|
_a = individual.data.verify.responseBody || {}, merchant_id = _a.merchant_id, board_id = _a.board_id;
|
|
248
248
|
user = params.user, collectInfo = params.collectInfo;
|
|
249
|
-
id = user.id,
|
|
249
|
+
id = user.id, objects = user.objects, ids = user.ids;
|
|
250
250
|
_b = (user === null || user === void 0 ? void 0 : user.contact) || {}, resEmail = _b.email, resPhone = _b.phone;
|
|
251
251
|
isPhoneAndEmailAvailable = isValidEmail(resEmail) && (resPhone === null || resPhone === void 0 ? void 0 : resPhone.country_code) && (resPhone === null || resPhone === void 0 ? void 0 : resPhone.number);
|
|
252
252
|
email = collectInfo.email, mobile = collectInfo.mobile, countryCode = collectInfo.countryCode;
|
|
@@ -255,8 +255,7 @@ export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsBy
|
|
|
255
255
|
if (!(!isPhoneAndEmailAvailable && hasContact)) return [3, 2];
|
|
256
256
|
hasPhone = mobile && (countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix);
|
|
257
257
|
requestBody = {
|
|
258
|
-
|
|
259
|
-
type: type,
|
|
258
|
+
ids: (ids === null || ids === void 0 ? void 0 : ids.length) ? ids : [id],
|
|
260
259
|
contact: {
|
|
261
260
|
email: email,
|
|
262
261
|
phone: hasPhone
|
|
@@ -267,18 +266,11 @@ export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsBy
|
|
|
267
266
|
: undefined
|
|
268
267
|
}
|
|
269
268
|
};
|
|
270
|
-
return [4, API.individualService.
|
|
269
|
+
return [4, API.individualService.updateMultipleIndividual(requestBody)];
|
|
271
270
|
case 1:
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
individualData = data_1 === null || data_1 === void 0 ? void 0 : data_1.shareholder;
|
|
276
|
-
else if (type === IndividualType.BOARD_MEMBER)
|
|
277
|
-
individualData = data_1 === null || data_1 === void 0 ? void 0 : data_1.board_member;
|
|
278
|
-
else if (type === IndividualType.BUYER)
|
|
279
|
-
individualData = data_1 === null || data_1 === void 0 ? void 0 : data_1.buyer;
|
|
280
|
-
else if (type === IndividualType.CUSTOMER)
|
|
281
|
-
individualData = data_1 === null || data_1 === void 0 ? void 0 : data_1.customer;
|
|
271
|
+
data_2 = _d.sent();
|
|
272
|
+
user_1 = (sortUserList(mapUserList(data_2 === null || data_2 === void 0 ? void 0 : data_2.individuals)) || [])[0];
|
|
273
|
+
individualData = user_1;
|
|
282
274
|
_d.label = 2;
|
|
283
275
|
case 2:
|
|
284
276
|
payload = {
|
|
@@ -292,7 +284,7 @@ export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsBy
|
|
|
292
284
|
notification: {
|
|
293
285
|
recipient: {
|
|
294
286
|
id: id,
|
|
295
|
-
type:
|
|
287
|
+
type: (objects === null || objects === void 0 ? void 0 : objects[0]) || ''
|
|
296
288
|
},
|
|
297
289
|
channel: ['email']
|
|
298
290
|
}
|
|
@@ -300,14 +292,14 @@ export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsBy
|
|
|
300
292
|
return [4, API.boardService.requestDetailsByEmail(payload)];
|
|
301
293
|
case 3:
|
|
302
294
|
data = _d.sent();
|
|
303
|
-
return [2, { data: data,
|
|
295
|
+
return [2, { data: data, individualData: individualData }];
|
|
304
296
|
}
|
|
305
297
|
});
|
|
306
298
|
}); });
|
|
307
299
|
export var getIndividualList = createAsyncThunk('individual/getIndividualList', function (businessId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
308
|
-
var payload,
|
|
309
|
-
return __generator(this, function (
|
|
310
|
-
switch (
|
|
300
|
+
var payload, individuals, list;
|
|
301
|
+
return __generator(this, function (_a) {
|
|
302
|
+
switch (_a.label) {
|
|
311
303
|
case 0:
|
|
312
304
|
payload = {
|
|
313
305
|
page: 1,
|
|
@@ -316,12 +308,9 @@ export var getIndividualList = createAsyncThunk('individual/getIndividualList',
|
|
|
316
308
|
};
|
|
317
309
|
return [4, API.individualService.getIndividualList(payload)];
|
|
318
310
|
case 1:
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
boardMemberList = (board_members || []).map(function (board_member) { return (__assign(__assign({}, board_member), { type: IndividualType.BOARD_MEMBER })); });
|
|
323
|
-
individualList = __spreadArray(__spreadArray(__spreadArray([], userList, true), shareHolderList, true), boardMemberList, true);
|
|
324
|
-
return [2, individualList];
|
|
311
|
+
individuals = (_a.sent()).individuals;
|
|
312
|
+
list = sortUserList(mapUserList(individuals)) || [];
|
|
313
|
+
return [2, __spreadArray([], list, true)];
|
|
325
314
|
}
|
|
326
315
|
});
|
|
327
316
|
}); });
|
|
@@ -341,30 +330,35 @@ export var getCityList = createAsyncThunk('individual/getCityList', function (co
|
|
|
341
330
|
});
|
|
342
331
|
}); });
|
|
343
332
|
export var retrieveIndividualInfo = createAsyncThunk('individual/retrieveIndividualInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
344
|
-
var id, type, countryCode, settings, data, individualData;
|
|
345
|
-
return __generator(this, function (
|
|
346
|
-
switch (
|
|
333
|
+
var id, type, countryCode, settings, data, _a, isShareholder, isBoardMember, isBuyer, isCustomer, individualData;
|
|
334
|
+
return __generator(this, function (_b) {
|
|
335
|
+
switch (_b.label) {
|
|
347
336
|
case 0:
|
|
348
337
|
id = params.id, type = params.type, countryCode = params.countryCode;
|
|
349
338
|
settings = thunkApi.getState().settings;
|
|
350
339
|
return [4, API.individualService.retrieveIndividual(id, type)];
|
|
351
340
|
case 1:
|
|
352
|
-
data =
|
|
341
|
+
data = _b.sent();
|
|
342
|
+
_a = getIndividualType([type]), isShareholder = _a.isShareholder, isBoardMember = _a.isBoardMember, isBuyer = _a.isBuyer, isCustomer = _a.isCustomer;
|
|
353
343
|
individualData = data === null || data === void 0 ? void 0 : data.user;
|
|
354
|
-
if (
|
|
344
|
+
if (isShareholder)
|
|
355
345
|
individualData = data === null || data === void 0 ? void 0 : data.shareholder;
|
|
356
|
-
else if (
|
|
346
|
+
else if (isBoardMember)
|
|
357
347
|
individualData = data === null || data === void 0 ? void 0 : data.board_member;
|
|
358
|
-
else if (
|
|
348
|
+
else if (isBuyer)
|
|
359
349
|
individualData = data === null || data === void 0 ? void 0 : data.buyer;
|
|
360
|
-
else if (
|
|
350
|
+
else if (isCustomer)
|
|
361
351
|
individualData = data === null || data === void 0 ? void 0 : data.customer;
|
|
362
|
-
return [2, {
|
|
352
|
+
return [2, {
|
|
353
|
+
data: __assign(__assign({}, (individualData || {})), { objects: [type], individual_data_state: individualData === null || individualData === void 0 ? void 0 : individualData.data_state, object: type }),
|
|
354
|
+
countryCode: countryCode,
|
|
355
|
+
countries: settings.data.countries
|
|
356
|
+
}];
|
|
363
357
|
}
|
|
364
358
|
});
|
|
365
359
|
}); });
|
|
366
360
|
export var retrieveDataList = createAsyncThunk('individualRetrieveDataList', function (countryCode) { return __awaiter(void 0, void 0, void 0, function () {
|
|
367
|
-
var monthlyIncomeBody, dataBody, _a, sourceIncome, monthlyIncome, occupation;
|
|
361
|
+
var monthlyIncomeBody, dataBody, _a, sourceIncome, monthlyIncome, occupationData, occupation, mappedOccupation;
|
|
368
362
|
return __generator(this, function (_b) {
|
|
369
363
|
switch (_b.label) {
|
|
370
364
|
case 0:
|
|
@@ -381,15 +375,35 @@ export var retrieveDataList = createAsyncThunk('individualRetrieveDataList', fun
|
|
|
381
375
|
API.dataService.getOccupation(dataBody)
|
|
382
376
|
])];
|
|
383
377
|
case 1:
|
|
384
|
-
_a = _b.sent(), sourceIncome = _a[0], monthlyIncome = _a[1],
|
|
378
|
+
_a = _b.sent(), sourceIncome = _a[0], monthlyIncome = _a[1], occupationData = _a[2];
|
|
379
|
+
occupation = (occupationData === null || occupationData === void 0 ? void 0 : occupationData.occupation) || {};
|
|
380
|
+
mappedOccupation = (occupation.section || []).map(function (section) {
|
|
381
|
+
var sub = (occupation.chapter || []).filter(function (chapter) { return chapter.section_code === section.code; });
|
|
382
|
+
return __assign(__assign({}, section), { sub: sub });
|
|
383
|
+
});
|
|
385
384
|
return [2, {
|
|
386
385
|
sourceIncome: sourceIncome,
|
|
387
386
|
monthlyIncome: monthlyIncome,
|
|
388
|
-
occupation:
|
|
387
|
+
occupation: { list: mappedOccupation || [] }
|
|
389
388
|
}];
|
|
390
389
|
}
|
|
391
390
|
});
|
|
392
391
|
}); });
|
|
392
|
+
export var retrieveBoardStatus = createAsyncThunk('individual/retrieveBoardStatus', function (parmas, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
393
|
+
var individual, board_id, data;
|
|
394
|
+
return __generator(this, function (_a) {
|
|
395
|
+
switch (_a.label) {
|
|
396
|
+
case 0:
|
|
397
|
+
individual = thunkApi.getState().individual;
|
|
398
|
+
board_id = (individual.data.verify.responseBody || {}).board_id;
|
|
399
|
+
return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
400
|
+
case 1:
|
|
401
|
+
data = _a.sent();
|
|
402
|
+
thunkApi.dispatch(handlePrevScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
403
|
+
return [2, { flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
}); });
|
|
393
407
|
export var retrieveBoardDetails = createAsyncThunk('retrieveIndividualBoardDetails', function (boardId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
394
408
|
var _a, user, data;
|
|
395
409
|
var _b, _c;
|
|
@@ -405,8 +419,8 @@ export var retrieveBoardDetails = createAsyncThunk('retrieveIndividualBoardDetai
|
|
|
405
419
|
});
|
|
406
420
|
}); });
|
|
407
421
|
export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
408
|
-
var _a, individual, settings, responseBody, _b, board_id, board_info_id, countries, payload, data, boardInfoData, individualData, boardData, boardInfoStatus, countryCode, notification, _c, id, type,
|
|
409
|
-
var
|
|
422
|
+
var _a, individual, settings, responseBody, _b, board_id, board_info_id, countries, payload, data, boardInfoData, individualData, boardData, boardInfoStatus, countryCode, notification, _c, id, type, data_3, birthCountry, individuals, _d, is_authorized, data_state;
|
|
423
|
+
var _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
410
424
|
return __generator(this, function (_q) {
|
|
411
425
|
switch (_q.label) {
|
|
412
426
|
case 0:
|
|
@@ -416,7 +430,7 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
|
|
|
416
430
|
countries = settings.data.countries;
|
|
417
431
|
payload = {
|
|
418
432
|
data: params.otp,
|
|
419
|
-
service_name: (
|
|
433
|
+
service_name: (_e = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _e === void 0 ? void 0 : _e.service_name,
|
|
420
434
|
verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
|
|
421
435
|
step_name: INDIVIDUAl_STEP_NAMES.PHONE_AUTH,
|
|
422
436
|
encryption_contract: ['data']
|
|
@@ -425,60 +439,55 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
|
|
|
425
439
|
case 1:
|
|
426
440
|
data = (_q.sent()).data;
|
|
427
441
|
boardInfoStatus = undefined;
|
|
428
|
-
if ((
|
|
442
|
+
if ((_f = data.errors) === null || _f === void 0 ? void 0 : _f.length)
|
|
429
443
|
throw new Error(data.errors[0].description);
|
|
430
|
-
if (!board_id) return [3,
|
|
444
|
+
if (!board_id) return [3, 3];
|
|
431
445
|
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
432
446
|
case 2:
|
|
433
447
|
boardData = _q.sent();
|
|
434
|
-
|
|
448
|
+
_q.label = 3;
|
|
435
449
|
case 3:
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
case 4:
|
|
439
|
-
countryCode = (_f = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _f === void 0 ? void 0 : _f.country;
|
|
440
|
-
if (!(board_id && board_info_id)) return [3, 7];
|
|
450
|
+
countryCode = (_g = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _g === void 0 ? void 0 : _g.country;
|
|
451
|
+
if (!(board_id && board_info_id)) return [3, 6];
|
|
441
452
|
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
442
|
-
case
|
|
453
|
+
case 4:
|
|
443
454
|
boardInfoData = _q.sent();
|
|
444
455
|
notification = (boardInfoData || {}).notification;
|
|
445
456
|
_c = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _c.id, type = _c.type;
|
|
446
|
-
if (!(id && type)) return [3,
|
|
447
|
-
return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode }))];
|
|
457
|
+
if (!(id && type)) return [3, 6];
|
|
458
|
+
return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
|
|
459
|
+
case 5:
|
|
460
|
+
data_3 = (_q.sent()).data;
|
|
461
|
+
individualData = data_3 || {};
|
|
462
|
+
_q.label = 6;
|
|
448
463
|
case 6:
|
|
449
|
-
payload_2 = (_q.sent()).payload;
|
|
450
|
-
individualData = payload_2.data || {};
|
|
451
|
-
_q.label = 7;
|
|
452
|
-
case 7:
|
|
453
464
|
if (countryCode)
|
|
454
465
|
thunkApi.dispatch(handleSetCountryByIso2(countryCode));
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
if (!hasIndividualCompleted) return [3, 8];
|
|
458
|
-
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
459
|
-
return [3, 14];
|
|
460
|
-
case 8:
|
|
461
|
-
if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 11];
|
|
462
|
-
if (!((_h = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _h === void 0 ? void 0 : _h.id)) return [3, 10];
|
|
466
|
+
if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 10];
|
|
467
|
+
if (!((_h = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _h === void 0 ? void 0 : _h.id)) return [3, 8];
|
|
463
468
|
return [4, thunkApi.dispatch(getIndividualList((_j = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _j === void 0 ? void 0 : _j.id))];
|
|
464
|
-
case
|
|
469
|
+
case 7:
|
|
465
470
|
_q.sent();
|
|
466
|
-
_q.label =
|
|
467
|
-
case
|
|
471
|
+
_q.label = 8;
|
|
472
|
+
case 8: return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
473
|
+
case 9:
|
|
474
|
+
boardInfoStatus = _q.sent();
|
|
468
475
|
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
|
|
469
|
-
return [3,
|
|
470
|
-
case
|
|
476
|
+
return [3, 13];
|
|
477
|
+
case 10:
|
|
471
478
|
birthCountry = ((_k = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _k === void 0 ? void 0 : _k.country) || countryCode;
|
|
472
|
-
if (!birthCountry) return [3,
|
|
479
|
+
if (!birthCountry) return [3, 12];
|
|
473
480
|
return [4, thunkApi.dispatch(getCityList(birthCountry))];
|
|
474
|
-
case
|
|
481
|
+
case 11:
|
|
475
482
|
_q.sent();
|
|
483
|
+
_q.label = 12;
|
|
484
|
+
case 12:
|
|
485
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
|
|
476
486
|
_q.label = 13;
|
|
477
487
|
case 13:
|
|
478
|
-
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP'));
|
|
479
|
-
_q.label = 14;
|
|
480
|
-
case 14:
|
|
481
488
|
(_m = (_l = settings.data.appConfig).onStepCompleted) === null || _m === void 0 ? void 0 : _m.call(_l, settings.data.activeScreen.name, { otp: params.otp });
|
|
489
|
+
individuals = (boardData || {}).individuals;
|
|
490
|
+
_d = individualData || {}, is_authorized = _d.is_authorized, data_state = _d.data_state;
|
|
482
491
|
return [2, {
|
|
483
492
|
data: data,
|
|
484
493
|
boardResponse: {
|
|
@@ -489,10 +498,11 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
|
|
|
489
498
|
merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
|
|
490
499
|
name: (_o = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _o === void 0 ? void 0 : _o.names,
|
|
491
500
|
contact: (_p = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _p === void 0 ? void 0 : _p.contact,
|
|
492
|
-
individuals:
|
|
501
|
+
individuals: is_authorized ? individuals : __assign(__assign({}, individuals), (!!data_state && { data_state: data_state })),
|
|
493
502
|
countries: countries,
|
|
494
503
|
countryCode: countryCode,
|
|
495
504
|
notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
|
|
505
|
+
business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
|
|
496
506
|
flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
|
|
497
507
|
},
|
|
498
508
|
formData: __assign({}, params)
|
|
@@ -500,213 +510,243 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
|
|
|
500
510
|
}
|
|
501
511
|
});
|
|
502
512
|
}); });
|
|
503
|
-
export var updatePhoneInfo = createAsyncThunk('individual/updatePhoneInfo', function (
|
|
504
|
-
var
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
513
|
+
export var updatePhoneInfo = createAsyncThunk('individual/updatePhoneInfo', function (_a, thunkApi) {
|
|
514
|
+
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
515
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
516
|
+
var individual, _b, token, responseBody, id, mobile, countryCode, requestBody, data;
|
|
517
|
+
var _c;
|
|
518
|
+
return __generator(this, function (_d) {
|
|
519
|
+
switch (_d.label) {
|
|
520
|
+
case 0:
|
|
521
|
+
individual = thunkApi.getState().individual;
|
|
522
|
+
_b = individual.data.verify, token = _b.token, responseBody = _b.responseBody;
|
|
523
|
+
id = ((responseBody === null || responseBody === void 0 ? void 0 : responseBody.source) || {}).id;
|
|
524
|
+
mobile = formData.mobile, countryCode = formData.countryCode;
|
|
525
|
+
requestBody = {
|
|
526
|
+
ids: [id],
|
|
527
|
+
contact: {
|
|
528
|
+
phone: {
|
|
529
|
+
country_code: (_c = countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix) === null || _c === void 0 ? void 0 : _c.toString(),
|
|
530
|
+
number: mobile || ''
|
|
531
|
+
}
|
|
520
532
|
}
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
}
|
|
533
|
+
};
|
|
534
|
+
return [4, API.individualService.updateMultipleIndividual(requestBody)];
|
|
535
|
+
case 1:
|
|
536
|
+
data = _d.sent();
|
|
537
|
+
return [4, thunkApi.dispatch(verifyToken({ token: token, isUpdatePhoneInfo: true }))];
|
|
538
|
+
case 2:
|
|
539
|
+
_d.sent();
|
|
540
|
+
return [2, { data: data, formData: originalFormData }];
|
|
541
|
+
}
|
|
542
|
+
});
|
|
531
543
|
});
|
|
532
|
-
});
|
|
533
|
-
export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateIndividualPersonalInfo', function (
|
|
534
|
-
var
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
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
|
-
|
|
544
|
+
});
|
|
545
|
+
export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateIndividualPersonalInfo', function (_a, thunkApi) {
|
|
546
|
+
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
547
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
548
|
+
var _b, settings, individual, _c, notification, user, entity, id, _d, objects, ids, name, email, mobile, countryCode, gender, nid, issuedCountry, expiryDate, dob, placeOfBirthCountry, placeOfBirthCity, nationality, code, data_status, userName, identification_id_type, isGenderNonEditable, isNameENNonEditable, isNameARNonEditable, isEmailNonEditable, isMobileNumberNonEditable, isMobileCountryNonEditable, isNidNonEditable, isIssuedCountryNonEditable, isExpiryNonEditable, isIdTypeNonEditable, isNationalityNonEditable, isDOBNonEditable, isBirthCityNonEditable, isBirthCountryNonEditable, hasContact, hasPhone, hasIdentification, hasBirth, nameIsEditable, contact, requestBody, data, _e, isUser, isBuyer, isUserORBuyerType;
|
|
549
|
+
var _f, _g, _h, _j, _k;
|
|
550
|
+
return __generator(this, function (_l) {
|
|
551
|
+
switch (_l.label) {
|
|
552
|
+
case 0:
|
|
553
|
+
_b = thunkApi.getState(), settings = _b.settings, individual = _b.individual;
|
|
554
|
+
_c = individual.data.verify.responseBody || {}, notification = _c.notification, user = _c.user, entity = _c.entity;
|
|
555
|
+
id = (((user === null || user === void 0 ? void 0 : user.is_authorized) ? user : notification === null || notification === void 0 ? void 0 : notification.recipient) || {}).id;
|
|
556
|
+
_d = user || {}, objects = _d.objects, ids = _d.ids;
|
|
557
|
+
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;
|
|
558
|
+
code = entity === null || entity === void 0 ? void 0 : entity.country;
|
|
559
|
+
data_status = (user || {}).data_status;
|
|
560
|
+
userName = getUserNameObject(name);
|
|
561
|
+
identification_id_type = nid ? (nid.startsWith('1') ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA) : undefined;
|
|
562
|
+
isGenderNonEditable = hasNoneEditableValue(data_status, 'gender');
|
|
563
|
+
isNameENNonEditable = hasNoneEditableValue(data_status, 'name.en');
|
|
564
|
+
isNameARNonEditable = hasNoneEditableValue(data_status, 'name.ar');
|
|
565
|
+
isEmailNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.contact, 'email');
|
|
566
|
+
isMobileNumberNonEditable = hasNoneEditableValue((_f = data_status === null || data_status === void 0 ? void 0 : data_status.contact) === null || _f === void 0 ? void 0 : _f.phone, 'number');
|
|
567
|
+
isMobileCountryNonEditable = hasNoneEditableValue((_g = data_status === null || data_status === void 0 ? void 0 : data_status.contact) === null || _g === void 0 ? void 0 : _g.phone, 'country_code');
|
|
568
|
+
isNidNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.identification, 'id');
|
|
569
|
+
isIssuedCountryNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.identification, 'issuer_country');
|
|
570
|
+
isExpiryNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.identification, 'expiry');
|
|
571
|
+
isIdTypeNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.identification, 'type');
|
|
572
|
+
isNationalityNonEditable = hasNoneEditableValue(data_status, 'nationality');
|
|
573
|
+
isDOBNonEditable = hasNoneEditableValue(data_status, 'birth.date');
|
|
574
|
+
isBirthCityNonEditable = hasNoneEditableValue(data_status, 'birth.city');
|
|
575
|
+
isBirthCountryNonEditable = hasNoneEditableValue(data_status, 'birth.country');
|
|
576
|
+
hasContact = email || mobile || countryCode;
|
|
577
|
+
hasPhone = mobile && (countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix);
|
|
578
|
+
hasIdentification = nid && (issuedCountry || identification_id_type || expiryDate);
|
|
579
|
+
hasBirth = placeOfBirthCity || placeOfBirthCountry;
|
|
580
|
+
nameIsEditable = userName.first && !(isNameENNonEditable && isNameARNonEditable);
|
|
581
|
+
contact = hasContact && !(isEmailNonEditable && isMobileCountryNonEditable && isMobileNumberNonEditable)
|
|
582
|
+
? __assign({ email: isEmailNonEditable ? undefined : email }, (!((isMobileCountryNonEditable && isMobileNumberNonEditable) || !hasPhone) && {
|
|
583
|
+
phone: {
|
|
584
|
+
country_code: isMobileCountryNonEditable ? undefined : (_h = countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix) === null || _h === void 0 ? void 0 : _h.toString(),
|
|
585
|
+
number: isMobileNumberNonEditable || !mobile ? undefined : mobile
|
|
586
|
+
}
|
|
587
|
+
})) : undefined;
|
|
588
|
+
requestBody = __assign(__assign(__assign(__assign(__assign(__assign(__assign({ ids: (ids === null || ids === void 0 ? void 0 : ids.length) ? ids : [id], gender: isGenderNonEditable || !gender ? undefined : gender }, (nameIsEditable && {
|
|
589
|
+
names: {
|
|
590
|
+
en: isNameENNonEditable ? undefined : userName,
|
|
591
|
+
ar: isNameARNonEditable ? undefined : userName
|
|
592
|
+
}
|
|
593
|
+
})), { contact: contact }), (hasIdentification &&
|
|
594
|
+
!(isNidNonEditable && isIssuedCountryNonEditable && isExpiryNonEditable && isIdTypeNonEditable) && {
|
|
595
|
+
identification: {
|
|
596
|
+
id: isNidNonEditable || !nid ? undefined : nid,
|
|
597
|
+
issued_country_code: isIssuedCountryNonEditable ? undefined : issuedCountry === null || issuedCountry === void 0 ? void 0 : issuedCountry.iso2,
|
|
598
|
+
expiry: isExpiryNonEditable || !expiryDate ? undefined : new Date(expiryDate).getTime(),
|
|
599
|
+
type: isIdTypeNonEditable || !identification_id_type ? undefined : identification_id_type
|
|
600
|
+
}
|
|
601
|
+
})), (!isDOBNonEditable && {
|
|
602
|
+
date_of_birth: dob
|
|
603
|
+
})), (hasBirth &&
|
|
604
|
+
!(isBirthCityNonEditable && isBirthCountryNonEditable) && {
|
|
605
|
+
birth: {
|
|
606
|
+
city: isBirthCityNonEditable ? undefined : placeOfBirthCity === null || placeOfBirthCity === void 0 ? void 0 : placeOfBirthCity.id,
|
|
607
|
+
country: isBirthCountryNonEditable ? undefined : placeOfBirthCountry === null || placeOfBirthCountry === void 0 ? void 0 : placeOfBirthCountry.iso2
|
|
608
|
+
}
|
|
609
|
+
})), (!isNationalityNonEditable && {
|
|
610
|
+
nationality: nationality === null || nationality === void 0 ? void 0 : nationality.iso2
|
|
611
|
+
})), { encryption_contract: [
|
|
612
|
+
'gender',
|
|
613
|
+
'contact.email',
|
|
614
|
+
'contact.phone.country_code',
|
|
615
|
+
'contact.phone.number',
|
|
616
|
+
'identification.id',
|
|
617
|
+
'identification.issued_country_code',
|
|
618
|
+
'identification.expiry',
|
|
619
|
+
'identification.type',
|
|
620
|
+
'birth.country',
|
|
621
|
+
'date_of_birth',
|
|
622
|
+
'nationality'
|
|
623
|
+
], step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_PERSONAL_INFO });
|
|
624
|
+
return [4, API.individualService.updateMultipleIndividual(requestBody)];
|
|
625
|
+
case 1:
|
|
626
|
+
data = _l.sent();
|
|
627
|
+
_e = getIndividualType(objects), isUser = _e.isUser, isBuyer = _e.isBuyer;
|
|
628
|
+
isUserORBuyerType = isUser || isBuyer;
|
|
629
|
+
if (!isUserORBuyerType) return [3, 3];
|
|
630
|
+
return [4, thunkApi.dispatch(retrieveDataList(code))];
|
|
631
|
+
case 2:
|
|
632
|
+
_l.sent();
|
|
633
|
+
_l.label = 3;
|
|
634
|
+
case 3:
|
|
635
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
636
|
+
(_k = (_j = settings.data.appConfig).onStepCompleted) === null || _k === void 0 ? void 0 : _k.call(_j, settings.data.activeScreen.name, requestBody);
|
|
637
|
+
return [2, { data: data, formData: originalFormData }];
|
|
638
|
+
}
|
|
639
|
+
});
|
|
640
|
+
});
|
|
641
|
+
});
|
|
642
|
+
export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', 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, individual, _c, notification, user, id, _d, objects, ids, occupation, sourceIncome, monthlyIncome, isPEP, isInfluencer, shareCount, shareValue, civilID, signatureFileId, isOccupationNonEditable, isSourceIncomeNonEditable, isPEPNonEditable, isInfluencerNonEditable, isMonthlyIncomeNonEditable, isSharesAvailable, pepInfo, influencerInfo, occupationInfo, sourceIncomeInfo, monthlyIncomeInfo, userPayload, shareHolderPayload, boardMemberPayload, buyerMemberPayload, _e, isUser, isShareholder, isBoardMember, isBuyer, isCustomer, isUserORBuyerType, payload, requestBody, data, businessCountry, hasCivilIdDocument, hasSignatureDocument, isSendSignatureFile, civilIdDocument, signatureDocument, documentBody, documentBody, documentsList, documentBody, individualData;
|
|
646
|
+
var _f, _g;
|
|
647
|
+
return __generator(this, function (_h) {
|
|
648
|
+
switch (_h.label) {
|
|
649
|
+
case 0:
|
|
650
|
+
_b = thunkApi.getState(), settings = _b.settings, individual = _b.individual;
|
|
651
|
+
_c = individual.data.verify.responseBody || {}, notification = _c.notification, user = _c.user;
|
|
652
|
+
id = (((user === null || user === void 0 ? void 0 : user.is_authorized) ? user : notification === null || notification === void 0 ? void 0 : notification.recipient) || {}).id;
|
|
653
|
+
_d = user || {}, objects = _d.objects, ids = _d.ids;
|
|
654
|
+
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;
|
|
655
|
+
isOccupationNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'occupation');
|
|
656
|
+
isSourceIncomeNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'source_of_income');
|
|
657
|
+
isPEPNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'is_relative_PEP');
|
|
658
|
+
isInfluencerNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'is_influencer');
|
|
659
|
+
isMonthlyIncomeNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'monthly_income');
|
|
660
|
+
isSharesAvailable = shareCount || shareValue;
|
|
661
|
+
pepInfo = isPEPNonEditable ? undefined : isPEP;
|
|
662
|
+
influencerInfo = isInfluencerNonEditable ? undefined : isInfluencer;
|
|
663
|
+
occupationInfo = isOccupationNonEditable || !(occupation === null || occupation === void 0 ? void 0 : occupation.id) ? undefined : { chapter: { id: occupation.id } };
|
|
664
|
+
sourceIncomeInfo = isSourceIncomeNonEditable || !(sourceIncome === null || sourceIncome === void 0 ? void 0 : sourceIncome.id) ? undefined : [{ id: sourceIncome.id }];
|
|
665
|
+
monthlyIncomeInfo = isMonthlyIncomeNonEditable || !(monthlyIncome === null || monthlyIncome === void 0 ? void 0 : monthlyIncome.id) ? undefined : { id: monthlyIncome.id };
|
|
666
|
+
userPayload = {
|
|
667
|
+
occupation: occupationInfo,
|
|
668
|
+
source_income: sourceIncomeInfo,
|
|
669
|
+
monthly_income: monthlyIncomeInfo,
|
|
670
|
+
is_relative_PEP: pepInfo,
|
|
671
|
+
is_influencer: influencerInfo
|
|
672
|
+
};
|
|
673
|
+
shareHolderPayload = {
|
|
674
|
+
shares: isSharesAvailable
|
|
570
675
|
? {
|
|
571
|
-
|
|
572
|
-
|
|
676
|
+
count: shareCount && Number(shareCount),
|
|
677
|
+
value: shareValue && Number(removeAllCharsFromNumber(shareValue))
|
|
573
678
|
}
|
|
574
679
|
: undefined
|
|
680
|
+
};
|
|
681
|
+
boardMemberPayload = {
|
|
682
|
+
is_relative_PEP: pepInfo,
|
|
683
|
+
is_influencer: influencerInfo
|
|
684
|
+
};
|
|
685
|
+
buyerMemberPayload = {
|
|
686
|
+
occupation: occupationInfo,
|
|
687
|
+
source_income: sourceIncomeInfo,
|
|
688
|
+
monthly_income: monthlyIncomeInfo
|
|
689
|
+
};
|
|
690
|
+
_e = getIndividualType(objects), isUser = _e.isUser, isShareholder = _e.isShareholder, isBoardMember = _e.isBoardMember, isBuyer = _e.isBuyer, isCustomer = _e.isCustomer;
|
|
691
|
+
isUserORBuyerType = isUser || isBuyer;
|
|
692
|
+
payload = userPayload;
|
|
693
|
+
if (objects === null || objects === void 0 ? void 0 : objects.length) {
|
|
694
|
+
payload = __assign(__assign(__assign(__assign(__assign({}, (isUser && payload)), (isShareholder && shareHolderPayload)), (isBoardMember && boardMemberPayload)), (isBuyer && buyerMemberPayload)), (isCustomer && {}));
|
|
575
695
|
}
|
|
576
|
-
:
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
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, civilID, signatureFileId, businessCountry, documentsList, isSendSignatureFile, documentBody, occupation, sourceIncome, monthlyIncome, isPEP, isInfluencer, shareCount, shareValue, isOccupationEditable, isSourceIncomeEditable, isPEPEditable, isInfluencerEditable, isSharesAvailable, pepInfo, influencerInfo, occupationInfo, sourceIncomeInfo, monthlyIncomeInfo, userPayload, shareHolderPayload, boardMemberPayload, buyerMemberPayload, payload, requestBody, data;
|
|
630
|
-
var _d, _e, _f, _g, _h, _j;
|
|
631
|
-
return __generator(this, function (_k) {
|
|
632
|
-
switch (_k.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
|
-
civilID = params.civilID, signatureFileId = params.signatureFileId;
|
|
638
|
-
businessCountry = settings.data.businessCountry;
|
|
639
|
-
documentsList = [];
|
|
640
|
-
isSendSignatureFile = (user === null || user === void 0 ? void 0 : user.is_authorized) && (type === IndividualType.USER || type === IndividualType.BUYER);
|
|
641
|
-
if ((civilID || []).length > 0)
|
|
642
|
-
documentsList.push({ type: 'Civil ID File', images: civilID });
|
|
643
|
-
if (isSendSignatureFile && (signatureFileId || []).length > 0)
|
|
644
|
-
documentsList.push({ type: 'Signature File', images: signatureFileId });
|
|
645
|
-
documentBody = {
|
|
646
|
-
individual_type_id: id || '',
|
|
647
|
-
country: businessCountry.iso2,
|
|
648
|
-
documents: documentsList
|
|
649
|
-
};
|
|
650
|
-
if (!(documentsList.length > 0)) return [3, 2];
|
|
651
|
-
return [4, API.entityService.updateDocumentInfo(documentBody)];
|
|
652
|
-
case 1:
|
|
653
|
-
_k.sent();
|
|
654
|
-
_k.label = 2;
|
|
655
|
-
case 2:
|
|
656
|
-
occupation = params.occupation, sourceIncome = params.sourceIncome, monthlyIncome = params.monthlyIncome, isPEP = params.isPEP, isInfluencer = params.isInfluencer, shareCount = params.shareCount, shareValue = params.shareValue;
|
|
657
|
-
isOccupationEditable = ((_d = user === null || user === void 0 ? void 0 : user.data_status) === null || _d === void 0 ? void 0 : _d.occupation) === FieldType.EDITABLE && (occupation === null || occupation === void 0 ? void 0 : occupation.id);
|
|
658
|
-
isSourceIncomeEditable = ((_e = user === null || user === void 0 ? void 0 : user.data_status) === null || _e === void 0 ? void 0 : _e.source_of_income) === FieldType.EDITABLE && (sourceIncome === null || sourceIncome === void 0 ? void 0 : sourceIncome.id);
|
|
659
|
-
isPEPEditable = ((_f = user === null || user === void 0 ? void 0 : user.data_status) === null || _f === void 0 ? void 0 : _f.is_relative_PEP) === FieldType.EDITABLE;
|
|
660
|
-
isInfluencerEditable = ((_g = user === null || user === void 0 ? void 0 : user.data_status) === null || _g === void 0 ? void 0 : _g.is_influencer) === FieldType.EDITABLE;
|
|
661
|
-
isSharesAvailable = shareCount || shareValue;
|
|
662
|
-
pepInfo = isPEPEditable ? isPEP : undefined;
|
|
663
|
-
influencerInfo = isInfluencerEditable ? isInfluencer : undefined;
|
|
664
|
-
occupationInfo = isOccupationEditable ? { id: occupation.id } : undefined;
|
|
665
|
-
sourceIncomeInfo = isSourceIncomeEditable ? [{ id: sourceIncome.id }] : undefined;
|
|
666
|
-
monthlyIncomeInfo = (monthlyIncome === null || monthlyIncome === void 0 ? void 0 : monthlyIncome.id) && { id: monthlyIncome.id };
|
|
667
|
-
userPayload = {
|
|
668
|
-
occupation: occupationInfo,
|
|
669
|
-
source_income: sourceIncomeInfo,
|
|
670
|
-
monthly_income: monthlyIncomeInfo,
|
|
671
|
-
is_relative_PEP: pepInfo,
|
|
672
|
-
is_influencer: influencerInfo
|
|
673
|
-
};
|
|
674
|
-
shareHolderPayload = {
|
|
675
|
-
shares: isSharesAvailable
|
|
676
|
-
? {
|
|
677
|
-
count: shareCount && Number(shareCount),
|
|
678
|
-
value: shareValue && Number(shareValue)
|
|
679
|
-
}
|
|
680
|
-
: undefined
|
|
681
|
-
};
|
|
682
|
-
boardMemberPayload = {
|
|
683
|
-
is_relative_PEP: pepInfo,
|
|
684
|
-
is_influencer: influencerInfo
|
|
685
|
-
};
|
|
686
|
-
buyerMemberPayload = {
|
|
687
|
-
occupation: occupationInfo,
|
|
688
|
-
source_income: sourceIncomeInfo,
|
|
689
|
-
monthly_income: monthlyIncomeInfo
|
|
690
|
-
};
|
|
691
|
-
payload = userPayload;
|
|
692
|
-
if (type === IndividualType.SHARE_HOLDER)
|
|
693
|
-
payload = shareHolderPayload;
|
|
694
|
-
if (type === IndividualType.BOARD_MEMBER)
|
|
695
|
-
payload = boardMemberPayload;
|
|
696
|
-
if (type === IndividualType.BUYER)
|
|
697
|
-
payload = buyerMemberPayload;
|
|
698
|
-
if (type === IndividualType.CUSTOMER)
|
|
699
|
-
payload = {};
|
|
700
|
-
requestBody = __assign(__assign({ id: id, type: type }, payload), { encryption_contract: [], step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO });
|
|
701
|
-
return [4, API.individualService.updateIndividual(requestBody)];
|
|
702
|
-
case 3:
|
|
703
|
-
data = (_k.sent()).data;
|
|
704
|
-
thunkApi.dispatch(handleNextScreenStep());
|
|
705
|
-
(_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, requestBody);
|
|
706
|
-
return [2, { data: data, formData: params }];
|
|
707
|
-
}
|
|
696
|
+
requestBody = __assign(__assign({ ids: (ids === null || ids === void 0 ? void 0 : ids.length) ? ids : [id] }, payload), { encryption_contract: [], step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO });
|
|
697
|
+
return [4, API.individualService.updateMultipleIndividual(requestBody)];
|
|
698
|
+
case 1:
|
|
699
|
+
data = _h.sent();
|
|
700
|
+
businessCountry = settings.data.businessCountry;
|
|
701
|
+
hasCivilIdDocument = (civilID || []).length > 0;
|
|
702
|
+
hasSignatureDocument = (signatureFileId || []).length > 0;
|
|
703
|
+
isSendSignatureFile = (user === null || user === void 0 ? void 0 : user.is_authorized) && isUserORBuyerType;
|
|
704
|
+
civilIdDocument = getRecentDocumentBasedOnPurpose(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.IDENTITY_DOCUMENT);
|
|
705
|
+
signatureDocument = getRecentDocumentBasedOnPurpose(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.CUSTOMER_SIGNATURE);
|
|
706
|
+
if (!((civilIdDocument === null || civilIdDocument === void 0 ? void 0 : civilIdDocument.id) && hasCivilIdDocument)) return [3, 3];
|
|
707
|
+
documentBody = {
|
|
708
|
+
id: civilIdDocument.id,
|
|
709
|
+
images: civilID
|
|
710
|
+
};
|
|
711
|
+
return [4, API.documentService.addFilesToExistingDocument(documentBody)];
|
|
712
|
+
case 2:
|
|
713
|
+
_h.sent();
|
|
714
|
+
_h.label = 3;
|
|
715
|
+
case 3:
|
|
716
|
+
if (!((signatureDocument === null || signatureDocument === void 0 ? void 0 : signatureDocument.id) && hasSignatureDocument && isSendSignatureFile)) return [3, 5];
|
|
717
|
+
documentBody = {
|
|
718
|
+
id: signatureDocument.id,
|
|
719
|
+
images: signatureFileId
|
|
720
|
+
};
|
|
721
|
+
return [4, API.documentService.addFilesToExistingDocument(documentBody)];
|
|
722
|
+
case 4:
|
|
723
|
+
_h.sent();
|
|
724
|
+
_h.label = 5;
|
|
725
|
+
case 5:
|
|
726
|
+
documentsList = [];
|
|
727
|
+
if (hasCivilIdDocument && !(civilIdDocument === null || civilIdDocument === void 0 ? void 0 : civilIdDocument.id))
|
|
728
|
+
documentsList.push({ type: DocumentPurpose.IDENTITY_DOCUMENT, images: civilID });
|
|
729
|
+
if (isSendSignatureFile && hasSignatureDocument && !(signatureDocument === null || signatureDocument === void 0 ? void 0 : signatureDocument.id))
|
|
730
|
+
documentsList.push({ type: DocumentPurpose.CUSTOMER_SIGNATURE, images: signatureFileId });
|
|
731
|
+
if (!(documentsList.length > 0)) return [3, 7];
|
|
732
|
+
documentBody = {
|
|
733
|
+
individual_type_id: ((ids === null || ids === void 0 ? void 0 : ids.length) ? ids.find(function (i) { return i.includes('usr_'); }) : id) || '',
|
|
734
|
+
country: businessCountry.iso2,
|
|
735
|
+
documents: documentsList
|
|
736
|
+
};
|
|
737
|
+
return [4, API.documentService.updateDocumentInfo(documentBody)];
|
|
738
|
+
case 6:
|
|
739
|
+
_h.sent();
|
|
740
|
+
_h.label = 7;
|
|
741
|
+
case 7:
|
|
742
|
+
individualData = (sortUserList(mapUserList(data === null || data === void 0 ? void 0 : data.individuals)) || [])[0];
|
|
743
|
+
thunkApi.dispatch(handleNextScreenStep());
|
|
744
|
+
(_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, requestBody);
|
|
745
|
+
return [2, { data: data, formData: originalFormData, individualData: individualData }];
|
|
746
|
+
}
|
|
747
|
+
});
|
|
708
748
|
});
|
|
709
|
-
});
|
|
749
|
+
});
|
|
710
750
|
export var checkEmailAvailability = createAsyncThunk('checkEmailAvailability', function (_a) {
|
|
711
751
|
var email = _a.email, cancelToken = _a.cancelToken, onSuccess = _a.onSuccess;
|
|
712
752
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -730,13 +770,13 @@ export var checkEmailAvailability = createAsyncThunk('checkEmailAvailability', f
|
|
|
730
770
|
});
|
|
731
771
|
});
|
|
732
772
|
export var updateBoardSuccess = createAsyncThunk('individualUpdateBoardSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
733
|
-
var _a, settings, individual, _b, id, infoId, payload, data, boardInfoStatus;
|
|
734
|
-
var
|
|
735
|
-
return __generator(this, function (
|
|
736
|
-
switch (
|
|
773
|
+
var _a, settings, individual, _b, id, infoId, primaryUser, payload, data, boardInfoStatus, individualDataRes, _c, is_authorized, userId, type;
|
|
774
|
+
var _d, _e, _f, _g;
|
|
775
|
+
return __generator(this, function (_h) {
|
|
776
|
+
switch (_h.label) {
|
|
737
777
|
case 0:
|
|
738
778
|
_a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
|
|
739
|
-
_b = individual.data.verify.responseBody || {}, id = _b.board_id, infoId = _b.board_info_id;
|
|
779
|
+
_b = individual.data.verify.responseBody || {}, id = _b.board_id, infoId = _b.board_info_id, primaryUser = _b.primaryUser;
|
|
740
780
|
if (!id)
|
|
741
781
|
return [2];
|
|
742
782
|
payload = {
|
|
@@ -746,17 +786,27 @@ export var updateBoardSuccess = createAsyncThunk('individualUpdateBoardSuccess',
|
|
|
746
786
|
};
|
|
747
787
|
return [4, API.boardService.updateBoardInfo(__assign({ id: id, infoId: infoId }, payload))];
|
|
748
788
|
case 1:
|
|
749
|
-
data =
|
|
789
|
+
data = _h.sent();
|
|
750
790
|
return [4, API.boardService.retrieveBoardInfoStatus(id)];
|
|
751
791
|
case 2:
|
|
752
|
-
boardInfoStatus =
|
|
792
|
+
boardInfoStatus = _h.sent();
|
|
753
793
|
return [4, thunkApi.dispatch(retrieveBoardDetails(id))];
|
|
754
794
|
case 3:
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
795
|
+
_h.sent();
|
|
796
|
+
individualDataRes = undefined;
|
|
797
|
+
_c = primaryUser || {}, is_authorized = _c.is_authorized, userId = _c.id, type = _c.object;
|
|
798
|
+
if (!!is_authorized) return [3, 5];
|
|
799
|
+
return [4, thunkApi
|
|
800
|
+
.dispatch(retrieveIndividualInfo({ id: userId, type: type, countryCode: settings.data.businessCountry.iso2 }))
|
|
801
|
+
.unwrap()];
|
|
802
|
+
case 4:
|
|
803
|
+
individualDataRes = _h.sent();
|
|
804
|
+
_h.label = 5;
|
|
805
|
+
case 5:
|
|
806
|
+
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, {});
|
|
807
|
+
(_g = (_f = settings.data.appConfig).onFlowCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, { data: data });
|
|
758
808
|
thunkApi.dispatch(handleNextScreenStep());
|
|
759
|
-
return [2, { response: __assign(__assign({}, data), { flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || [] }), formData: params }];
|
|
809
|
+
return [2, { response: __assign(__assign({}, data), { flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || [] }), formData: params, individualData: individualDataRes === null || individualDataRes === void 0 ? void 0 : individualDataRes.data }];
|
|
760
810
|
}
|
|
761
811
|
});
|
|
762
812
|
}); });
|
|
@@ -790,7 +840,7 @@ var initialState = {
|
|
|
790
840
|
nid: '',
|
|
791
841
|
issuedCountry: undefined,
|
|
792
842
|
expiryDate: '',
|
|
793
|
-
dob:
|
|
843
|
+
dob: '',
|
|
794
844
|
placeOfBirthCountry: undefined,
|
|
795
845
|
placeOfBirthCity: undefined,
|
|
796
846
|
nationality: undefined
|
|
@@ -800,7 +850,6 @@ var initialState = {
|
|
|
800
850
|
sourceIncome: undefined,
|
|
801
851
|
monthlyIncome: undefined,
|
|
802
852
|
employerName: '',
|
|
803
|
-
employerLocation: undefined,
|
|
804
853
|
isPEP: null,
|
|
805
854
|
isInfluencer: null,
|
|
806
855
|
shareCount: '',
|
|
@@ -902,10 +951,72 @@ export var individualSlice = createSlice({
|
|
|
902
951
|
state.error = null;
|
|
903
952
|
})
|
|
904
953
|
.addCase(addDetailsAsync.fulfilled, function (state, action) {
|
|
954
|
+
var _a, _b, _c, _d;
|
|
905
955
|
state.loading = false;
|
|
906
956
|
state.error = null;
|
|
907
|
-
var
|
|
957
|
+
var _e = action.payload, userList = _e.userList, individualId = _e.individualId, countries = _e.countries;
|
|
958
|
+
var primaryUser = (state.data.verify.responseBody || {}).user;
|
|
959
|
+
var user = (userList || []).find(function (user) { return user.individual_id === individualId; });
|
|
908
960
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { userList: userList });
|
|
961
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { userList: userList, user: __assign(__assign({}, user), { is_authorized: (user === null || user === void 0 ? void 0 : user.is_authorized) !== undefined ? user === null || user === void 0 ? void 0 : user.is_authorized : primaryUser === null || primaryUser === void 0 ? void 0 : primaryUser.is_authorized }) });
|
|
962
|
+
var _f = user || {}, source_income = _f.source_income, monthly_income = _f.monthly_income, occupation = _f.occupation, is_relative_PEP = _f.is_relative_PEP, is_influencer = _f.is_influencer, birth = _f.birth, contact = _f.contact, identification = _f.identification, nationality = _f.nationality, gender = _f.gender, shares = _f.shares;
|
|
963
|
+
var _g = state.data.individualData.responseBody || {}, sourceIncomeList = _g.sourceIncomeList, monthlyIncomeList = _g.monthlyIncomeList;
|
|
964
|
+
var cityList = (state.data.verify.responseBody || {}).cityList;
|
|
965
|
+
if (user)
|
|
966
|
+
state.data.individualPersonalData.name = getUserName(user, false);
|
|
967
|
+
if (contact === null || contact === void 0 ? void 0 : contact.email)
|
|
968
|
+
state.data.individualPersonalData.email = contact === null || contact === void 0 ? void 0 : contact.email;
|
|
969
|
+
if ((_a = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _a === void 0 ? void 0 : _a.number)
|
|
970
|
+
state.data.individualPersonalData.mobile = (_b = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _b === void 0 ? void 0 : _b.number;
|
|
971
|
+
if ((_c = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _c === void 0 ? void 0 : _c.country_code) {
|
|
972
|
+
state.data.individualPersonalData.countryCode = findCountryByIddPrefix(countries, (_d = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _d === void 0 ? void 0 : _d.country_code) || defaultCountry;
|
|
973
|
+
}
|
|
974
|
+
if (gender)
|
|
975
|
+
state.data.individualPersonalData.gender = gender.toLowerCase();
|
|
976
|
+
if (identification === null || identification === void 0 ? void 0 : identification.id)
|
|
977
|
+
state.data.individualPersonalData.nid = identification === null || identification === void 0 ? void 0 : identification.id;
|
|
978
|
+
if (identification === null || identification === void 0 ? void 0 : identification.issued_country_code) {
|
|
979
|
+
state.data.individualPersonalData.issuedCountry = findCountryByIso2(countries, identification === null || identification === void 0 ? void 0 : identification.issued_country_code);
|
|
980
|
+
}
|
|
981
|
+
var expiryDate = new Date((identification === null || identification === void 0 ? void 0 : identification.expiry) || new Date().getTime());
|
|
982
|
+
state.data.individualPersonalData.expiryDate = convertNumbers2English(dateFormat(expiryDate));
|
|
983
|
+
if (birth === null || birth === void 0 ? void 0 : birth.date)
|
|
984
|
+
state.data.individualPersonalData.dob = convertNumbers2English(dateFormat(new Date(birth === null || birth === void 0 ? void 0 : birth.date)));
|
|
985
|
+
if (birth === null || birth === void 0 ? void 0 : birth.country) {
|
|
986
|
+
state.data.individualPersonalData.placeOfBirthCountry = findCountryByIso2(countries, birth === null || birth === void 0 ? void 0 : birth.country);
|
|
987
|
+
}
|
|
988
|
+
if (birth === null || birth === void 0 ? void 0 : birth.city) {
|
|
989
|
+
var selectedCity = cityList === null || cityList === void 0 ? void 0 : cityList.find(function (city) {
|
|
990
|
+
var _a;
|
|
991
|
+
return city.id === ((_a = birth === null || birth === void 0 ? void 0 : birth.city) === null || _a === void 0 ? void 0 : _a.cityId);
|
|
992
|
+
});
|
|
993
|
+
state.data.individualPersonalData.placeOfBirthCity = selectedCity;
|
|
994
|
+
}
|
|
995
|
+
if (nationality) {
|
|
996
|
+
state.data.individualPersonalData.nationality = findCountryByIso2(countries, nationality);
|
|
997
|
+
}
|
|
998
|
+
var _h = shares || {}, count = _h.count, value = _h.value;
|
|
999
|
+
var shareCount = count === null || count === void 0 ? void 0 : count.toString();
|
|
1000
|
+
var shareValue = value === null || value === void 0 ? void 0 : value.toString();
|
|
1001
|
+
if (shareCount) {
|
|
1002
|
+
state.data.individualData.shareCount = shareCount;
|
|
1003
|
+
}
|
|
1004
|
+
if (shareValue) {
|
|
1005
|
+
state.data.individualData.shareValue = formatNumberAsCurrency(shareValue);
|
|
1006
|
+
}
|
|
1007
|
+
var selectedSourceIncome = (sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList.find(function (source) { var _a; return (source === null || source === void 0 ? void 0 : source.id) === ((_a = source_income === null || source_income === void 0 ? void 0 : source_income[0]) === null || _a === void 0 ? void 0 : _a.id); })) || (sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList[0]);
|
|
1008
|
+
if (!!selectedSourceIncome)
|
|
1009
|
+
state.data.individualData.sourceIncome = selectedSourceIncome;
|
|
1010
|
+
var selectedMonthlyIncome = monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList.find(function (income) {
|
|
1011
|
+
return income.id === (monthly_income === null || monthly_income === void 0 ? void 0 : monthly_income.id);
|
|
1012
|
+
});
|
|
1013
|
+
var selectedOccupation = (occupation === null || occupation === void 0 ? void 0 : occupation.chapter) || (occupation === null || occupation === void 0 ? void 0 : occupation.section);
|
|
1014
|
+
state.data.individualData.monthlyIncome = selectedMonthlyIncome;
|
|
1015
|
+
state.data.individualData.occupation = selectedOccupation;
|
|
1016
|
+
if (is_relative_PEP !== undefined)
|
|
1017
|
+
state.data.individualData.isPEP = is_relative_PEP;
|
|
1018
|
+
if (is_influencer !== undefined)
|
|
1019
|
+
state.data.individualData.isInfluencer = is_influencer;
|
|
909
1020
|
})
|
|
910
1021
|
.addCase(addDetailsAsync.rejected, function (state, action) {
|
|
911
1022
|
state.loading = false;
|
|
@@ -918,12 +1029,12 @@ export var individualSlice = createSlice({
|
|
|
918
1029
|
.addCase(requestDetailsByEmail.fulfilled, function (state, action) {
|
|
919
1030
|
state.loading = false;
|
|
920
1031
|
state.error = null;
|
|
921
|
-
var _a = action.payload, data = _a.data,
|
|
1032
|
+
var _a = action.payload, data = _a.data, individualData = _a.individualData;
|
|
922
1033
|
var userList = (state.data.verify.responseBody || {}).userList;
|
|
923
1034
|
var list = userList || [];
|
|
924
1035
|
list = list.map(function (user) {
|
|
925
1036
|
var _a, _b;
|
|
926
|
-
var userInfo = user.id === (
|
|
1037
|
+
var userInfo = user.id === (individualData === null || individualData === void 0 ? void 0 : individualData.id) ? individualData : user;
|
|
927
1038
|
return user.id === ((_b = (_a = data === null || data === void 0 ? void 0 : data.notification) === null || _a === void 0 ? void 0 : _a.recipient) === null || _b === void 0 ? void 0 : _b.id) ? __assign(__assign({}, userInfo), { isRequestedEmail: true }) : userInfo;
|
|
928
1039
|
});
|
|
929
1040
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { requestEmailData: data, userList: list });
|
|
@@ -938,11 +1049,11 @@ export var individualSlice = createSlice({
|
|
|
938
1049
|
.addCase(retrieveIndividualInfo.fulfilled, function (state, action) {
|
|
939
1050
|
var _a, _b, _c, _d;
|
|
940
1051
|
state.error = null;
|
|
941
|
-
var _e = action.payload, data = _e.data, countries = _e.countries
|
|
1052
|
+
var _e = action.payload, data = _e.data, countries = _e.countries;
|
|
942
1053
|
var user = (state.data.verify.responseBody || {}).user;
|
|
943
|
-
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { user: __assign(__assign({}, data), { is_authorized: data.is_authorized !== undefined ? data.is_authorized : user === null || user === void 0 ? void 0 : user.is_authorized }) });
|
|
944
|
-
var _f = data || {}, source_income = _f.source_income, monthly_income = _f.monthly_income, occupation = _f.occupation, is_relative_PEP = _f.is_relative_PEP, is_influencer = _f.is_influencer, birth = _f.birth, contact = _f.contact, identification = _f.identification, nationality = _f.nationality, gender = _f.gender,
|
|
945
|
-
var _g = state.data.individualData.responseBody || {}, sourceIncomeList = _g.sourceIncomeList, monthlyIncomeList = _g.monthlyIncomeList
|
|
1054
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { primaryUser: data, user: __assign(__assign({}, data), { is_authorized: data.is_authorized !== undefined ? data.is_authorized : user === null || user === void 0 ? void 0 : user.is_authorized }) });
|
|
1055
|
+
var _f = data || {}, source_income = _f.source_income, monthly_income = _f.monthly_income, occupation = _f.occupation, is_relative_PEP = _f.is_relative_PEP, is_influencer = _f.is_influencer, birth = _f.birth, contact = _f.contact, identification = _f.identification, nationality = _f.nationality, gender = _f.gender, shares = _f.shares;
|
|
1056
|
+
var _g = state.data.individualData.responseBody || {}, sourceIncomeList = _g.sourceIncomeList, monthlyIncomeList = _g.monthlyIncomeList;
|
|
946
1057
|
var cityList = (state.data.verify.responseBody || {}).cityList;
|
|
947
1058
|
if (data)
|
|
948
1059
|
state.data.individualPersonalData.name = getUserName(data, false);
|
|
@@ -957,7 +1068,6 @@ export var individualSlice = createSlice({
|
|
|
957
1068
|
state.data.individualPersonalData.gender = gender.toLowerCase();
|
|
958
1069
|
if (identification === null || identification === void 0 ? void 0 : identification.id)
|
|
959
1070
|
state.data.individualPersonalData.nid = identification === null || identification === void 0 ? void 0 : identification.id;
|
|
960
|
-
state.data.individualPersonalData.issuedCountry = identification === null || identification === void 0 ? void 0 : identification.issued_country_code;
|
|
961
1071
|
if (identification === null || identification === void 0 ? void 0 : identification.issued_country_code) {
|
|
962
1072
|
state.data.individualPersonalData.issuedCountry = findCountryByIso2(countries, identification === null || identification === void 0 ? void 0 : identification.issued_country_code);
|
|
963
1073
|
}
|
|
@@ -970,7 +1080,8 @@ export var individualSlice = createSlice({
|
|
|
970
1080
|
}
|
|
971
1081
|
if (birth === null || birth === void 0 ? void 0 : birth.city) {
|
|
972
1082
|
var selectedCity = cityList === null || cityList === void 0 ? void 0 : cityList.find(function (city) {
|
|
973
|
-
|
|
1083
|
+
var _a;
|
|
1084
|
+
return city.id === ((_a = birth === null || birth === void 0 ? void 0 : birth.city) === null || _a === void 0 ? void 0 : _a.cityId);
|
|
974
1085
|
});
|
|
975
1086
|
state.data.individualPersonalData.placeOfBirthCity = selectedCity;
|
|
976
1087
|
}
|
|
@@ -984,22 +1095,15 @@ export var individualSlice = createSlice({
|
|
|
984
1095
|
state.data.individualData.shareCount = shareCount;
|
|
985
1096
|
}
|
|
986
1097
|
if (shareValue) {
|
|
987
|
-
state.data.individualData.shareValue = shareValue;
|
|
1098
|
+
state.data.individualData.shareValue = formatNumberAsCurrency(shareValue);
|
|
988
1099
|
}
|
|
989
1100
|
var selectedSourceIncome = (sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList.find(function (source) { var _a; return (source === null || source === void 0 ? void 0 : source.id) === ((_a = source_income === null || source_income === void 0 ? void 0 : source_income[0]) === null || _a === void 0 ? void 0 : _a.id); })) || (sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList[0]);
|
|
990
1101
|
if (!!selectedSourceIncome)
|
|
991
1102
|
state.data.individualData.sourceIncome = selectedSourceIncome;
|
|
992
|
-
var code = employer_country || countryCode;
|
|
993
|
-
if (!!code) {
|
|
994
|
-
var employerLocation = (countries || []).find(function (country) { return country.iso2 === code; });
|
|
995
|
-
state.data.individualData.employerLocation = employerLocation;
|
|
996
|
-
}
|
|
997
1103
|
var selectedMonthlyIncome = monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList.find(function (income) {
|
|
998
1104
|
return income.id === (monthly_income === null || monthly_income === void 0 ? void 0 : monthly_income.id);
|
|
999
1105
|
});
|
|
1000
|
-
var selectedOccupation =
|
|
1001
|
-
return occup.id === (occupation === null || occupation === void 0 ? void 0 : occupation.id);
|
|
1002
|
-
});
|
|
1106
|
+
var selectedOccupation = (occupation === null || occupation === void 0 ? void 0 : occupation.chapter) || (occupation === null || occupation === void 0 ? void 0 : occupation.section);
|
|
1003
1107
|
state.data.individualData.monthlyIncome = selectedMonthlyIncome;
|
|
1004
1108
|
state.data.individualData.occupation = selectedOccupation;
|
|
1005
1109
|
state.data.individualData.isPEP = is_relative_PEP;
|
|
@@ -1042,9 +1146,7 @@ export var individualSlice = createSlice({
|
|
|
1042
1146
|
var selectedMonthlyIncome = monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList.find(function (income) {
|
|
1043
1147
|
return income.id === (monthly_income === null || monthly_income === void 0 ? void 0 : monthly_income.id);
|
|
1044
1148
|
});
|
|
1045
|
-
var selectedOccupation =
|
|
1046
|
-
return occup.id === (occupation === null || occupation === void 0 ? void 0 : occupation.id);
|
|
1047
|
-
});
|
|
1149
|
+
var selectedOccupation = (occupation === null || occupation === void 0 ? void 0 : occupation.chapter) || (occupation === null || occupation === void 0 ? void 0 : occupation.section);
|
|
1048
1150
|
state.data.individualData.monthlyIncome = selectedMonthlyIncome;
|
|
1049
1151
|
state.data.individualData.occupation = selectedOccupation;
|
|
1050
1152
|
})
|
|
@@ -1064,10 +1166,10 @@ export var individualSlice = createSlice({
|
|
|
1064
1166
|
var cityList = action.payload;
|
|
1065
1167
|
state.data.verify.responseBody = __assign(__assign({}, data), { cityList: cityList });
|
|
1066
1168
|
var birth = (((_a = state.data.verify.responseBody) === null || _a === void 0 ? void 0 : _a.user) || {}).birth;
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
return
|
|
1169
|
+
if (birth === null || birth === void 0 ? void 0 : birth.city) {
|
|
1170
|
+
var selectedCity = cityList === null || cityList === void 0 ? void 0 : cityList.find(function (city) {
|
|
1171
|
+
var _a;
|
|
1172
|
+
return city.id === ((_a = birth === null || birth === void 0 ? void 0 : birth.city) === null || _a === void 0 ? void 0 : _a.cityId);
|
|
1071
1173
|
});
|
|
1072
1174
|
state.data.individualPersonalData.placeOfBirthCity = selectedCity;
|
|
1073
1175
|
}
|
|
@@ -1113,9 +1215,16 @@ export var individualSlice = createSlice({
|
|
|
1113
1215
|
.addCase(updateIndividualInfo.fulfilled, function (state, action) {
|
|
1114
1216
|
state.loading = false;
|
|
1115
1217
|
state.error = null;
|
|
1116
|
-
var _a = action.payload, data = _a.data, formData = _a.formData;
|
|
1218
|
+
var _a = action.payload, data = _a.data, formData = _a.formData, individualData = _a.individualData;
|
|
1117
1219
|
state.data.individualData = formData;
|
|
1118
1220
|
state.data.individualData.responseBody = data;
|
|
1221
|
+
var userList = (state.data.verify.responseBody || {}).userList;
|
|
1222
|
+
var list = userList || [];
|
|
1223
|
+
list = list.map(function (user) {
|
|
1224
|
+
var userInfo = user.id === (individualData === null || individualData === void 0 ? void 0 : individualData.id) ? individualData : user;
|
|
1225
|
+
return userInfo;
|
|
1226
|
+
});
|
|
1227
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { userList: list });
|
|
1119
1228
|
})
|
|
1120
1229
|
.addCase(updateIndividualInfo.rejected, function (state, action) {
|
|
1121
1230
|
state.loading = false;
|
|
@@ -1135,6 +1244,20 @@ export var individualSlice = createSlice({
|
|
|
1135
1244
|
.addCase(retrieveBoardDetails.rejected, function (state, action) {
|
|
1136
1245
|
state.error = action.error.message;
|
|
1137
1246
|
state.loading = false;
|
|
1247
|
+
})
|
|
1248
|
+
.addCase(retrieveBoardStatus.pending, function (state) {
|
|
1249
|
+
state.error = null;
|
|
1250
|
+
state.loading = true;
|
|
1251
|
+
})
|
|
1252
|
+
.addCase(retrieveBoardStatus.fulfilled, function (state, action) {
|
|
1253
|
+
state.error = null;
|
|
1254
|
+
state.loading = false;
|
|
1255
|
+
var flows = action.payload.flows;
|
|
1256
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows });
|
|
1257
|
+
})
|
|
1258
|
+
.addCase(retrieveBoardStatus.rejected, function (state, action) {
|
|
1259
|
+
state.error = action.error.message;
|
|
1260
|
+
state.loading = false;
|
|
1138
1261
|
})
|
|
1139
1262
|
.addCase(checkEmailAvailability.fulfilled, function (state, action) {
|
|
1140
1263
|
var _a;
|
|
@@ -1153,14 +1276,15 @@ export var individualSlice = createSlice({
|
|
|
1153
1276
|
var _a;
|
|
1154
1277
|
state.loading = false;
|
|
1155
1278
|
state.error = null;
|
|
1156
|
-
var
|
|
1279
|
+
var _b = action.payload || {}, response = _b.response, individualData = _b.individualData;
|
|
1157
1280
|
var description = (((_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
1158
1281
|
if (description) {
|
|
1159
1282
|
state.error = description;
|
|
1160
1283
|
return;
|
|
1161
1284
|
}
|
|
1162
1285
|
var flows = response.flows;
|
|
1163
|
-
|
|
1286
|
+
var individuals = (state.data.verify.responseBody || {}).individuals;
|
|
1287
|
+
state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), { flows: flows }), (individualData && { individuals: __assign(__assign({}, individuals), { data_state: individualData === null || individualData === void 0 ? void 0 : individualData.data_state }) }));
|
|
1164
1288
|
})
|
|
1165
1289
|
.addCase(updateBoardSuccess.pending, function (state) {
|
|
1166
1290
|
state.loading = true;
|