@tap-payments/auth-jsconnect 2.1.100-test → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/@types/app.d.ts +298 -7
- package/build/@types/app.js +12 -0
- package/build/@types/form.d.ts +29 -26
- package/build/@types/redux.d.ts +4 -0
- package/build/@types/theme.d.ts +1 -1
- package/build/@types/user.d.ts +39 -3
- package/build/api/account.d.ts +2 -2
- package/build/api/auth.d.ts +11 -11
- package/build/api/availabilityServices.d.ts +3 -3
- package/build/api/axios.js +1 -1
- package/build/api/board.d.ts +3 -3
- package/build/api/brand.d.ts +7 -0
- package/build/api/brand.js +10 -1
- package/build/api/country.d.ts +1 -1
- package/build/api/data.d.ts +18 -10
- package/build/api/data.js +34 -2
- package/build/api/document.d.ts +25 -0
- package/build/api/document.js +38 -0
- package/build/api/entity.d.ts +24 -24
- package/build/api/entity.js +22 -5
- package/build/api/file.d.ts +2 -1
- package/build/api/file.js +14 -1
- package/build/api/index.d.ts +36 -6
- package/build/api/index.js +5 -1
- package/build/api/individual.d.ts +32 -14
- package/build/api/individual.js +9 -1
- package/build/api/init.d.ts +16 -0
- package/build/api/init.js +13 -0
- package/build/api/lead.d.ts +18 -11
- package/build/api/lead.js +9 -1
- package/build/api/operator.d.ts +1 -1
- package/build/api/operator.js +1 -1
- package/build/api/user.d.ts +2 -2
- package/build/app/settings.d.ts +19 -9
- package/build/app/settings.js +69 -24
- package/build/app/store.d.ts +4 -4
- package/build/assets/locales/ar.json +27 -1
- package/build/assets/locales/en.json +27 -1
- package/build/components/AnimationFlow/AnimationFlow.d.ts +4 -2
- package/build/components/AnimationFlow/AnimationFlow.js +4 -4
- package/build/components/AnimationFlow/BottomSheet.d.ts +4 -1
- package/build/components/AnimationFlow/BottomSheet.js +43 -19
- package/build/components/AnimationFlow/Dialog.d.ts +4 -2
- package/build/components/AnimationFlow/Dialog.js +30 -7
- package/build/components/DatePicker/DatePicker.d.ts +3 -1
- package/build/components/DatePicker/DatePicker.js +20 -15
- package/build/components/LogoBadge/LogoBadge.js +3 -0
- package/build/components/RadioGroup/RadioGroup.d.ts +5 -2
- package/build/components/RadioGroup/RadioGroup.js +5 -9
- package/build/components/RadioGroup/index.d.ts +1 -1
- package/build/components/SimpleList/SimpleList.d.ts +5 -2
- package/build/components/SimpleList/SimpleList.js +31 -11
- package/build/components/Slide/Slide.d.ts +1 -1
- package/build/constants/api.d.ts +7 -0
- package/build/constants/api.js +14 -1
- package/build/constants/app.d.ts +45 -0
- package/build/constants/app.js +101 -52
- package/build/constants/assets.d.ts +7 -0
- package/build/constants/assets.js +7 -0
- package/build/constants/validation.d.ts +1 -0
- package/build/constants/validation.js +1 -0
- package/build/features/app/bank/bankStore.d.ts +88 -12
- package/build/features/app/bank/bankStore.js +153 -107
- package/build/features/app/brand/brandStore.d.ts +158 -21
- package/build/features/app/brand/brandStore.js +401 -221
- package/build/features/app/business/businessStore.d.ts +176 -29
- package/build/features/app/business/businessStore.js +343 -282
- package/build/features/app/connect/connectStore.d.ts +150 -14
- package/build/features/app/connect/connectStore.js +185 -67
- package/build/features/app/connectExpress/connectExpressStore.d.ts +223 -20
- package/build/features/app/connectExpress/connectExpressStore.js +234 -101
- package/build/features/app/entity/entityStore.d.ts +93 -23
- package/build/features/app/entity/entityStore.js +273 -237
- package/build/features/app/individual/individualStore.d.ts +192 -27
- package/build/features/app/individual/individualStore.js +504 -380
- package/build/features/app/password/passwordStore.d.ts +106 -12
- package/build/features/app/password/passwordStore.js +84 -36
- package/build/features/app/signIn/signInStore.d.ts +61 -7
- package/build/features/app/signIn/signInStore.js +1 -1
- package/build/features/app/tax/taxStore.d.ts +76 -9
- package/build/features/app/tax/taxStore.js +136 -89
- package/build/features/bank/Bank.js +10 -6
- package/build/features/bank/screens/BankDetails/BankDetails.js +43 -17
- package/build/features/bank/screens/BankDetails/BankName.d.ts +5 -1
- package/build/features/bank/screens/BankDetails/BankName.js +9 -9
- package/build/features/bank/screens/BankDetails/BankStatement.d.ts +6 -2
- package/build/features/bank/screens/BankDetails/BankStatement.js +7 -10
- package/build/features/bank/screens/BankDetails/Beneficiary.d.ts +3 -1
- package/build/features/bank/screens/BankDetails/Beneficiary.js +6 -7
- package/build/features/bank/screens/BankDetails/ConfirmPolicy.d.ts +4 -1
- package/build/features/bank/screens/BankDetails/ConfirmPolicy.js +12 -13
- package/build/features/bank/screens/BankDetails/IBAN.d.ts +3 -1
- package/build/features/bank/screens/BankDetails/IBAN.js +4 -6
- package/build/features/bank/screens/BankDetails/validation.d.ts +8 -8
- package/build/features/bank/screens/BankDetails/validation.js +6 -17
- package/build/features/bank/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -4
- package/build/features/bank/screens/Verify/OTPInput.js +5 -3
- package/build/features/bank/screens/Verify/Verify.js +1 -5
- package/build/features/brand/Brand.js +10 -6
- package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +13 -30
- package/build/features/brand/screens/BrandActivities/ActivitiesList.js +50 -34
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +41 -9
- package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +14 -41
- package/build/features/brand/screens/BrandActivities/CustomerBase.js +21 -32
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.d.ts +3 -1
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +22 -19
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.d.ts +3 -1
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +28 -19
- package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +15 -8
- package/build/features/brand/screens/BrandActivities/RefundPolicy.js +23 -12
- package/build/features/brand/screens/BrandActivities/TAC.d.ts +14 -2
- package/build/features/brand/screens/BrandActivities/TAC.js +21 -12
- package/build/features/brand/screens/BrandActivities/TransactionPolicy.d.ts +4 -1
- package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +18 -4
- package/build/features/brand/screens/BrandActivities/validation.d.ts +7 -7
- package/build/features/brand/screens/BrandActivities/validation.js +10 -19
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +40 -33
- package/build/features/brand/screens/BrandInfo/BrandLogo.d.ts +9 -0
- package/build/features/brand/screens/BrandInfo/BrandLogo.js +41 -0
- package/build/features/brand/screens/BrandInfo/BrandName.d.ts +3 -2
- package/build/features/brand/screens/BrandInfo/BrandName.js +5 -8
- package/build/features/brand/screens/BrandInfo/SalesChannels.d.ts +2 -1
- package/build/features/brand/screens/BrandInfo/SalesChannels.js +20 -26
- package/build/features/brand/screens/BrandInfo/validation.d.ts +7 -13
- package/build/features/brand/screens/BrandInfo/validation.js +37 -47
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.d.ts +5 -0
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +102 -0
- package/build/features/brand/screens/BrandSegmentInfo/SegmentLocations.d.ts +10 -0
- package/build/features/brand/screens/BrandSegmentInfo/SegmentLocations.js +69 -0
- package/build/features/brand/screens/BrandSegmentInfo/SegmentProfits.d.ts +10 -0
- package/build/features/brand/screens/BrandSegmentInfo/SegmentProfits.js +69 -0
- package/build/features/brand/screens/BrandSegmentInfo/SegmentTechs.d.ts +10 -0
- package/build/features/brand/screens/BrandSegmentInfo/SegmentTechs.js +69 -0
- package/build/features/{connect/screens/Merchant → brand/screens/BrandSegmentInfo}/TeamSize.d.ts +3 -1
- package/build/features/brand/screens/{BrandInfo → BrandSegmentInfo}/TeamSize.js +20 -25
- package/build/features/brand/screens/BrandSegmentInfo/index.d.ts +2 -0
- package/build/features/brand/screens/BrandSegmentInfo/index.js +2 -0
- package/build/features/brand/screens/BrandSegmentInfo/validation.d.ts +17 -0
- package/build/features/brand/screens/BrandSegmentInfo/validation.js +9 -0
- package/build/features/brand/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -4
- package/build/features/brand/screens/Verify/OTPInput.js +5 -3
- package/build/features/brand/screens/Verify/Verify.js +7 -20
- package/build/features/business/Business.js +7 -5
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +17 -70
- package/build/features/business/screens/Activities/ActivitiesList.js +226 -98
- package/build/features/business/screens/Activities/OperationStartDate.d.ts +3 -3
- package/build/features/business/screens/Activities/OperationStartDate.js +2 -2
- package/build/features/business/screens/Activities/validation.d.ts +165 -30
- package/build/features/business/screens/Activities/validation.js +5 -2
- package/build/features/business/screens/BrandDetails/BrandDetails.d.ts +5 -0
- package/build/features/business/screens/BrandDetails/BrandDetails.js +39 -0
- package/build/features/business/screens/BrandDetails/BrandName.d.ts +5 -0
- package/build/features/business/screens/BrandDetails/BrandName.js +36 -0
- package/build/features/business/screens/BrandDetails/Header.d.ts +5 -0
- package/build/features/business/screens/BrandDetails/Header.js +49 -0
- package/build/features/business/screens/BrandDetails/LicenseInfo.d.ts +5 -0
- package/build/features/business/screens/BrandDetails/LicenseInfo.js +38 -0
- package/build/features/{brand/screens/BrandActivities/OperationStartDate.d.ts → business/screens/BrandDetails/SalesChannel.d.ts} +6 -8
- package/build/features/business/screens/BrandDetails/SalesChannel.js +48 -0
- package/build/features/business/screens/BrandDetails/index.d.ts +3 -0
- package/build/features/business/screens/BrandDetails/index.js +2 -0
- package/build/features/business/screens/BusinessType/Article.d.ts +4 -2
- package/build/features/business/screens/BusinessType/Article.js +19 -54
- package/build/features/business/screens/BusinessType/BusinessType.js +35 -11
- package/build/features/business/screens/BusinessType/EntityLicenseList.d.ts +9 -0
- package/build/features/business/screens/BusinessType/EntityLicenseList.js +129 -0
- package/build/features/business/screens/BusinessType/EntityName.js +6 -7
- package/build/features/business/screens/BusinessType/LicenseCertificate.js +2 -1
- package/build/features/business/screens/BusinessType/LicenseList.d.ts +1 -0
- package/build/features/business/screens/BusinessType/LicenseList.js +7 -22
- package/build/features/business/screens/BusinessType/LicenseNumber.d.ts +1 -2
- package/build/features/business/screens/BusinessType/LicenseNumber.js +4 -2
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +3 -3
- package/build/features/business/screens/CivilID/IDNumber.js +2 -3
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +47 -40
- package/build/features/business/screens/Customers/CustomerLocations.js +35 -19
- package/build/features/business/screens/Customers/Customers.js +27 -16
- package/build/features/business/screens/Customers/ExpectedCustomers.js +12 -4
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +14 -6
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +7 -7
- package/build/features/business/screens/Customers/RefundPolicy.js +15 -4
- package/build/features/business/screens/Customers/TransactionPolicy.js +19 -9
- package/build/features/business/screens/IDBOD/DOB.js +2 -2
- package/build/features/business/screens/IDBOD/ID.js +2 -3
- package/build/features/business/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
- package/build/features/business/screens/Verify/OTPInput.js +5 -3
- package/build/features/connect/Connect.js +28 -8
- package/build/features/connect/screens/BrandSegment/BrandSegment.d.ts +5 -0
- package/build/features/connect/screens/BrandSegment/BrandSegment.js +84 -0
- package/build/features/connect/screens/BrandSegment/SegmentLocations.d.ts +8 -0
- package/build/features/connect/screens/{Merchant/Segments.js → BrandSegment/SegmentLocations.js} +17 -25
- package/build/features/connect/screens/BrandSegment/SegmentProfits.d.ts +8 -0
- package/build/features/{brand/screens/BrandInfo/Segments.js → connect/screens/BrandSegment/SegmentProfits.js} +18 -26
- package/build/features/connect/screens/BrandSegment/SegmentTechs.d.ts +8 -0
- package/build/features/connect/screens/BrandSegment/SegmentTechs.js +66 -0
- package/build/features/connect/screens/{Merchant → BrandSegment}/TeamSize.js +12 -20
- package/build/features/connect/screens/BrandSegment/index.d.ts +3 -0
- package/build/features/connect/screens/BrandSegment/index.js +2 -0
- package/build/features/connect/screens/BrandSegment/validation.d.ts +17 -0
- package/build/features/connect/screens/BrandSegment/validation.js +9 -0
- package/build/features/connect/screens/CivilID/CivilID.js +5 -13
- package/build/features/connect/screens/CivilID/IDNumber.js +5 -6
- package/build/features/connect/screens/Individual/Email.js +18 -28
- package/build/features/connect/screens/Individual/Individual.js +8 -1
- package/build/features/connect/screens/Individual/MobileNumber.js +16 -15
- package/build/features/connect/screens/Individual/Name.js +11 -15
- package/build/features/connect/screens/Merchant/BrandList.js +4 -22
- package/build/features/connect/screens/Merchant/BrandName.js +5 -8
- package/build/features/connect/screens/Merchant/Merchant.js +13 -15
- package/build/features/connect/screens/Merchant/validation.d.ts +3 -6
- package/build/features/connect/screens/Merchant/validation.js +6 -9
- package/build/features/connect/screens/Mobile/Mobile.js +13 -16
- package/build/features/connect/screens/Mobile/MobileNumber.js +14 -10
- package/build/features/connect/screens/NID/DOB.js +1 -1
- package/build/features/connect/screens/NID/IDNumber.js +6 -7
- package/build/features/connect/screens/NID/NID.js +6 -0
- package/build/features/connect/screens/OTP/OTP.js +13 -15
- package/build/features/connect/screens/OTP/OTPInput.js +10 -0
- package/build/features/connect/screens/ThankYou/ThankYou.js +17 -2
- package/build/features/connectExpress/ConnectExpress.d.ts +1 -0
- package/build/features/connectExpress/ConnectExpress.js +78 -13
- package/build/features/connectExpress/screens/Brand/Brand.js +1 -1
- package/build/features/connectExpress/screens/CivilID/IDNumber.js +6 -7
- package/build/features/connectExpress/screens/CivilIDMissed/IDNumber.js +6 -7
- package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.d.ts +2 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.js +6 -8
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +7 -4
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.d.ts +2 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +9 -14
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.d.ts +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +5 -4
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.js +4 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +14 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.js +9 -10
- package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +11 -6
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.d.ts +2 -1
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +7 -15
- package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.d.ts +1 -0
- package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.js +6 -2
- package/build/features/connectExpress/screens/CollectIndividualInfo/Name.d.ts +2 -1
- package/build/features/connectExpress/screens/CollectIndividualInfo/Name.js +3 -4
- package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +2 -2
- package/build/features/connectExpress/screens/Mobile/Mobile.js +4 -3
- package/build/features/connectExpress/screens/Mobile/MobileNumber.d.ts +1 -0
- package/build/features/connectExpress/screens/Mobile/MobileNumber.js +6 -2
- package/build/features/connectExpress/screens/Mobile/TAC.d.ts +2 -1
- package/build/features/connectExpress/screens/Mobile/TAC.js +3 -1
- package/build/features/connectExpress/screens/NID/DOB.d.ts +2 -1
- package/build/features/connectExpress/screens/NID/DOB.js +2 -2
- package/build/features/connectExpress/screens/NID/IDNumber.d.ts +1 -0
- package/build/features/connectExpress/screens/NID/IDNumber.js +3 -4
- package/build/features/connectExpress/screens/NID/NID.js +4 -2
- package/build/features/connectExpress/screens/NID/TAC.d.ts +14 -1
- package/build/features/connectExpress/screens/NID/TAC.js +9 -10
- package/build/features/connectExpress/screens/NIDMissed/DOB.js +1 -1
- package/build/features/connectExpress/screens/NIDMissed/IDNumber.js +2 -3
- package/build/features/connectExpress/screens/OTP/OTPInput.js +3 -3
- package/build/features/entity/Entity.js +10 -6
- package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +17 -70
- package/build/features/entity/screens/EntityCapital/ActivityList.js +219 -108
- package/build/features/entity/screens/EntityCapital/CapitalPaid.d.ts +3 -1
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +14 -16
- package/build/features/entity/screens/EntityCapital/CapitalShareCount.d.ts +3 -1
- package/build/features/entity/screens/EntityCapital/CapitalShareCount.js +10 -12
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.d.ts +3 -1
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +15 -17
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +31 -20
- package/build/features/entity/screens/EntityCapital/validation.d.ts +175 -40
- package/build/features/entity/screens/EntityCapital/validation.js +9 -12
- package/build/features/entity/screens/EntityName/Article.d.ts +6 -2
- package/build/features/entity/screens/EntityName/Article.js +20 -54
- package/build/features/entity/screens/EntityName/EntityName.js +60 -16
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +13 -30
- package/build/features/entity/screens/EntityName/EntityTypeList.js +28 -45
- package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +6 -4
- package/build/features/entity/screens/EntityName/ExpiryDate.js +6 -8
- package/build/features/entity/screens/EntityName/IssuingDate.d.ts +6 -4
- package/build/features/entity/screens/EntityName/IssuingDate.js +5 -8
- package/build/features/entity/screens/EntityName/LegalName.d.ts +3 -1
- package/build/features/entity/screens/EntityName/LegalName.js +10 -9
- package/build/features/entity/screens/EntityName/LicenseCertificate.d.ts +4 -1
- package/build/features/entity/screens/EntityName/LicenseCertificate.js +13 -7
- package/build/features/entity/screens/EntityName/LicenseNumber.d.ts +3 -1
- package/build/features/entity/screens/EntityName/LicenseNumber.js +13 -11
- package/build/features/entity/screens/EntityName/UnifiedNumber.d.ts +3 -1
- package/build/features/entity/screens/EntityName/UnifiedNumber.js +11 -10
- package/build/features/entity/screens/EntityName/validation.d.ts +35 -35
- package/build/features/entity/screens/EntityName/validation.js +68 -93
- package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -4
- package/build/features/entity/screens/Verify/OTPInput.js +5 -3
- package/build/features/entity/screens/Verify/Verify.js +7 -20
- package/build/features/featuresScreens.js +13 -1
- package/build/features/individual/Individual.js +10 -6
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +3 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +54 -23
- package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.d.ts +7 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.js +29 -10
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.d.ts +3 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +18 -15
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +30 -42
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.d.ts +3 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +94 -56
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +5 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +18 -15
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.js +9 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +13 -7
- package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.d.ts +4 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.js +14 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +32 -43
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +8 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +7 -11
- package/build/features/individual/screens/IndividualList/CollectPhoneEmail.js +1 -1
- package/build/features/individual/screens/IndividualList/Email.js +1 -1
- package/build/features/individual/screens/IndividualList/IndividualList.d.ts +6 -6
- package/build/features/individual/screens/IndividualList/MobileNumber.js +0 -1
- package/build/features/individual/screens/IndividualList/UserList.js +15 -6
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.d.ts +2 -0
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.js +14 -20
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.d.ts +2 -0
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.js +8 -14
- package/build/features/individual/screens/IndividualPersonalInfo/DOB.d.ts +3 -1
- package/build/features/individual/screens/IndividualPersonalInfo/DOB.js +3 -3
- package/build/features/individual/screens/IndividualPersonalInfo/Email.d.ts +3 -1
- package/build/features/individual/screens/IndividualPersonalInfo/Email.js +4 -12
- package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.d.ts +3 -1
- package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.js +5 -8
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +6 -4
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.js +5 -2
- package/build/features/individual/screens/IndividualPersonalInfo/ID.d.ts +3 -1
- package/build/features/individual/screens/IndividualPersonalInfo/ID.js +4 -12
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +3 -3
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +79 -36
- package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.d.ts +2 -0
- package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.js +14 -26
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.d.ts +2 -0
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +18 -21
- package/build/features/individual/screens/IndividualPersonalInfo/Name.d.ts +3 -1
- package/build/features/individual/screens/IndividualPersonalInfo/Name.js +4 -12
- package/build/features/individual/screens/IndividualPersonalInfo/Nationality.d.ts +2 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Nationality.js +14 -26
- package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.d.ts +1 -0
- package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.js +6 -3
- package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +6 -3
- package/build/features/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
- package/build/features/individual/screens/Verify/OTPInput.js +5 -3
- package/build/features/individual/screens/Verify/Verify.js +1 -5
- package/build/features/password/Password.js +7 -5
- package/build/features/password/screens/CreatePassword/CreatePassword.js +9 -16
- package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
- package/build/features/password/screens/Verify/OTPInput.js +5 -3
- package/build/features/password/screens/Verify/Verify.js +7 -20
- package/build/features/shared/Address/CountryList.d.ts +10 -10
- package/build/features/shared/Address/CountryList.js +1 -1
- package/build/features/shared/Address/InputSelect.d.ts +10 -10
- package/build/features/shared/Address/InputSelect.js +2 -2
- package/build/features/shared/Button/Button.d.ts +3 -1
- package/build/features/shared/Button/Button.js +3 -3
- package/build/features/shared/Button/EmailProvidersButtons.d.ts +1 -1
- package/build/features/shared/Button/EmailProvidersButtons.js +9 -2
- package/build/features/shared/Button/FlowsButtons.d.ts +1 -1
- package/build/features/shared/Button/FlowsButtons.js +23 -21
- package/build/features/shared/Button/IndividualActionButtons.d.ts +21 -0
- package/build/features/shared/Button/IndividualActionButtons.js +156 -0
- package/build/features/shared/Button/index.d.ts +1 -1
- package/build/features/shared/Button/index.js +1 -1
- package/build/features/shared/CheckIcon/CheckIcon.d.ts +7 -1
- package/build/features/shared/CheckIcon/CheckIcon.js +7 -6
- package/build/features/shared/Chip/Chip.d.ts +3 -0
- package/build/features/shared/Chip/Chip.js +21 -0
- package/build/features/shared/Chip/index.d.ts +2 -0
- package/build/features/shared/Chip/index.js +2 -0
- package/build/features/shared/Containers/FeatureContainer.d.ts +4 -1
- package/build/features/shared/Containers/FeatureContainer.js +5 -4
- package/build/features/shared/Containers/ScreenContainer.d.ts +1 -1
- package/build/features/shared/Dot/Dot.d.ts +8 -0
- package/build/features/shared/Dot/Dot.js +29 -0
- package/build/features/shared/Dot/index.d.ts +2 -0
- package/build/features/shared/Dot/index.js +2 -0
- package/build/features/shared/EndAdornment/EndAdornment.d.ts +10 -0
- package/build/features/shared/EndAdornment/EndAdornment.js +17 -0
- package/build/features/shared/EndAdornment/EndAdornmentExpanded.d.ts +7 -0
- package/build/features/shared/EndAdornment/EndAdornmentExpanded.js +13 -0
- package/build/features/shared/EndAdornment/index.d.ts +3 -0
- package/build/features/shared/EndAdornment/index.js +3 -0
- package/build/features/shared/Footer/Footer.js +8 -0
- package/build/features/shared/Footer/PoweredByFooter.d.ts +9 -0
- package/build/features/shared/Footer/PoweredByFooter.js +36 -0
- package/build/features/shared/Footer/index.d.ts +3 -2
- package/build/features/shared/Footer/index.js +3 -2
- package/build/features/shared/GenericError/GenericError.js +1 -1
- package/build/features/shared/Input/Input.d.ts +6 -7
- package/build/features/shared/Input/Input.js +2 -3
- package/build/features/shared/Input/index.d.ts +2 -1
- package/build/features/shared/InputSelect/InputSelect.d.ts +4 -0
- package/build/features/shared/InputSelect/InputSelect.js +33 -0
- package/build/features/shared/InputSelect/index.d.ts +2 -0
- package/build/features/shared/InputSelect/index.js +2 -0
- package/build/features/shared/OTP/OTP.d.ts +2 -1
- package/build/features/shared/OTP/OTP.js +2 -2
- package/build/features/shared/SalesChannels/SaleChannelIconsInput.d.ts +3 -1
- package/build/features/shared/SalesChannels/SaleChannelIconsInput.js +8 -6
- package/build/features/shared/SalesChannels/SalesChannel.d.ts +3 -1
- package/build/features/shared/SalesChannels/SalesChannel.js +9 -4
- package/build/features/shared/Search/Search.d.ts +2 -1
- package/build/features/shared/Search/Search.js +2 -2
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +14 -5
- package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +3 -1
- package/build/features/shared/SuccessScreen/SuccessScreen.js +3 -2
- package/build/features/shared/UploadFile/FileUpload.d.ts +32 -0
- package/build/features/shared/UploadFile/FileUpload.js +267 -0
- package/build/features/shared/UploadFile/UploadFile.d.ts +2 -2
- package/build/features/shared/UploadFile/UploadFile.js +7 -7
- package/build/features/shared/UploadFile/UploadWrapper.d.ts +36 -0
- package/build/features/shared/UploadFile/UploadWrapper.js +115 -0
- package/build/features/shared/UploadFile/index.d.ts +2 -1
- package/build/features/shared/UploadFile/index.js +2 -1
- package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +11 -20
- package/build/features/shared/UploadMultipleFile/UploadFile.js +119 -30
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +8 -4
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +28 -21
- package/build/features/signIn/SignIn.js +3 -4
- package/build/features/tax/Tax.js +10 -6
- package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -4
- package/build/features/tax/screens/TaxDetails/ConfirmPolicy.d.ts +4 -1
- package/build/features/tax/screens/TaxDetails/ConfirmPolicy.js +12 -12
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +23 -10
- package/build/features/tax/screens/TaxDetails/TaxDocument.d.ts +4 -1
- package/build/features/tax/screens/TaxDetails/TaxDocument.js +7 -5
- package/build/features/tax/screens/TaxDetails/VATId.d.ts +5 -1
- package/build/features/tax/screens/TaxDetails/VATId.js +5 -10
- package/build/features/tax/screens/TaxDetails/validation.d.ts +4 -4
- package/build/features/tax/screens/TaxDetails/validation.js +2 -5
- package/build/features/tax/screens/Verify/OTPInput.js +5 -3
- package/build/features/tax/screens/Verify/Verify.js +6 -22
- package/build/hooks/index.d.ts +5 -0
- package/build/hooks/index.js +5 -0
- package/build/hooks/useAppConfig.d.ts +4 -2
- package/build/hooks/useAppConfig.js +10 -5
- package/build/hooks/useDataNoneEditable.d.ts +2 -0
- package/build/hooks/useDataNoneEditable.js +19 -0
- package/build/hooks/useDataVerified.d.ts +6 -0
- package/build/hooks/useDataVerified.js +19 -0
- package/build/hooks/useErrorListener.d.ts +2 -1
- package/build/hooks/useErrorListener.js +16 -1
- package/build/hooks/useExcludeReadOnlyFelids.d.ts +11 -0
- package/build/hooks/useExcludeReadOnlyFelids.js +33 -0
- package/build/hooks/useFormErrorAndUpdateReadOnly.d.ts +6 -0
- package/build/hooks/useFormErrorAndUpdateReadOnly.js +48 -0
- package/build/hooks/useFormReadOnly.d.ts +6 -0
- package/build/hooks/useFormReadOnly.js +40 -0
- package/build/hooks/useVerifyToken.js +1 -1
- package/build/index.d.ts +2 -2
- package/build/index.js +4 -3
- package/build/theme/shadows.js +1 -1
- package/build/utils/array.d.ts +17 -3
- package/build/utils/array.js +220 -6
- package/build/utils/date.d.ts +1 -0
- package/build/utils/date.js +6 -0
- package/build/utils/error.d.ts +1 -0
- package/build/utils/error.js +3 -0
- package/build/utils/gtm.d.ts +6 -0
- package/build/utils/gtm.js +29 -0
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +1 -0
- package/build/utils/object.d.ts +4 -0
- package/build/utils/object.js +17 -0
- package/build/utils/string.d.ts +5 -2
- package/build/utils/string.js +28 -7
- package/package.json +4 -2
- package/build/features/brand/screens/BrandActivities/OperationStartDate.js +0 -45
- package/build/features/brand/screens/BrandInfo/Segments.d.ts +0 -8
- package/build/features/connect/screens/Merchant/Segments.d.ts +0 -8
- package/build/features/shared/Button/ListButton.d.ts +0 -18
- package/build/features/shared/Button/ListButton.js +0 -125
- /package/build/features/{brand/screens/BrandInfo → connect/screens/BrandSegment}/TeamSize.d.ts +0 -0
|
@@ -24,7 +24,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
24
24
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
25
|
function step(op) {
|
|
26
26
|
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (_) try {
|
|
27
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
28
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
29
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
30
|
switch (op[0]) {
|
|
@@ -57,15 +57,15 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
57
57
|
var _a;
|
|
58
58
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
59
59
|
import API from '../../../api';
|
|
60
|
-
import { BusinessType, FlowsTypes, DocumentPurpose } from '../../../@types';
|
|
61
|
-
import { BUSINESS_STEP_NAMES, IDENTIFICATION_TYPE, OTHER_CR_LICENSE, OTHER_FL_LICENSE } from '../../../constants';
|
|
62
|
-
import { convertNumbers2English,
|
|
60
|
+
import { BusinessType, FlowsTypes, DocumentPurpose, LicenseType } from '../../../@types';
|
|
61
|
+
import { BUSINESS_STEP_NAMES, IDENTIFICATION_TYPE, OTHER_CR_LICENSE, OTHER_ENTITY_LICENSE, OTHER_FL_LICENSE } from '../../../constants';
|
|
62
|
+
import { convertNumbers2English, hasKey, sleep, isKW, isSA, dateFormat, isOtherLicense } from '../../../utils';
|
|
63
63
|
import { handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
|
|
64
64
|
export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
65
|
-
var payload, data, countryIso2, boardData, brandData, leadData,
|
|
66
|
-
var
|
|
67
|
-
return __generator(this, function (
|
|
68
|
-
switch (
|
|
65
|
+
var payload, data, countryIso2, boardData, brandData, isicActivityList, leadData, _a, steps, brand, board_id, business_id, entity, brandID, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted, list, list;
|
|
66
|
+
var _b;
|
|
67
|
+
return __generator(this, function (_c) {
|
|
68
|
+
switch (_c.label) {
|
|
69
69
|
case 0:
|
|
70
70
|
payload = {
|
|
71
71
|
service_name: 'tap_email',
|
|
@@ -73,20 +73,20 @@ export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', functio
|
|
|
73
73
|
};
|
|
74
74
|
return [4, API.leadService.verifyLeadToken(payload)];
|
|
75
75
|
case 1:
|
|
76
|
-
data = (
|
|
77
|
-
if ((
|
|
76
|
+
data = (_c.sent()).data;
|
|
77
|
+
if ((_b = data.errors) === null || _b === void 0 ? void 0 : _b.length)
|
|
78
78
|
throw new Error(data.errors[0].description);
|
|
79
79
|
if (data.mw_error)
|
|
80
80
|
throw new Error(data.mw_error);
|
|
81
81
|
countryIso2 = data === null || data === void 0 ? void 0 : data.country_code;
|
|
82
82
|
if (countryIso2)
|
|
83
83
|
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
84
|
-
if (!(data.step_name !== BUSINESS_STEP_NAMES.PHONE_AUTH)) return [3,
|
|
84
|
+
if (!(data.step_name !== BUSINESS_STEP_NAMES.PHONE_AUTH)) return [3, 20];
|
|
85
85
|
boardData = undefined;
|
|
86
|
-
brandData = undefined;
|
|
86
|
+
brandData = void 0, isicActivityList = undefined;
|
|
87
87
|
return [4, API.leadService.retrieveLead(data === null || data === void 0 ? void 0 : data.id)];
|
|
88
88
|
case 2:
|
|
89
|
-
leadData = (
|
|
89
|
+
leadData = (_c.sent()).data;
|
|
90
90
|
countryIso2 = leadData === null || leadData === void 0 ? void 0 : leadData.country_code;
|
|
91
91
|
if (!countryIso2)
|
|
92
92
|
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
@@ -96,74 +96,78 @@ export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', functio
|
|
|
96
96
|
if (data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH && !isKW(countryIso2)) {
|
|
97
97
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
|
|
98
98
|
}
|
|
99
|
-
if (!(data.step_name === BUSINESS_STEP_NAMES.BUSINESS_INFO)) return [3,
|
|
100
|
-
|
|
99
|
+
if (!(data.step_name === BUSINESS_STEP_NAMES.BUSINESS_INFO)) return [3, 19];
|
|
100
|
+
_a = leadData || {}, steps = _a.steps, brand = _a.brand, board_id = _a.board_id, business_id = _a.business_id, entity = _a.entity;
|
|
101
101
|
brandID = brand === null || brand === void 0 ? void 0 : brand.id;
|
|
102
102
|
hasBusinessCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_SUCCESS);
|
|
103
103
|
hasBusinessCRInfoCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CR_INFO) && hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_INFO_CONFIRM);
|
|
104
104
|
hasBusinessCRActivitiesCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CR_ACTIVITIES);
|
|
105
105
|
hasBusinessCustomersCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CUSTOMERS);
|
|
106
|
-
if (!
|
|
107
|
-
return [
|
|
106
|
+
if (!hasBusinessCompleted) return [3, 6];
|
|
107
|
+
if (!board_id) return [3, 5];
|
|
108
|
+
return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
108
109
|
case 3:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
_b.label = 4;
|
|
110
|
+
boardData = _c.sent();
|
|
111
|
+
return [4, thunkApi.dispatch(retrieveBoardDetails(board_id))];
|
|
112
112
|
case 4:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
113
|
+
_c.sent();
|
|
114
|
+
_c.label = 5;
|
|
116
115
|
case 5:
|
|
117
|
-
|
|
118
|
-
return [
|
|
116
|
+
thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
117
|
+
return [3, 19];
|
|
119
118
|
case 6:
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
if (!(data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH)) return [3, 7];
|
|
120
|
+
thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
|
|
121
|
+
return [3, 19];
|
|
122
122
|
case 7:
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
if (!hasBusinessCustomersCompleted) return [3, 8];
|
|
124
|
+
thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_STEP'));
|
|
125
|
+
return [3, 19];
|
|
125
126
|
case 8:
|
|
126
|
-
if (!
|
|
127
|
-
|
|
128
|
-
return [3, 18];
|
|
127
|
+
if (!hasBusinessCRActivitiesCompleted) return [3, 12];
|
|
128
|
+
return [4, API.dataService.getActivitiesIsIc()];
|
|
129
129
|
case 9:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
return [3, 18];
|
|
133
|
-
case 10:
|
|
134
|
-
if (!hasBusinessCRActivitiesCompleted) return [3, 13];
|
|
130
|
+
list = (_c.sent()).list;
|
|
131
|
+
isicActivityList = list || [];
|
|
135
132
|
return [4, thunkApi.dispatch(retrieveDataList())];
|
|
133
|
+
case 10:
|
|
134
|
+
_c.sent();
|
|
135
|
+
return [4, API.brandService.retrieveBrand(brandID)];
|
|
136
136
|
case 11:
|
|
137
|
-
|
|
137
|
+
brandData = _c.sent();
|
|
138
138
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_CUSTOMERS_STEP'));
|
|
139
|
-
return [
|
|
139
|
+
return [3, 19];
|
|
140
140
|
case 12:
|
|
141
|
-
brandData = _b.sent();
|
|
142
|
-
return [3, 18];
|
|
143
|
-
case 13:
|
|
144
141
|
if (!hasBusinessCRInfoCompleted) return [3, 15];
|
|
142
|
+
return [4, API.dataService.getActivitiesIsIc()];
|
|
143
|
+
case 13:
|
|
144
|
+
list = (_c.sent()).list;
|
|
145
|
+
isicActivityList = list || [];
|
|
145
146
|
return [4, API.brandService.retrieveBrand(brandID)];
|
|
146
147
|
case 14:
|
|
147
|
-
brandData =
|
|
148
|
+
brandData = _c.sent();
|
|
148
149
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_ACTIVITIES_STEP'));
|
|
149
|
-
return [3,
|
|
150
|
-
case 15:
|
|
151
|
-
if (!isSA(countryIso2)) return [3, 17];
|
|
152
|
-
return [4, thunkApi.dispatch(retrieveEntityList({ leadId: data === null || data === void 0 ? void 0 : data.id }))];
|
|
150
|
+
return [3, 19];
|
|
151
|
+
case 15: return [4, thunkApi.dispatch(retrieveAllEntityList({ businessId: business_id, entityId: entity === null || entity === void 0 ? void 0 : entity.id }))];
|
|
153
152
|
case 16:
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
_c.sent();
|
|
154
|
+
if (!isSA(countryIso2)) return [3, 18];
|
|
155
|
+
return [4, thunkApi.dispatch(retrieveEntityList({ leadId: data === null || data === void 0 ? void 0 : data.id }))];
|
|
156
156
|
case 17:
|
|
157
|
+
_c.sent();
|
|
158
|
+
_c.label = 18;
|
|
159
|
+
case 18:
|
|
157
160
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
|
|
158
|
-
|
|
159
|
-
case
|
|
161
|
+
_c.label = 19;
|
|
162
|
+
case 19: return [2, {
|
|
160
163
|
data: data,
|
|
164
|
+
isicActivityList: isicActivityList,
|
|
161
165
|
leadData: __assign(__assign({}, leadData), { flows: (boardData === null || boardData === void 0 ? void 0 : boardData.info) || [] }),
|
|
162
166
|
token: token,
|
|
163
|
-
brandData: brandData,
|
|
167
|
+
brandData: brandData === null || brandData === void 0 ? void 0 : brandData.brand,
|
|
164
168
|
boardId: leadData === null || leadData === void 0 ? void 0 : leadData.board_id
|
|
165
169
|
}];
|
|
166
|
-
case
|
|
170
|
+
case 20: return [2, { data: data, isRequireOTP: true, token: token }];
|
|
167
171
|
}
|
|
168
172
|
});
|
|
169
173
|
}); });
|
|
@@ -185,7 +189,7 @@ export var resendOTP = createAsyncThunk('resendOTPBusiness', function (params, t
|
|
|
185
189
|
});
|
|
186
190
|
}); });
|
|
187
191
|
export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
188
|
-
var _a, business, settings, isNID, responseBody, stepName, payload, data, brandData, leadData, brand, country_code, steps, board_id, brandID, countryIso2, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted, isIdentityAuthStep,
|
|
192
|
+
var _a, business, settings, isNID, responseBody, stepName, payload, data, brandData, isicActivityList, leadData, brand, country_code, steps, board_id, business_id, entity, brandID, countryIso2, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted, isIdentityAuthStep, boardResponse, list, list;
|
|
189
193
|
var _b, _c, _d, _e, _f, _g, _h;
|
|
190
194
|
return __generator(this, function (_j) {
|
|
191
195
|
switch (_j.label) {
|
|
@@ -206,12 +210,12 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
|
|
|
206
210
|
data = (_j.sent()).data;
|
|
207
211
|
if ((_f = data.errors) === null || _f === void 0 ? void 0 : _f.length)
|
|
208
212
|
throw new Error(data.errors[0].description);
|
|
209
|
-
|
|
213
|
+
isicActivityList = undefined;
|
|
210
214
|
return [4, API.leadService.retrieveLead(data === null || data === void 0 ? void 0 : data.id)];
|
|
211
215
|
case 2:
|
|
212
216
|
leadData = (_j.sent()).data;
|
|
213
217
|
thunkApi.dispatch(updateStepName(stepName));
|
|
214
|
-
brand = leadData.brand, country_code = leadData.country_code, steps = leadData.steps, board_id = leadData.board_id;
|
|
218
|
+
brand = leadData.brand, country_code = leadData.country_code, steps = leadData.steps, board_id = leadData.board_id, business_id = leadData.business_id, entity = leadData.entity;
|
|
215
219
|
brandID = brand === null || brand === void 0 ? void 0 : brand.id;
|
|
216
220
|
countryIso2 = country_code;
|
|
217
221
|
if (countryIso2)
|
|
@@ -222,27 +226,25 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
|
|
|
222
226
|
hasBusinessCRActivitiesCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CR_ACTIVITIES);
|
|
223
227
|
hasBusinessCustomersCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CUSTOMERS);
|
|
224
228
|
isIdentityAuthStep = data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH;
|
|
225
|
-
if (!(
|
|
226
|
-
return [4, thunkApi.dispatch(
|
|
229
|
+
if (!(!isIdentityAuthStep && !hasBusinessCRInfoCompleted)) return [3, 4];
|
|
230
|
+
return [4, thunkApi.dispatch(retrieveAllEntityList({ businessId: business_id, entityId: entity === null || entity === void 0 ? void 0 : entity.id }))];
|
|
227
231
|
case 3:
|
|
228
232
|
_j.sent();
|
|
229
233
|
_j.label = 4;
|
|
230
234
|
case 4:
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
return [4, API.dataService.getActivities()];
|
|
235
|
+
if (!(isSA(countryIso2) && !isIdentityAuthStep && !hasBusinessCRInfoCompleted)) return [3, 6];
|
|
236
|
+
return [4, thunkApi.dispatch(retrieveEntityList({ leadId: data === null || data === void 0 ? void 0 : data.id }))];
|
|
234
237
|
case 5:
|
|
235
|
-
|
|
236
|
-
leadData = __assign(__assign({}, leadData), { entity_activities: activityList });
|
|
238
|
+
_j.sent();
|
|
237
239
|
_j.label = 6;
|
|
238
240
|
case 6:
|
|
239
241
|
if (!isNID) return [3, 7];
|
|
240
242
|
thunkApi.dispatch(handleNextScreenStep());
|
|
241
|
-
return [3,
|
|
243
|
+
return [3, 22];
|
|
242
244
|
case 7:
|
|
243
245
|
if (!(isIdentityAuthStep && isKW(countryIso2))) return [3, 8];
|
|
244
246
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_CIVIL_ID_STEP'));
|
|
245
|
-
return [3,
|
|
247
|
+
return [3, 22];
|
|
246
248
|
case 8:
|
|
247
249
|
if (!hasBusinessCompleted) return [3, 12];
|
|
248
250
|
if (!board_id) return [3, 11];
|
|
@@ -256,47 +258,56 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
|
|
|
256
258
|
_j.label = 11;
|
|
257
259
|
case 11:
|
|
258
260
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
259
|
-
return [3,
|
|
261
|
+
return [3, 22];
|
|
260
262
|
case 12:
|
|
261
263
|
if (!(data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH)) return [3, 13];
|
|
262
264
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
|
|
263
|
-
return [3,
|
|
265
|
+
return [3, 22];
|
|
264
266
|
case 13:
|
|
265
267
|
if (!hasBusinessCustomersCompleted) return [3, 14];
|
|
266
268
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_STEP'));
|
|
267
|
-
return [3,
|
|
269
|
+
return [3, 22];
|
|
268
270
|
case 14:
|
|
269
|
-
if (!hasBusinessCRActivitiesCompleted) return [3,
|
|
270
|
-
return [4,
|
|
271
|
+
if (!hasBusinessCRActivitiesCompleted) return [3, 18];
|
|
272
|
+
return [4, API.dataService.getActivitiesIsIc()];
|
|
271
273
|
case 15:
|
|
274
|
+
list = (_j.sent()).list;
|
|
275
|
+
isicActivityList = list || [];
|
|
276
|
+
return [4, thunkApi.dispatch(retrieveDataList())];
|
|
277
|
+
case 16:
|
|
272
278
|
_j.sent();
|
|
273
|
-
thunkApi.dispatch(handleNextScreenStep('BUSINESS_CUSTOMERS_STEP'));
|
|
274
279
|
return [4, API.brandService.retrieveBrand(brandID)];
|
|
275
|
-
case 16:
|
|
276
|
-
brandData = _j.sent();
|
|
277
|
-
return [3, 20];
|
|
278
280
|
case 17:
|
|
279
|
-
|
|
280
|
-
|
|
281
|
+
brandData = _j.sent();
|
|
282
|
+
thunkApi.dispatch(handleNextScreenStep('BUSINESS_CUSTOMERS_STEP'));
|
|
283
|
+
return [3, 22];
|
|
281
284
|
case 18:
|
|
285
|
+
if (!hasBusinessCRInfoCompleted) return [3, 21];
|
|
286
|
+
return [4, API.dataService.getActivitiesIsIc()];
|
|
287
|
+
case 19:
|
|
288
|
+
list = (_j.sent()).list;
|
|
289
|
+
isicActivityList = list || [];
|
|
290
|
+
return [4, API.brandService.retrieveBrand(brandID)];
|
|
291
|
+
case 20:
|
|
282
292
|
brandData = _j.sent();
|
|
283
293
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_ACTIVITIES_STEP'));
|
|
284
|
-
return [3,
|
|
285
|
-
case
|
|
294
|
+
return [3, 22];
|
|
295
|
+
case 21:
|
|
286
296
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
|
|
287
|
-
_j.label =
|
|
288
|
-
case
|
|
297
|
+
_j.label = 22;
|
|
298
|
+
case 22: return [2, { data: data, isicActivityList: isicActivityList, formData: __assign(__assign({}, params), { isNID: isNID }), brand: brandData === null || brandData === void 0 ? void 0 : brandData.brand, leadData: leadData }];
|
|
289
299
|
}
|
|
290
300
|
});
|
|
291
301
|
}); });
|
|
292
302
|
export var verifyPACI = createAsyncThunk('businessVerifyPACI', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
293
|
-
var _a, settings, business, responseBody, expiry, interval, maxCalls, count, data, isSuccess;
|
|
294
|
-
var
|
|
295
|
-
return __generator(this, function (
|
|
296
|
-
switch (
|
|
303
|
+
var _a, settings, business, responseBody, _b, business_id, entity, expiry, interval, maxCalls, count, data, isSuccess;
|
|
304
|
+
var _c, _d, _e, _f;
|
|
305
|
+
return __generator(this, function (_g) {
|
|
306
|
+
switch (_g.label) {
|
|
297
307
|
case 0:
|
|
298
308
|
_a = thunkApi.getState(), settings = _a.settings, business = _a.business;
|
|
299
309
|
responseBody = business.data.civilIdData.responseBody;
|
|
310
|
+
_b = business.data.verify.responseBody || {}, business_id = _b.business_id, entity = _b.entity;
|
|
300
311
|
expiry = (responseBody === null || responseBody === void 0 ? void 0 : responseBody.expiry) || 120;
|
|
301
312
|
interval = 5;
|
|
302
313
|
maxCalls = Math.floor(expiry / interval);
|
|
@@ -304,29 +315,32 @@ export var verifyPACI = createAsyncThunk('businessVerifyPACI', function (params,
|
|
|
304
315
|
return [2, { response: null }];
|
|
305
316
|
}
|
|
306
317
|
count = 1;
|
|
307
|
-
|
|
318
|
+
_g.label = 1;
|
|
308
319
|
case 1:
|
|
309
|
-
if (!(count <= maxCalls)) return [3,
|
|
320
|
+
if (!(count <= maxCalls)) return [3, 8];
|
|
310
321
|
return [4, API.authService.getTokenVerify(responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token)];
|
|
311
322
|
case 2:
|
|
312
|
-
data =
|
|
313
|
-
isSuccess = ((
|
|
314
|
-
if (!isSuccess) return [3,
|
|
315
|
-
|
|
316
|
-
(_e = params === null || params === void 0 ? void 0 : params.onSuccess) === null || _e === void 0 ? void 0 : _e.call(params);
|
|
317
|
-
return [4, sleep(3000)];
|
|
323
|
+
data = _g.sent();
|
|
324
|
+
isSuccess = ((_c = data.status) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'success';
|
|
325
|
+
if (!isSuccess) return [3, 5];
|
|
326
|
+
return [4, thunkApi.dispatch(retrieveAllEntityList({ businessId: business_id, entityId: entity === null || entity === void 0 ? void 0 : entity.id }))];
|
|
318
327
|
case 3:
|
|
319
|
-
|
|
328
|
+
_g.sent();
|
|
329
|
+
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, {});
|
|
330
|
+
(_f = params === null || params === void 0 ? void 0 : params.onSuccess) === null || _f === void 0 ? void 0 : _f.call(params);
|
|
331
|
+
return [4, sleep(3000)];
|
|
332
|
+
case 4:
|
|
333
|
+
_g.sent();
|
|
320
334
|
thunkApi.dispatch(handleNextScreenStep());
|
|
321
335
|
return [2, { response: data }];
|
|
322
|
-
case
|
|
323
|
-
case 5:
|
|
324
|
-
_f.sent();
|
|
325
|
-
_f.label = 6;
|
|
336
|
+
case 5: return [4, sleep(interval * 1000)];
|
|
326
337
|
case 6:
|
|
338
|
+
_g.sent();
|
|
339
|
+
_g.label = 7;
|
|
340
|
+
case 7:
|
|
327
341
|
count++;
|
|
328
342
|
return [3, 1];
|
|
329
|
-
case
|
|
343
|
+
case 8: throw new Error('paci_verification_failed');
|
|
330
344
|
}
|
|
331
345
|
});
|
|
332
346
|
}); });
|
|
@@ -426,6 +440,19 @@ export var retrieveEntityList = createAsyncThunk('retrieveEntityList', function
|
|
|
426
440
|
}
|
|
427
441
|
});
|
|
428
442
|
}); });
|
|
443
|
+
export var retrieveAllEntityList = createAsyncThunk('retrieveAllEntityList', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
444
|
+
var settings, data;
|
|
445
|
+
return __generator(this, function (_a) {
|
|
446
|
+
switch (_a.label) {
|
|
447
|
+
case 0:
|
|
448
|
+
settings = thunkApi.getState().settings;
|
|
449
|
+
return [4, API.entityService.retrieveAllEntities(params.businessId)];
|
|
450
|
+
case 1:
|
|
451
|
+
data = _a.sent();
|
|
452
|
+
return [2, { data: data, businessCountryCode: settings.data.businessCountry.iso2, entityId: params.entityId }];
|
|
453
|
+
}
|
|
454
|
+
});
|
|
455
|
+
}); });
|
|
429
456
|
export var retrieveBoardDetails = createAsyncThunk('retrieveBoardDetails', function (boardID) { return __awaiter(void 0, void 0, void 0, function () {
|
|
430
457
|
var data;
|
|
431
458
|
var _a, _b;
|
|
@@ -435,42 +462,37 @@ export var retrieveBoardDetails = createAsyncThunk('retrieveBoardDetails', funct
|
|
|
435
462
|
case 1:
|
|
436
463
|
data = _c.sent();
|
|
437
464
|
return [2, {
|
|
438
|
-
data: __assign(__assign({}, data), { user: data === null || data === void 0 ? void 0 : data.user, brand: data === null || data === void 0 ? void 0 : data.brand, bank_account: data === null || data === void 0 ? void 0 : data.bank_account, entity: data === null || data === void 0 ? void 0 : data.entity, merchant: data === null || data === void 0 ? void 0 : data.merchant, name: (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.names, contact: (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.contact, individuals: data === null || data === void 0 ? void 0 : data.individuals })
|
|
465
|
+
data: __assign(__assign({}, data), { user: data === null || data === void 0 ? void 0 : data.user, brand: data === null || data === void 0 ? void 0 : data.brand, bank_account: data === null || data === void 0 ? void 0 : data.bank_account, entity: data === null || data === void 0 ? void 0 : data.entity, merchant: data === null || data === void 0 ? void 0 : data.merchant, name: (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.names, contact: (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.contact, individuals: data === null || data === void 0 ? void 0 : data.individuals, board_id: data === null || data === void 0 ? void 0 : data.id })
|
|
439
466
|
}];
|
|
440
467
|
}
|
|
441
468
|
});
|
|
442
469
|
}); });
|
|
443
470
|
export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
444
|
-
var _a, settings, business, isNonSA, isFL,
|
|
445
|
-
var
|
|
446
|
-
return __generator(this, function (
|
|
447
|
-
switch (
|
|
471
|
+
var _a, settings, business, isNonSA, selectedLicense, licenseNumber, entityLegalName, certificateId, articleId, selectedEntityLicense, isFL, _b, lead_id, brand, stepName, payload, data, accountBody, accountData, brandData, brandRes, _c, message, error, list, documentData, entityData, entityId, documentBody, payload_1;
|
|
472
|
+
var _d, _e;
|
|
473
|
+
return __generator(this, function (_f) {
|
|
474
|
+
switch (_f.label) {
|
|
448
475
|
case 0:
|
|
449
476
|
_a = thunkApi.getState(), settings = _a.settings, business = _a.business;
|
|
450
477
|
isNonSA = !isSA(settings.data.businessCountry.iso2);
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
478
|
+
selectedLicense = params.selectedLicense, licenseNumber = params.licenseNumber, entityLegalName = params.entityLegalName, certificateId = params.certificateId, articleId = params.articleId, selectedEntityLicense = params.selectedEntityLicense;
|
|
479
|
+
isFL = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.FL;
|
|
480
|
+
_b = business.data.verify.responseBody || {}, lead_id = _b.lead_id, brand = _b.brand;
|
|
481
|
+
stepName = 'BUSINESS_ACTIVITIES_STEP';
|
|
482
|
+
payload = __assign(__assign(__assign(__assign({ id: lead_id || '', entity: {
|
|
483
|
+
id: (selectedEntityLicense === null || selectedEntityLicense === void 0 ? void 0 : selectedEntityLicense.id) && (isNonSA ? !isFL : true) ? selectedEntityLicense === null || selectedEntityLicense === void 0 ? void 0 : selectedEntityLicense.id : ''
|
|
484
|
+
} }, (!(selectedEntityLicense === null || selectedEntityLicense === void 0 ? void 0 : selectedEntityLicense.id) && {
|
|
485
|
+
license_number: isNonSA && isFL ? '' : licenseNumber,
|
|
486
|
+
license_type: isFL ? LicenseType.FL : LicenseType.CR,
|
|
487
|
+
business_type: selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type
|
|
488
|
+
})), { step_name: BUSINESS_STEP_NAMES.BUSINESS_CR_INFO }), (isNonSA && {
|
|
489
|
+
business_name: isFL ? undefined : { ar: entityLegalName, en: entityLegalName }
|
|
490
|
+
})), { encryption_contract: ['license_number', 'business_type', 'license_type'] });
|
|
461
491
|
return [4, API.leadService.updateLead(payload)];
|
|
462
492
|
case 1:
|
|
463
|
-
data =
|
|
464
|
-
entity_activities = data.entity_activities;
|
|
465
|
-
if (!!entity_activities) return [3, 3];
|
|
466
|
-
return [4, API.dataService.getActivities()];
|
|
467
|
-
case 2:
|
|
468
|
-
list = (_h.sent()).list;
|
|
469
|
-
data.entity_activities = list;
|
|
470
|
-
_h.label = 3;
|
|
471
|
-
case 3:
|
|
493
|
+
data = _f.sent();
|
|
472
494
|
accountBody = {
|
|
473
|
-
lead_id:
|
|
495
|
+
lead_id: lead_id,
|
|
474
496
|
notify: {
|
|
475
497
|
email: false,
|
|
476
498
|
phone: false
|
|
@@ -479,100 +501,116 @@ export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', f
|
|
|
479
501
|
is_acknowledged: true,
|
|
480
502
|
step_name: BUSINESS_STEP_NAMES.BUSINESS_INFO_CONFIRM
|
|
481
503
|
};
|
|
504
|
+
brandData = undefined;
|
|
505
|
+
_f.label = 2;
|
|
506
|
+
case 2:
|
|
507
|
+
_f.trys.push([2, 5, , 6]);
|
|
482
508
|
return [4, API.accountService.createAccount(accountBody)];
|
|
509
|
+
case 3:
|
|
510
|
+
accountData = _f.sent();
|
|
511
|
+
thunkApi.dispatch(updateStepName(BUSINESS_STEP_NAMES.BUSINESS_INFO_CONFIRM));
|
|
512
|
+
return [4, API.brandService.retrieveBrand(brand === null || brand === void 0 ? void 0 : brand.id)];
|
|
483
513
|
case 4:
|
|
484
|
-
|
|
514
|
+
brandRes = (_f.sent()).brand;
|
|
515
|
+
brandData = brandRes;
|
|
516
|
+
return [3, 6];
|
|
517
|
+
case 5:
|
|
518
|
+
_c = _f.sent();
|
|
519
|
+
message = _c.message;
|
|
520
|
+
error = message;
|
|
521
|
+
if ((error === null || error === void 0 ? void 0 : error.toLowerCase()) === 'entity with license already exist') {
|
|
522
|
+
stepName = 'BUSINESS_VERIFY_BRAND_INFO';
|
|
523
|
+
}
|
|
524
|
+
else
|
|
525
|
+
throw new Error(error);
|
|
526
|
+
return [3, 6];
|
|
527
|
+
case 6: return [4, API.dataService.getActivitiesIsIc()];
|
|
528
|
+
case 7:
|
|
529
|
+
list = (_f.sent()).list;
|
|
485
530
|
entityData = undefined;
|
|
486
531
|
entityId = accountData === null || accountData === void 0 ? void 0 : accountData.entity_id;
|
|
487
|
-
|
|
488
|
-
if (!((params.certificateId || []).length > 0)) return [3, 6];
|
|
532
|
+
if (!((certificateId || []).length > 0)) return [3, 9];
|
|
489
533
|
documentBody = {
|
|
490
534
|
entity_id: entityId || '',
|
|
491
535
|
documents: [
|
|
492
536
|
{
|
|
493
|
-
|
|
537
|
+
type: DocumentPurpose.CR,
|
|
538
|
+
images: certificateId
|
|
494
539
|
}
|
|
495
540
|
]
|
|
496
541
|
};
|
|
497
|
-
return [4, API.
|
|
498
|
-
case
|
|
499
|
-
documentData =
|
|
500
|
-
|
|
501
|
-
case
|
|
502
|
-
if (!(articleId && entityId)) return [3,
|
|
542
|
+
return [4, API.documentService.updateDocumentInfo(documentBody)];
|
|
543
|
+
case 8:
|
|
544
|
+
documentData = _f.sent();
|
|
545
|
+
_f.label = 9;
|
|
546
|
+
case 9:
|
|
547
|
+
if (!(articleId && entityId)) return [3, 11];
|
|
503
548
|
payload_1 = {
|
|
504
549
|
id: (accountData === null || accountData === void 0 ? void 0 : accountData.entity_id) || '',
|
|
505
550
|
AOA_file_id: articleId
|
|
506
551
|
};
|
|
507
552
|
return [4, API.entityService.updateEntity(payload_1)];
|
|
508
|
-
case
|
|
509
|
-
entityData =
|
|
510
|
-
|
|
511
|
-
case
|
|
512
|
-
thunkApi.dispatch(handleNextScreenStep());
|
|
513
|
-
(
|
|
514
|
-
return [2, { data: data, formData: params, accountData: accountData, documentData: documentData, entityData: entityData }];
|
|
553
|
+
case 10:
|
|
554
|
+
entityData = _f.sent();
|
|
555
|
+
_f.label = 11;
|
|
556
|
+
case 11:
|
|
557
|
+
thunkApi.dispatch(handleNextScreenStep(stepName));
|
|
558
|
+
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, params);
|
|
559
|
+
return [2, { data: __assign(__assign({}, data), { brand: brandData }), formData: params, accountData: accountData, documentData: documentData, entityData: entityData, isicActivityList: list || [] }];
|
|
515
560
|
}
|
|
516
561
|
});
|
|
517
562
|
}); });
|
|
518
|
-
export var uploadArticle = createAsyncThunk('businessUploadArticle', function (_a) {
|
|
519
|
-
var file = _a.file, onProgress = _a.onProgress;
|
|
520
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
521
|
-
var typeArray, type, uploadPayload, onUploadProgress, data;
|
|
522
|
-
var _b;
|
|
523
|
-
return __generator(this, function (_c) {
|
|
524
|
-
switch (_c.label) {
|
|
525
|
-
case 0:
|
|
526
|
-
typeArray = ((_b = file === null || file === void 0 ? void 0 : file.type) === null || _b === void 0 ? void 0 : _b.split('/')) || [];
|
|
527
|
-
type = typeArray[1] || '';
|
|
528
|
-
uploadPayload = {
|
|
529
|
-
file_link_create: true,
|
|
530
|
-
title: file === null || file === void 0 ? void 0 : file.name,
|
|
531
|
-
purpose: DocumentPurpose.ARTICLE_ASSOCIATION,
|
|
532
|
-
type: type,
|
|
533
|
-
file: file
|
|
534
|
-
};
|
|
535
|
-
onUploadProgress = function (progressEvent) {
|
|
536
|
-
var progress = ((progressEvent === null || progressEvent === void 0 ? void 0 : progressEvent.loaded) / (progressEvent === null || progressEvent === void 0 ? void 0 : progressEvent.total)) * 100;
|
|
537
|
-
onProgress === null || onProgress === void 0 ? void 0 : onProgress(Math.floor(progress));
|
|
538
|
-
};
|
|
539
|
-
return [4, API.fileService.uploadFileInfo(uploadPayload, { onUploadProgress: onUploadProgress })];
|
|
540
|
-
case 1:
|
|
541
|
-
data = _c.sent();
|
|
542
|
-
return [2, { data: data }];
|
|
543
|
-
}
|
|
544
|
-
});
|
|
545
|
-
});
|
|
546
|
-
});
|
|
547
563
|
export var updateActivitiesInfo = createAsyncThunk('updateActivitiesInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
548
|
-
var _a, settings, business, activities, stepName, id, requestBody, data;
|
|
549
|
-
var
|
|
550
|
-
return __generator(this, function (
|
|
551
|
-
switch (
|
|
564
|
+
var _a, settings, business, _b, brand, entity_activities, entity, _c, brandActivities, brandId, activities, operationStartDate, stepName, id, removedActivities, payload, newBrandActivities, newEntityActivities, activityPayload, requestBody, data;
|
|
565
|
+
var _d, _e;
|
|
566
|
+
return __generator(this, function (_f) {
|
|
567
|
+
switch (_f.label) {
|
|
552
568
|
case 0:
|
|
553
569
|
_a = thunkApi.getState(), settings = _a.settings, business = _a.business;
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
});
|
|
570
|
+
_b = business.data.verify.responseBody || {}, brand = _b.brand, entity_activities = _b.entity_activities, entity = _b.entity;
|
|
571
|
+
_c = brand || {}, brandActivities = _c.activities, brandId = _c.id;
|
|
572
|
+
activities = params.activities, operationStartDate = params.operationStartDate;
|
|
558
573
|
stepName = BUSINESS_STEP_NAMES.BUSINESS_CR_ACTIVITIES;
|
|
559
|
-
id =
|
|
560
|
-
|
|
574
|
+
id = brandId;
|
|
575
|
+
removedActivities = (brandActivities || []).filter(function (brandActivity) { return !(activities || []).some(function (activity) { return activity.id === brandActivity.id; }); });
|
|
576
|
+
if (!(removedActivities === null || removedActivities === void 0 ? void 0 : removedActivities.length)) return [3, 2];
|
|
577
|
+
payload = {
|
|
561
578
|
id: id,
|
|
562
|
-
activities:
|
|
563
|
-
operations: {
|
|
564
|
-
start_date: params.operationStartDate
|
|
565
|
-
},
|
|
566
|
-
step_name: stepName,
|
|
567
|
-
encryption_contract: ['operations.start_date']
|
|
579
|
+
activities: removedActivities
|
|
568
580
|
};
|
|
569
|
-
return [4, API.brandService.
|
|
581
|
+
return [4, API.brandService.removeBrandActivity(payload)];
|
|
570
582
|
case 1:
|
|
571
|
-
|
|
583
|
+
_f.sent();
|
|
584
|
+
_f.label = 2;
|
|
585
|
+
case 2:
|
|
586
|
+
newBrandActivities = activities === null || activities === void 0 ? void 0 : activities.filter(function (act) { return !(brandActivities || []).some(function (brandActivity) { return act.id === brandActivity.id; }); });
|
|
587
|
+
newEntityActivities = activities === null || activities === void 0 ? void 0 : activities.filter(function (act) { return !(entity_activities || []).some(function (entityActivity) { return act.id === entityActivity.id; }); });
|
|
588
|
+
if (!(newEntityActivities === null || newEntityActivities === void 0 ? void 0 : newEntityActivities.length)) return [3, 4];
|
|
589
|
+
activityPayload = {
|
|
590
|
+
id: entity === null || entity === void 0 ? void 0 : entity.id,
|
|
591
|
+
activities: newEntityActivities.map(function (_a) {
|
|
592
|
+
var id = _a.id;
|
|
593
|
+
return ({ id: id });
|
|
594
|
+
})
|
|
595
|
+
};
|
|
596
|
+
return [4, API.entityService.updateEntityActivity(activityPayload)];
|
|
597
|
+
case 3:
|
|
598
|
+
_f.sent();
|
|
599
|
+
_f.label = 4;
|
|
600
|
+
case 4:
|
|
601
|
+
requestBody = __assign(__assign({ id: id }, ((newBrandActivities === null || newBrandActivities === void 0 ? void 0 : newBrandActivities.length) && { activities: newBrandActivities.map(function (_a) {
|
|
602
|
+
var id = _a.id;
|
|
603
|
+
return ({ id: id });
|
|
604
|
+
}) })), { operations: {
|
|
605
|
+
start_date: operationStartDate
|
|
606
|
+
}, step_name: stepName, encryption_contract: ['operations.start_date'] });
|
|
607
|
+
return [4, API.brandService.updateBrandInfo(requestBody)];
|
|
608
|
+
case 5:
|
|
609
|
+
data = _f.sent();
|
|
572
610
|
thunkApi.dispatch(retrieveDataList());
|
|
573
611
|
thunkApi.dispatch(updateStepName(stepName));
|
|
574
612
|
thunkApi.dispatch(handleNextScreenStep());
|
|
575
|
-
(
|
|
613
|
+
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, requestBody);
|
|
576
614
|
return [2, { data: data === null || data === void 0 ? void 0 : data.brand, formData: __assign({}, params) }];
|
|
577
615
|
}
|
|
578
616
|
});
|
|
@@ -707,7 +745,6 @@ var initialState = {
|
|
|
707
745
|
customLoading: false,
|
|
708
746
|
uploading: false,
|
|
709
747
|
uploadingArticle: false,
|
|
710
|
-
uploadingArticleError: null,
|
|
711
748
|
data: {
|
|
712
749
|
flowName: FlowsTypes.BUSINESS,
|
|
713
750
|
verify: {
|
|
@@ -722,7 +759,7 @@ var initialState = {
|
|
|
722
759
|
},
|
|
723
760
|
nidData: {
|
|
724
761
|
nid: '',
|
|
725
|
-
dob:
|
|
762
|
+
dob: '',
|
|
726
763
|
type: ''
|
|
727
764
|
},
|
|
728
765
|
businessTypeData: {
|
|
@@ -755,11 +792,15 @@ export var businessSlice = createSlice({
|
|
|
755
792
|
resetOTPScreen: function (state) {
|
|
756
793
|
state.data.otpData.otp = '';
|
|
757
794
|
},
|
|
758
|
-
clearArticleId: function (state) {
|
|
759
|
-
state.data.businessTypeData.articleId = '';
|
|
760
|
-
},
|
|
761
795
|
uploadingStatus: function (state, action) {
|
|
762
796
|
state.uploading = action.payload;
|
|
797
|
+
},
|
|
798
|
+
uploadingArticleStatus: function (state, action) {
|
|
799
|
+
state.uploadingArticle = action.payload;
|
|
800
|
+
},
|
|
801
|
+
clearAOAFile: function (state) {
|
|
802
|
+
var entity = (state.data.verify.responseBody || {}).entity;
|
|
803
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { entity: __assign(__assign({}, entity), { AOA_file: undefined, AOA_file_id: undefined }) });
|
|
763
804
|
}
|
|
764
805
|
},
|
|
765
806
|
extraReducers: function (builder) {
|
|
@@ -772,47 +813,33 @@ export var businessSlice = createSlice({
|
|
|
772
813
|
var _a, _b;
|
|
773
814
|
state.error = null;
|
|
774
815
|
state.customLoading = false;
|
|
775
|
-
var _c = action.payload, data = _c.data, boardId = _c.boardId, brandData = _c.brandData, leadData = _c.leadData, token = _c.token, isRequireOTP = _c.isRequireOTP;
|
|
816
|
+
var _c = action.payload, data = _c.data, boardId = _c.boardId, brandData = _c.brandData, leadData = _c.leadData, token = _c.token, isRequireOTP = _c.isRequireOTP, isicActivityList = _c.isicActivityList;
|
|
776
817
|
var responseBody = state.data.verify.responseBody;
|
|
777
|
-
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), leadData), responseBody), { board_id: boardId, lead_id: data === null || data === void 0 ? void 0 : data.id });
|
|
818
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign(__assign({}, data), leadData), responseBody), { board_id: boardId, lead_id: data === null || data === void 0 ? void 0 : data.id }), (brandData && { brand: brandData }));
|
|
778
819
|
if (token)
|
|
779
820
|
state.data.verify.token = token;
|
|
780
821
|
state.data.otpData.isNID = false;
|
|
781
822
|
if (isRequireOTP)
|
|
782
823
|
return;
|
|
783
|
-
var _d = state.data.verify.responseBody || {}, entity = _d.entity, entity_activities = _d.entity_activities,
|
|
784
|
-
|
|
824
|
+
var _d = state.data.verify.responseBody || {}, entity = _d.entity, entity_activities = _d.entity_activities, business_name = _d.business_name;
|
|
825
|
+
if (business_name === null || business_name === void 0 ? void 0 : business_name.en)
|
|
826
|
+
state.data.businessTypeData.entityLegalName = business_name === null || business_name === void 0 ? void 0 : business_name.en;
|
|
827
|
+
var issuingDate = ((_a = brandData === null || brandData === void 0 ? void 0 : brandData.operations) === null || _a === void 0 ? void 0 : _a.start_date) || ((_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.issuing_date);
|
|
785
828
|
if (issuingDate)
|
|
786
829
|
state.data.activitiesData.operationStartDate = convertNumbers2English(dateFormat(issuingDate));
|
|
787
|
-
var
|
|
788
|
-
var
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
var number_1 = license.number;
|
|
797
|
-
var _e = state.data.businessTypeData || {}, busResData = _e.responseBody, selectedLicense = _e.selectedLicense;
|
|
798
|
-
var licenseList = (busResData || {}).licenseList;
|
|
799
|
-
var selectedLicenseData = selectedLicense;
|
|
800
|
-
if (number_1) {
|
|
801
|
-
var findLicense = (_b = licenseList === null || licenseList === void 0 ? void 0 : licenseList.find) === null || _b === void 0 ? void 0 : _b.call(licenseList, function (_a) {
|
|
802
|
-
var license = _a.license;
|
|
803
|
-
return (license === null || license === void 0 ? void 0 : license.number) === number_1;
|
|
804
|
-
});
|
|
805
|
-
if (findLicense)
|
|
806
|
-
selectedLicenseData = findLicense;
|
|
807
|
-
else if (!findLicense && business_type === BusinessType.FL) {
|
|
808
|
-
selectedLicenseData = __assign(__assign({}, OTHER_FL_LICENSE), { license: { number: number_1 } });
|
|
809
|
-
}
|
|
810
|
-
else
|
|
811
|
-
selectedLicenseData = __assign(__assign({}, OTHER_CR_LICENSE), { license: { number: number_1 } });
|
|
812
|
-
state.data.businessTypeData.licenseNumber = number_1;
|
|
830
|
+
var _e = brandData || {}, terms = _e.terms, activities = _e.activities;
|
|
831
|
+
var entityActivities = (entity_activities === null || entity_activities === void 0 ? void 0 : entity_activities.filter(function (activity) {
|
|
832
|
+
return !(activities === null || activities === void 0 ? void 0 : activities.some(function (value) { return value.id === activity.id; }));
|
|
833
|
+
})) || [];
|
|
834
|
+
var selectedActivity = __spreadArray(__spreadArray([], (activities || []), true), entityActivities, true);
|
|
835
|
+
terms === null || terms === void 0 ? void 0 : terms.forEach(function (element) {
|
|
836
|
+
if ((element === null || element === void 0 ? void 0 : element.term) === 'general') {
|
|
837
|
+
state.data.customersData.transactionPolicy = element.agree;
|
|
838
|
+
state.data.customersData.refundPolicy = element.agree;
|
|
813
839
|
}
|
|
814
|
-
|
|
815
|
-
|
|
840
|
+
});
|
|
841
|
+
state.data.activitiesData.activities = selectedActivity;
|
|
842
|
+
state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activityList: isicActivityList });
|
|
816
843
|
})
|
|
817
844
|
.addCase(verifyLeadToken.rejected, function (state, action) {
|
|
818
845
|
state.error = action.error.message;
|
|
@@ -843,43 +870,29 @@ export var businessSlice = createSlice({
|
|
|
843
870
|
var _a, _b;
|
|
844
871
|
state.loading = false;
|
|
845
872
|
state.error = null;
|
|
846
|
-
var _c = action.payload, data = _c.data, formData = _c.formData, brand = _c.brand, leadData = _c.leadData;
|
|
873
|
+
var _c = action.payload, data = _c.data, formData = _c.formData, brand = _c.brand, leadData = _c.leadData, isicActivityList = _c.isicActivityList;
|
|
847
874
|
state.data.otpData = formData;
|
|
848
875
|
state.data.otpData.responseBody = data;
|
|
849
|
-
state.data.verify.responseBody = __assign(__assign(__assign({}, leadData), state.data.verify.responseBody), { flows: (leadData === null || leadData === void 0 ? void 0 : leadData.flows) || [] });
|
|
850
|
-
var _d = leadData || {}, entity = _d.entity, entity_activities = _d.entity_activities,
|
|
851
|
-
|
|
876
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, leadData), state.data.verify.responseBody), (brand && { brand: brand })), { flows: (leadData === null || leadData === void 0 ? void 0 : leadData.flows) || [] });
|
|
877
|
+
var _d = leadData || {}, entity = _d.entity, entity_activities = _d.entity_activities, business_name = _d.business_name;
|
|
878
|
+
if (business_name === null || business_name === void 0 ? void 0 : business_name.en)
|
|
879
|
+
state.data.businessTypeData.entityLegalName = business_name === null || business_name === void 0 ? void 0 : business_name.en;
|
|
880
|
+
var issuingDate = ((_a = brand === null || brand === void 0 ? void 0 : brand.operations) === null || _a === void 0 ? void 0 : _a.start_date) || ((_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.issuing_date);
|
|
852
881
|
if (issuingDate)
|
|
853
882
|
state.data.activitiesData.operationStartDate = convertNumbers2English(dateFormat(issuingDate));
|
|
854
|
-
var
|
|
855
|
-
var
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
var number_2 = license.number;
|
|
864
|
-
var _e = state.data.businessTypeData || {}, busResData = _e.responseBody, selectedLicense = _e.selectedLicense;
|
|
865
|
-
var licenseList = (busResData || {}).licenseList;
|
|
866
|
-
var selectedLicenseData = selectedLicense;
|
|
867
|
-
if (number_2) {
|
|
868
|
-
var findLicense = (_b = licenseList === null || licenseList === void 0 ? void 0 : licenseList.find) === null || _b === void 0 ? void 0 : _b.call(licenseList, function (_a) {
|
|
869
|
-
var license = _a.license;
|
|
870
|
-
return (license === null || license === void 0 ? void 0 : license.number) === number_2;
|
|
871
|
-
});
|
|
872
|
-
if (findLicense)
|
|
873
|
-
selectedLicenseData = findLicense;
|
|
874
|
-
else if (!findLicense && business_type === BusinessType.FL) {
|
|
875
|
-
selectedLicenseData = __assign(__assign({}, OTHER_FL_LICENSE), { license: { number: number_2 } });
|
|
876
|
-
}
|
|
877
|
-
else
|
|
878
|
-
selectedLicenseData = __assign(__assign({}, OTHER_CR_LICENSE), { license: { number: number_2 } });
|
|
879
|
-
state.data.businessTypeData.licenseNumber = number_2;
|
|
883
|
+
var _e = brand || {}, terms = _e.terms, activities = _e.activities;
|
|
884
|
+
var entityActivities = (entity_activities === null || entity_activities === void 0 ? void 0 : entity_activities.filter(function (activity) {
|
|
885
|
+
return !(activities === null || activities === void 0 ? void 0 : activities.some(function (value) { return value.id === activity.id; }));
|
|
886
|
+
})) || [];
|
|
887
|
+
var selectedActivity = __spreadArray(__spreadArray([], (activities || []), true), entityActivities, true);
|
|
888
|
+
terms === null || terms === void 0 ? void 0 : terms.forEach(function (element) {
|
|
889
|
+
if ((element === null || element === void 0 ? void 0 : element.term) === 'general') {
|
|
890
|
+
state.data.customersData.transactionPolicy = element.agree;
|
|
891
|
+
state.data.customersData.refundPolicy = element.agree;
|
|
880
892
|
}
|
|
881
|
-
|
|
882
|
-
|
|
893
|
+
});
|
|
894
|
+
state.data.activitiesData.activities = selectedActivity;
|
|
895
|
+
state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activityList: isicActivityList });
|
|
883
896
|
})
|
|
884
897
|
.addCase(verifyLeadOTP.rejected, function (state, action) {
|
|
885
898
|
state.loading = false;
|
|
@@ -972,6 +985,7 @@ export var businessSlice = createSlice({
|
|
|
972
985
|
state.error = null;
|
|
973
986
|
state.loading = false;
|
|
974
987
|
var data = action.payload;
|
|
988
|
+
var entityLicenseList = (state.data.businessTypeData.responseBody || {}).entityLicenseList;
|
|
975
989
|
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
976
990
|
var licenseList = [];
|
|
977
991
|
if (!description) {
|
|
@@ -986,19 +1000,59 @@ export var businessSlice = createSlice({
|
|
|
986
1000
|
return __assign(__assign({}, item), { type: BusinessType.FL });
|
|
987
1001
|
});
|
|
988
1002
|
licenseList = __spreadArray(__spreadArray([], licenseList, true), mappedFL, true);
|
|
1003
|
+
licenseList = licenseList.filter(function (_a) {
|
|
1004
|
+
var license = _a.license;
|
|
1005
|
+
return !(entityLicenseList || []).some(function (e) { return e.license.number === license.number; });
|
|
1006
|
+
});
|
|
989
1007
|
}
|
|
990
1008
|
}
|
|
991
1009
|
licenseList = __spreadArray(__spreadArray([], licenseList, true), [OTHER_CR_LICENSE, OTHER_FL_LICENSE], false);
|
|
992
1010
|
state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { licenseList: licenseList });
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
1011
|
+
if (!(entityLicenseList === null || entityLicenseList === void 0 ? void 0 : entityLicenseList.length)) {
|
|
1012
|
+
var selectedLicense = licenseList === null || licenseList === void 0 ? void 0 : licenseList[0];
|
|
1013
|
+
var isOtherLicense_1 = ((_b = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.license) === null || _b === void 0 ? void 0 : _b.number) === 'other_fl' || ((_c = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.license) === null || _c === void 0 ? void 0 : _c.number) === 'other_cr';
|
|
1014
|
+
state.data.businessTypeData.selectedLicense = selectedLicense;
|
|
1015
|
+
if (!isOtherLicense_1)
|
|
1016
|
+
state.data.businessTypeData.licenseNumber = ((_d = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.license) === null || _d === void 0 ? void 0 : _d.number) || '';
|
|
1017
|
+
}
|
|
998
1018
|
})
|
|
999
1019
|
.addCase(retrieveEntityList.rejected, function (state, action) {
|
|
1000
1020
|
state.error = action.error.message;
|
|
1001
1021
|
state.loading = false;
|
|
1022
|
+
})
|
|
1023
|
+
.addCase(retrieveAllEntityList.pending, function (state) {
|
|
1024
|
+
state.error = null;
|
|
1025
|
+
state.loading = true;
|
|
1026
|
+
})
|
|
1027
|
+
.addCase(retrieveAllEntityList.fulfilled, function (state, action) {
|
|
1028
|
+
var _a;
|
|
1029
|
+
state.error = null;
|
|
1030
|
+
state.loading = false;
|
|
1031
|
+
var _b = action.payload, data = _b.data, businessCountryCode = _b.businessCountryCode, entityId = _b.entityId;
|
|
1032
|
+
var isKWCountry = isKW(businessCountryCode);
|
|
1033
|
+
var list = (data === null || data === void 0 ? void 0 : data.entities_info) || [];
|
|
1034
|
+
if (isKWCountry) {
|
|
1035
|
+
list = list.filter(function (l) { var _a; return ((_a = l.license) === null || _a === void 0 ? void 0 : _a.type) !== LicenseType.FL; });
|
|
1036
|
+
}
|
|
1037
|
+
var entityLicenseList = [];
|
|
1038
|
+
if (list.length > 0) {
|
|
1039
|
+
entityLicenseList = list.map(function (item) {
|
|
1040
|
+
var _a;
|
|
1041
|
+
return __assign(__assign({}, item), { type: ((_a = item.license) === null || _a === void 0 ? void 0 : _a.type) === LicenseType.FL ? BusinessType.FL : BusinessType.CR });
|
|
1042
|
+
});
|
|
1043
|
+
entityLicenseList = __spreadArray(__spreadArray([], entityLicenseList, true), [OTHER_ENTITY_LICENSE], false);
|
|
1044
|
+
state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { entityLicenseList: entityLicenseList });
|
|
1045
|
+
var findEntity = entityLicenseList.find(function (e) { return e.id === entityId; });
|
|
1046
|
+
var selectedLicense = findEntity ? findEntity : entityLicenseList[0];
|
|
1047
|
+
state.data.businessTypeData.selectedEntityLicense = selectedLicense;
|
|
1048
|
+
state.data.businessTypeData.selectedLicense = selectedLicense;
|
|
1049
|
+
if (!isOtherLicense(selectedLicense))
|
|
1050
|
+
state.data.businessTypeData.licenseNumber = ((_a = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.license) === null || _a === void 0 ? void 0 : _a.number) || '';
|
|
1051
|
+
}
|
|
1052
|
+
})
|
|
1053
|
+
.addCase(retrieveAllEntityList.rejected, function (state, action) {
|
|
1054
|
+
state.error = action.error.message;
|
|
1055
|
+
state.loading = false;
|
|
1002
1056
|
})
|
|
1003
1057
|
.addCase(retrieveBoardDetails.pending, function (state) {
|
|
1004
1058
|
state.error = null;
|
|
@@ -1022,38 +1076,37 @@ export var businessSlice = createSlice({
|
|
|
1022
1076
|
var _a;
|
|
1023
1077
|
state.loading = false;
|
|
1024
1078
|
state.error = null;
|
|
1025
|
-
var _b = action.payload, data = _b.data, formData = _b.formData, accountData = _b.accountData, documentData = _b.documentData;
|
|
1079
|
+
var _b = action.payload, data = _b.data, formData = _b.formData, accountData = _b.accountData, documentData = _b.documentData, isicActivityList = _b.isicActivityList;
|
|
1026
1080
|
state.data.businessTypeData = __assign(__assign({}, state.data.businessTypeData), formData);
|
|
1027
|
-
var entity = data.entity, entity_activities = data.entity_activities;
|
|
1081
|
+
var entity = data.entity, entity_activities = data.entity_activities, brand = data.brand;
|
|
1028
1082
|
var issuingDate = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.issuing_date) || new Date().getTime();
|
|
1029
1083
|
if ((accountData === null || accountData === void 0 ? void 0 : accountData.status) === 'ALREADY_TAKEN') {
|
|
1030
1084
|
state.error = 'signup_user_exists_error';
|
|
1031
1085
|
return;
|
|
1032
1086
|
}
|
|
1087
|
+
var activities = (brand || {}).activities;
|
|
1088
|
+
var entityActivities = (entity_activities === null || entity_activities === void 0 ? void 0 : entity_activities.filter(function (activity) {
|
|
1089
|
+
return !(activities === null || activities === void 0 ? void 0 : activities.some(function (value) { return value.id === activity.id; }));
|
|
1090
|
+
})) || [];
|
|
1091
|
+
var selectedActivity = __spreadArray(__spreadArray([], (activities || []), true), entityActivities, true);
|
|
1092
|
+
state.data.activitiesData.activities = selectedActivity;
|
|
1033
1093
|
if (issuingDate) {
|
|
1034
1094
|
state.data.activitiesData.operationStartDate = convertNumbers2English(dateFormat(issuingDate));
|
|
1035
1095
|
}
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1096
|
+
state.data.businessTypeData.responseBody = __assign(__assign(__assign(__assign(__assign({}, data), state.data.businessTypeData.responseBody), { activityList: isicActivityList }), accountData), documentData);
|
|
1097
|
+
var terms = (brand || {}).terms;
|
|
1098
|
+
var entity_id = (accountData || {}).entity_id;
|
|
1099
|
+
terms === null || terms === void 0 ? void 0 : terms.forEach(function (element) {
|
|
1100
|
+
if ((element === null || element === void 0 ? void 0 : element.term) === 'general') {
|
|
1101
|
+
state.data.customersData.transactionPolicy = element.agree;
|
|
1102
|
+
state.data.customersData.refundPolicy = element.agree;
|
|
1103
|
+
}
|
|
1104
|
+
});
|
|
1105
|
+
state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), { entity: __assign(__assign({}, entity), (entity_id && { id: entity_id })) }), (brand && { brand: brand }));
|
|
1039
1106
|
})
|
|
1040
1107
|
.addCase(updateLeadBusinessType.rejected, function (state, action) {
|
|
1041
1108
|
state.loading = false;
|
|
1042
1109
|
state.error = action.error.message;
|
|
1043
|
-
})
|
|
1044
|
-
.addCase(uploadArticle.pending, function (state) {
|
|
1045
|
-
state.uploadingArticleError = null;
|
|
1046
|
-
state.uploadingArticle = true;
|
|
1047
|
-
})
|
|
1048
|
-
.addCase(uploadArticle.fulfilled, function (state, action) {
|
|
1049
|
-
state.uploadingArticleError = null;
|
|
1050
|
-
state.uploadingArticle = false;
|
|
1051
|
-
var data = action.payload.data;
|
|
1052
|
-
state.data.businessTypeData.articleId = data === null || data === void 0 ? void 0 : data.id;
|
|
1053
|
-
})
|
|
1054
|
-
.addCase(uploadArticle.rejected, function (state) {
|
|
1055
|
-
state.uploadingArticle = false;
|
|
1056
|
-
state.uploadingArticleError = 'file_upload_article_error';
|
|
1057
1110
|
})
|
|
1058
1111
|
.addCase(updateActivitiesInfo.pending, function (state) {
|
|
1059
1112
|
state.loading = true;
|
|
@@ -1064,6 +1117,14 @@ export var businessSlice = createSlice({
|
|
|
1064
1117
|
state.error = null;
|
|
1065
1118
|
var _a = action.payload, data = _a.data, formData = _a.formData;
|
|
1066
1119
|
state.data.activitiesData = formData;
|
|
1120
|
+
var terms = (data || {}).terms;
|
|
1121
|
+
terms === null || terms === void 0 ? void 0 : terms.forEach(function (element) {
|
|
1122
|
+
if ((element === null || element === void 0 ? void 0 : element.term) === 'general') {
|
|
1123
|
+
state.data.customersData.transactionPolicy = element.agree;
|
|
1124
|
+
state.data.customersData.refundPolicy = element.agree;
|
|
1125
|
+
}
|
|
1126
|
+
});
|
|
1127
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { brand: data });
|
|
1067
1128
|
state.data.activitiesData.responseBody = __assign(__assign({}, data), state.data.activitiesData.responseBody);
|
|
1068
1129
|
})
|
|
1069
1130
|
.addCase(updateActivitiesInfo.rejected, function (state, action) {
|
|
@@ -1137,6 +1198,6 @@ export var businessSlice = createSlice({
|
|
|
1137
1198
|
});
|
|
1138
1199
|
}
|
|
1139
1200
|
});
|
|
1140
|
-
export var clearError = (_a = businessSlice.actions, _a.clearError), stopLoader = _a.stopLoader, resetOTPScreen = _a.resetOTPScreen,
|
|
1201
|
+
export var clearError = (_a = businessSlice.actions, _a.clearError), stopLoader = _a.stopLoader, resetOTPScreen = _a.resetOTPScreen, uploadingStatus = _a.uploadingStatus, uploadingArticleStatus = _a.uploadingArticleStatus, clearAOAFile = _a.clearAOAFile;
|
|
1141
1202
|
export default businessSlice.reducer;
|
|
1142
1203
|
export var businessSelector = function (state) { return state.business; };
|