@tap-payments/auth-jsconnect 2.3.5-test → 2.3.6
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 +303 -1
- package/build/@types/app.js +17 -0
- package/build/@types/form.d.ts +10 -7
- package/build/@types/redux.d.ts +4 -0
- package/build/@types/user.d.ts +39 -3
- package/build/api/brand.d.ts +7 -0
- package/build/api/brand.js +10 -1
- package/build/api/data.d.ts +8 -0
- package/build/api/data.js +34 -2
- package/build/api/entity.d.ts +20 -5
- package/build/api/entity.js +26 -1
- package/build/api/index.d.ts +29 -5
- package/build/api/index.js +3 -1
- package/build/api/individual.d.ts +24 -6
- package/build/api/individual.js +9 -1
- package/build/api/init.d.ts +17 -0
- package/build/api/init.js +13 -0
- package/build/api/lead.d.ts +8 -1
- package/build/api/lead.js +9 -1
- package/build/app/settings.d.ts +12 -9
- package/build/app/settings.js +77 -34
- package/build/assets/locales/ar.json +28 -1
- package/build/assets/locales/en.json +28 -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/ArabicDatePicker/ArabicDatePicker.d.ts +5 -2
- package/build/components/ArabicDatePicker/ArabicDatePicker.js +45 -23
- package/build/components/ArabicDatePicker/arabicAr.d.ts +8 -0
- package/build/components/ArabicDatePicker/arabicAr.js +32 -0
- package/build/components/ArabicDatePicker/arabicEn.d.ts +8 -0
- package/build/components/ArabicDatePicker/arabicEn.js +32 -0
- package/build/components/ArabicDatePicker/style.css +45 -5
- package/build/components/DatePicker/DatePicker.d.ts +4 -1
- package/build/components/DatePicker/DatePicker.js +27 -17
- 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 +9 -0
- package/build/constants/assets.js +9 -0
- package/build/constants/validation.d.ts +3 -2
- package/build/constants/validation.js +3 -2
- package/build/features/app/bank/bankStore.d.ts +7 -3
- package/build/features/app/bank/bankStore.js +155 -115
- package/build/features/app/brand/brandStore.d.ts +32 -12
- package/build/features/app/brand/brandStore.js +384 -203
- package/build/features/app/business/businessStore.d.ts +16 -13
- package/build/features/app/business/businessStore.js +364 -295
- package/build/features/app/connect/connectStore.d.ts +15 -1
- package/build/features/app/connect/connectStore.js +292 -95
- package/build/features/app/connectExpress/connectExpressStore.d.ts +17 -3
- package/build/features/app/connectExpress/connectExpressStore.js +232 -100
- package/build/features/app/entity/entityStore.d.ts +15 -17
- package/build/features/app/entity/entityStore.js +279 -248
- package/build/features/app/individual/individualStore.d.ts +22 -10
- package/build/features/app/individual/individualStore.js +531 -418
- package/build/features/app/password/passwordStore.d.ts +4 -0
- package/build/features/app/password/passwordStore.js +99 -43
- package/build/features/app/tax/taxStore.d.ts +6 -2
- package/build/features/app/tax/taxStore.js +143 -101
- 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 +5 -1
- 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 +3 -5
- 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 +10 -27
- package/build/features/brand/screens/BrandActivities/ActivitiesList.js +45 -28
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +41 -9
- package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +11 -38
- package/build/features/brand/screens/BrandActivities/CustomerBase.js +22 -31
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.d.ts +3 -1
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +24 -20
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.d.ts +3 -1
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +31 -19
- package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +13 -6
- package/build/features/brand/screens/BrandActivities/RefundPolicy.js +23 -12
- package/build/features/brand/screens/BrandActivities/TAC.d.ts +14 -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 +43 -43
- package/build/features/brand/screens/BrandActivities/validation.js +11 -25
- 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 +4 -7
- package/build/features/brand/screens/BrandInfo/SalesChannels.d.ts +2 -1
- package/build/features/brand/screens/BrandInfo/SalesChannels.js +19 -25
- package/build/features/brand/screens/BrandInfo/validation.d.ts +7 -13
- package/build/features/brand/screens/BrandInfo/validation.js +43 -53
- 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 +15 -68
- package/build/features/business/screens/Activities/ActivitiesList.js +226 -98
- package/build/features/business/screens/Activities/OperationStartDate.d.ts +2 -2
- package/build/features/business/screens/Activities/OperationStartDate.js +3 -3
- 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} +5 -7
- 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 +3 -1
- 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 +7 -5
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +2 -2
- package/build/features/business/screens/BusinessType/validation.js +2 -2
- package/build/features/business/screens/CivilID/IDNumber.js +2 -3
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +44 -37
- 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 +5 -5
- 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 +3 -3
- 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.d.ts +2 -0
- package/build/features/connect/Connect.js +86 -11
- 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 +17 -27
- 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 +4 -7
- package/build/features/connect/screens/Merchant/Merchant.js +13 -15
- package/build/features/connect/screens/Merchant/SalesChannels.js +6 -6
- package/build/features/connect/screens/Merchant/validation.d.ts +3 -6
- package/build/features/connect/screens/Merchant/validation.js +14 -17
- 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 +3 -3
- 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 +72 -12
- 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 +5 -7
- 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 +4 -4
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +4 -3
- 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/CollectBusinessInfo/validation.js +4 -4
- 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 +6 -14
- 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 +3 -3
- 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 +2 -2
- package/build/features/connectExpress/screens/NIDMissed/IDNumber.js +2 -3
- package/build/features/connectExpress/screens/OTP/OTPInput.js +3 -3
- package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -1
- package/build/features/entity/Entity.js +10 -6
- package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +16 -68
- package/build/features/entity/screens/EntityCapital/ActivityList.js +221 -106
- package/build/features/entity/screens/EntityCapital/CapitalPaid.d.ts +3 -1
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +14 -15
- package/build/features/entity/screens/EntityCapital/CapitalShareCount.d.ts +3 -1
- package/build/features/entity/screens/EntityCapital/CapitalShareCount.js +10 -11
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.d.ts +3 -1
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +15 -16
- 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 +5 -1
- 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 +11 -27
- package/build/features/entity/screens/EntityName/EntityTypeList.js +32 -43
- package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +5 -3
- package/build/features/entity/screens/EntityName/ExpiryDate.js +5 -5
- package/build/features/entity/screens/EntityName/IssuingDate.d.ts +5 -3
- package/build/features/entity/screens/EntityName/IssuingDate.js +4 -5
- package/build/features/entity/screens/EntityName/LegalName.d.ts +3 -1
- package/build/features/entity/screens/EntityName/LegalName.js +9 -6
- 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 +9 -7
- 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 +2 -2
- 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 +17 -12
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +30 -41
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.d.ts +3 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +94 -55
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +5 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +17 -12
- 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 -42
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +8 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +8 -12
- package/build/features/individual/screens/IndividualList/IndividualList.d.ts +4 -4
- package/build/features/individual/screens/IndividualList/MobileNumber.js +0 -1
- package/build/features/individual/screens/IndividualList/UserList.js +10 -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 +4 -4
- package/build/features/individual/screens/IndividualPersonalInfo/Email.d.ts +3 -1
- package/build/features/individual/screens/IndividualPersonalInfo/Email.js +3 -10
- package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.d.ts +3 -1
- package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.js +5 -7
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +5 -3
- 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 +3 -10
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +2 -2
- 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 +10 -21
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.d.ts +2 -0
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +14 -16
- package/build/features/individual/screens/IndividualPersonalInfo/Name.d.ts +3 -1
- package/build/features/individual/screens/IndividualPersonalInfo/Name.js +3 -10
- package/build/features/individual/screens/IndividualPersonalInfo/Nationality.d.ts +2 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Nationality.js +10 -21
- 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 +7 -7
- package/build/features/shared/Address/CountryList.js +1 -1
- package/build/features/shared/Address/InputSelect.d.ts +7 -7
- package/build/features/shared/Address/InputSelect.js +1 -1
- package/build/features/shared/Button/Button.d.ts +3 -1
- package/build/features/shared/Button/Button.js +2 -2
- package/build/features/shared/Button/EmailProvidersButtons.js +9 -2
- package/build/features/shared/Button/FlowsButtons.js +22 -20
- package/build/features/shared/Button/IndividualActionButtons.d.ts +3 -1
- package/build/features/shared/Button/IndividualActionButtons.js +28 -4
- package/build/features/shared/Calender/Calender.d.ts +13 -0
- package/build/features/shared/Calender/Calender.js +56 -0
- package/build/features/shared/Calender/index.d.ts +2 -0
- package/build/features/shared/Calender/index.js +2 -0
- 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 +5 -6
- 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 +19 -8
- 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 +1 -1
- 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 +8 -27
- package/build/features/shared/UploadMultipleFile/UploadFile.js +70 -56
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +7 -3
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +11 -17
- 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 +6 -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 +18 -16
- 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/theme/shadows.js +1 -1
- package/build/utils/array.d.ts +14 -2
- package/build/utils/array.js +196 -4
- package/build/utils/common.d.ts +1 -0
- package/build/utils/common.js +10 -0
- 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/{brand/screens/BrandInfo → connect/screens/BrandSegment}/TeamSize.d.ts +0 -0
|
@@ -71,7 +71,7 @@ import { handleNextScreenStep } from '../../../app/settings';
|
|
|
71
71
|
import { CONNECT_STEP_NAMES, defaultCountry, IDENTIFICATION_TYPE, OTHER_BRAND } from '../../../constants';
|
|
72
72
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
73
73
|
import { AuthForType, FlowsTypes } from '../../../@types';
|
|
74
|
-
import { capitalizeTheFirstLetterOfEachWord, concatenateObjectValues, findCountryByIddPrefix, fixBrandList,
|
|
74
|
+
import { capitalizeTheFirstLetterOfEachWord, concatenateObjectValues, findCountryByIddPrefix, fixBrandList, isTwitter, getIndividualName, isWebsite, sleep, sendCustomEventToGTM } from '../../../utils';
|
|
75
75
|
export var createMobileAuth = createAsyncThunk('createMobileAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
76
76
|
var settings, requestBody, data;
|
|
77
77
|
var _a, _b;
|
|
@@ -156,19 +156,20 @@ export var resendOTPMobile = createAsyncThunk('resendOTPMobile', function (param
|
|
|
156
156
|
});
|
|
157
157
|
}); });
|
|
158
158
|
export var resendOTPNID = createAsyncThunk('resendOTPNID', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
159
|
-
var _a, settings, connect, _b, nid, dob,
|
|
159
|
+
var _a, settings, connect, _b, nid, dob, identification_id_type, requestBody, data;
|
|
160
160
|
return __generator(this, function (_c) {
|
|
161
161
|
switch (_c.label) {
|
|
162
162
|
case 0:
|
|
163
163
|
_a = thunkApi.getState(), settings = _a.settings, connect = _a.connect;
|
|
164
|
-
_b = connect.data.nidData, nid = _b.nid, dob = _b.dob
|
|
164
|
+
_b = connect.data.nidData, nid = _b.nid, dob = _b.dob;
|
|
165
|
+
identification_id_type = nid.startsWith('1') ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA;
|
|
165
166
|
requestBody = {
|
|
166
167
|
country: settings.data.businessCountry.iso2,
|
|
167
168
|
scope: settings.data.appConfig.scope,
|
|
168
169
|
lang: settings.data.language,
|
|
169
170
|
user_credentail: {
|
|
170
171
|
identification_id: nid,
|
|
171
|
-
identification_id_type:
|
|
172
|
+
identification_id_type: identification_id_type,
|
|
172
173
|
date_of_birth: dob,
|
|
173
174
|
country_code: settings.data.businessCountry.iso2
|
|
174
175
|
},
|
|
@@ -227,7 +228,7 @@ export var createNIDAuth = createAsyncThunk('createNIDAuth', function (params, t
|
|
|
227
228
|
});
|
|
228
229
|
}); });
|
|
229
230
|
export var verifyAuth = createAsyncThunk('connect/verifyAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
230
|
-
var _a, connect, settings, startWithNID, _b, mobileData, nidData, responseBody, stepName, payload, data, lead_id, leadResponse, channels,
|
|
231
|
+
var _a, connect, settings, startWithNID, _b, mobileData, nidData, responseBody, stepName, payload, data, lead_id, leadResponse, channels, brand, err_1, brands, err_2, countryCode, phone;
|
|
231
232
|
var _c, _d, _e, _f;
|
|
232
233
|
return __generator(this, function (_g) {
|
|
233
234
|
switch (_g.label) {
|
|
@@ -253,6 +254,11 @@ export var verifyAuth = createAsyncThunk('connect/verifyAuth', function (params,
|
|
|
253
254
|
data = (_g.sent()).data;
|
|
254
255
|
if ((_c = data.errors) === null || _c === void 0 ? void 0 : _c.length)
|
|
255
256
|
throw new Error(data.errors[0].description);
|
|
257
|
+
sendCustomEventToGTM({
|
|
258
|
+
event: 'Send Event',
|
|
259
|
+
event_category: 'User Registration Flow',
|
|
260
|
+
event_action: 'First OTP Success'
|
|
261
|
+
});
|
|
256
262
|
lead_id = data.lead_id;
|
|
257
263
|
if (!lead_id)
|
|
258
264
|
throw new Error('Lead id is missing');
|
|
@@ -268,15 +274,25 @@ export var verifyAuth = createAsyncThunk('connect/verifyAuth', function (params,
|
|
|
268
274
|
_g.label = 4;
|
|
269
275
|
case 4:
|
|
270
276
|
_g.trys.push([4, 6, , 7]);
|
|
271
|
-
return [4, API.brandService.
|
|
277
|
+
return [4, API.brandService.retrieveBrand(leadResponse.brand.id)];
|
|
272
278
|
case 5:
|
|
273
|
-
|
|
274
|
-
leadResponse.
|
|
279
|
+
brand = (_g.sent()).brand;
|
|
280
|
+
leadResponse.brand = __assign(__assign({}, leadResponse.brand), brand);
|
|
275
281
|
return [3, 7];
|
|
276
282
|
case 6:
|
|
277
283
|
err_1 = _g.sent();
|
|
278
284
|
return [3, 7];
|
|
279
285
|
case 7:
|
|
286
|
+
_g.trys.push([7, 9, , 10]);
|
|
287
|
+
return [4, API.brandService.getBrandList({ individual_id: leadResponse.individual_id })];
|
|
288
|
+
case 8:
|
|
289
|
+
brands = (_g.sent()).brands;
|
|
290
|
+
leadResponse.brand_list = fixBrandList(brands, channels);
|
|
291
|
+
return [3, 10];
|
|
292
|
+
case 9:
|
|
293
|
+
err_2 = _g.sent();
|
|
294
|
+
return [3, 10];
|
|
295
|
+
case 10:
|
|
280
296
|
countryCode = settings.data.businessCountry;
|
|
281
297
|
phone = (leadResponse.contact || {}).phone;
|
|
282
298
|
if (phone === null || phone === void 0 ? void 0 : phone.country_code)
|
|
@@ -288,7 +304,7 @@ export var verifyAuth = createAsyncThunk('connect/verifyAuth', function (params,
|
|
|
288
304
|
});
|
|
289
305
|
}); });
|
|
290
306
|
export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
291
|
-
var _a, settings, connect, responseBody, expiry, interval, maxCalls, count, authResponse, isSuccess, lead_id, leadResponse, countryCode, channels, brands,
|
|
307
|
+
var _a, settings, connect, responseBody, expiry, interval, maxCalls, count, authResponse, isSuccess, lead_id, leadResponse, countryCode, channels, brand, err_3, brands, err_4, phone;
|
|
292
308
|
var _b, _c, _d, _e, _f;
|
|
293
309
|
return __generator(this, function (_g) {
|
|
294
310
|
switch (_g.label) {
|
|
@@ -301,15 +317,15 @@ export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params,
|
|
|
301
317
|
count = 1;
|
|
302
318
|
_g.label = 1;
|
|
303
319
|
case 1:
|
|
304
|
-
if (!(count <= maxCalls)) return [3,
|
|
320
|
+
if (!(count <= maxCalls)) return [3, 16];
|
|
305
321
|
if (thunkApi.signal.aborted) {
|
|
306
|
-
return [3,
|
|
322
|
+
return [3, 16];
|
|
307
323
|
}
|
|
308
324
|
return [4, API.authService.getVerifyAuth(responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_token)];
|
|
309
325
|
case 2:
|
|
310
326
|
authResponse = _g.sent();
|
|
311
327
|
isSuccess = ((_b = authResponse.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
|
|
312
|
-
if (!isSuccess) return [3,
|
|
328
|
+
if (!isSuccess) return [3, 13];
|
|
313
329
|
lead_id = authResponse.lead_id;
|
|
314
330
|
if (!lead_id)
|
|
315
331
|
throw new Error('Lead id is missing');
|
|
@@ -326,18 +342,28 @@ export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params,
|
|
|
326
342
|
_g.label = 5;
|
|
327
343
|
case 5:
|
|
328
344
|
_g.trys.push([5, 7, , 8]);
|
|
329
|
-
return [4, API.brandService.
|
|
345
|
+
return [4, API.brandService.retrieveBrand(leadResponse.brand.id)];
|
|
330
346
|
case 6:
|
|
331
|
-
|
|
332
|
-
leadResponse.
|
|
347
|
+
brand = (_g.sent()).brand;
|
|
348
|
+
leadResponse.brand = __assign(__assign({}, leadResponse.brand), brand);
|
|
333
349
|
return [3, 8];
|
|
334
350
|
case 7:
|
|
335
|
-
|
|
351
|
+
err_3 = _g.sent();
|
|
336
352
|
return [3, 8];
|
|
337
353
|
case 8:
|
|
354
|
+
_g.trys.push([8, 10, , 11]);
|
|
355
|
+
return [4, API.brandService.getBrandList({ individual_id: leadResponse.individual_id })];
|
|
356
|
+
case 9:
|
|
357
|
+
brands = (_g.sent()).brands;
|
|
358
|
+
leadResponse.brand_list = fixBrandList(brands, channels);
|
|
359
|
+
return [3, 11];
|
|
360
|
+
case 10:
|
|
361
|
+
err_4 = _g.sent();
|
|
362
|
+
return [3, 11];
|
|
363
|
+
case 11:
|
|
338
364
|
(_d = params.onSuccess) === null || _d === void 0 ? void 0 : _d.call(params);
|
|
339
365
|
return [4, sleep(3000)];
|
|
340
|
-
case
|
|
366
|
+
case 12:
|
|
341
367
|
_g.sent();
|
|
342
368
|
phone = (leadResponse.contact || {}).phone;
|
|
343
369
|
if (phone === null || phone === void 0 ? void 0 : phone.country_code)
|
|
@@ -345,25 +371,26 @@ export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params,
|
|
|
345
371
|
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, {});
|
|
346
372
|
thunkApi.dispatch(handleNextScreenStep());
|
|
347
373
|
return [2, { authResponse: authResponse, leadResponse: leadResponse, countryCode: countryCode }];
|
|
348
|
-
case
|
|
349
|
-
case
|
|
374
|
+
case 13: return [4, sleep(interval * 1000)];
|
|
375
|
+
case 14:
|
|
350
376
|
_g.sent();
|
|
351
|
-
_g.label =
|
|
352
|
-
case
|
|
377
|
+
_g.label = 15;
|
|
378
|
+
case 15:
|
|
353
379
|
count++;
|
|
354
380
|
return [3, 1];
|
|
355
|
-
case
|
|
381
|
+
case 16: throw new Error('paci_verification_failed');
|
|
356
382
|
}
|
|
357
383
|
});
|
|
358
384
|
}); });
|
|
359
385
|
export var updateLeadIndividual = createAsyncThunk('updateLeadIndividual', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
360
|
-
var _a, settings, connect, lead_id, phoneCountry, payload, leadResponse
|
|
386
|
+
var _a, settings, connect, lead_id, brandData, phoneCountry, payload, leadResponse;
|
|
361
387
|
var _b, _c, _d, _e, _f;
|
|
362
388
|
return __generator(this, function (_g) {
|
|
363
389
|
switch (_g.label) {
|
|
364
390
|
case 0:
|
|
365
391
|
_a = thunkApi.getState(), settings = _a.settings, connect = _a.connect;
|
|
366
392
|
lead_id = (connect.data.otpData.responseBody || {}).lead_id;
|
|
393
|
+
brandData = (connect.data.brandData.responseBody || {}).brandData;
|
|
367
394
|
phoneCountry = (_c = (_b = params.countryCode) === null || _b === void 0 ? void 0 : _b.idd_prefix) === null || _c === void 0 ? void 0 : _c.toString();
|
|
368
395
|
payload = {
|
|
369
396
|
id: lead_id || '',
|
|
@@ -376,51 +403,67 @@ export var updateLeadIndividual = createAsyncThunk('updateLeadIndividual', funct
|
|
|
376
403
|
return [4, API.leadService.updateLead(payload)];
|
|
377
404
|
case 1:
|
|
378
405
|
leadResponse = _g.sent();
|
|
379
|
-
|
|
380
|
-
case 2:
|
|
381
|
-
_g.trys.push([2, 4, , 5]);
|
|
382
|
-
return [4, API.dataService.getSegments({ page: 0 })];
|
|
383
|
-
case 3:
|
|
384
|
-
segments = _g.sent();
|
|
385
|
-
leadResponse.segments_list = segments.list;
|
|
386
|
-
return [3, 5];
|
|
387
|
-
case 4:
|
|
388
|
-
err_3 = _g.sent();
|
|
389
|
-
return [3, 5];
|
|
390
|
-
case 5:
|
|
391
|
-
_g.trys.push([5, 7, , 8]);
|
|
392
|
-
return [4, API.dataService.getTeamSize({ page: 0 })];
|
|
393
|
-
case 6:
|
|
394
|
-
teamSize = _g.sent();
|
|
395
|
-
leadResponse.team_size_list = teamSize.list;
|
|
396
|
-
return [3, 8];
|
|
397
|
-
case 7:
|
|
398
|
-
err_4 = _g.sent();
|
|
399
|
-
return [3, 8];
|
|
400
|
-
case 8:
|
|
401
|
-
if (!leadResponse.brand) return [3, 10];
|
|
402
|
-
return [4, API.brandService.retrieveBrand(leadResponse.brand.id)];
|
|
403
|
-
case 9:
|
|
404
|
-
brand = (_g.sent()).brand;
|
|
405
|
-
leadResponse.brand = __assign(__assign({}, leadResponse.brand), brand);
|
|
406
|
-
_g.label = 10;
|
|
407
|
-
case 10:
|
|
406
|
+
leadResponse.brand = __assign(__assign({}, leadResponse.brand), brandData);
|
|
408
407
|
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, params);
|
|
409
408
|
thunkApi.dispatch(handleNextScreenStep());
|
|
410
409
|
return [2, { leadResponse: leadResponse, formData: params }];
|
|
411
410
|
}
|
|
412
411
|
});
|
|
413
412
|
}); });
|
|
413
|
+
export var retrieveLead = createAsyncThunk('connect/retrieveLead', function (leadId, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
414
|
+
var settings, data, countryCode, phone;
|
|
415
|
+
var _a;
|
|
416
|
+
return __generator(this, function (_b) {
|
|
417
|
+
switch (_b.label) {
|
|
418
|
+
case 0:
|
|
419
|
+
settings = thunkApi.getState().settings;
|
|
420
|
+
return [4, API.leadService.retrieveLead(leadId)];
|
|
421
|
+
case 1:
|
|
422
|
+
data = (_b.sent()).data;
|
|
423
|
+
if ((_a = data.errors) === null || _a === void 0 ? void 0 : _a.length)
|
|
424
|
+
throw new Error(data.errors[0].description);
|
|
425
|
+
countryCode = settings.data.businessCountry;
|
|
426
|
+
phone = (data.contact || {}).phone;
|
|
427
|
+
if (phone === null || phone === void 0 ? void 0 : phone.country_code)
|
|
428
|
+
countryCode = findCountryByIddPrefix(settings.data.countries, phone.country_code);
|
|
429
|
+
return [2, { data: data, countryCode: countryCode }];
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
}); });
|
|
433
|
+
export var retrieveSegmentDataList = createAsyncThunk('connectRetrieveSegmentDataList', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
434
|
+
var dataBody, _a, segmentLocation, segmentProfit, segmentTech;
|
|
435
|
+
return __generator(this, function (_b) {
|
|
436
|
+
switch (_b.label) {
|
|
437
|
+
case 0:
|
|
438
|
+
dataBody = {
|
|
439
|
+
page: 0,
|
|
440
|
+
limit: 50
|
|
441
|
+
};
|
|
442
|
+
return [4, Promise.all([
|
|
443
|
+
API.dataService.getSegmentLocation(dataBody),
|
|
444
|
+
API.dataService.getSegmentProfit(dataBody),
|
|
445
|
+
API.dataService.getSegmentTech(dataBody)
|
|
446
|
+
])];
|
|
447
|
+
case 1:
|
|
448
|
+
_a = _b.sent(), segmentLocation = _a[0].list, segmentProfit = _a[1].list, segmentTech = _a[2].list;
|
|
449
|
+
return [2, {
|
|
450
|
+
segmentLocation: segmentLocation,
|
|
451
|
+
segmentProfit: segmentProfit,
|
|
452
|
+
segmentTech: segmentTech
|
|
453
|
+
}];
|
|
454
|
+
}
|
|
455
|
+
});
|
|
456
|
+
}); });
|
|
414
457
|
export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
415
|
-
var _a, settings, connect, responseBody, leadBrandId, isNewBrand, brandName, salesChannels, selectedBrandItem, termAndConditionChecked, getAddress, channel_services, payload_1, brandReqBody_1, brand_1, brandNameBody, payload, lead, brandReqBody, brand;
|
|
416
|
-
var
|
|
417
|
-
return __generator(this, function (
|
|
418
|
-
switch (
|
|
458
|
+
var _a, settings, connect, responseBody, leadBrandId, isNewBrand, brandName, salesChannels, selectedBrandItem, brandLogoId, termAndConditionChecked, getAddress, channel_services, payload_1, brandReqBody_1, brand_1, _b, segmentLocation, segmentProfit, segmentTech, err_5, teamSize, err_6, brandNameBody, payload, lead, brandReqBody, brand, _c, segmentLocation, segmentProfit, segmentTech, err_7, teamSize, err_8;
|
|
459
|
+
var _d, _e, _f, _g, _h;
|
|
460
|
+
return __generator(this, function (_j) {
|
|
461
|
+
switch (_j.label) {
|
|
419
462
|
case 0:
|
|
420
463
|
_a = thunkApi.getState(), settings = _a.settings, connect = _a.connect;
|
|
421
464
|
responseBody = connect.data.otpData.responseBody;
|
|
422
465
|
leadBrandId = responseBody === null || responseBody === void 0 ? void 0 : responseBody.brand_id;
|
|
423
|
-
isNewBrand = params.isNewBrand, brandName = params.brandName, salesChannels = params.salesChannels, selectedBrandItem = params.selectedBrandItem, termAndConditionChecked = params.termAndConditionChecked;
|
|
466
|
+
isNewBrand = params.isNewBrand, brandName = params.brandName, salesChannels = params.salesChannels, selectedBrandItem = params.selectedBrandItem, brandLogoId = params.brandLogoId, termAndConditionChecked = params.termAndConditionChecked;
|
|
424
467
|
getAddress = function (value, isTwitter, isWeb) {
|
|
425
468
|
if (isTwitter)
|
|
426
469
|
return '@' + value;
|
|
@@ -438,50 +481,75 @@ export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (param
|
|
|
438
481
|
})
|
|
439
482
|
};
|
|
440
483
|
});
|
|
441
|
-
if (!!isNewBrand) return [3,
|
|
484
|
+
if (!!isNewBrand) return [3, 11];
|
|
442
485
|
if (!(leadBrandId !== (selectedBrandItem === null || selectedBrandItem === void 0 ? void 0 : selectedBrandItem.id))) return [3, 2];
|
|
443
486
|
payload_1 = {
|
|
444
487
|
brand: {
|
|
445
488
|
id: (selectedBrandItem === null || selectedBrandItem === void 0 ? void 0 : selectedBrandItem.id) || ''
|
|
446
489
|
},
|
|
490
|
+
terms_conditions_accepted: termAndConditionChecked,
|
|
447
491
|
id: (responseBody === null || responseBody === void 0 ? void 0 : responseBody.lead_id) || '',
|
|
448
492
|
step_name: CONNECT_STEP_NAMES.UPDATE_LEAD_BRAND
|
|
449
493
|
};
|
|
450
494
|
return [4, API.leadService.updateLead(payload_1)];
|
|
451
495
|
case 1:
|
|
452
|
-
|
|
453
|
-
|
|
496
|
+
_j.sent();
|
|
497
|
+
_j.label = 2;
|
|
454
498
|
case 2:
|
|
455
499
|
brandReqBody_1 = {
|
|
456
500
|
id: (selectedBrandItem === null || selectedBrandItem === void 0 ? void 0 : selectedBrandItem.id) || '',
|
|
457
501
|
channel_services: channel_services,
|
|
458
|
-
|
|
502
|
+
term: ['general'],
|
|
459
503
|
step_name: CONNECT_STEP_NAMES.UPDATE_BRAND_INFO
|
|
460
504
|
};
|
|
461
505
|
return [4, API.brandService.updateBrandInfo(brandReqBody_1)];
|
|
462
506
|
case 3:
|
|
463
|
-
brand_1 =
|
|
464
|
-
|
|
465
|
-
|
|
507
|
+
brand_1 = _j.sent();
|
|
508
|
+
_j.label = 4;
|
|
509
|
+
case 4:
|
|
510
|
+
_j.trys.push([4, 6, , 7]);
|
|
511
|
+
return [4, thunkApi.dispatch(retrieveSegmentDataList()).unwrap()];
|
|
512
|
+
case 5:
|
|
513
|
+
_b = _j.sent(), segmentLocation = _b.segmentLocation, segmentProfit = _b.segmentProfit, segmentTech = _b.segmentTech;
|
|
514
|
+
brand_1.segment_location_list = segmentLocation;
|
|
515
|
+
brand_1.segment_profit_list = segmentProfit;
|
|
516
|
+
brand_1.segment_tech_list = segmentTech;
|
|
517
|
+
return [3, 7];
|
|
518
|
+
case 6:
|
|
519
|
+
err_5 = _j.sent();
|
|
520
|
+
return [3, 7];
|
|
521
|
+
case 7:
|
|
522
|
+
_j.trys.push([7, 9, , 10]);
|
|
523
|
+
return [4, API.dataService.getTeamSize({ page: 0 })];
|
|
524
|
+
case 8:
|
|
525
|
+
teamSize = _j.sent();
|
|
526
|
+
brand_1.team_size_list = teamSize.list;
|
|
527
|
+
return [3, 10];
|
|
528
|
+
case 9:
|
|
529
|
+
err_6 = _j.sent();
|
|
530
|
+
return [3, 10];
|
|
531
|
+
case 10:
|
|
532
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
466
533
|
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, params);
|
|
467
534
|
return [2, { response: brand_1, formData: params }];
|
|
468
|
-
case
|
|
535
|
+
case 11:
|
|
469
536
|
brandNameBody = {
|
|
537
|
+
id: '',
|
|
470
538
|
name: {
|
|
471
539
|
en: brandName,
|
|
472
|
-
ar: brandName
|
|
473
|
-
zh: brandName
|
|
540
|
+
ar: brandName
|
|
474
541
|
}
|
|
475
542
|
};
|
|
476
543
|
payload = {
|
|
477
544
|
brand: brandNameBody,
|
|
545
|
+
terms_conditions_accepted: termAndConditionChecked,
|
|
478
546
|
id: (responseBody === null || responseBody === void 0 ? void 0 : responseBody.lead_id) || '',
|
|
479
547
|
step_name: CONNECT_STEP_NAMES.UPDATE_LEAD_BRAND,
|
|
480
548
|
encryption_contract: ['brand.name.en', 'brand.name.ar', 'brand.name.zh']
|
|
481
549
|
};
|
|
482
550
|
return [4, API.leadService.updateLead(payload)];
|
|
483
|
-
case
|
|
484
|
-
lead =
|
|
551
|
+
case 12:
|
|
552
|
+
lead = _j.sent();
|
|
485
553
|
if (!lead.brand) {
|
|
486
554
|
console.error('Internal server error: brand is not created');
|
|
487
555
|
throw new Error('Internal server error');
|
|
@@ -490,15 +558,62 @@ export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (param
|
|
|
490
558
|
id: ((_f = lead.brand) === null || _f === void 0 ? void 0 : _f.id) || '',
|
|
491
559
|
channel_services: channel_services,
|
|
492
560
|
term: ['general'],
|
|
493
|
-
step_name: CONNECT_STEP_NAMES.UPDATE_BRAND_INFO
|
|
494
|
-
segment: { type: { id: ((_g = params.segment) === null || _g === void 0 ? void 0 : _g.id) || '' }, team: { id: ((_h = params.teamSize) === null || _h === void 0 ? void 0 : _h.id) || '' } }
|
|
561
|
+
step_name: CONNECT_STEP_NAMES.UPDATE_BRAND_INFO
|
|
495
562
|
};
|
|
496
563
|
return [4, API.brandService.updateBrandInfo(brandReqBody)];
|
|
497
|
-
case
|
|
498
|
-
brand =
|
|
564
|
+
case 13:
|
|
565
|
+
brand = _j.sent();
|
|
566
|
+
_j.label = 14;
|
|
567
|
+
case 14:
|
|
568
|
+
_j.trys.push([14, 16, , 17]);
|
|
569
|
+
return [4, thunkApi.dispatch(retrieveSegmentDataList()).unwrap()];
|
|
570
|
+
case 15:
|
|
571
|
+
_c = _j.sent(), segmentLocation = _c.segmentLocation, segmentProfit = _c.segmentProfit, segmentTech = _c.segmentTech;
|
|
572
|
+
brand.segment_location_list = segmentLocation;
|
|
573
|
+
brand.segment_profit_list = segmentProfit;
|
|
574
|
+
brand.segment_tech_list = segmentTech;
|
|
575
|
+
return [3, 17];
|
|
576
|
+
case 16:
|
|
577
|
+
err_7 = _j.sent();
|
|
578
|
+
return [3, 17];
|
|
579
|
+
case 17:
|
|
580
|
+
_j.trys.push([17, 19, , 20]);
|
|
581
|
+
return [4, API.dataService.getTeamSize({ page: 0 })];
|
|
582
|
+
case 18:
|
|
583
|
+
teamSize = _j.sent();
|
|
584
|
+
brand.team_size_list = teamSize.list;
|
|
585
|
+
return [3, 20];
|
|
586
|
+
case 19:
|
|
587
|
+
err_8 = _j.sent();
|
|
588
|
+
return [3, 20];
|
|
589
|
+
case 20:
|
|
590
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
591
|
+
(_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, params);
|
|
592
|
+
return [2, { response: brand, formData: params }];
|
|
593
|
+
}
|
|
594
|
+
});
|
|
595
|
+
}); });
|
|
596
|
+
export var updateLeadBrandSegment = createAsyncThunk('updateLeadBrandSegment', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
597
|
+
var _a, settings, connect, responseBody, leadBrandId, segmentLocation, segmentProfit, segmentTech, teamSize, brandReqBody, brand;
|
|
598
|
+
var _b, _c, _d;
|
|
599
|
+
return __generator(this, function (_e) {
|
|
600
|
+
switch (_e.label) {
|
|
601
|
+
case 0:
|
|
602
|
+
_a = thunkApi.getState(), settings = _a.settings, connect = _a.connect;
|
|
603
|
+
responseBody = connect.data.brandData.responseBody;
|
|
604
|
+
leadBrandId = (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.brand) === null || _b === void 0 ? void 0 : _b.id;
|
|
605
|
+
segmentLocation = params.segmentLocation, segmentProfit = params.segmentProfit, segmentTech = params.segmentTech, teamSize = params.teamSize;
|
|
606
|
+
brandReqBody = {
|
|
607
|
+
id: leadBrandId || '',
|
|
608
|
+
step_name: CONNECT_STEP_NAMES.UPDATE_BRAND_SEGMENT_INFO,
|
|
609
|
+
segment: __assign(__assign(__assign(__assign({}, ((segmentLocation === null || segmentLocation === void 0 ? void 0 : segmentLocation.id) && { location_type: { id: segmentLocation.id } })), ((segmentProfit === null || segmentProfit === void 0 ? void 0 : segmentProfit.id) && { profit_type: { id: segmentProfit.id } })), ((segmentTech === null || segmentTech === void 0 ? void 0 : segmentTech.id) && { tech_type: { id: segmentTech.id } })), { team: { id: (teamSize === null || teamSize === void 0 ? void 0 : teamSize.id) || '' } })
|
|
610
|
+
};
|
|
611
|
+
return [4, API.brandService.updateBrandInfo(brandReqBody)];
|
|
612
|
+
case 1:
|
|
613
|
+
brand = _e.sent();
|
|
499
614
|
thunkApi.dispatch(updateLeadSuccess());
|
|
500
615
|
thunkApi.dispatch(handleNextScreenStep());
|
|
501
|
-
(
|
|
616
|
+
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
|
|
502
617
|
return [2, { response: brand, formData: params }];
|
|
503
618
|
}
|
|
504
619
|
});
|
|
@@ -585,7 +700,7 @@ var initialState = {
|
|
|
585
700
|
},
|
|
586
701
|
nidData: {
|
|
587
702
|
nid: '',
|
|
588
|
-
dob:
|
|
703
|
+
dob: '',
|
|
589
704
|
type: ''
|
|
590
705
|
},
|
|
591
706
|
civilIdData: {
|
|
@@ -608,13 +723,17 @@ var initialState = {
|
|
|
608
723
|
brandData: {
|
|
609
724
|
brandName: '',
|
|
610
725
|
salesChannels: [],
|
|
611
|
-
segment: undefined,
|
|
612
|
-
teamSize: undefined,
|
|
613
726
|
termAndConditionChecked: false,
|
|
614
727
|
selectedBrandItem: {},
|
|
615
728
|
responseBody: {
|
|
616
729
|
brand_list: []
|
|
617
730
|
}
|
|
731
|
+
},
|
|
732
|
+
brandSegmentData: {
|
|
733
|
+
segmentLocation: undefined,
|
|
734
|
+
segmentProfit: undefined,
|
|
735
|
+
segmentTech: undefined,
|
|
736
|
+
teamSize: undefined
|
|
618
737
|
}
|
|
619
738
|
}
|
|
620
739
|
};
|
|
@@ -728,13 +847,14 @@ export var connectSlice = createSlice({
|
|
|
728
847
|
var isBrandExist = brand_list.find(function (item) { return item.id === (brand === null || brand === void 0 ? void 0 : brand.id); });
|
|
729
848
|
brandList = __spreadArray([], brand_list, true);
|
|
730
849
|
if (!isBrandExist && brand)
|
|
731
|
-
brandList = __spreadArray(__spreadArray([], brandList, true), [__assign(__assign({}, brand), { channel_services: [] })], false);
|
|
850
|
+
brandList = __spreadArray(__spreadArray([], brandList, true), [__assign(__assign({}, brand), { channel_services: (brand === null || brand === void 0 ? void 0 : brand.channel_services) || [] })], false);
|
|
732
851
|
brandList = __spreadArray(__spreadArray([], brandList, true), [OTHER_BRAND], false);
|
|
733
852
|
state.data.brandData.selectedBrandItem = brandList[0];
|
|
734
853
|
}
|
|
735
854
|
state.data.brandData.responseBody = {
|
|
736
855
|
brand_list: brandList,
|
|
737
|
-
channel_list: channel_list
|
|
856
|
+
channel_list: channel_list,
|
|
857
|
+
brandData: brand
|
|
738
858
|
};
|
|
739
859
|
state.data.otpData.responseBody = __assign(__assign({}, authResponse), { is_new_individual: is_new_individual, lead_id: id, brand_id: brand === null || brand === void 0 ? void 0 : brand.id, name: name, contact: contact });
|
|
740
860
|
})
|
|
@@ -770,13 +890,14 @@ export var connectSlice = createSlice({
|
|
|
770
890
|
var isBrandExist = brand_list.find(function (item) { return item.id === (brand === null || brand === void 0 ? void 0 : brand.id); });
|
|
771
891
|
brandList = __spreadArray([], brand_list, true);
|
|
772
892
|
if (!isBrandExist && brand)
|
|
773
|
-
brandList = __spreadArray(__spreadArray([], brandList, true), [__assign(__assign({}, brand), { channel_services: [] })], false);
|
|
893
|
+
brandList = __spreadArray(__spreadArray([], brandList, true), [__assign(__assign({}, brand), { channel_services: (brand === null || brand === void 0 ? void 0 : brand.channel_services) || [] })], false);
|
|
774
894
|
brandList = __spreadArray(__spreadArray([], brandList, true), [OTHER_BRAND], false);
|
|
775
895
|
state.data.brandData.selectedBrandItem = brandList[0];
|
|
776
896
|
}
|
|
777
897
|
state.data.brandData.responseBody = {
|
|
778
898
|
brand_list: brandList,
|
|
779
|
-
channel_list: channel_list
|
|
899
|
+
channel_list: channel_list,
|
|
900
|
+
brandData: brand
|
|
780
901
|
};
|
|
781
902
|
state.data.otpData.responseBody = __assign(__assign({}, authResponse), { is_new_individual: is_new_individual, lead_id: id, brand_id: brand === null || brand === void 0 ? void 0 : brand.id, name: name, contact: contact });
|
|
782
903
|
})
|
|
@@ -821,7 +942,7 @@ export var connectSlice = createSlice({
|
|
|
821
942
|
state.loading = false;
|
|
822
943
|
state.error = null;
|
|
823
944
|
var _d = action.payload, formData = _d.formData, leadResponse = _d.leadResponse;
|
|
824
|
-
var brand = leadResponse.brand, rest = __rest(leadResponse, ["brand"]);
|
|
945
|
+
var brand = leadResponse.brand, terms_conditions_accepted = leadResponse.terms_conditions_accepted, rest = __rest(leadResponse, ["brand", "terms_conditions_accepted"]);
|
|
825
946
|
if (brand) {
|
|
826
947
|
var channel_services = brand.channel_services, terms = brand.terms;
|
|
827
948
|
state.data.brandData.salesChannels = channel_services || [];
|
|
@@ -829,20 +950,10 @@ export var connectSlice = createSlice({
|
|
|
829
950
|
var term = _a.term, agree = _a.agree;
|
|
830
951
|
return term === 'general' && agree === true;
|
|
831
952
|
});
|
|
832
|
-
state.data.brandData.termAndConditionChecked = !!termAndCondition;
|
|
953
|
+
state.data.brandData.termAndConditionChecked = !!termAndCondition || terms_conditions_accepted;
|
|
833
954
|
}
|
|
834
955
|
var selectedBrand = ((_b = (_a = state.data.brandData) === null || _a === void 0 ? void 0 : _a.responseBody) === null || _b === void 0 ? void 0 : _b.brand_list[0]) || leadResponse.brand;
|
|
835
956
|
state.data.brandData.brandName = (_c = selectedBrand === null || selectedBrand === void 0 ? void 0 : selectedBrand.name) === null || _c === void 0 ? void 0 : _c.en;
|
|
836
|
-
state.data.brandData.segment = rest.segments_list.find(function (_a) {
|
|
837
|
-
var _b, _c;
|
|
838
|
-
var id = _a.id;
|
|
839
|
-
return ((_c = (_b = selectedBrand === null || selectedBrand === void 0 ? void 0 : selectedBrand.segment) === null || _b === void 0 ? void 0 : _b.type) === null || _c === void 0 ? void 0 : _c.id) === id;
|
|
840
|
-
});
|
|
841
|
-
state.data.brandData.teamSize = rest.team_size_list.find(function (_a) {
|
|
842
|
-
var _b, _c;
|
|
843
|
-
var id = _a.id;
|
|
844
|
-
return ((_c = (_b = selectedBrand === null || selectedBrand === void 0 ? void 0 : selectedBrand.segment) === null || _b === void 0 ? void 0 : _b.team) === null || _c === void 0 ? void 0 : _c.id) === id;
|
|
845
|
-
});
|
|
846
957
|
state.data.individualData = formData;
|
|
847
958
|
state.data.individualData.responseBody = rest;
|
|
848
959
|
})
|
|
@@ -853,13 +964,47 @@ export var connectSlice = createSlice({
|
|
|
853
964
|
.addCase(updateLeadIndividual.rejected, function (state, action) {
|
|
854
965
|
state.loading = false;
|
|
855
966
|
state.error = action.error.message;
|
|
967
|
+
})
|
|
968
|
+
.addCase(retrieveSegmentDataList.pending, function (state) {
|
|
969
|
+
state.loading = true;
|
|
970
|
+
state.error = null;
|
|
971
|
+
})
|
|
972
|
+
.addCase(retrieveSegmentDataList.fulfilled, function (state) {
|
|
973
|
+
state.loading = false;
|
|
974
|
+
state.error = null;
|
|
975
|
+
})
|
|
976
|
+
.addCase(retrieveSegmentDataList.rejected, function (state, action) {
|
|
977
|
+
state.loading = false;
|
|
978
|
+
state.error = action.error.message;
|
|
856
979
|
})
|
|
857
980
|
.addCase(updateLeadBrand.fulfilled, function (state, action) {
|
|
858
981
|
state.loading = false;
|
|
859
982
|
state.error = null;
|
|
860
983
|
var _a = action.payload, formData = _a.formData, response = _a.response;
|
|
861
|
-
|
|
862
|
-
|
|
984
|
+
var _b = response || {}, segment_location_list = _b.segment_location_list, segment_profit_list = _b.segment_profit_list, segment_tech_list = _b.segment_tech_list, team_size_list = _b.team_size_list, brand = _b.brand;
|
|
985
|
+
var selectedSegmentLocation = segment_location_list === null || segment_location_list === void 0 ? void 0 : segment_location_list.find(function (location) {
|
|
986
|
+
var _a, _b;
|
|
987
|
+
return location.id === ((_b = (_a = brand === null || brand === void 0 ? void 0 : brand.segment) === null || _a === void 0 ? void 0 : _a.location_type) === null || _b === void 0 ? void 0 : _b.id);
|
|
988
|
+
});
|
|
989
|
+
var selectedSegmentProfit = segment_profit_list === null || segment_profit_list === void 0 ? void 0 : segment_profit_list.find(function (profit) {
|
|
990
|
+
var _a, _b;
|
|
991
|
+
return profit.id === ((_b = (_a = brand === null || brand === void 0 ? void 0 : brand.segment) === null || _a === void 0 ? void 0 : _a.profit_type) === null || _b === void 0 ? void 0 : _b.id);
|
|
992
|
+
});
|
|
993
|
+
var selectedSegmentTech = segment_tech_list === null || segment_tech_list === void 0 ? void 0 : segment_tech_list.find(function (tech) {
|
|
994
|
+
var _a, _b;
|
|
995
|
+
return tech.id === ((_b = (_a = brand === null || brand === void 0 ? void 0 : brand.segment) === null || _a === void 0 ? void 0 : _a.tech_type) === null || _b === void 0 ? void 0 : _b.id);
|
|
996
|
+
});
|
|
997
|
+
var selectedTeamSize = team_size_list === null || team_size_list === void 0 ? void 0 : team_size_list.find(function (_a) {
|
|
998
|
+
var _b, _c;
|
|
999
|
+
var id = _a.id;
|
|
1000
|
+
return ((_c = (_b = brand === null || brand === void 0 ? void 0 : brand.segment) === null || _b === void 0 ? void 0 : _b.team) === null || _c === void 0 ? void 0 : _c.id) === id;
|
|
1001
|
+
});
|
|
1002
|
+
state.data.brandSegmentData.segmentLocation = selectedSegmentLocation || (segment_location_list === null || segment_location_list === void 0 ? void 0 : segment_location_list[0]);
|
|
1003
|
+
state.data.brandSegmentData.segmentProfit = selectedSegmentProfit || (segment_profit_list === null || segment_profit_list === void 0 ? void 0 : segment_profit_list[0]);
|
|
1004
|
+
state.data.brandSegmentData.segmentTech = selectedSegmentTech || (segment_tech_list === null || segment_tech_list === void 0 ? void 0 : segment_tech_list[1]);
|
|
1005
|
+
state.data.brandSegmentData.teamSize = selectedTeamSize;
|
|
1006
|
+
state.data.brandData = __assign(__assign({}, formData), { responseBody: __assign(__assign({}, state.data.brandData.responseBody), { brand: brand }) });
|
|
1007
|
+
state.data.brandSegmentData.responseBody = { segment_location_list: segment_location_list, segment_profit_list: segment_profit_list, segment_tech_list: segment_tech_list, team_size_list: team_size_list };
|
|
863
1008
|
})
|
|
864
1009
|
.addCase(updateLeadBrand.pending, function (state) {
|
|
865
1010
|
state.loading = true;
|
|
@@ -868,6 +1013,21 @@ export var connectSlice = createSlice({
|
|
|
868
1013
|
.addCase(updateLeadBrand.rejected, function (state, action) {
|
|
869
1014
|
state.loading = false;
|
|
870
1015
|
state.error = action.error.message;
|
|
1016
|
+
})
|
|
1017
|
+
.addCase(updateLeadBrandSegment.fulfilled, function (state, action) {
|
|
1018
|
+
state.loading = false;
|
|
1019
|
+
state.error = null;
|
|
1020
|
+
var _a = action.payload, formData = _a.formData, response = _a.response;
|
|
1021
|
+
state.data.brandSegmentData = formData;
|
|
1022
|
+
state.data.brandSegmentData.responseBody = __assign(__assign({}, state.data.brandSegmentData.responseBody), response);
|
|
1023
|
+
})
|
|
1024
|
+
.addCase(updateLeadBrandSegment.pending, function (state) {
|
|
1025
|
+
state.loading = true;
|
|
1026
|
+
state.error = null;
|
|
1027
|
+
})
|
|
1028
|
+
.addCase(updateLeadBrandSegment.rejected, function (state, action) {
|
|
1029
|
+
state.loading = false;
|
|
1030
|
+
state.error = action.error.message;
|
|
871
1031
|
})
|
|
872
1032
|
.addCase(checkEmailAvailability.fulfilled, function (state, action) {
|
|
873
1033
|
var _a;
|
|
@@ -913,6 +1073,43 @@ export var connectSlice = createSlice({
|
|
|
913
1073
|
.addCase(updateLeadSuccess.rejected, function (state, action) {
|
|
914
1074
|
state.loading = false;
|
|
915
1075
|
state.error = action.error.message;
|
|
1076
|
+
})
|
|
1077
|
+
.addCase(retrieveLead.fulfilled, function (state, action) {
|
|
1078
|
+
var _a;
|
|
1079
|
+
state.customLoading = false;
|
|
1080
|
+
state.error = null;
|
|
1081
|
+
var _b = action.payload, data = _b.data, countryCode = _b.countryCode;
|
|
1082
|
+
var _c = data || {}, name = _c.name, contact = _c.contact, brand = _c.brand, identification = _c.identification, date_of_birth = _c.date_of_birth;
|
|
1083
|
+
var _d = contact || {}, email = _d.email, phone = _d.phone;
|
|
1084
|
+
var fullName = concatenateObjectValues(name, ['first', 'middle', 'last']);
|
|
1085
|
+
if (!!fullName) {
|
|
1086
|
+
var capitalizedName = capitalizeTheFirstLetterOfEachWord(fullName);
|
|
1087
|
+
state.data.individualData.name = capitalizedName;
|
|
1088
|
+
}
|
|
1089
|
+
if (email)
|
|
1090
|
+
state.data.individualData.email = email;
|
|
1091
|
+
if (phone === null || phone === void 0 ? void 0 : phone.number) {
|
|
1092
|
+
state.data.mobileData.mobile = phone.number;
|
|
1093
|
+
state.data.individualData.mobile = phone.number;
|
|
1094
|
+
}
|
|
1095
|
+
if (!!countryCode) {
|
|
1096
|
+
state.data.mobileData.countryCode = countryCode;
|
|
1097
|
+
state.data.individualData.countryCode = countryCode;
|
|
1098
|
+
}
|
|
1099
|
+
if ((_a = brand === null || brand === void 0 ? void 0 : brand.name) === null || _a === void 0 ? void 0 : _a.en)
|
|
1100
|
+
state.data.brandData.brandName = brand.name.en;
|
|
1101
|
+
if (identification === null || identification === void 0 ? void 0 : identification.id)
|
|
1102
|
+
state.data.nidData.nid = identification === null || identification === void 0 ? void 0 : identification.id;
|
|
1103
|
+
if (date_of_birth)
|
|
1104
|
+
state.data.nidData.dob = date_of_birth;
|
|
1105
|
+
})
|
|
1106
|
+
.addCase(retrieveLead.pending, function (state) {
|
|
1107
|
+
state.customLoading = true;
|
|
1108
|
+
state.error = null;
|
|
1109
|
+
})
|
|
1110
|
+
.addCase(retrieveLead.rejected, function (state, action) {
|
|
1111
|
+
state.customLoading = false;
|
|
1112
|
+
state.error = action.error.message;
|
|
916
1113
|
});
|
|
917
1114
|
}
|
|
918
1115
|
});
|