@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
|
@@ -60,16 +60,16 @@ var _a;
|
|
|
60
60
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
61
61
|
import API from '../../../api';
|
|
62
62
|
import { FlowsTypes } from '../../../@types';
|
|
63
|
-
import { handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
|
|
63
|
+
import { handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2 } from '../../../app/settings';
|
|
64
64
|
import { BRAND_STEP_NAMES } from '../../../constants';
|
|
65
|
-
import { isKW, isTwitter, isWebsite, sleep } from '../../../utils';
|
|
65
|
+
import { hasNoneEditableValue, isKW, isTwitter, isWebsite, mapSalesChannel, retrieveIndividualData, sleep } from '../../../utils';
|
|
66
66
|
export var verifyLeadToken = createAsyncThunk('brandVerifyLeadToken', function (_a, thunkApi) {
|
|
67
67
|
var token = _a.token, isInternally = _a.isInternally;
|
|
68
68
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
69
|
-
var payload, data, countryIso2, board_id,
|
|
70
|
-
var
|
|
71
|
-
return __generator(this, function (
|
|
72
|
-
switch (
|
|
69
|
+
var payload, data, countryIso2, _b, board_id, board_info_id, config, publicKey, salesChannels, boardData, boardInfoData, individualData, _c, id_1, type_1, serviceCallBack, _d, boardRes, individualRes;
|
|
70
|
+
var _e, _f, _g, _h;
|
|
71
|
+
return __generator(this, function (_j) {
|
|
72
|
+
switch (_j.label) {
|
|
73
73
|
case 0:
|
|
74
74
|
payload = {
|
|
75
75
|
service_name: 'tap_email',
|
|
@@ -77,59 +77,66 @@ export var verifyLeadToken = createAsyncThunk('brandVerifyLeadToken', function (
|
|
|
77
77
|
};
|
|
78
78
|
return [4, API.leadService.verifyLeadToken(payload)];
|
|
79
79
|
case 1:
|
|
80
|
-
data = (
|
|
80
|
+
data = (_j.sent()).data;
|
|
81
81
|
if ((data === null || data === void 0 ? void 0 : data.errors) && (data === null || data === void 0 ? void 0 : data.mw_error)) {
|
|
82
82
|
throw new Error(data.errors[0].description);
|
|
83
83
|
}
|
|
84
84
|
countryIso2 = data === null || data === void 0 ? void 0 : data.country_code;
|
|
85
85
|
if (countryIso2)
|
|
86
86
|
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
87
|
-
|
|
87
|
+
_b = data || {}, board_id = _b.id, board_info_id = _b.board_info_id, config = _b.config;
|
|
88
|
+
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
89
|
+
if (publicKey) {
|
|
90
|
+
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
91
|
+
}
|
|
88
92
|
if (!board_id) {
|
|
89
93
|
throw new Error('Internal server error');
|
|
90
94
|
}
|
|
91
|
-
|
|
95
|
+
individualData = undefined;
|
|
92
96
|
if (isInternally)
|
|
93
97
|
data.step_name = BRAND_STEP_NAMES.BRAND_INFO;
|
|
94
98
|
if (!(data.step_name !== BRAND_STEP_NAMES.PHONE_AUTH || isInternally)) return [3, 7];
|
|
95
|
-
return [
|
|
99
|
+
if (!board_info_id) return [3, 3];
|
|
100
|
+
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
96
101
|
case 2:
|
|
97
|
-
boardInfoData =
|
|
98
|
-
|
|
99
|
-
case 3:
|
|
100
|
-
|
|
102
|
+
boardInfoData = _j.sent();
|
|
103
|
+
_j.label = 3;
|
|
104
|
+
case 3: return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
105
|
+
case 4:
|
|
106
|
+
boardData = _j.sent();
|
|
107
|
+
_c = ((_e = boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification) === null || _e === void 0 ? void 0 : _e.recipient) || {}, id_1 = _c.id, type_1 = _c.type;
|
|
108
|
+
serviceCallBack = function () { return API.individualService.retrieveIndividual(id_1, type_1); };
|
|
109
|
+
return [4, retrieveIndividualData(type_1, boardData, serviceCallBack)];
|
|
110
|
+
case 5:
|
|
111
|
+
_d = _j.sent(), boardRes = _d.boardRes, individualRes = _d.individualRes;
|
|
112
|
+
boardData = boardRes;
|
|
113
|
+
individualData = individualRes;
|
|
101
114
|
if (!countryIso2) {
|
|
102
|
-
countryIso2 = (
|
|
115
|
+
countryIso2 = (_f = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _f === void 0 ? void 0 : _f.country;
|
|
103
116
|
if (countryIso2)
|
|
104
117
|
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
105
118
|
}
|
|
106
|
-
return [4, API.dataService.getSegments({ page: 0 })];
|
|
107
|
-
case 4:
|
|
108
|
-
segmentsList = _e.sent();
|
|
109
119
|
return [4, API.dataService.getChannelsOfServices({ page: 0 })];
|
|
110
|
-
case 5:
|
|
111
|
-
salesChannels = _e.sent();
|
|
112
|
-
return [4, API.dataService.getTeamSize({ page: 0 })];
|
|
113
120
|
case 6:
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
121
|
+
salesChannels = _j.sent();
|
|
122
|
+
thunkApi.dispatch(handleNextScreenStep('BRAND_INFO_STEP'));
|
|
123
|
+
_j.label = 7;
|
|
117
124
|
case 7: return [2, {
|
|
118
125
|
data: data,
|
|
126
|
+
individualData: individualData,
|
|
119
127
|
boardResponse: {
|
|
120
128
|
user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
|
|
121
129
|
brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
|
|
122
130
|
entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
|
|
123
131
|
bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
|
|
124
132
|
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
125
|
-
name: (
|
|
126
|
-
contact: (
|
|
133
|
+
name: (_g = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _g === void 0 ? void 0 : _g.names,
|
|
134
|
+
contact: (_h = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _h === void 0 ? void 0 : _h.contact,
|
|
127
135
|
individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
|
|
128
|
-
|
|
136
|
+
business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
|
|
137
|
+
notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification
|
|
129
138
|
},
|
|
130
139
|
salesChannels: salesChannels,
|
|
131
|
-
segmentsList: segmentsList === null || segmentsList === void 0 ? void 0 : segmentsList.list,
|
|
132
|
-
teamSizeList: teamSizeList === null || teamSizeList === void 0 ? void 0 : teamSizeList.list,
|
|
133
140
|
token: token
|
|
134
141
|
}];
|
|
135
142
|
}
|
|
@@ -154,67 +161,114 @@ export var resendOTP = createAsyncThunk('brandResendOTP', function (params, thun
|
|
|
154
161
|
});
|
|
155
162
|
}); });
|
|
156
163
|
export var verifyBrandLeadOTP = createAsyncThunk('verifyBrandLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
157
|
-
var _a, brand, settings, responseBody, payload, data, board_id, boardInfoData, boardData,
|
|
158
|
-
var
|
|
159
|
-
return __generator(this, function (
|
|
160
|
-
switch (
|
|
164
|
+
var _a, brand, settings, responseBody, payload, data, publicKey, _b, board_id, board_info_id, boardInfoData, individualData, boardData, _c, id, type, serviceCallBack, _d, boardRes, individualRes, salesChannels;
|
|
165
|
+
var _e, _f, _g, _h, _j, _k, _l, _m;
|
|
166
|
+
return __generator(this, function (_o) {
|
|
167
|
+
switch (_o.label) {
|
|
161
168
|
case 0:
|
|
162
169
|
_a = thunkApi.getState(), brand = _a.brand, settings = _a.settings;
|
|
163
170
|
responseBody = brand.data.verify.responseBody;
|
|
164
171
|
payload = {
|
|
165
172
|
data: params.otp,
|
|
166
|
-
service_name: (
|
|
173
|
+
service_name: (_e = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _e === void 0 ? void 0 : _e.service_name,
|
|
167
174
|
verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
|
|
168
175
|
step_name: BRAND_STEP_NAMES.PHONE_AUTH,
|
|
169
176
|
encryption_contract: ['data']
|
|
170
177
|
};
|
|
171
178
|
return [4, API.leadService.verifyLeadOTP(payload)];
|
|
172
179
|
case 1:
|
|
173
|
-
data = (
|
|
174
|
-
if ((
|
|
180
|
+
data = (_o.sent()).data;
|
|
181
|
+
if ((_f = data.errors) === null || _f === void 0 ? void 0 : _f.length)
|
|
175
182
|
throw new Error(data.errors[0].description);
|
|
176
|
-
|
|
183
|
+
publicKey = (_g = data === null || data === void 0 ? void 0 : data.config) === null || _g === void 0 ? void 0 : _g.public_key;
|
|
184
|
+
if (publicKey) {
|
|
185
|
+
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
186
|
+
}
|
|
187
|
+
_b = responseBody || {}, board_id = _b.id, board_info_id = _b.board_info_id;
|
|
177
188
|
if (!board_id) {
|
|
178
189
|
throw new Error('Internal server error');
|
|
179
190
|
}
|
|
180
|
-
|
|
191
|
+
individualData = undefined;
|
|
192
|
+
if (!board_info_id) return [3, 3];
|
|
193
|
+
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
181
194
|
case 2:
|
|
182
|
-
boardInfoData =
|
|
183
|
-
|
|
184
|
-
case 3:
|
|
185
|
-
boardData = _h.sent();
|
|
186
|
-
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, { otp: params.otp });
|
|
187
|
-
return [4, API.dataService.getSegments({ page: 0 })];
|
|
195
|
+
boardInfoData = _o.sent();
|
|
196
|
+
_o.label = 3;
|
|
197
|
+
case 3: return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
188
198
|
case 4:
|
|
189
|
-
|
|
190
|
-
|
|
199
|
+
boardData = _o.sent();
|
|
200
|
+
_c = ((_h = boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification) === null || _h === void 0 ? void 0 : _h.recipient) || {}, id = _c.id, type = _c.type;
|
|
201
|
+
serviceCallBack = function () { return API.individualService.retrieveIndividual(id, type); };
|
|
202
|
+
return [4, retrieveIndividualData(type, boardData, serviceCallBack)];
|
|
191
203
|
case 5:
|
|
192
|
-
|
|
193
|
-
|
|
204
|
+
_d = _o.sent(), boardRes = _d.boardRes, individualRes = _d.individualRes;
|
|
205
|
+
boardData = boardRes;
|
|
206
|
+
individualData = individualRes;
|
|
207
|
+
(_k = (_j = settings.data.appConfig).onStepCompleted) === null || _k === void 0 ? void 0 : _k.call(_j, settings.data.activeScreen.name, { otp: params.otp });
|
|
208
|
+
return [4, API.dataService.getChannelsOfServices({ page: 0 })];
|
|
194
209
|
case 6:
|
|
195
|
-
|
|
196
|
-
thunkApi.dispatch(handleNextScreenStep('BRAND_INFO_STEP'));
|
|
210
|
+
salesChannels = _o.sent();
|
|
211
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('BRAND_INFO_STEP')); });
|
|
197
212
|
return [2, {
|
|
198
213
|
data: data,
|
|
214
|
+
individualData: individualData,
|
|
199
215
|
boardResponse: {
|
|
200
216
|
user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
|
|
201
217
|
brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
|
|
202
218
|
entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
|
|
203
219
|
bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
|
|
204
220
|
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
205
|
-
name: (
|
|
206
|
-
contact: (
|
|
221
|
+
name: (_l = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _l === void 0 ? void 0 : _l.names,
|
|
222
|
+
contact: (_m = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _m === void 0 ? void 0 : _m.contact,
|
|
207
223
|
individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
|
|
208
|
-
|
|
224
|
+
business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
|
|
225
|
+
notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification
|
|
209
226
|
},
|
|
210
227
|
salesChannels: salesChannels,
|
|
211
|
-
segmentsList: segmentsList === null || segmentsList === void 0 ? void 0 : segmentsList.list,
|
|
212
|
-
teamSizeList: teamSizeList === null || teamSizeList === void 0 ? void 0 : teamSizeList.list,
|
|
213
228
|
formData: params
|
|
214
229
|
}];
|
|
215
230
|
}
|
|
216
231
|
});
|
|
217
232
|
}); });
|
|
233
|
+
export var retrieveSegmentDataList = createAsyncThunk('brandRetrieveSegmentDataList', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
234
|
+
var dataBody, _a, segmentLocation, segmentProfit, segmentTech;
|
|
235
|
+
return __generator(this, function (_b) {
|
|
236
|
+
switch (_b.label) {
|
|
237
|
+
case 0:
|
|
238
|
+
dataBody = {
|
|
239
|
+
page: 0,
|
|
240
|
+
limit: 50
|
|
241
|
+
};
|
|
242
|
+
return [4, Promise.all([
|
|
243
|
+
API.dataService.getSegmentLocation(dataBody),
|
|
244
|
+
API.dataService.getSegmentProfit(dataBody),
|
|
245
|
+
API.dataService.getSegmentTech(dataBody)
|
|
246
|
+
])];
|
|
247
|
+
case 1:
|
|
248
|
+
_a = _b.sent(), segmentLocation = _a[0].list, segmentProfit = _a[1].list, segmentTech = _a[2].list;
|
|
249
|
+
return [2, {
|
|
250
|
+
segmentLocation: segmentLocation,
|
|
251
|
+
segmentProfit: segmentProfit,
|
|
252
|
+
segmentTech: segmentTech
|
|
253
|
+
}];
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
}); });
|
|
257
|
+
export var retrieveBoardStatus = createAsyncThunk('brand/retrieveBoardStatus', function (parmas, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
258
|
+
var brand, board_id, data;
|
|
259
|
+
return __generator(this, function (_a) {
|
|
260
|
+
switch (_a.label) {
|
|
261
|
+
case 0:
|
|
262
|
+
brand = thunkApi.getState().brand;
|
|
263
|
+
board_id = (brand.data.verify.responseBody || {}).board_id;
|
|
264
|
+
return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
265
|
+
case 1:
|
|
266
|
+
data = _a.sent();
|
|
267
|
+
thunkApi.dispatch(handlePrevScreenStep());
|
|
268
|
+
return [2, { flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
}); });
|
|
218
272
|
export var retrieveBoardDetails = createAsyncThunk('brandRetrieveBrandInfo', function (boardId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
219
273
|
var data;
|
|
220
274
|
var _a, _b;
|
|
@@ -254,68 +308,118 @@ export var checkBrandNameAvailability = createAsyncThunk('checkBrandNameAvailabi
|
|
|
254
308
|
});
|
|
255
309
|
});
|
|
256
310
|
});
|
|
257
|
-
export var updateBrand = createAsyncThunk('brandUpdateBrand', function (
|
|
258
|
-
var
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
311
|
+
export var updateBrand = createAsyncThunk('brandUpdateBrand', function (_a, thunkApi) {
|
|
312
|
+
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
313
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
314
|
+
var _b, settings, brand, brandRes, _c, id, data_status, isNameENNonEditable, isNameARNonEditable, isChannelServicesNonEditable, salesChannels, brandName, brandLogoId, getAddress, channel_services, brandNameIsEditable, requestBody, brandData, _d, segmentLocation, segmentProfit, segmentTech, teamSizeList;
|
|
315
|
+
var _e, _f;
|
|
316
|
+
return __generator(this, function (_g) {
|
|
317
|
+
switch (_g.label) {
|
|
318
|
+
case 0:
|
|
319
|
+
_b = thunkApi.getState(), settings = _b.settings, brand = _b.brand;
|
|
320
|
+
brandRes = (brand.data.verify.responseBody || {}).brand;
|
|
321
|
+
_c = brandRes || {}, id = _c.id, data_status = _c.data_status;
|
|
322
|
+
isNameENNonEditable = hasNoneEditableValue(data_status, 'name.en');
|
|
323
|
+
isNameARNonEditable = hasNoneEditableValue(data_status, 'name.ar');
|
|
324
|
+
isChannelServicesNonEditable = hasNoneEditableValue(data_status, 'channel_services');
|
|
325
|
+
salesChannels = formData.salesChannels, brandName = formData.brandName, brandLogoId = formData.brandLogoId;
|
|
326
|
+
getAddress = function (value, isTwitter, isWeb) {
|
|
327
|
+
if (isTwitter)
|
|
328
|
+
return '@' + value.replaceAll('@', '');
|
|
329
|
+
if (isWeb)
|
|
330
|
+
return 'https://www.' + value.replaceAll('https://www.', '');
|
|
331
|
+
return value;
|
|
332
|
+
};
|
|
333
|
+
channel_services = isChannelServicesNonEditable
|
|
334
|
+
? undefined
|
|
335
|
+
: salesChannels === null || salesChannels === void 0 ? void 0 : salesChannels.map(function (channel) {
|
|
336
|
+
var _a;
|
|
337
|
+
return {
|
|
338
|
+
id: channel.id,
|
|
339
|
+
address: getAddress(channel.address || '', isTwitter(channel.code), isWebsite(channel.code)),
|
|
340
|
+
sub: (_a = channel.sub) === null || _a === void 0 ? void 0 : _a.map(function (sub) {
|
|
341
|
+
return { id: sub.id, address: getAddress(sub.address || '', isTwitter(sub.code), isWebsite(sub.code)) };
|
|
342
|
+
})
|
|
343
|
+
};
|
|
344
|
+
});
|
|
345
|
+
brandNameIsEditable = brandName && !(isNameENNonEditable && isNameARNonEditable);
|
|
346
|
+
requestBody = __assign(__assign({ id: id }, (brandNameIsEditable && {
|
|
347
|
+
name: {
|
|
348
|
+
en: !isNameENNonEditable ? brandName : undefined,
|
|
349
|
+
ar: !isNameARNonEditable ? brandName : undefined
|
|
350
|
+
}
|
|
351
|
+
})), { logo: brandLogoId, channel_services: channel_services });
|
|
352
|
+
return [4, API.brandService.updateBrandInfo(requestBody)];
|
|
353
|
+
case 1:
|
|
354
|
+
brandData = (_g.sent()).brand;
|
|
355
|
+
return [4, thunkApi.dispatch(retrieveSegmentDataList()).unwrap()];
|
|
356
|
+
case 2:
|
|
357
|
+
_d = _g.sent(), segmentLocation = _d.segmentLocation, segmentProfit = _d.segmentProfit, segmentTech = _d.segmentTech;
|
|
358
|
+
return [4, API.dataService.getTeamSize({ page: 0 })];
|
|
359
|
+
case 3:
|
|
360
|
+
teamSizeList = _g.sent();
|
|
361
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
362
|
+
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, id);
|
|
363
|
+
return [2, {
|
|
364
|
+
data: __assign({}, brandData),
|
|
365
|
+
formData: originalFormData,
|
|
366
|
+
teamSizeList: teamSizeList === null || teamSizeList === void 0 ? void 0 : teamSizeList.list,
|
|
367
|
+
segmentLocationList: segmentLocation,
|
|
368
|
+
segmentProfitList: segmentProfit,
|
|
369
|
+
segmentTechList: segmentTech
|
|
370
|
+
}];
|
|
371
|
+
}
|
|
372
|
+
});
|
|
317
373
|
});
|
|
318
|
-
});
|
|
374
|
+
});
|
|
375
|
+
export var updateSegmentBrand = createAsyncThunk('brandUpdateBrandSegment', function (_a, thunkApi) {
|
|
376
|
+
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
377
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
378
|
+
var _b, settings, brand, brandRes, _c, id, data_status, isSegmentLocationNonEditable, isSegmentProfitNonEditable, isSegmentTechNonEditable, isSegmentTeamsNonEditable, segmentLocation, segmentProfit, segmentTech, teamSize, segmentLocationId, segmentProfitId, segmentTechId, teamSizeId, hasSegment, requestBody, brandData, activities, activityList;
|
|
379
|
+
var _d, _e, _f;
|
|
380
|
+
return __generator(this, function (_g) {
|
|
381
|
+
switch (_g.label) {
|
|
382
|
+
case 0:
|
|
383
|
+
_b = thunkApi.getState(), settings = _b.settings, brand = _b.brand;
|
|
384
|
+
brandRes = (brand.data.verify.responseBody || {}).brand;
|
|
385
|
+
_c = brandRes || {}, id = _c.id, data_status = _c.data_status;
|
|
386
|
+
isSegmentLocationNonEditable = hasNoneEditableValue(data_status, 'segment.location_type');
|
|
387
|
+
isSegmentProfitNonEditable = hasNoneEditableValue(data_status, 'segment.profit_type');
|
|
388
|
+
isSegmentTechNonEditable = hasNoneEditableValue(data_status, 'segment.tech_type');
|
|
389
|
+
isSegmentTeamsNonEditable = hasNoneEditableValue(data_status, 'segment.teams');
|
|
390
|
+
segmentLocation = formData.segmentLocation, segmentProfit = formData.segmentProfit, segmentTech = formData.segmentTech, teamSize = formData.teamSize;
|
|
391
|
+
segmentLocationId = isSegmentLocationNonEditable ? undefined : segmentLocation && { id: segmentLocation.id };
|
|
392
|
+
segmentProfitId = isSegmentProfitNonEditable ? undefined : segmentProfit && { id: segmentProfit.id };
|
|
393
|
+
segmentTechId = isSegmentTechNonEditable ? undefined : segmentTech && { id: segmentTech.id };
|
|
394
|
+
teamSizeId = isSegmentTeamsNonEditable ? undefined : teamSize && { id: teamSize.id };
|
|
395
|
+
hasSegment = segmentLocationId || segmentProfitId || segmentTechId || teamSizeId;
|
|
396
|
+
requestBody = __assign({ id: id }, (hasSegment && {
|
|
397
|
+
segment: { location_type: segmentLocationId, profit_type: segmentProfitId, tech_type: segmentTechId, team: teamSizeId }
|
|
398
|
+
}));
|
|
399
|
+
return [4, API.brandService.updateBrandInfo(requestBody)];
|
|
400
|
+
case 1:
|
|
401
|
+
brandData = (_g.sent()).brand;
|
|
402
|
+
activities = (((_d = brand.data.verify.responseBody) === null || _d === void 0 ? void 0 : _d.entity) || {}).activities;
|
|
403
|
+
return [4, thunkApi.dispatch(retrieveDataList())];
|
|
404
|
+
case 2:
|
|
405
|
+
_g.sent();
|
|
406
|
+
if (activities) {
|
|
407
|
+
brandData = __assign(__assign({}, brandData), { entity_activities: activities || {} });
|
|
408
|
+
}
|
|
409
|
+
if (!!activities) return [3, 4];
|
|
410
|
+
return [4, API.dataService.getActivities()];
|
|
411
|
+
case 3:
|
|
412
|
+
activityList = (_g.sent()).list;
|
|
413
|
+
brandData = __assign(__assign({}, brandData), { entity_activities: activityList || {} });
|
|
414
|
+
_g.label = 4;
|
|
415
|
+
case 4:
|
|
416
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
417
|
+
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, id);
|
|
418
|
+
return [2, { data: __assign({}, brandData), formData: originalFormData }];
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
});
|
|
422
|
+
});
|
|
319
423
|
export var retrieveEntityList = createAsyncThunk('retrieveEntityList', function (params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
320
424
|
var data;
|
|
321
425
|
return __generator(this, function (_a) {
|
|
@@ -327,45 +431,63 @@ export var retrieveEntityList = createAsyncThunk('retrieveEntityList', function
|
|
|
327
431
|
}
|
|
328
432
|
});
|
|
329
433
|
}); });
|
|
330
|
-
export var updateBrandActivities = createAsyncThunk('brandUpdateBrandActivities', function (
|
|
331
|
-
var
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
434
|
+
export var updateBrandActivities = createAsyncThunk('brandUpdateBrandActivities', function (_a, thunkApi) {
|
|
435
|
+
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
436
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
437
|
+
var _b, settings, brand, _c, brandRes, notification, _d, data_status, id, brandActivities, terms, isActivitiesNonEditable, isCustomerBaseLocationNonEditable, isCustomerBaseNonEditable, isTermsNonEditable, isSalesRangeNonEditable, activities, customerLocations, expectedCustomer, expectedSale, termAndConditionChecked, refundPolicy, transactionPolicy, isTermsUndefined, isAllTermsAgreed, isTermsAvailable, removedActivities, payload, requestBody, customerLocation, customerBaseId, salesId, customerBase, brandData;
|
|
438
|
+
var _e, _f, _g, _h;
|
|
439
|
+
return __generator(this, function (_j) {
|
|
440
|
+
switch (_j.label) {
|
|
441
|
+
case 0:
|
|
442
|
+
_b = thunkApi.getState(), settings = _b.settings, brand = _b.brand;
|
|
443
|
+
_c = brand.data.verify.responseBody || {}, brandRes = _c.brand, notification = _c.notification;
|
|
444
|
+
_d = brandRes || {}, data_status = _d.data_status, id = _d.id, brandActivities = _d.activities, terms = _d.terms;
|
|
445
|
+
isActivitiesNonEditable = hasNoneEditableValue(data_status, 'activities');
|
|
446
|
+
isCustomerBaseLocationNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.operations, 'customer_base_location');
|
|
447
|
+
isCustomerBaseNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.operations, 'customer_base');
|
|
448
|
+
isTermsNonEditable = hasNoneEditableValue(data_status, 'terms');
|
|
449
|
+
isSalesRangeNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.operations, 'sales_range');
|
|
450
|
+
activities = formData.activities, customerLocations = formData.customerLocations, expectedCustomer = formData.expectedCustomer, expectedSale = formData.expectedSale, termAndConditionChecked = formData.termAndConditionChecked, refundPolicy = formData.refundPolicy, transactionPolicy = formData.transactionPolicy;
|
|
451
|
+
isTermsUndefined = termAndConditionChecked === undefined && refundPolicy === undefined && transactionPolicy === undefined;
|
|
452
|
+
isAllTermsAgreed = ((_e = terms === null || terms === void 0 ? void 0 : terms.filter(function (t) { return t === null || t === void 0 ? void 0 : t.agree; })) === null || _e === void 0 ? void 0 : _e.length) === 3;
|
|
453
|
+
isTermsAvailable = !(isTermsNonEditable && isTermsUndefined) && !isAllTermsAgreed;
|
|
454
|
+
removedActivities = (activities === null || activities === void 0 ? void 0 : activities.length) > 0 &&
|
|
455
|
+
(brandActivities || []).filter(function (brandActivity) { return !(activities || []).some(function (activity) { return activity.id === brandActivity.id; }); });
|
|
456
|
+
if (!(!isActivitiesNonEditable && (removedActivities === null || removedActivities === void 0 ? void 0 : removedActivities.length) > 0)) return [3, 2];
|
|
457
|
+
payload = {
|
|
458
|
+
id: id,
|
|
459
|
+
activities: removedActivities
|
|
460
|
+
};
|
|
461
|
+
return [4, API.brandService.removeBrandActivity(payload)];
|
|
462
|
+
case 1:
|
|
463
|
+
_j.sent();
|
|
464
|
+
_j.label = 2;
|
|
465
|
+
case 2:
|
|
466
|
+
requestBody = __assign(__assign({ id: id, activities: isActivitiesNonEditable ? undefined : activities }, (isTermsAvailable && {
|
|
467
|
+
term_by: (_f = notification === null || notification === void 0 ? void 0 : notification.recipient) === null || _f === void 0 ? void 0 : _f.id,
|
|
468
|
+
term: ['general', 'refund', 'chargeback']
|
|
469
|
+
})), { step_name: BRAND_STEP_NAMES.BRAND_ACTIVITIES });
|
|
470
|
+
customerLocation = (customerLocations || []).map(function (location) { return ({
|
|
471
|
+
id: location.id
|
|
472
|
+
}); });
|
|
473
|
+
customerBaseId = (expectedCustomer === null || expectedCustomer === void 0 ? void 0 : expectedCustomer.id) && { id: expectedCustomer.id, period: 'monthly' };
|
|
474
|
+
salesId = (expectedSale === null || expectedSale === void 0 ? void 0 : expectedSale.id) && { id: expectedSale.id, period: 'monthly' };
|
|
475
|
+
customerBase = (customerBaseId || customerLocation.length) && __assign(__assign({}, (customerBaseId && !isCustomerBaseNonEditable && { id: expectedCustomer.id, period: 'monthly' })), (customerLocation.length && !isCustomerBaseLocationNonEditable && { locations: customerLocation }));
|
|
476
|
+
if (customerBase && !(isCustomerBaseNonEditable && isCustomerBaseLocationNonEditable))
|
|
477
|
+
requestBody = __assign(__assign({}, requestBody), { operations: __assign(__assign({}, requestBody.operations), { customer_base: customerBase }) });
|
|
478
|
+
if (salesId && !isSalesRangeNonEditable) {
|
|
479
|
+
requestBody = __assign(__assign({}, requestBody), { operations: __assign(__assign({}, requestBody.operations), { sales: salesId }) });
|
|
480
|
+
}
|
|
481
|
+
return [4, API.brandService.updateBrandInfo(requestBody)];
|
|
482
|
+
case 3:
|
|
483
|
+
brandData = (_j.sent()).data;
|
|
484
|
+
thunkApi.dispatch(handleNextScreenStep());
|
|
485
|
+
(_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, id);
|
|
486
|
+
return [2, { data: __assign({}, brandData), formData: originalFormData }];
|
|
487
|
+
}
|
|
488
|
+
});
|
|
367
489
|
});
|
|
368
|
-
});
|
|
490
|
+
});
|
|
369
491
|
export var retrieveDataList = createAsyncThunk('brandRetrieveDataList', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
370
492
|
var settings, countryISO2, dataBody, salesDataBody, _a, customerBases, expectedSales, expectedCustomerSales;
|
|
371
493
|
return __generator(this, function (_b) {
|
|
@@ -432,6 +554,7 @@ var initialState = {
|
|
|
432
554
|
loading: false,
|
|
433
555
|
customLoading: false,
|
|
434
556
|
uploading: false,
|
|
557
|
+
uploadingBrandLogo: false,
|
|
435
558
|
data: {
|
|
436
559
|
flowName: FlowsTypes.BRAND,
|
|
437
560
|
verify: {
|
|
@@ -442,9 +565,13 @@ var initialState = {
|
|
|
442
565
|
},
|
|
443
566
|
brandData: {
|
|
444
567
|
brandName: '',
|
|
445
|
-
salesChannels: []
|
|
446
|
-
|
|
447
|
-
|
|
568
|
+
salesChannels: []
|
|
569
|
+
},
|
|
570
|
+
brandSegmentData: {
|
|
571
|
+
segmentLocation: undefined,
|
|
572
|
+
segmentTech: undefined,
|
|
573
|
+
segmentProfit: undefined,
|
|
574
|
+
teamSize: undefined
|
|
448
575
|
},
|
|
449
576
|
brandActivities: {
|
|
450
577
|
activities: [],
|
|
@@ -469,6 +596,13 @@ export var brandSlice = createSlice({
|
|
|
469
596
|
},
|
|
470
597
|
resetOTPScreen: function (state) {
|
|
471
598
|
state.data.otpData.otp = '';
|
|
599
|
+
},
|
|
600
|
+
uploadingBrandLogoStatus: function (state, action) {
|
|
601
|
+
state.uploadingBrandLogo = action.payload;
|
|
602
|
+
},
|
|
603
|
+
clearBrandLogo: function (state) {
|
|
604
|
+
var brand = (state.data.verify.responseBody || {}).brand;
|
|
605
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { brand: __assign(__assign({}, brand), { logo_details: undefined, logo: undefined }) });
|
|
472
606
|
}
|
|
473
607
|
},
|
|
474
608
|
extraReducers: function (builder) {
|
|
@@ -478,35 +612,22 @@ export var brandSlice = createSlice({
|
|
|
478
612
|
state.customLoading = true;
|
|
479
613
|
})
|
|
480
614
|
.addCase(verifyLeadToken.fulfilled, function (state, action) {
|
|
481
|
-
var _a, _b
|
|
615
|
+
var _a, _b;
|
|
482
616
|
state.error = null;
|
|
483
617
|
state.customLoading = false;
|
|
484
|
-
var
|
|
618
|
+
var _c = action.payload, data = _c.data, token = _c.token, boardResponse = _c.boardResponse, salesChannels = _c.salesChannels, individualData = _c.individualData;
|
|
485
619
|
var brand = boardResponse.brand, entity = boardResponse.entity;
|
|
486
|
-
state.data.brandData.brandName = (_a = brand === null || brand === void 0 ? void 0 : brand.name) === null || _a === void 0 ? void 0 : _a.en;
|
|
487
|
-
|
|
488
|
-
var _a, _b;
|
|
489
|
-
return segment.id === ((_b = (_a = brand === null || brand === void 0 ? void 0 : brand.segment) === null || _a === void 0 ? void 0 : _a.type) === null || _b === void 0 ? void 0 : _b.id);
|
|
490
|
-
})) === null || _b === void 0 ? void 0 : _b[0];
|
|
491
|
-
var selectedTeamSize = (_c = teamSizeList === null || teamSizeList === void 0 ? void 0 : teamSizeList.filter(function (team) {
|
|
492
|
-
var _a, _b;
|
|
493
|
-
return team.id === ((_b = (_a = brand === null || brand === void 0 ? void 0 : brand.segment) === null || _a === void 0 ? void 0 : _a.team) === null || _b === void 0 ? void 0 : _b.id);
|
|
494
|
-
})) === null || _c === void 0 ? void 0 : _c[0];
|
|
495
|
-
(_d = brand === null || brand === void 0 ? void 0 : brand.terms) === null || _d === void 0 ? void 0 : _d.forEach(function (element) {
|
|
620
|
+
state.data.brandData.brandName = (((_a = brand === null || brand === void 0 ? void 0 : brand.name) === null || _a === void 0 ? void 0 : _a.en) || '').trim();
|
|
621
|
+
(_b = brand === null || brand === void 0 ? void 0 : brand.terms) === null || _b === void 0 ? void 0 : _b.forEach(function (element) {
|
|
496
622
|
if ((element === null || element === void 0 ? void 0 : element.term) === 'general') {
|
|
497
623
|
state.data.brandActivities.termAndConditionChecked = element.agree;
|
|
498
|
-
}
|
|
499
|
-
if ((element === null || element === void 0 ? void 0 : element.term) === 'chargeback') {
|
|
500
624
|
state.data.brandActivities.transactionPolicy = element.agree;
|
|
501
|
-
}
|
|
502
|
-
if ((element === null || element === void 0 ? void 0 : element.term) === 'refund') {
|
|
503
625
|
state.data.brandActivities.refundPolicy = element.agree;
|
|
504
626
|
}
|
|
505
627
|
});
|
|
506
|
-
|
|
507
|
-
state.data.brandData.
|
|
508
|
-
state.data.
|
|
509
|
-
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.verify.responseBody), boardResponse), { board_id: data.id, channel_list: (salesChannels === null || salesChannels === void 0 ? void 0 : salesChannels.list) || [], salesChannels: brand === null || brand === void 0 ? void 0 : brand.channel_services, activities: entity === null || entity === void 0 ? void 0 : entity.activities, segmentsList: segmentsList, teamSizeList: teamSizeList });
|
|
628
|
+
var mappedSalesChannels = mapSalesChannel((brand === null || brand === void 0 ? void 0 : brand.channel_services) || []);
|
|
629
|
+
state.data.brandData.salesChannels = mappedSalesChannels;
|
|
630
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.verify.responseBody), boardResponse), { board_id: data.id, channel_list: (salesChannels === null || salesChannels === void 0 ? void 0 : salesChannels.list) || [], salesChannels: mappedSalesChannels, activities: entity === null || entity === void 0 ? void 0 : entity.activities, individualData: individualData });
|
|
510
631
|
state.data.verify.token = token;
|
|
511
632
|
})
|
|
512
633
|
.addCase(verifyLeadToken.rejected, function (state, action) {
|
|
@@ -529,37 +650,24 @@ export var brandSlice = createSlice({
|
|
|
529
650
|
state.error = null;
|
|
530
651
|
})
|
|
531
652
|
.addCase(verifyBrandLeadOTP.fulfilled, function (state, action) {
|
|
532
|
-
var _a, _b
|
|
653
|
+
var _a, _b;
|
|
533
654
|
state.loading = false;
|
|
534
655
|
state.error = null;
|
|
535
|
-
var
|
|
656
|
+
var _c = action.payload, data = _c.data, boardResponse = _c.boardResponse, formData = _c.formData, salesChannels = _c.salesChannels, individualData = _c.individualData;
|
|
536
657
|
var brand = boardResponse.brand, entity = boardResponse.entity;
|
|
537
658
|
state.data.otpData = formData;
|
|
538
659
|
state.data.otpData.responseBody = data;
|
|
539
|
-
state.data.brandData.brandName = (_a = brand === null || brand === void 0 ? void 0 : brand.name) === null || _a === void 0 ? void 0 : _a.en;
|
|
540
|
-
var
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
})) === null || _b === void 0 ? void 0 : _b[0];
|
|
544
|
-
var selectedTeamSize = (_c = teamSizeList === null || teamSizeList === void 0 ? void 0 : teamSizeList.filter(function (team) {
|
|
545
|
-
var _a, _b;
|
|
546
|
-
return team.id === ((_b = (_a = brand === null || brand === void 0 ? void 0 : brand.segment) === null || _a === void 0 ? void 0 : _a.team) === null || _b === void 0 ? void 0 : _b.id);
|
|
547
|
-
})) === null || _c === void 0 ? void 0 : _c[0];
|
|
548
|
-
state.data.brandData.segment = selectedSegment;
|
|
549
|
-
state.data.brandData.teamSize = selectedTeamSize;
|
|
550
|
-
state.data.brandData.salesChannels = (brand === null || brand === void 0 ? void 0 : brand.channel_services) || [];
|
|
551
|
-
(_d = brand === null || brand === void 0 ? void 0 : brand.terms) === null || _d === void 0 ? void 0 : _d.forEach(function (element) {
|
|
660
|
+
state.data.brandData.brandName = (((_a = brand === null || brand === void 0 ? void 0 : brand.name) === null || _a === void 0 ? void 0 : _a.en) || '').trim();
|
|
661
|
+
var mappedSalesChannels = mapSalesChannel((brand === null || brand === void 0 ? void 0 : brand.channel_services) || []);
|
|
662
|
+
state.data.brandData.salesChannels = mappedSalesChannels;
|
|
663
|
+
(_b = brand === null || brand === void 0 ? void 0 : brand.terms) === null || _b === void 0 ? void 0 : _b.forEach(function (element) {
|
|
552
664
|
if ((element === null || element === void 0 ? void 0 : element.term) === 'general') {
|
|
553
665
|
state.data.brandActivities.termAndConditionChecked = element.agree;
|
|
554
|
-
}
|
|
555
|
-
if ((element === null || element === void 0 ? void 0 : element.term) === 'chargeback') {
|
|
556
666
|
state.data.brandActivities.transactionPolicy = element.agree;
|
|
557
|
-
}
|
|
558
|
-
if ((element === null || element === void 0 ? void 0 : element.term) === 'refund') {
|
|
559
667
|
state.data.brandActivities.refundPolicy = element.agree;
|
|
560
668
|
}
|
|
561
669
|
});
|
|
562
|
-
state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), boardResponse), { board_id: data.id, channel_list: (salesChannels === null || salesChannels === void 0 ? void 0 : salesChannels.list) || [], activities: entity === null || entity === void 0 ? void 0 : entity.activities, salesChannels:
|
|
670
|
+
state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), boardResponse), { board_id: data.id, channel_list: (salesChannels === null || salesChannels === void 0 ? void 0 : salesChannels.list) || [], activities: entity === null || entity === void 0 ? void 0 : entity.activities, salesChannels: mappedSalesChannels, individualData: individualData });
|
|
563
671
|
})
|
|
564
672
|
.addCase(verifyBrandLeadOTP.rejected, function (state, action) {
|
|
565
673
|
state.loading = false;
|
|
@@ -585,12 +693,48 @@ export var brandSlice = createSlice({
|
|
|
585
693
|
.addCase(updateBrand.fulfilled, function (state, action) {
|
|
586
694
|
state.loading = false;
|
|
587
695
|
state.error = null;
|
|
696
|
+
var _a = action.payload, data = _a.data, formData = _a.formData, segmentLocationList = _a.segmentLocationList, segmentProfitList = _a.segmentProfitList, segmentTechList = _a.segmentTechList, teamSizeList = _a.teamSizeList;
|
|
697
|
+
var segment = data.segment;
|
|
698
|
+
state.data.brandData = formData;
|
|
699
|
+
var selectedSegmentLocation = segmentLocationList === null || segmentLocationList === void 0 ? void 0 : segmentLocationList.find(function (location) {
|
|
700
|
+
var _a;
|
|
701
|
+
return location.id === ((_a = segment === null || segment === void 0 ? void 0 : segment.location_type) === null || _a === void 0 ? void 0 : _a.id);
|
|
702
|
+
});
|
|
703
|
+
var selectedSegmentProfit = segmentProfitList === null || segmentProfitList === void 0 ? void 0 : segmentProfitList.find(function (profit) {
|
|
704
|
+
var _a;
|
|
705
|
+
return profit.id === ((_a = segment === null || segment === void 0 ? void 0 : segment.profit_type) === null || _a === void 0 ? void 0 : _a.id);
|
|
706
|
+
});
|
|
707
|
+
var selectedSegmentTech = segmentTechList === null || segmentTechList === void 0 ? void 0 : segmentTechList.find(function (tech) {
|
|
708
|
+
var _a;
|
|
709
|
+
return tech.id === ((_a = segment === null || segment === void 0 ? void 0 : segment.tech_type) === null || _a === void 0 ? void 0 : _a.id);
|
|
710
|
+
});
|
|
711
|
+
var selectedTeamSize = teamSizeList === null || teamSizeList === void 0 ? void 0 : teamSizeList.find(function (team) {
|
|
712
|
+
var _a;
|
|
713
|
+
return team.id === ((_a = segment === null || segment === void 0 ? void 0 : segment.team) === null || _a === void 0 ? void 0 : _a.id);
|
|
714
|
+
});
|
|
715
|
+
state.data.brandSegmentData.segmentLocation = selectedSegmentLocation || (segmentLocationList === null || segmentLocationList === void 0 ? void 0 : segmentLocationList[0]);
|
|
716
|
+
state.data.brandSegmentData.segmentProfit = selectedSegmentProfit || (segmentProfitList === null || segmentProfitList === void 0 ? void 0 : segmentProfitList[0]);
|
|
717
|
+
state.data.brandSegmentData.segmentTech = selectedSegmentTech || (segmentTechList === null || segmentTechList === void 0 ? void 0 : segmentTechList[1]);
|
|
718
|
+
state.data.brandSegmentData.teamSize = selectedTeamSize;
|
|
719
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { teamSizeList: teamSizeList, segmentLocationList: segmentLocationList, segmentProfitList: segmentProfitList, segmentTechList: segmentTechList });
|
|
720
|
+
})
|
|
721
|
+
.addCase(updateBrand.rejected, function (state, action) {
|
|
722
|
+
state.loading = false;
|
|
723
|
+
state.error = action.error.message;
|
|
724
|
+
})
|
|
725
|
+
.addCase(updateSegmentBrand.pending, function (state) {
|
|
726
|
+
state.loading = true;
|
|
727
|
+
state.error = null;
|
|
728
|
+
})
|
|
729
|
+
.addCase(updateSegmentBrand.fulfilled, function (state, action) {
|
|
730
|
+
state.loading = false;
|
|
731
|
+
state.error = null;
|
|
588
732
|
var _a = action.payload, data = _a.data, formData = _a.formData;
|
|
589
|
-
var entity_activities = data.entity_activities, activities = data.activities, operations = data.operations;
|
|
733
|
+
var entity_activities = data.entity_activities, activities = data.activities, operations = data.operations, terms = data.terms;
|
|
590
734
|
var selectedActivity = entity_activities === null || entity_activities === void 0 ? void 0 : entity_activities.filter(function (activity) {
|
|
591
735
|
return activities === null || activities === void 0 ? void 0 : activities.find(function (value) { return activity.id === value.id; });
|
|
592
736
|
});
|
|
593
|
-
state.data.
|
|
737
|
+
state.data.brandSegmentData = formData;
|
|
594
738
|
state.data.brandActivities.activities = (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : [];
|
|
595
739
|
var _b = operations || {}, customer_base = _b.customer_base, sales = _b.sales;
|
|
596
740
|
var _c = customer_base || {}, locations = _c.locations, customerBase = __rest(_c, ["locations"]);
|
|
@@ -600,7 +744,18 @@ export var brandSlice = createSlice({
|
|
|
600
744
|
state.data.brandActivities.expectedSale = sales;
|
|
601
745
|
if (!!customerBase)
|
|
602
746
|
state.data.brandActivities.expectedCustomer = customerBase;
|
|
603
|
-
|
|
747
|
+
terms === null || terms === void 0 ? void 0 : terms.forEach(function (element) {
|
|
748
|
+
if ((element === null || element === void 0 ? void 0 : element.term) === 'general') {
|
|
749
|
+
state.data.brandActivities.termAndConditionChecked = element.agree;
|
|
750
|
+
state.data.brandActivities.transactionPolicy = element.agree;
|
|
751
|
+
state.data.brandActivities.refundPolicy = element.agree;
|
|
752
|
+
}
|
|
753
|
+
});
|
|
754
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { activities: entity_activities });
|
|
755
|
+
})
|
|
756
|
+
.addCase(updateSegmentBrand.rejected, function (state, action) {
|
|
757
|
+
state.loading = false;
|
|
758
|
+
state.error = action.error.message;
|
|
604
759
|
})
|
|
605
760
|
.addCase(updateBrandActivities.rejected, function (state, action) {
|
|
606
761
|
state.loading = false;
|
|
@@ -614,7 +769,15 @@ export var brandSlice = createSlice({
|
|
|
614
769
|
state.loading = false;
|
|
615
770
|
state.error = null;
|
|
616
771
|
})
|
|
617
|
-
.addCase(
|
|
772
|
+
.addCase(retrieveSegmentDataList.pending, function (state) {
|
|
773
|
+
state.loading = true;
|
|
774
|
+
state.error = null;
|
|
775
|
+
})
|
|
776
|
+
.addCase(retrieveSegmentDataList.fulfilled, function (state) {
|
|
777
|
+
state.loading = false;
|
|
778
|
+
state.error = null;
|
|
779
|
+
})
|
|
780
|
+
.addCase(retrieveSegmentDataList.rejected, function (state, action) {
|
|
618
781
|
state.loading = false;
|
|
619
782
|
state.error = action.error.message;
|
|
620
783
|
})
|
|
@@ -648,13 +811,31 @@ export var brandSlice = createSlice({
|
|
|
648
811
|
.addCase(retrieveBoardDetails.rejected, function (state, action) {
|
|
649
812
|
state.error = action.error.message;
|
|
650
813
|
state.loading = false;
|
|
814
|
+
})
|
|
815
|
+
.addCase(retrieveBoardStatus.pending, function (state) {
|
|
816
|
+
state.error = null;
|
|
817
|
+
state.loading = true;
|
|
818
|
+
})
|
|
819
|
+
.addCase(retrieveBoardStatus.fulfilled, function (state, action) {
|
|
820
|
+
state.error = null;
|
|
821
|
+
state.loading = false;
|
|
822
|
+
var flows = action.payload.flows;
|
|
823
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows });
|
|
824
|
+
})
|
|
825
|
+
.addCase(retrieveBoardStatus.rejected, function (state, action) {
|
|
826
|
+
state.error = action.error.message;
|
|
827
|
+
state.loading = false;
|
|
651
828
|
})
|
|
652
829
|
.addCase(updateBoardSuccess.fulfilled, function (state, action) {
|
|
653
830
|
var _a;
|
|
654
831
|
state.loading = false;
|
|
655
832
|
state.error = null;
|
|
656
833
|
var flows = (((_a = action.payload) === null || _a === void 0 ? void 0 : _a.response) || {}).flows;
|
|
657
|
-
state.data.verify.responseBody
|
|
834
|
+
var _b = state.data.verify.responseBody || {}, individuals = _b.individuals, individualData = _b.individualData;
|
|
835
|
+
var data_state = (((individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) ? individuals : individualData) || {}).data_state;
|
|
836
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, state.data.verify.responseBody), { flows: flows }), (individualData && { user: individualData })), (data_state && {
|
|
837
|
+
individuals: __assign(__assign({}, individuals), { data_state: data_state })
|
|
838
|
+
}));
|
|
658
839
|
})
|
|
659
840
|
.addCase(updateBoardSuccess.pending, function (state) {
|
|
660
841
|
state.loading = true;
|
|
@@ -666,6 +847,6 @@ export var brandSlice = createSlice({
|
|
|
666
847
|
});
|
|
667
848
|
}
|
|
668
849
|
});
|
|
669
|
-
export var clearError = (_a = brandSlice.actions, _a.clearError), stopLoader = _a.stopLoader, resetOTPScreen = _a.resetOTPScreen;
|
|
850
|
+
export var clearError = (_a = brandSlice.actions, _a.clearError), stopLoader = _a.stopLoader, resetOTPScreen = _a.resetOTPScreen, uploadingBrandLogoStatus = _a.uploadingBrandLogoStatus, clearBrandLogo = _a.clearBrandLogo;
|
|
670
851
|
export default brandSlice.reducer;
|
|
671
852
|
export var brandSelector = function (state) { return state.brand; };
|