@tap-payments/auth-jsconnect 2.1.99-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 +33 -28
- 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 +46 -0
- package/build/constants/app.js +106 -40
- 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 +198 -26
- package/build/features/app/individual/individualStore.js +547 -348
- 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 +18 -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 +13 -0
- package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.js +146 -0
- package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.d.ts +5 -0
- package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +63 -0
- package/build/features/individual/screens/IndividualPhoneInfo/index.d.ts +3 -0
- package/build/features/individual/screens/IndividualPhoneInfo/index.js +2 -0
- package/build/features/individual/screens/IndividualPhoneInfo/validation.d.ts +8 -0
- package/build/features/individual/screens/IndividualPhoneInfo/validation.js +31 -0
- 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,
|
|
75
|
-
export var
|
|
76
|
-
var token = _a.token, isInternally = _a.isInternally;
|
|
74
|
+
import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, hasNoneEditableValue, getUserNameObject, getUserName, sleep, isValidEmail, getRecentDocumentBasedOnPurpose, formatNumberAsCurrency, removeAllCharsFromNumber, mapUserList, sortUserList, getIndividualType } from '../../../utils';
|
|
75
|
+
export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a, thunkApi) {
|
|
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 verifyLeadToken = createAsyncThunk('individualVerifyLeadToken', funct
|
|
|
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;
|
|
@@ -98,49 +98,46 @@ export var verifyLeadToken = createAsyncThunk('individualVerifyLeadToken', funct
|
|
|
98
98
|
countryCode = data === null || data === void 0 ? void 0 : data.country_code;
|
|
99
99
|
thunkApi.dispatch(handleSetCountryByIso2(countryCode));
|
|
100
100
|
}
|
|
101
|
-
if (!(data.step_name
|
|
101
|
+
if (!(data.step_name === INDIVIDUAl_STEP_NAMES.PHONE_INFO)) return [3, 2];
|
|
102
|
+
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PHONE_INFO_STEP'));
|
|
103
|
+
return [3, 16];
|
|
104
|
+
case 2:
|
|
105
|
+
if (!(data.step_name !== INDIVIDUAl_STEP_NAMES.PHONE_AUTH)) return [3, 15];
|
|
102
106
|
board_id = data === null || data === void 0 ? void 0 : data.id;
|
|
103
107
|
board_info_id = data === null || data === void 0 ? void 0 : data.board_info_id;
|
|
104
|
-
if (!(board_id && board_info_id)) return [3,
|
|
108
|
+
if (!(board_id && board_info_id)) return [3, 5];
|
|
105
109
|
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
106
|
-
case
|
|
110
|
+
case 3:
|
|
107
111
|
boardInfoData = _l.sent();
|
|
108
112
|
notification = (boardInfoData || {}).notification;
|
|
109
113
|
_b = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _b.id, type = _b.type;
|
|
110
|
-
if (!(id && type)) return [3,
|
|
111
|
-
return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode }))];
|
|
112
|
-
case 3:
|
|
113
|
-
payload_1 = (_l.sent()).payload;
|
|
114
|
-
individualData = payload_1.data || {};
|
|
115
|
-
_l.label = 4;
|
|
114
|
+
if (!(id && type)) return [3, 5];
|
|
115
|
+
return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
|
|
116
116
|
case 4:
|
|
117
|
+
data_1 = (_l.sent()).data;
|
|
118
|
+
individualData = data_1 || {};
|
|
119
|
+
_l.label = 5;
|
|
120
|
+
case 5:
|
|
117
121
|
if (!board_id) return [3, 7];
|
|
118
122
|
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
119
|
-
case 5:
|
|
120
|
-
boardData = _l.sent();
|
|
121
|
-
return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
122
123
|
case 6:
|
|
123
|
-
|
|
124
|
+
boardData = _l.sent();
|
|
124
125
|
_l.label = 7;
|
|
125
126
|
case 7:
|
|
126
127
|
if (!countryCode) {
|
|
127
|
-
countryCode = (
|
|
128
|
+
countryCode = (_e = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _e === void 0 ? void 0 : _e.country;
|
|
128
129
|
if (countryCode)
|
|
129
130
|
thunkApi.dispatch(handleSetCountryByIso2(countryCode));
|
|
130
131
|
}
|
|
131
|
-
info = (boardInfoStatus || {}).info;
|
|
132
|
-
hasIndividualCompleted = ((_e = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'individual'; })) === null || _e === void 0 ? void 0 : _e.status) === 'completed';
|
|
133
|
-
if (!hasIndividualCompleted) return [3, 8];
|
|
134
|
-
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
135
|
-
return [3, 14];
|
|
136
|
-
case 8:
|
|
137
132
|
if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 11];
|
|
138
|
-
if (!((_f = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _f === void 0 ? void 0 : _f.id)) return [3,
|
|
133
|
+
if (!((_f = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _f === void 0 ? void 0 : _f.id)) return [3, 9];
|
|
139
134
|
return [4, thunkApi.dispatch(getIndividualList((_g = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _g === void 0 ? void 0 : _g.id))];
|
|
140
|
-
case
|
|
135
|
+
case 8:
|
|
141
136
|
_l.sent();
|
|
142
|
-
_l.label =
|
|
137
|
+
_l.label = 9;
|
|
138
|
+
case 9: return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
143
139
|
case 10:
|
|
140
|
+
boardInfoStatus = _l.sent();
|
|
144
141
|
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
|
|
145
142
|
return [3, 14];
|
|
146
143
|
case 11:
|
|
@@ -153,24 +150,52 @@ export var verifyLeadToken = createAsyncThunk('individualVerifyLeadToken', funct
|
|
|
153
150
|
case 13:
|
|
154
151
|
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP'));
|
|
155
152
|
_l.label = 14;
|
|
156
|
-
case 14: return [
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
153
|
+
case 14: return [3, 16];
|
|
154
|
+
case 15:
|
|
155
|
+
if (isUpdatePhoneInfo) {
|
|
156
|
+
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_VERIFY_STEP'));
|
|
157
|
+
}
|
|
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
|
+
}];
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
export var verifyLeadToken = createAsyncThunk('individualVerifyLeadToken', function (_a, thunkApi) {
|
|
186
|
+
var token = _a.token, isInternally = _a.isInternally;
|
|
187
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
188
|
+
return __generator(this, function (_b) {
|
|
189
|
+
switch (_b.label) {
|
|
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
|
+
})];
|
|
196
|
+
case 1:
|
|
197
|
+
_b.sent();
|
|
198
|
+
return [2];
|
|
174
199
|
}
|
|
175
200
|
});
|
|
176
201
|
});
|
|
@@ -193,29 +218,27 @@ export var resendOTP = createAsyncThunk('resendOTPIndividual', function (params,
|
|
|
193
218
|
});
|
|
194
219
|
}); });
|
|
195
220
|
export var addDetailsAsync = createAsyncThunk('individual/addDetailsAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
196
|
-
var settings, user, userList,
|
|
221
|
+
var settings, user, userList, birth, individual_id, countryCode;
|
|
197
222
|
return __generator(this, function (_a) {
|
|
198
223
|
switch (_a.label) {
|
|
199
224
|
case 0:
|
|
200
225
|
settings = thunkApi.getState().settings;
|
|
201
226
|
user = params.user, userList = params.userList;
|
|
202
|
-
|
|
227
|
+
birth = user.birth, individual_id = user.individual_id;
|
|
203
228
|
countryCode = (birth === null || birth === void 0 ? void 0 : birth.country) || settings.data.businessCountry.iso2;
|
|
204
229
|
if (!countryCode) return [3, 2];
|
|
205
230
|
return [4, thunkApi.dispatch(getCityList(countryCode))];
|
|
206
231
|
case 1:
|
|
207
232
|
_a.sent();
|
|
208
233
|
_a.label = 2;
|
|
209
|
-
case 2:
|
|
210
|
-
case 3:
|
|
211
|
-
_a.sent();
|
|
234
|
+
case 2:
|
|
212
235
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
|
|
213
|
-
return [2, { userList: userList }];
|
|
236
|
+
return [2, { userList: userList, individualId: individual_id, countryCode: settings.data.businessCountry.iso2, countries: settings.data.countries }];
|
|
214
237
|
}
|
|
215
238
|
});
|
|
216
239
|
}); });
|
|
217
240
|
export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsByEmail', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
218
|
-
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;
|
|
219
242
|
var _c;
|
|
220
243
|
return __generator(this, function (_d) {
|
|
221
244
|
switch (_d.label) {
|
|
@@ -223,7 +246,7 @@ export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsBy
|
|
|
223
246
|
individual = thunkApi.getState().individual;
|
|
224
247
|
_a = individual.data.verify.responseBody || {}, merchant_id = _a.merchant_id, board_id = _a.board_id;
|
|
225
248
|
user = params.user, collectInfo = params.collectInfo;
|
|
226
|
-
id = user.id,
|
|
249
|
+
id = user.id, objects = user.objects, ids = user.ids;
|
|
227
250
|
_b = (user === null || user === void 0 ? void 0 : user.contact) || {}, resEmail = _b.email, resPhone = _b.phone;
|
|
228
251
|
isPhoneAndEmailAvailable = isValidEmail(resEmail) && (resPhone === null || resPhone === void 0 ? void 0 : resPhone.country_code) && (resPhone === null || resPhone === void 0 ? void 0 : resPhone.number);
|
|
229
252
|
email = collectInfo.email, mobile = collectInfo.mobile, countryCode = collectInfo.countryCode;
|
|
@@ -232,8 +255,7 @@ export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsBy
|
|
|
232
255
|
if (!(!isPhoneAndEmailAvailable && hasContact)) return [3, 2];
|
|
233
256
|
hasPhone = mobile && (countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix);
|
|
234
257
|
requestBody = {
|
|
235
|
-
|
|
236
|
-
type: type,
|
|
258
|
+
ids: (ids === null || ids === void 0 ? void 0 : ids.length) ? ids : [id],
|
|
237
259
|
contact: {
|
|
238
260
|
email: email,
|
|
239
261
|
phone: hasPhone
|
|
@@ -244,18 +266,11 @@ export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsBy
|
|
|
244
266
|
: undefined
|
|
245
267
|
}
|
|
246
268
|
};
|
|
247
|
-
return [4, API.individualService.
|
|
269
|
+
return [4, API.individualService.updateMultipleIndividual(requestBody)];
|
|
248
270
|
case 1:
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
individualData = data_1 === null || data_1 === void 0 ? void 0 : data_1.shareholder;
|
|
253
|
-
else if (type === IndividualType.BOARD_MEMBER)
|
|
254
|
-
individualData = data_1 === null || data_1 === void 0 ? void 0 : data_1.board_member;
|
|
255
|
-
else if (type === IndividualType.BUYER)
|
|
256
|
-
individualData = data_1 === null || data_1 === void 0 ? void 0 : data_1.buyer;
|
|
257
|
-
else if (type === IndividualType.CUSTOMER)
|
|
258
|
-
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;
|
|
259
274
|
_d.label = 2;
|
|
260
275
|
case 2:
|
|
261
276
|
payload = {
|
|
@@ -269,7 +284,7 @@ export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsBy
|
|
|
269
284
|
notification: {
|
|
270
285
|
recipient: {
|
|
271
286
|
id: id,
|
|
272
|
-
type:
|
|
287
|
+
type: (objects === null || objects === void 0 ? void 0 : objects[0]) || ''
|
|
273
288
|
},
|
|
274
289
|
channel: ['email']
|
|
275
290
|
}
|
|
@@ -277,14 +292,14 @@ export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsBy
|
|
|
277
292
|
return [4, API.boardService.requestDetailsByEmail(payload)];
|
|
278
293
|
case 3:
|
|
279
294
|
data = _d.sent();
|
|
280
|
-
return [2, { data: data,
|
|
295
|
+
return [2, { data: data, individualData: individualData }];
|
|
281
296
|
}
|
|
282
297
|
});
|
|
283
298
|
}); });
|
|
284
299
|
export var getIndividualList = createAsyncThunk('individual/getIndividualList', function (businessId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
285
|
-
var payload,
|
|
286
|
-
return __generator(this, function (
|
|
287
|
-
switch (
|
|
300
|
+
var payload, individuals, list;
|
|
301
|
+
return __generator(this, function (_a) {
|
|
302
|
+
switch (_a.label) {
|
|
288
303
|
case 0:
|
|
289
304
|
payload = {
|
|
290
305
|
page: 1,
|
|
@@ -293,12 +308,9 @@ export var getIndividualList = createAsyncThunk('individual/getIndividualList',
|
|
|
293
308
|
};
|
|
294
309
|
return [4, API.individualService.getIndividualList(payload)];
|
|
295
310
|
case 1:
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
boardMemberList = (board_members || []).map(function (board_member) { return (__assign(__assign({}, board_member), { type: IndividualType.BOARD_MEMBER })); });
|
|
300
|
-
individualList = __spreadArray(__spreadArray(__spreadArray([], userList, true), shareHolderList, true), boardMemberList, true);
|
|
301
|
-
return [2, individualList];
|
|
311
|
+
individuals = (_a.sent()).individuals;
|
|
312
|
+
list = sortUserList(mapUserList(individuals)) || [];
|
|
313
|
+
return [2, __spreadArray([], list, true)];
|
|
302
314
|
}
|
|
303
315
|
});
|
|
304
316
|
}); });
|
|
@@ -318,30 +330,35 @@ export var getCityList = createAsyncThunk('individual/getCityList', function (co
|
|
|
318
330
|
});
|
|
319
331
|
}); });
|
|
320
332
|
export var retrieveIndividualInfo = createAsyncThunk('individual/retrieveIndividualInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
321
|
-
var id, type, countryCode, settings, data, individualData;
|
|
322
|
-
return __generator(this, function (
|
|
323
|
-
switch (
|
|
333
|
+
var id, type, countryCode, settings, data, _a, isShareholder, isBoardMember, isBuyer, isCustomer, individualData;
|
|
334
|
+
return __generator(this, function (_b) {
|
|
335
|
+
switch (_b.label) {
|
|
324
336
|
case 0:
|
|
325
337
|
id = params.id, type = params.type, countryCode = params.countryCode;
|
|
326
338
|
settings = thunkApi.getState().settings;
|
|
327
339
|
return [4, API.individualService.retrieveIndividual(id, type)];
|
|
328
340
|
case 1:
|
|
329
|
-
data =
|
|
341
|
+
data = _b.sent();
|
|
342
|
+
_a = getIndividualType([type]), isShareholder = _a.isShareholder, isBoardMember = _a.isBoardMember, isBuyer = _a.isBuyer, isCustomer = _a.isCustomer;
|
|
330
343
|
individualData = data === null || data === void 0 ? void 0 : data.user;
|
|
331
|
-
if (
|
|
344
|
+
if (isShareholder)
|
|
332
345
|
individualData = data === null || data === void 0 ? void 0 : data.shareholder;
|
|
333
|
-
else if (
|
|
346
|
+
else if (isBoardMember)
|
|
334
347
|
individualData = data === null || data === void 0 ? void 0 : data.board_member;
|
|
335
|
-
else if (
|
|
348
|
+
else if (isBuyer)
|
|
336
349
|
individualData = data === null || data === void 0 ? void 0 : data.buyer;
|
|
337
|
-
else if (
|
|
350
|
+
else if (isCustomer)
|
|
338
351
|
individualData = data === null || data === void 0 ? void 0 : data.customer;
|
|
339
|
-
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
|
+
}];
|
|
340
357
|
}
|
|
341
358
|
});
|
|
342
359
|
}); });
|
|
343
360
|
export var retrieveDataList = createAsyncThunk('individualRetrieveDataList', function (countryCode) { return __awaiter(void 0, void 0, void 0, function () {
|
|
344
|
-
var monthlyIncomeBody, dataBody, _a, sourceIncome, monthlyIncome, occupation;
|
|
361
|
+
var monthlyIncomeBody, dataBody, _a, sourceIncome, monthlyIncome, occupationData, occupation, mappedOccupation;
|
|
345
362
|
return __generator(this, function (_b) {
|
|
346
363
|
switch (_b.label) {
|
|
347
364
|
case 0:
|
|
@@ -358,15 +375,35 @@ export var retrieveDataList = createAsyncThunk('individualRetrieveDataList', fun
|
|
|
358
375
|
API.dataService.getOccupation(dataBody)
|
|
359
376
|
])];
|
|
360
377
|
case 1:
|
|
361
|
-
_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
|
+
});
|
|
362
384
|
return [2, {
|
|
363
385
|
sourceIncome: sourceIncome,
|
|
364
386
|
monthlyIncome: monthlyIncome,
|
|
365
|
-
occupation:
|
|
387
|
+
occupation: { list: mappedOccupation || [] }
|
|
366
388
|
}];
|
|
367
389
|
}
|
|
368
390
|
});
|
|
369
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
|
+
}); });
|
|
370
407
|
export var retrieveBoardDetails = createAsyncThunk('retrieveIndividualBoardDetails', function (boardId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
371
408
|
var _a, user, data;
|
|
372
409
|
var _b, _c;
|
|
@@ -382,8 +419,8 @@ export var retrieveBoardDetails = createAsyncThunk('retrieveIndividualBoardDetai
|
|
|
382
419
|
});
|
|
383
420
|
}); });
|
|
384
421
|
export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
385
|
-
var _a, individual, settings, responseBody, _b, board_id, board_info_id, countries, payload, data, boardInfoData, individualData, boardData, boardInfoStatus, countryCode, notification, _c, id, type,
|
|
386
|
-
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;
|
|
387
424
|
return __generator(this, function (_q) {
|
|
388
425
|
switch (_q.label) {
|
|
389
426
|
case 0:
|
|
@@ -393,7 +430,7 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
|
|
|
393
430
|
countries = settings.data.countries;
|
|
394
431
|
payload = {
|
|
395
432
|
data: params.otp,
|
|
396
|
-
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,
|
|
397
434
|
verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
|
|
398
435
|
step_name: INDIVIDUAl_STEP_NAMES.PHONE_AUTH,
|
|
399
436
|
encryption_contract: ['data']
|
|
@@ -402,7 +439,7 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
|
|
|
402
439
|
case 1:
|
|
403
440
|
data = (_q.sent()).data;
|
|
404
441
|
boardInfoStatus = undefined;
|
|
405
|
-
if ((
|
|
442
|
+
if ((_f = data.errors) === null || _f === void 0 ? void 0 : _f.length)
|
|
406
443
|
throw new Error(data.errors[0].description);
|
|
407
444
|
if (!board_id) return [3, 3];
|
|
408
445
|
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
@@ -410,7 +447,7 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
|
|
|
410
447
|
boardData = _q.sent();
|
|
411
448
|
_q.label = 3;
|
|
412
449
|
case 3:
|
|
413
|
-
countryCode = (
|
|
450
|
+
countryCode = (_g = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _g === void 0 ? void 0 : _g.country;
|
|
414
451
|
if (!(board_id && board_info_id)) return [3, 6];
|
|
415
452
|
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
416
453
|
case 4:
|
|
@@ -418,47 +455,39 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
|
|
|
418
455
|
notification = (boardInfoData || {}).notification;
|
|
419
456
|
_c = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _c.id, type = _c.type;
|
|
420
457
|
if (!(id && type)) return [3, 6];
|
|
421
|
-
return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode }))];
|
|
458
|
+
return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
|
|
422
459
|
case 5:
|
|
423
|
-
|
|
424
|
-
individualData =
|
|
460
|
+
data_3 = (_q.sent()).data;
|
|
461
|
+
individualData = data_3 || {};
|
|
425
462
|
_q.label = 6;
|
|
426
463
|
case 6:
|
|
427
464
|
if (countryCode)
|
|
428
465
|
thunkApi.dispatch(handleSetCountryByIso2(countryCode));
|
|
429
|
-
if (!
|
|
430
|
-
return [
|
|
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];
|
|
468
|
+
return [4, thunkApi.dispatch(getIndividualList((_j = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _j === void 0 ? void 0 : _j.id))];
|
|
431
469
|
case 7:
|
|
432
|
-
|
|
470
|
+
_q.sent();
|
|
433
471
|
_q.label = 8;
|
|
434
|
-
case 8:
|
|
435
|
-
info = (boardInfoStatus || {}).info;
|
|
436
|
-
hasIndividualCompleted = ((_g = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'individual'; })) === null || _g === void 0 ? void 0 : _g.status) === 'completed';
|
|
437
|
-
if (!hasIndividualCompleted) return [3, 9];
|
|
438
|
-
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
439
|
-
return [3, 15];
|
|
472
|
+
case 8: return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
440
473
|
case 9:
|
|
441
|
-
|
|
442
|
-
if (!((_h = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _h === void 0 ? void 0 : _h.id)) return [3, 11];
|
|
443
|
-
return [4, thunkApi.dispatch(getIndividualList((_j = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _j === void 0 ? void 0 : _j.id))];
|
|
444
|
-
case 10:
|
|
445
|
-
_q.sent();
|
|
446
|
-
_q.label = 11;
|
|
447
|
-
case 11:
|
|
474
|
+
boardInfoStatus = _q.sent();
|
|
448
475
|
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
|
|
449
|
-
return [3,
|
|
450
|
-
case
|
|
476
|
+
return [3, 13];
|
|
477
|
+
case 10:
|
|
451
478
|
birthCountry = ((_k = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _k === void 0 ? void 0 : _k.country) || countryCode;
|
|
452
|
-
if (!birthCountry) return [3,
|
|
479
|
+
if (!birthCountry) return [3, 12];
|
|
453
480
|
return [4, thunkApi.dispatch(getCityList(birthCountry))];
|
|
454
|
-
case
|
|
481
|
+
case 11:
|
|
455
482
|
_q.sent();
|
|
456
|
-
_q.label =
|
|
457
|
-
case
|
|
458
|
-
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP'));
|
|
459
|
-
_q.label =
|
|
460
|
-
case
|
|
483
|
+
_q.label = 12;
|
|
484
|
+
case 12:
|
|
485
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
|
|
486
|
+
_q.label = 13;
|
|
487
|
+
case 13:
|
|
461
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;
|
|
462
491
|
return [2, {
|
|
463
492
|
data: data,
|
|
464
493
|
boardResponse: {
|
|
@@ -469,10 +498,11 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
|
|
|
469
498
|
merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
|
|
470
499
|
name: (_o = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _o === void 0 ? void 0 : _o.names,
|
|
471
500
|
contact: (_p = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _p === void 0 ? void 0 : _p.contact,
|
|
472
|
-
individuals:
|
|
501
|
+
individuals: is_authorized ? individuals : __assign(__assign({}, individuals), (!!data_state && { data_state: data_state })),
|
|
473
502
|
countries: countries,
|
|
474
503
|
countryCode: countryCode,
|
|
475
504
|
notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
|
|
505
|
+
business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
|
|
476
506
|
flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
|
|
477
507
|
},
|
|
478
508
|
formData: __assign({}, params)
|
|
@@ -480,183 +510,243 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
|
|
|
480
510
|
}
|
|
481
511
|
});
|
|
482
512
|
}); });
|
|
483
|
-
export var
|
|
484
|
-
var
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
isNidEditable = ((_j = data_status === null || data_status === void 0 ? void 0 : data_status.identification) === null || _j === void 0 ? void 0 : _j.id) === FieldType.EDITABLE && nid;
|
|
502
|
-
isIssuedCountryEditable = ((_k = data_status === null || data_status === void 0 ? void 0 : data_status.identification) === null || _k === void 0 ? void 0 : _k.issuer_country) === FieldType.EDITABLE;
|
|
503
|
-
isExpiryEditable = ((_l = data_status === null || data_status === void 0 ? void 0 : data_status.identification) === null || _l === void 0 ? void 0 : _l.expiry) === FieldType.EDITABLE && expiryDate;
|
|
504
|
-
isIdTypeEditable = ((_m = data_status === null || data_status === void 0 ? void 0 : data_status.identification) === null || _m === void 0 ? void 0 : _m.type) === FieldType.EDITABLE && identification_id_type;
|
|
505
|
-
isNationalityEditable = (data_status === null || data_status === void 0 ? void 0 : data_status.nationality) === FieldType.EDITABLE;
|
|
506
|
-
hasContact = email || mobile || countryCode;
|
|
507
|
-
hasPhone = mobile && (countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix);
|
|
508
|
-
hasIdentification = nid || issuedCountry || identification_id_type || expiryDate;
|
|
509
|
-
hasBirth = placeOfBirthCity || placeOfBirthCountry;
|
|
510
|
-
names = isNameEditable
|
|
511
|
-
? {
|
|
512
|
-
en: userName,
|
|
513
|
-
ar: userName
|
|
514
|
-
}
|
|
515
|
-
: undefined;
|
|
516
|
-
contact = hasContact
|
|
517
|
-
? {
|
|
518
|
-
email: isEmailEditable ? email : undefined,
|
|
519
|
-
phone: hasPhone
|
|
520
|
-
? {
|
|
521
|
-
country_code: isMobileCountryEditable ? (_o = countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix) === null || _o === void 0 ? void 0 : _o.toString() : undefined,
|
|
522
|
-
number: isMobileNumberEditable ? mobile : undefined
|
|
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 || ''
|
|
523
531
|
}
|
|
524
|
-
: undefined
|
|
525
|
-
}
|
|
526
|
-
: undefined;
|
|
527
|
-
requestBody = {
|
|
528
|
-
id: id,
|
|
529
|
-
type: type,
|
|
530
|
-
names: names,
|
|
531
|
-
gender: gender || undefined,
|
|
532
|
-
contact: contact,
|
|
533
|
-
identification: hasIdentification
|
|
534
|
-
? {
|
|
535
|
-
id: isNidEditable ? nid : undefined,
|
|
536
|
-
issued_country_code: isIssuedCountryEditable ? issuedCountry === null || issuedCountry === void 0 ? void 0 : issuedCountry.iso2 : undefined,
|
|
537
|
-
expiry: isExpiryEditable ? new Date(expiryDate).getTime() : undefined,
|
|
538
|
-
type: isIdTypeEditable ? identification_id_type : undefined
|
|
539
532
|
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
'contact.phone.country_code',
|
|
551
|
-
'contact.phone.number',
|
|
552
|
-
'identification.id',
|
|
553
|
-
'identification.issued_country_code',
|
|
554
|
-
'identification.expiry',
|
|
555
|
-
'identification.type',
|
|
556
|
-
'birth.city',
|
|
557
|
-
'birth.country',
|
|
558
|
-
'date_of_birth',
|
|
559
|
-
'nationality'
|
|
560
|
-
],
|
|
561
|
-
step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_PERSONAL_INFO
|
|
562
|
-
};
|
|
563
|
-
return [4, API.individualService.updateIndividual(requestBody)];
|
|
564
|
-
case 1:
|
|
565
|
-
data = (_s.sent()).data;
|
|
566
|
-
if (!(type === IndividualType.USER || type === IndividualType.BUYER)) return [3, 3];
|
|
567
|
-
return [4, thunkApi.dispatch(retrieveDataList(code))];
|
|
568
|
-
case 2:
|
|
569
|
-
_s.sent();
|
|
570
|
-
_s.label = 3;
|
|
571
|
-
case 3:
|
|
572
|
-
thunkApi.dispatch(handleNextScreenStep());
|
|
573
|
-
(_r = (_q = settings.data.appConfig).onStepCompleted) === null || _r === void 0 ? void 0 : _r.call(_q, settings.data.activeScreen.name, requestBody);
|
|
574
|
-
return [2, { data: data, formData: params }];
|
|
575
|
-
}
|
|
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
|
+
});
|
|
576
543
|
});
|
|
577
|
-
});
|
|
578
|
-
export var
|
|
579
|
-
var
|
|
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
|
-
shares: isSharesAvailable
|
|
626
|
-
? {
|
|
627
|
-
count: shareCount && Number(shareCount),
|
|
628
|
-
value: shareValue && Number(shareValue)
|
|
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
|
|
629
592
|
}
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
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
|
+
});
|
|
658
640
|
});
|
|
659
|
-
});
|
|
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
|
|
675
|
+
? {
|
|
676
|
+
count: shareCount && Number(shareCount),
|
|
677
|
+
value: shareValue && Number(removeAllCharsFromNumber(shareValue))
|
|
678
|
+
}
|
|
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 && {}));
|
|
695
|
+
}
|
|
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
|
+
});
|
|
748
|
+
});
|
|
749
|
+
});
|
|
660
750
|
export var checkEmailAvailability = createAsyncThunk('checkEmailAvailability', function (_a) {
|
|
661
751
|
var email = _a.email, cancelToken = _a.cancelToken, onSuccess = _a.onSuccess;
|
|
662
752
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -680,13 +770,13 @@ export var checkEmailAvailability = createAsyncThunk('checkEmailAvailability', f
|
|
|
680
770
|
});
|
|
681
771
|
});
|
|
682
772
|
export var updateBoardSuccess = createAsyncThunk('individualUpdateBoardSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
683
|
-
var _a, settings, individual, _b, id, infoId, payload, data, boardInfoStatus;
|
|
684
|
-
var
|
|
685
|
-
return __generator(this, function (
|
|
686
|
-
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) {
|
|
687
777
|
case 0:
|
|
688
778
|
_a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
|
|
689
|
-
_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;
|
|
690
780
|
if (!id)
|
|
691
781
|
return [2];
|
|
692
782
|
payload = {
|
|
@@ -696,17 +786,27 @@ export var updateBoardSuccess = createAsyncThunk('individualUpdateBoardSuccess',
|
|
|
696
786
|
};
|
|
697
787
|
return [4, API.boardService.updateBoardInfo(__assign({ id: id, infoId: infoId }, payload))];
|
|
698
788
|
case 1:
|
|
699
|
-
data =
|
|
789
|
+
data = _h.sent();
|
|
700
790
|
return [4, API.boardService.retrieveBoardInfoStatus(id)];
|
|
701
791
|
case 2:
|
|
702
|
-
boardInfoStatus =
|
|
792
|
+
boardInfoStatus = _h.sent();
|
|
703
793
|
return [4, thunkApi.dispatch(retrieveBoardDetails(id))];
|
|
704
794
|
case 3:
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
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 });
|
|
708
808
|
thunkApi.dispatch(handleNextScreenStep());
|
|
709
|
-
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 }];
|
|
710
810
|
}
|
|
711
811
|
});
|
|
712
812
|
}); });
|
|
@@ -722,6 +822,10 @@ var initialState = {
|
|
|
722
822
|
otpData: {
|
|
723
823
|
otp: ''
|
|
724
824
|
},
|
|
825
|
+
individualPhoneInfo: {
|
|
826
|
+
mobile: '',
|
|
827
|
+
countryCode: defaultCountry
|
|
828
|
+
},
|
|
725
829
|
individualCollectData: {
|
|
726
830
|
email: '',
|
|
727
831
|
mobile: '',
|
|
@@ -736,7 +840,7 @@ var initialState = {
|
|
|
736
840
|
nid: '',
|
|
737
841
|
issuedCountry: undefined,
|
|
738
842
|
expiryDate: '',
|
|
739
|
-
dob:
|
|
843
|
+
dob: '',
|
|
740
844
|
placeOfBirthCountry: undefined,
|
|
741
845
|
placeOfBirthCity: undefined,
|
|
742
846
|
nationality: undefined
|
|
@@ -746,7 +850,6 @@ var initialState = {
|
|
|
746
850
|
sourceIncome: undefined,
|
|
747
851
|
monthlyIncome: undefined,
|
|
748
852
|
employerName: '',
|
|
749
|
-
employerLocation: undefined,
|
|
750
853
|
isPEP: null,
|
|
751
854
|
isInfluencer: null,
|
|
752
855
|
shareCount: '',
|
|
@@ -780,16 +883,25 @@ export var individualSlice = createSlice({
|
|
|
780
883
|
},
|
|
781
884
|
extraReducers: function (builder) {
|
|
782
885
|
builder
|
|
783
|
-
.addCase(
|
|
886
|
+
.addCase(verifyToken.pending, function (state) {
|
|
784
887
|
state.error = null;
|
|
785
|
-
state.customLoading = true;
|
|
786
888
|
})
|
|
787
|
-
.addCase(
|
|
889
|
+
.addCase(verifyToken.fulfilled, function (state, action) {
|
|
788
890
|
state.error = null;
|
|
789
|
-
state.customLoading = false;
|
|
790
891
|
var _a = action.payload, data = _a.data, token = _a.token, boardResponse = _a.boardResponse;
|
|
791
892
|
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.verify.responseBody), boardResponse), { board_id: data.id });
|
|
792
893
|
state.data.verify.token = token;
|
|
894
|
+
})
|
|
895
|
+
.addCase(verifyToken.rejected, function (state, action) {
|
|
896
|
+
state.error = action.error.message;
|
|
897
|
+
})
|
|
898
|
+
.addCase(verifyLeadToken.pending, function (state) {
|
|
899
|
+
state.error = null;
|
|
900
|
+
state.customLoading = true;
|
|
901
|
+
})
|
|
902
|
+
.addCase(verifyLeadToken.fulfilled, function (state) {
|
|
903
|
+
state.error = null;
|
|
904
|
+
state.customLoading = false;
|
|
793
905
|
})
|
|
794
906
|
.addCase(verifyLeadToken.rejected, function (state, action) {
|
|
795
907
|
state.error = action.error.message;
|
|
@@ -839,10 +951,72 @@ export var individualSlice = createSlice({
|
|
|
839
951
|
state.error = null;
|
|
840
952
|
})
|
|
841
953
|
.addCase(addDetailsAsync.fulfilled, function (state, action) {
|
|
954
|
+
var _a, _b, _c, _d;
|
|
842
955
|
state.loading = false;
|
|
843
956
|
state.error = null;
|
|
844
|
-
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; });
|
|
845
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;
|
|
846
1020
|
})
|
|
847
1021
|
.addCase(addDetailsAsync.rejected, function (state, action) {
|
|
848
1022
|
state.loading = false;
|
|
@@ -855,12 +1029,12 @@ export var individualSlice = createSlice({
|
|
|
855
1029
|
.addCase(requestDetailsByEmail.fulfilled, function (state, action) {
|
|
856
1030
|
state.loading = false;
|
|
857
1031
|
state.error = null;
|
|
858
|
-
var _a = action.payload, data = _a.data,
|
|
1032
|
+
var _a = action.payload, data = _a.data, individualData = _a.individualData;
|
|
859
1033
|
var userList = (state.data.verify.responseBody || {}).userList;
|
|
860
1034
|
var list = userList || [];
|
|
861
1035
|
list = list.map(function (user) {
|
|
862
1036
|
var _a, _b;
|
|
863
|
-
var userInfo = user.id === (
|
|
1037
|
+
var userInfo = user.id === (individualData === null || individualData === void 0 ? void 0 : individualData.id) ? individualData : user;
|
|
864
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;
|
|
865
1039
|
});
|
|
866
1040
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { requestEmailData: data, userList: list });
|
|
@@ -870,18 +1044,16 @@ export var individualSlice = createSlice({
|
|
|
870
1044
|
state.error = action.error.message;
|
|
871
1045
|
})
|
|
872
1046
|
.addCase(retrieveIndividualInfo.pending, function (state) {
|
|
873
|
-
state.loading = true;
|
|
874
1047
|
state.error = null;
|
|
875
1048
|
})
|
|
876
1049
|
.addCase(retrieveIndividualInfo.fulfilled, function (state, action) {
|
|
877
1050
|
var _a, _b, _c, _d;
|
|
878
|
-
state.loading = false;
|
|
879
1051
|
state.error = null;
|
|
880
|
-
var _e = action.payload, data = _e.data, countries = _e.countries
|
|
1052
|
+
var _e = action.payload, data = _e.data, countries = _e.countries;
|
|
881
1053
|
var user = (state.data.verify.responseBody || {}).user;
|
|
882
|
-
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 }) });
|
|
883
|
-
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,
|
|
884
|
-
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;
|
|
885
1057
|
var cityList = (state.data.verify.responseBody || {}).cityList;
|
|
886
1058
|
if (data)
|
|
887
1059
|
state.data.individualPersonalData.name = getUserName(data, false);
|
|
@@ -896,7 +1068,6 @@ export var individualSlice = createSlice({
|
|
|
896
1068
|
state.data.individualPersonalData.gender = gender.toLowerCase();
|
|
897
1069
|
if (identification === null || identification === void 0 ? void 0 : identification.id)
|
|
898
1070
|
state.data.individualPersonalData.nid = identification === null || identification === void 0 ? void 0 : identification.id;
|
|
899
|
-
state.data.individualPersonalData.issuedCountry = identification === null || identification === void 0 ? void 0 : identification.issued_country_code;
|
|
900
1071
|
if (identification === null || identification === void 0 ? void 0 : identification.issued_country_code) {
|
|
901
1072
|
state.data.individualPersonalData.issuedCountry = findCountryByIso2(countries, identification === null || identification === void 0 ? void 0 : identification.issued_country_code);
|
|
902
1073
|
}
|
|
@@ -909,7 +1080,8 @@ export var individualSlice = createSlice({
|
|
|
909
1080
|
}
|
|
910
1081
|
if (birth === null || birth === void 0 ? void 0 : birth.city) {
|
|
911
1082
|
var selectedCity = cityList === null || cityList === void 0 ? void 0 : cityList.find(function (city) {
|
|
912
|
-
|
|
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);
|
|
913
1085
|
});
|
|
914
1086
|
state.data.individualPersonalData.placeOfBirthCity = selectedCity;
|
|
915
1087
|
}
|
|
@@ -923,29 +1095,21 @@ export var individualSlice = createSlice({
|
|
|
923
1095
|
state.data.individualData.shareCount = shareCount;
|
|
924
1096
|
}
|
|
925
1097
|
if (shareValue) {
|
|
926
|
-
state.data.individualData.shareValue = shareValue;
|
|
1098
|
+
state.data.individualData.shareValue = formatNumberAsCurrency(shareValue);
|
|
927
1099
|
}
|
|
928
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]);
|
|
929
1101
|
if (!!selectedSourceIncome)
|
|
930
1102
|
state.data.individualData.sourceIncome = selectedSourceIncome;
|
|
931
|
-
var code = employer_country || countryCode;
|
|
932
|
-
if (!!code) {
|
|
933
|
-
var employerLocation = (countries || []).find(function (country) { return country.iso2 === code; });
|
|
934
|
-
state.data.individualData.employerLocation = employerLocation;
|
|
935
|
-
}
|
|
936
1103
|
var selectedMonthlyIncome = monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList.find(function (income) {
|
|
937
1104
|
return income.id === (monthly_income === null || monthly_income === void 0 ? void 0 : monthly_income.id);
|
|
938
1105
|
});
|
|
939
|
-
var selectedOccupation =
|
|
940
|
-
return occup.id === (occupation === null || occupation === void 0 ? void 0 : occupation.id);
|
|
941
|
-
});
|
|
1106
|
+
var selectedOccupation = (occupation === null || occupation === void 0 ? void 0 : occupation.chapter) || (occupation === null || occupation === void 0 ? void 0 : occupation.section);
|
|
942
1107
|
state.data.individualData.monthlyIncome = selectedMonthlyIncome;
|
|
943
1108
|
state.data.individualData.occupation = selectedOccupation;
|
|
944
1109
|
state.data.individualData.isPEP = is_relative_PEP;
|
|
945
1110
|
state.data.individualData.isInfluencer = is_influencer;
|
|
946
1111
|
})
|
|
947
1112
|
.addCase(retrieveIndividualInfo.rejected, function (state, action) {
|
|
948
|
-
state.loading = false;
|
|
949
1113
|
state.error = action.error.message;
|
|
950
1114
|
})
|
|
951
1115
|
.addCase(getIndividualList.pending, function (state) {
|
|
@@ -982,9 +1146,7 @@ export var individualSlice = createSlice({
|
|
|
982
1146
|
var selectedMonthlyIncome = monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList.find(function (income) {
|
|
983
1147
|
return income.id === (monthly_income === null || monthly_income === void 0 ? void 0 : monthly_income.id);
|
|
984
1148
|
});
|
|
985
|
-
var selectedOccupation =
|
|
986
|
-
return occup.id === (occupation === null || occupation === void 0 ? void 0 : occupation.id);
|
|
987
|
-
});
|
|
1149
|
+
var selectedOccupation = (occupation === null || occupation === void 0 ? void 0 : occupation.chapter) || (occupation === null || occupation === void 0 ? void 0 : occupation.section);
|
|
988
1150
|
state.data.individualData.monthlyIncome = selectedMonthlyIncome;
|
|
989
1151
|
state.data.individualData.occupation = selectedOccupation;
|
|
990
1152
|
})
|
|
@@ -1004,10 +1166,10 @@ export var individualSlice = createSlice({
|
|
|
1004
1166
|
var cityList = action.payload;
|
|
1005
1167
|
state.data.verify.responseBody = __assign(__assign({}, data), { cityList: cityList });
|
|
1006
1168
|
var birth = (((_a = state.data.verify.responseBody) === null || _a === void 0 ? void 0 : _a.user) || {}).birth;
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
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);
|
|
1011
1173
|
});
|
|
1012
1174
|
state.data.individualPersonalData.placeOfBirthCity = selectedCity;
|
|
1013
1175
|
}
|
|
@@ -1015,6 +1177,21 @@ export var individualSlice = createSlice({
|
|
|
1015
1177
|
.addCase(getCityList.rejected, function (state, action) {
|
|
1016
1178
|
state.cityLoading = false;
|
|
1017
1179
|
state.error = action.error.message;
|
|
1180
|
+
})
|
|
1181
|
+
.addCase(updatePhoneInfo.pending, function (state) {
|
|
1182
|
+
state.loading = true;
|
|
1183
|
+
state.error = null;
|
|
1184
|
+
})
|
|
1185
|
+
.addCase(updatePhoneInfo.fulfilled, function (state, action) {
|
|
1186
|
+
state.loading = false;
|
|
1187
|
+
state.error = null;
|
|
1188
|
+
var _a = action.payload, data = _a.data, formData = _a.formData;
|
|
1189
|
+
state.data.individualPhoneInfo = formData;
|
|
1190
|
+
state.data.individualPhoneInfo.responseBody = data;
|
|
1191
|
+
})
|
|
1192
|
+
.addCase(updatePhoneInfo.rejected, function (state, action) {
|
|
1193
|
+
state.loading = false;
|
|
1194
|
+
state.error = action.error.message;
|
|
1018
1195
|
})
|
|
1019
1196
|
.addCase(updateIndividualPersonalInfo.pending, function (state) {
|
|
1020
1197
|
state.loading = true;
|
|
@@ -1038,9 +1215,16 @@ export var individualSlice = createSlice({
|
|
|
1038
1215
|
.addCase(updateIndividualInfo.fulfilled, function (state, action) {
|
|
1039
1216
|
state.loading = false;
|
|
1040
1217
|
state.error = null;
|
|
1041
|
-
var _a = action.payload, data = _a.data, formData = _a.formData;
|
|
1218
|
+
var _a = action.payload, data = _a.data, formData = _a.formData, individualData = _a.individualData;
|
|
1042
1219
|
state.data.individualData = formData;
|
|
1043
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 });
|
|
1044
1228
|
})
|
|
1045
1229
|
.addCase(updateIndividualInfo.rejected, function (state, action) {
|
|
1046
1230
|
state.loading = false;
|
|
@@ -1060,6 +1244,20 @@ export var individualSlice = createSlice({
|
|
|
1060
1244
|
.addCase(retrieveBoardDetails.rejected, function (state, action) {
|
|
1061
1245
|
state.error = action.error.message;
|
|
1062
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;
|
|
1063
1261
|
})
|
|
1064
1262
|
.addCase(checkEmailAvailability.fulfilled, function (state, action) {
|
|
1065
1263
|
var _a;
|
|
@@ -1078,14 +1276,15 @@ export var individualSlice = createSlice({
|
|
|
1078
1276
|
var _a;
|
|
1079
1277
|
state.loading = false;
|
|
1080
1278
|
state.error = null;
|
|
1081
|
-
var
|
|
1279
|
+
var _b = action.payload || {}, response = _b.response, individualData = _b.individualData;
|
|
1082
1280
|
var description = (((_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
1083
1281
|
if (description) {
|
|
1084
1282
|
state.error = description;
|
|
1085
1283
|
return;
|
|
1086
1284
|
}
|
|
1087
1285
|
var flows = response.flows;
|
|
1088
|
-
|
|
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 }) }));
|
|
1089
1288
|
})
|
|
1090
1289
|
.addCase(updateBoardSuccess.pending, function (state) {
|
|
1091
1290
|
state.loading = true;
|