@tap-payments/auth-jsconnect 2.7.11-test → 2.7.11
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 +47 -4
- package/build/@types/app.js +22 -0
- package/build/@types/config.d.ts +4 -0
- package/build/@types/form.d.ts +11 -1
- package/build/@types/redux.d.ts +1 -0
- package/build/api/account.d.ts +4 -1
- package/build/api/account.js +15 -1
- package/build/api/auth.d.ts +35 -20
- package/build/api/auth.js +1 -1
- package/build/api/axios.js +1 -2
- package/build/api/data.d.ts +4 -17
- package/build/api/data.js +5 -45
- package/build/api/entity.d.ts +3 -2
- package/build/api/entity.js +12 -4
- package/build/api/firebase.js +68 -8
- package/build/api/index.d.ts +14 -25
- package/build/api/lead.d.ts +16 -3
- package/build/api/lead.js +16 -0
- package/build/api/user.d.ts +7 -0
- package/build/api/user.js +9 -1
- package/build/app/rootReducer.d.ts +1 -0
- package/build/app/rootReducer.js +3 -1
- package/build/app/settings.d.ts +1 -0
- package/build/app/settings.js +16 -11
- package/build/app/store.d.ts +2 -0
- package/build/assets/currencies/SARSymbol.d.ts +7 -0
- package/build/assets/currencies/SARSymbol.js +28 -0
- package/build/assets/currencies/index.d.ts +2 -0
- package/build/assets/currencies/index.js +2 -0
- package/build/assets/currencies/utils.d.ts +4 -0
- package/build/assets/currencies/utils.js +4 -0
- package/build/assets/locales/ar.json +358 -151
- package/build/assets/locales/en.json +354 -150
- package/build/components/AnimationFlow/AnimationFlow.d.ts +9 -5
- package/build/components/AnimationFlow/AnimationFlow.js +5 -5
- package/build/components/AnimationFlow/BottomSheet.d.ts +3 -1
- package/build/components/AnimationFlow/BottomSheet.js +42 -14
- package/build/components/AnimationFlow/Dialog.d.ts +4 -3
- package/build/components/AnimationFlow/Dialog.js +5 -3
- package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +1 -1
- package/build/components/ArabicDatePicker/ArabicDatePicker.js +2 -2
- package/build/components/ArabicDatePicker/style.css +32 -3
- package/build/components/DatePicker/DatePicker.d.ts +1 -1
- package/build/components/DatePicker/DatePicker.js +2 -2
- package/build/components/Footer/Footer.js +2 -1
- package/build/components/Input/Input.js +1 -1
- package/build/components/Providers/ThemeProvider.js +3 -3
- package/build/components/TextWithCurrency/TextWithCurrency.d.ts +7 -0
- package/build/components/TextWithCurrency/TextWithCurrency.js +14 -0
- package/build/components/TextWithCurrency/index.d.ts +2 -0
- package/build/components/TextWithCurrency/index.js +2 -0
- package/build/components/Tooltip/Tooltip.js +1 -1
- package/build/constants/api.d.ts +5 -7
- package/build/constants/api.js +11 -15
- package/build/constants/app.d.ts +41 -0
- package/build/constants/app.js +369 -36
- package/build/constants/assets.d.ts +7 -0
- package/build/constants/assets.js +11 -1
- package/build/constants/dummy.d.ts +4 -219
- package/build/constants/dummy.js +64 -6194
- package/build/constants/flows.d.ts +26 -0
- package/build/constants/flows.js +27 -0
- package/build/constants/index.d.ts +1 -0
- package/build/constants/index.js +1 -0
- package/build/constants/validation.d.ts +2 -0
- package/build/constants/validation.js +2 -0
- package/build/features/app/auth/authStore.d.ts +29 -8
- package/build/features/app/auth/authStore.js +495 -149
- package/build/features/app/bank/bankStore.d.ts +13 -18
- package/build/features/app/bank/bankStore.js +186 -153
- package/build/features/app/board/boardStore.d.ts +5 -1
- package/build/features/app/board/boardStore.js +82 -51
- package/build/features/app/brand/brandStore.d.ts +17 -33
- package/build/features/app/brand/brandStore.js +254 -257
- package/build/features/app/business/businessStore.d.ts +37 -15
- package/build/features/app/business/businessStore.js +443 -235
- package/build/features/app/connect/connectStore.d.ts +33 -5
- package/build/features/app/connect/connectStore.js +355 -120
- package/build/features/app/connectExpress/connectExpressStore.d.ts +64 -27
- package/build/features/app/connectExpress/connectExpressStore.js +826 -394
- package/build/features/app/entity/entityStore.d.ts +20 -36
- package/build/features/app/entity/entityStore.js +204 -238
- package/build/features/app/individual/individualStore.d.ts +18 -34
- package/build/features/app/individual/individualStore.js +269 -292
- package/build/features/app/kyc/kycStore.d.ts +67 -0
- package/build/features/app/kyc/kycStore.js +432 -0
- package/build/features/app/password/passwordStore.d.ts +33 -18
- package/build/features/app/password/passwordStore.js +260 -219
- package/build/features/app/signIn/signInStore.js +19 -15
- package/build/features/app/tax/taxStore.d.ts +13 -7
- package/build/features/app/tax/taxStore.js +170 -136
- package/build/features/auth/Auth.d.ts +5 -6
- package/build/features/auth/Auth.js +40 -15
- package/build/features/auth/screens/AccountNotFound/AccountNotFound.js +2 -5
- package/build/features/auth/screens/AuthSwitch/AuthSwitch.d.ts +5 -0
- package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +58 -0
- package/build/features/auth/screens/AuthSwitch/index.d.ts +3 -0
- package/build/features/auth/screens/AuthSwitch/index.js +2 -0
- package/build/features/auth/screens/AuthenticationList/AuthenticationList.js +2 -8
- package/build/features/auth/screens/AuthenticationList/LicenseNumber.js +2 -2
- package/build/features/auth/screens/BusinessCountry/BusinessCountry.js +8 -2
- package/build/features/auth/screens/CivilID/CivilID.js +4 -35
- package/build/features/auth/screens/{NID → DOB}/DOB.js +3 -3
- package/build/features/auth/screens/DOB/DOBForm.d.ts +5 -0
- package/build/features/auth/screens/DOB/DOBForm.js +59 -0
- package/build/features/auth/screens/DOB/index.d.ts +3 -0
- package/build/features/auth/screens/DOB/index.js +2 -0
- package/build/features/{connectExpress/screens/IdentityOTP → auth/screens/DOB}/validation.d.ts +4 -4
- package/build/features/auth/screens/DOB/validation.js +4 -0
- package/build/features/auth/screens/Email/Email.d.ts +5 -0
- package/build/features/auth/screens/Email/Email.js +57 -0
- package/build/features/auth/screens/Email/EmailField.d.ts +8 -0
- package/build/features/auth/screens/Email/EmailField.js +52 -0
- package/build/features/auth/screens/Email/index.d.ts +3 -0
- package/build/features/auth/screens/Email/index.js +2 -0
- package/build/features/auth/screens/Email/validation.d.ts +8 -0
- package/build/features/auth/screens/Email/validation.js +4 -0
- package/build/features/auth/screens/EmailSent/EmailSent.d.ts +5 -0
- package/build/features/auth/screens/EmailSent/EmailSent.js +79 -0
- package/build/features/auth/screens/EmailSent/index.d.ts +2 -0
- package/build/features/auth/screens/EmailSent/index.js +2 -0
- package/build/features/auth/screens/MigratingData/MigratingData.d.ts +5 -0
- package/build/features/auth/screens/MigratingData/MigratingData.js +44 -0
- package/build/features/auth/screens/MigratingData/index.d.ts +2 -0
- package/build/features/auth/screens/MigratingData/index.js +2 -0
- package/build/features/auth/screens/Mobile/Mobile.js +6 -38
- package/build/features/auth/screens/Mobile/MobileNumber.js +13 -15
- package/build/features/auth/screens/Mobile/validation.js +11 -3
- package/build/features/auth/screens/NID/IDNumber.js +1 -1
- package/build/features/auth/screens/NID/NID.js +7 -43
- package/build/features/auth/screens/NID/validation.d.ts +0 -3
- package/build/features/auth/screens/NID/validation.js +0 -1
- package/build/features/auth/screens/OTP/OTP.js +41 -10
- package/build/features/auth/screens/OTP/OTPInput.js +23 -6
- package/build/features/auth/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/auth/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/auth/screens/OperatorError/index.d.ts +3 -0
- package/build/features/auth/screens/OperatorError/index.js +2 -0
- package/build/features/auth/screens/Password/Password.d.ts +5 -0
- package/build/features/auth/screens/Password/Password.js +61 -0
- package/build/features/auth/screens/Password/PasswordField.d.ts +5 -0
- package/build/features/auth/screens/Password/PasswordField.js +28 -0
- package/build/features/auth/screens/Password/index.d.ts +3 -0
- package/build/features/auth/screens/Password/index.js +2 -0
- package/build/features/auth/screens/Password/validation.d.ts +8 -0
- package/build/features/auth/screens/Password/validation.js +4 -0
- package/build/features/auth/screens/PreparingData/PreparingData.js +3 -0
- package/build/features/auth/screens/ResetPasswordMessage/ResetPasswordMessage.d.ts +5 -0
- package/build/features/auth/screens/ResetPasswordMessage/ResetPasswordMessage.js +21 -0
- package/build/features/auth/screens/ResetPasswordMessage/index.d.ts +3 -0
- package/build/features/auth/screens/ResetPasswordMessage/index.js +2 -0
- package/build/features/auth/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
- package/build/features/auth/screens/VerifyNafath/VerifyNafath.js +35 -0
- package/build/features/auth/screens/VerifyNafath/index.d.ts +3 -0
- package/build/features/auth/screens/VerifyNafath/index.js +2 -0
- package/build/features/bank/Bank.d.ts +5 -1
- package/build/features/bank/Bank.js +22 -9
- package/build/features/bank/screens/BankDetails/BankDetails.js +18 -5
- package/build/features/bank/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/bank/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/bank/screens/OperatorError/index.d.ts +3 -0
- package/build/features/bank/screens/OperatorError/index.js +2 -0
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/bank/screens/Verify/Verify.js +7 -6
- package/build/features/board/Board.d.ts +2 -0
- package/build/features/board/Board.js +24 -13
- package/build/features/board/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/board/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/board/screens/OperatorError/index.d.ts +3 -0
- package/build/features/board/screens/OperatorError/index.js +2 -0
- package/build/features/board/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/board/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
- package/build/features/board/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/board/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -4
- package/build/features/board/screens/Verify/Verify.js +3 -2
- package/build/features/brand/Brand.d.ts +5 -1
- package/build/features/brand/Brand.js +22 -9
- package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +5 -5
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +48 -11
- package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +6 -6
- package/build/features/brand/screens/BrandActivities/CustomerBase.js +1 -1
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -5
- package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +4 -4
- package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -1
- package/build/features/brand/screens/BrandActivities/TAC.d.ts +1 -1
- package/build/features/brand/screens/BrandActivities/TAC.js +1 -1
- package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -1
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +22 -4
- package/build/features/brand/screens/BrandInfo/BrandName.js +2 -2
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +22 -6
- package/build/features/brand/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/brand/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/brand/screens/OperatorError/index.d.ts +3 -0
- package/build/features/brand/screens/OperatorError/index.js +2 -0
- package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/brand/screens/Verify/Verify.js +3 -2
- package/build/features/business/Business.js +20 -12
- package/build/features/business/screens/Activities/Activities.js +26 -9
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +4 -4
- package/build/features/business/screens/Activities/ActivitiesList.js +1 -1
- package/build/features/business/screens/Activities/OperationStartDate.d.ts +5 -3
- package/build/features/business/screens/Activities/OperationStartDate.js +2 -2
- package/build/features/business/screens/BrandDetails/SalesChannel.d.ts +2 -2
- package/build/features/business/screens/BusinessType/BusinessType.js +11 -3
- package/build/features/business/screens/BusinessType/LicenseNumber.js +3 -3
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +10 -8
- package/build/features/business/screens/Customers/CustomerLocations.js +5 -3
- package/build/features/business/screens/Customers/Customers.js +50 -10
- package/build/features/business/screens/Customers/ExpectedCustomers.d.ts +3 -1
- package/build/features/business/screens/Customers/ExpectedCustomers.js +5 -3
- package/build/features/business/screens/Customers/ExpectedSalesRange.d.ts +3 -1
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +7 -6
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +12 -5
- package/build/features/business/screens/Customers/RefundPolicy.js +13 -13
- package/build/features/business/screens/Customers/TransactionPolicy.d.ts +4 -1
- package/build/features/business/screens/Customers/TransactionPolicy.js +8 -5
- package/build/features/business/screens/Customers/validation.d.ts +6 -6
- package/build/features/business/screens/Customers/validation.js +3 -8
- package/build/features/business/screens/DOB/DOB.d.ts +6 -0
- package/build/features/business/screens/DOB/DOB.js +45 -0
- package/build/features/business/screens/DOB/DOBForm.d.ts +5 -0
- package/build/features/business/screens/DOB/DOBForm.js +72 -0
- package/build/features/business/screens/DOB/index.d.ts +3 -0
- package/build/features/business/screens/DOB/index.js +2 -0
- package/build/features/business/screens/DOB/validation.d.ts +8 -0
- package/build/features/business/screens/DOB/validation.js +4 -0
- package/build/features/business/screens/IDBOD/IDBOD.js +10 -2
- package/build/features/business/screens/IDBOD/validation.d.ts +0 -3
- package/build/features/business/screens/IDBOD/validation.js +0 -1
- package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
- package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.js +103 -0
- package/build/features/{connectExpress/screens/IdentityOTP/OTP.d.ts → business/screens/MobileOwnership/MobileNumber.d.ts} +0 -2
- package/build/features/business/screens/MobileOwnership/MobileNumber.js +72 -0
- package/build/features/business/screens/MobileOwnership/index.d.ts +2 -0
- package/build/features/business/screens/MobileOwnership/index.js +2 -0
- package/build/features/business/screens/MobileOwnership/validation.d.ts +8 -0
- package/build/features/business/screens/MobileOwnership/validation.js +38 -0
- package/build/features/business/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/business/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/business/screens/OperatorError/index.d.ts +3 -0
- package/build/features/business/screens/OperatorError/index.js +2 -0
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -3
- package/build/features/business/screens/Verify/Verify.js +15 -4
- package/build/features/business/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
- package/build/features/business/screens/VerifyNafath/VerifyNafath.js +35 -0
- package/build/features/business/screens/VerifyNafath/index.d.ts +3 -0
- package/build/features/business/screens/VerifyNafath/index.js +2 -0
- package/build/features/connect/Connect.d.ts +5 -1
- package/build/features/connect/Connect.js +16 -9
- package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +7 -1
- package/build/features/connect/screens/CivilID/CivilID.js +6 -1
- package/build/features/{auth/screens/NID → connect/screens/DOB}/DOB.d.ts +1 -2
- package/build/features/connect/screens/{NID → DOB}/DOB.js +2 -2
- package/build/features/connect/screens/DOB/DOBForm.d.ts +5 -0
- package/build/features/connect/screens/DOB/DOBForm.js +59 -0
- package/build/features/connect/screens/DOB/index.d.ts +3 -0
- package/build/features/connect/screens/DOB/index.js +2 -0
- package/build/features/connect/screens/DOB/validation.d.ts +8 -0
- package/build/features/connect/screens/DOB/validation.js +4 -0
- package/build/features/connect/screens/Individual/Email.js +1 -3
- package/build/features/connect/screens/Individual/Individual.js +11 -5
- package/build/features/connect/screens/Individual/MobileNumber.js +8 -7
- package/build/features/connect/screens/Individual/validation.js +11 -3
- package/build/features/connect/screens/Merchant/BrandName.js +2 -2
- package/build/features/connect/screens/Mobile/Mobile.js +12 -9
- package/build/features/connect/screens/Mobile/MobileNumber.js +8 -7
- package/build/features/connect/screens/Mobile/validation.js +11 -3
- package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
- package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.js +104 -0
- package/build/features/connect/screens/MobileOwnership/MobileNumber.d.ts +3 -0
- package/build/features/connect/screens/MobileOwnership/MobileNumber.js +72 -0
- package/build/features/connect/screens/MobileOwnership/index.d.ts +2 -0
- package/build/features/connect/screens/MobileOwnership/index.js +2 -0
- package/build/features/connect/screens/MobileOwnership/validation.d.ts +8 -0
- package/build/features/connect/screens/MobileOwnership/validation.js +38 -0
- package/build/features/connect/screens/NID/IDNumber.d.ts +1 -0
- package/build/features/connect/screens/NID/IDNumber.js +2 -2
- package/build/features/connect/screens/NID/NID.js +5 -11
- package/build/features/connect/screens/NID/validation.d.ts +0 -3
- package/build/features/connect/screens/NID/validation.js +0 -1
- package/build/features/connect/screens/OTP/OTP.js +6 -6
- package/build/features/connect/screens/OTP/OTPInput.js +3 -11
- package/build/features/connect/screens/OperatorError/OperatorError.js +1 -1
- package/build/features/connect/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
- package/build/features/connect/screens/VerifyNafath/VerifyNafath.js +35 -0
- package/build/features/connect/screens/VerifyNafath/index.d.ts +3 -0
- package/build/features/connect/screens/VerifyNafath/index.js +2 -0
- package/build/features/connectExpress/ConnectExpress.d.ts +5 -2
- package/build/features/connectExpress/ConnectExpress.js +62 -39
- package/build/features/connectExpress/screens/AuthenticationList/LicenseNumber.js +2 -2
- package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +7 -1
- package/build/features/connectExpress/screens/CivilID/CivilID.js +6 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.js +2 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +8 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +2 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +1 -1
- package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +30 -7
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +1 -3
- package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.js +9 -8
- package/build/features/connectExpress/screens/CollectIndividualInfo/validation.js +11 -3
- package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +14 -24
- package/build/features/connectExpress/screens/{NID → DOB}/DOB.d.ts +1 -2
- package/build/features/connectExpress/screens/{NID → DOB}/DOB.js +3 -3
- package/build/features/connectExpress/screens/DOB/DOBForm.d.ts +5 -0
- package/build/features/connectExpress/screens/DOB/DOBForm.js +63 -0
- package/build/features/connectExpress/screens/DOB/index.d.ts +3 -0
- package/build/features/connectExpress/screens/DOB/index.js +2 -0
- package/build/features/connectExpress/screens/DOB/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/DOB/validation.js +4 -0
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.d.ts +3 -0
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.js +9 -0
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.d.ts +2 -0
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.js +2 -0
- package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.d.ts +5 -0
- package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.js +35 -0
- package/build/features/connectExpress/screens/IdentityVerifyNafath/index.d.ts +3 -0
- package/build/features/connectExpress/screens/IdentityVerifyNafath/index.js +2 -0
- package/build/features/connectExpress/screens/Mobile/Mobile.js +10 -3
- package/build/features/connectExpress/screens/Mobile/MobileNumber.js +9 -8
- package/build/features/connectExpress/screens/Mobile/validation.js +21 -6
- package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
- package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.js +106 -0
- package/build/features/connectExpress/screens/MobileOwnership/MobileNumber.d.ts +3 -0
- package/build/features/connectExpress/screens/MobileOwnership/MobileNumber.js +72 -0
- package/build/features/connectExpress/screens/MobileOwnership/index.d.ts +2 -0
- package/build/features/connectExpress/screens/MobileOwnership/index.js +2 -0
- package/build/features/connectExpress/screens/MobileOwnership/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/MobileOwnership/validation.js +38 -0
- package/build/features/connectExpress/screens/NID/IDNumber.d.ts +1 -0
- package/build/features/connectExpress/screens/NID/IDNumber.js +2 -2
- package/build/features/connectExpress/screens/NID/NID.js +10 -10
- package/build/features/connectExpress/screens/NID/TAC.d.ts +1 -1
- package/build/features/connectExpress/screens/NID/TAC.js +2 -2
- package/build/features/connectExpress/screens/NID/validation.d.ts +0 -3
- package/build/features/connectExpress/screens/NID/validation.js +0 -2
- package/build/features/connectExpress/screens/NIDMissed/NID.js +3 -3
- package/build/features/connectExpress/screens/NIDMissed/validation.d.ts +0 -3
- package/build/features/connectExpress/screens/NIDMissed/validation.js +0 -1
- package/build/features/connectExpress/screens/OTP/OTP.js +13 -15
- package/build/features/connectExpress/screens/OTP/OTPInput.js +12 -10
- package/build/features/connectExpress/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/connectExpress/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/connectExpress/screens/OperatorError/index.d.ts +3 -0
- package/build/features/connectExpress/screens/OperatorError/index.js +2 -0
- package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.d.ts +5 -0
- package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.js +34 -0
- package/build/features/connectExpress/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/connectExpress/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +3 -3
- package/build/features/{business/screens/OTP → connectExpress/screens/VerifyMobileAuthOTP}/OTPInput.js +3 -3
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/VerifyMobileAuthOTP.d.ts +5 -0
- package/build/features/connectExpress/screens/{IdentityOTP/OTP.js → VerifyMobileAuthOTP/VerifyMobileAuthOTP.js} +22 -21
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.d.ts +3 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.js +2 -0
- package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
- package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.js +41 -0
- package/build/features/connectExpress/screens/VerifyNafath/index.d.ts +3 -0
- package/build/features/connectExpress/screens/VerifyNafath/index.js +2 -0
- package/build/features/entity/Entity.d.ts +4 -1
- package/build/features/entity/Entity.js +22 -9
- package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +4 -4
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +5 -5
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +5 -5
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +33 -9
- package/build/features/entity/screens/EntityName/EntityName.js +31 -14
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +5 -5
- package/build/features/entity/screens/EntityName/EntityTypeList.js +2 -3
- package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +2 -2
- package/build/features/entity/screens/EntityName/ExpiryDate.js +13 -8
- package/build/features/entity/screens/EntityName/IssuingDate.d.ts +2 -2
- package/build/features/entity/screens/EntityName/IssuingDate.js +15 -8
- package/build/features/entity/screens/EntityName/LegalName.js +1 -13
- package/build/features/entity/screens/EntityName/LicenseNumber.js +6 -8
- package/build/features/entity/screens/EntityName/UnifiedNumber.js +4 -6
- package/build/features/entity/screens/EntityName/validation.d.ts +3 -3
- package/build/features/entity/screens/EntityName/validation.js +1 -10
- package/build/features/entity/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/entity/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/entity/screens/OperatorError/index.d.ts +3 -0
- package/build/features/entity/screens/OperatorError/index.js +2 -0
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/entity/screens/Verify/Verify.js +3 -2
- package/build/features/featuresScreens.d.ts +1 -0
- package/build/features/featuresScreens.js +216 -13
- package/build/features/individual/Individual.d.ts +4 -1
- package/build/features/individual/Individual.js +22 -9
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +44 -11
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +2 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +4 -4
- package/build/features/individual/screens/IndividualList/Email.js +2 -3
- package/build/features/individual/screens/IndividualList/IndividualList.d.ts +4 -4
- package/build/features/individual/screens/IndividualList/IndividualList.js +18 -5
- package/build/features/individual/screens/IndividualList/MobileNumber.js +8 -10
- package/build/features/individual/screens/IndividualList/UserList.js +7 -7
- package/build/features/individual/screens/IndividualList/validation.js +11 -4
- package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +2 -2
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +73 -18
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +6 -5
- package/build/features/individual/screens/IndividualPersonalInfo/validation.js +11 -3
- package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.js +9 -11
- package/build/features/individual/screens/IndividualPhoneInfo/validation.js +11 -3
- package/build/features/individual/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/individual/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/individual/screens/OperatorError/index.d.ts +3 -0
- package/build/features/individual/screens/OperatorError/index.js +2 -0
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/individual/screens/Verify/Verify.js +3 -2
- package/build/features/kyc/KYC.d.ts +11 -0
- package/build/features/kyc/KYC.js +99 -0
- package/build/features/kyc/index.d.ts +1 -0
- package/build/features/kyc/index.js +1 -0
- package/build/features/kyc/screens/AlreadySubmitted/AlreadySubmitted.d.ts +5 -0
- package/build/features/kyc/screens/AlreadySubmitted/AlreadySubmitted.js +19 -0
- package/build/features/kyc/screens/AlreadySubmitted/index.d.ts +2 -0
- package/build/features/kyc/screens/AlreadySubmitted/index.js +2 -0
- package/build/features/kyc/screens/Loading/Loading.d.ts +4 -0
- package/build/features/kyc/screens/Loading/Loading.js +10 -0
- package/build/features/kyc/screens/Loading/index.d.ts +2 -0
- package/build/features/kyc/screens/Loading/index.js +2 -0
- package/build/features/kyc/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/kyc/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/kyc/screens/OperatorError/index.d.ts +2 -0
- package/build/features/kyc/screens/OperatorError/index.js +2 -0
- package/build/features/kyc/screens/Success/Success.d.ts +5 -0
- package/build/features/kyc/screens/Success/Success.js +32 -0
- package/build/features/kyc/screens/Success/index.d.ts +2 -0
- package/build/features/kyc/screens/Success/index.js +2 -0
- package/build/features/kyc/screens/Terms/Header.d.ts +6 -0
- package/build/features/kyc/screens/Terms/Header.js +36 -0
- package/build/features/kyc/screens/Terms/Terms.d.ts +4 -0
- package/build/features/kyc/screens/Terms/Terms.js +87 -0
- package/build/features/kyc/screens/Terms/index.d.ts +2 -0
- package/build/features/kyc/screens/Terms/index.js +2 -0
- package/build/features/kyc/screens/TokenError/TokenError.d.ts +5 -0
- package/build/features/kyc/screens/TokenError/TokenError.js +9 -0
- package/build/features/kyc/screens/TokenError/index.d.ts +2 -0
- package/build/features/kyc/screens/TokenError/index.js +2 -0
- package/build/features/kyc/screens/Users/Users.d.ts +3 -0
- package/build/features/kyc/screens/Users/Users.js +76 -0
- package/build/features/kyc/screens/Users/index.d.ts +2 -0
- package/build/features/kyc/screens/Users/index.js +2 -0
- package/build/features/kyc/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
- package/build/features/kyc/screens/VerifyNafath/VerifyNafath.js +45 -0
- package/build/features/kyc/screens/VerifyNafath/index.d.ts +3 -0
- package/build/features/kyc/screens/VerifyNafath/index.js +2 -0
- package/build/features/kyc/screens/VerifyPaci/VerifyPACI.d.ts +5 -0
- package/build/features/kyc/screens/VerifyPaci/VerifyPACI.js +44 -0
- package/build/features/kyc/screens/VerifyPaci/index.d.ts +3 -0
- package/build/features/kyc/screens/VerifyPaci/index.js +2 -0
- package/build/features/password/Password.d.ts +4 -1
- package/build/features/password/Password.js +88 -31
- package/build/features/password/screens/CreatePassword/CreatePassword.js +8 -4
- package/build/features/password/screens/OTP/OTP.js +3 -3
- package/build/features/password/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/password/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/password/screens/OperatorError/index.d.ts +3 -0
- package/build/features/password/screens/OperatorError/index.js +2 -0
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
- package/build/features/password/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/password/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/password/screens/Verify/Verify.js +7 -6
- package/build/features/shared/Address/CountryList.d.ts +5 -5
- package/build/features/shared/Address/InputSelect.d.ts +5 -5
- package/build/features/shared/Background/Background.js +1 -1
- package/build/features/shared/Background/LogoBackground.js +5 -17
- package/build/features/shared/BusinessCountry/BusinessCountry.js +1 -1
- package/build/features/shared/Button/Button.js +3 -1
- package/build/features/shared/Button/EmailProvidersButtons.js +2 -0
- package/build/features/shared/Button/FlowsButtons.js +18 -4
- package/build/features/shared/Button/NafathButton.d.ts +8 -0
- package/build/features/shared/Button/{AbsherButton.js → NafathButton.js} +12 -3
- package/build/features/shared/Button/index.d.ts +2 -2
- package/build/features/shared/Button/index.js +2 -2
- package/build/features/shared/Calender/Calender.d.ts +2 -1
- package/build/features/shared/Calender/Calender.js +3 -3
- package/build/features/shared/Containers/FeatureContainer.d.ts +2 -1
- package/build/features/shared/Containers/FeatureContainer.js +5 -3
- package/build/features/shared/Containers/ScreenContainer.d.ts +1 -1
- package/build/features/shared/Dialog/DialogContainer.js +5 -4
- package/build/features/shared/Input/Input.d.ts +3 -3
- package/build/features/shared/NafathVerification/NafathVerification.d.ts +14 -0
- package/build/features/shared/NafathVerification/NafathVerification.js +92 -0
- package/build/features/shared/NafathVerification/VerifyNafathLoading.d.ts +8 -0
- package/build/features/shared/NafathVerification/VerifyNafathLoading.js +53 -0
- package/build/features/shared/NafathVerification/VerifyNafathSuccess.d.ts +5 -0
- package/build/features/shared/NafathVerification/VerifyNafathSuccess.js +8 -0
- package/build/features/shared/NafathVerification/index.d.ts +2 -0
- package/build/features/shared/NafathVerification/index.js +2 -0
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +6 -1
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +10 -13
- package/build/features/shared/SuccessScreen/SuccessScreen.js +1 -1
- package/build/features/shared/UploadFile/FileUpload.d.ts +1 -1
- package/build/features/shared/UploadFile/UploadFile.d.ts +1 -1
- package/build/features/shared/UploadFile/UploadWrapper.d.ts +1 -1
- package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +1 -1
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +1 -1
- package/build/features/signIn/SignIn.js +18 -7
- package/build/features/signIn/screens/Mobile/MobileNumber.js +8 -7
- package/build/features/signIn/screens/Mobile/validation.js +11 -3
- package/build/features/signIn/screens/OTP/OTP.js +5 -4
- package/build/features/signIn/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/signIn/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/signIn/screens/OperatorError/index.d.ts +3 -0
- package/build/features/signIn/screens/OperatorError/index.js +2 -0
- package/build/features/tax/Tax.d.ts +4 -1
- package/build/features/tax/Tax.js +22 -9
- package/build/features/tax/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/tax/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/tax/screens/OperatorError/index.d.ts +3 -0
- package/build/features/tax/screens/OperatorError/index.js +2 -0
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +7 -2
- package/build/features/tax/screens/Verify/Verify.js +7 -6
- package/build/hooks/index.d.ts +3 -0
- package/build/hooks/index.js +3 -0
- package/build/hooks/useAppConfig.d.ts +1 -1
- package/build/hooks/useAppConfig.js +2 -2
- package/build/hooks/useAppDispatch.d.ts +1 -0
- package/build/hooks/useAppTheme.js +4 -3
- package/build/hooks/useCountDown.d.ts +10 -0
- package/build/hooks/useCountDown.js +17 -0
- package/build/hooks/useFormDirtyCheck.d.ts +10 -0
- package/build/hooks/useFormDirtyCheck.js +66 -0
- package/build/hooks/useSanitizedTranslation.d.ts +2 -0
- package/build/hooks/useSanitizedTranslation.js +15 -0
- package/build/hooks/useVerifyToken.d.ts +4 -2
- package/build/hooks/useVerifyToken.js +9 -4
- package/build/index.css +360 -120
- package/build/index.d.ts +3 -2
- package/build/index.js +4 -2
- package/build/theme/components.js +7 -0
- package/build/theme/palette.js +2 -1
- package/build/theme/shadows.js +1 -1
- package/build/theme/theme.d.ts +1 -1
- package/build/theme/theme.js +2 -2
- package/build/utils/array.js +2 -2
- package/build/utils/common.d.ts +1 -0
- package/build/utils/common.js +16 -3
- package/build/utils/error.d.ts +1 -0
- package/build/utils/error.js +3 -0
- package/build/utils/object.d.ts +1 -0
- package/build/utils/object.js +3 -0
- package/build/utils/string.d.ts +6 -2
- package/build/utils/string.js +28 -3
- package/build/utils/validation.d.ts +2 -0
- package/build/utils/validation.js +6 -0
- package/package.json +3 -4
- package/build/features/business/screens/OTP/OTP.d.ts +0 -8
- package/build/features/business/screens/OTP/OTP.js +0 -90
- package/build/features/business/screens/OTP/index.d.ts +0 -3
- package/build/features/business/screens/OTP/index.js +0 -2
- package/build/features/connectExpress/screens/IdentityOTP/OTPInput.d.ts +0 -5
- package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +0 -54
- package/build/features/connectExpress/screens/IdentityOTP/index.d.ts +0 -3
- package/build/features/connectExpress/screens/IdentityOTP/index.js +0 -2
- package/build/features/connectExpress/screens/IdentityOTP/validation.js +0 -4
- package/build/features/shared/Button/AbsherButton.d.ts +0 -8
- /package/build/features/{connect/screens/NID → auth/screens/DOB}/DOB.d.ts +0 -0
- /package/build/features/{business/screens/OTP → connectExpress/screens/VerifyMobileAuthOTP}/OTPInput.d.ts +0 -0
- /package/build/features/{business/screens/OTP → connectExpress/screens/VerifyMobileAuthOTP}/validation.d.ts +0 -0
- /package/build/features/{business/screens/OTP → connectExpress/screens/VerifyMobileAuthOTP}/validation.js +0 -0
|
@@ -62,14 +62,14 @@ import API from '../../../api';
|
|
|
62
62
|
import { FlowsTypes } from '../../../@types';
|
|
63
63
|
import { handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
|
|
64
64
|
import { BRAND_STEP_NAMES, EXPECTED_SALES_LIST } from '../../../constants';
|
|
65
|
-
import { hasNoneEditableValue, isKW, isTwitter, isWebsite, mapSalesChannel, retrieveIndividualData, sleep } from '../../../utils';
|
|
66
|
-
export var verifyLeadToken = createAsyncThunk('
|
|
65
|
+
import { hasNoneEditableValue, isKW, isTwitter, isWebsite, mapSalesChannel, retrieveIndividualData, sendCustomEventToGTM, sleep } from '../../../utils';
|
|
66
|
+
export var verifyLeadToken = createAsyncThunk('brand/verifyLeadToken', 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,
|
|
70
|
-
var
|
|
71
|
-
return __generator(this, function (
|
|
72
|
-
switch (
|
|
69
|
+
var payload, data, _b, config, brand_id, entity_id, board_id, country_code, publicKey, salesChannels, brandData, data_1;
|
|
70
|
+
var _c, _d, _e;
|
|
71
|
+
return __generator(this, function (_f) {
|
|
72
|
+
switch (_f.label) {
|
|
73
73
|
case 0:
|
|
74
74
|
payload = __assign({ service_name: 'tap_email', verify_token: token }, (isInternally && {
|
|
75
75
|
notification: {
|
|
@@ -78,67 +78,47 @@ export var verifyLeadToken = createAsyncThunk('brandVerifyLeadToken', function (
|
|
|
78
78
|
}));
|
|
79
79
|
return [4, API.leadService.verifyLeadToken(payload)];
|
|
80
80
|
case 1:
|
|
81
|
-
data = (
|
|
82
|
-
if ((data === null || data === void 0 ? void 0 : data.errors)
|
|
83
|
-
throw new Error(data.errors[0].description);
|
|
84
|
-
}
|
|
85
|
-
countryIso2 = data === null || data === void 0 ? void 0 : data.country_code;
|
|
86
|
-
if (countryIso2)
|
|
87
|
-
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
88
|
-
_b = data || {}, board_id = _b.id, board_info_id = _b.board_info_id, config = _b.config;
|
|
81
|
+
data = (_f.sent()).data;
|
|
82
|
+
if (((_c = data === null || data === void 0 ? void 0 : data.errors) === null || _c === void 0 ? void 0 : _c.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
|
|
83
|
+
throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
|
|
84
|
+
_b = data || {}, config = _b.config, brand_id = _b.brand_id, entity_id = _b.entity_id, board_id = _b.id, country_code = _b.country_code;
|
|
89
85
|
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
90
|
-
if (
|
|
86
|
+
if (country_code)
|
|
87
|
+
thunkApi.dispatch(handleSetCountryByIso2(country_code));
|
|
88
|
+
if (publicKey)
|
|
91
89
|
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
92
|
-
|
|
93
|
-
if (!board_id) {
|
|
94
|
-
throw new Error('Internal server error');
|
|
95
|
-
}
|
|
96
|
-
individualData = undefined;
|
|
90
|
+
brandData = undefined;
|
|
97
91
|
if (isInternally)
|
|
98
92
|
data.step_name = BRAND_STEP_NAMES.BRAND_INFO;
|
|
99
93
|
if (!(data.step_name !== BRAND_STEP_NAMES.PHONE_AUTH || isInternally)) return [3, 7];
|
|
100
|
-
if (!
|
|
101
|
-
return [4, API.boardService.
|
|
94
|
+
if (!(!brand_id || !country_code)) return [3, 3];
|
|
95
|
+
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
102
96
|
case 2:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
97
|
+
data_1 = _f.sent();
|
|
98
|
+
if (!country_code && ((_d = data_1 === null || data_1 === void 0 ? void 0 : data_1.entity) === null || _d === void 0 ? void 0 : _d.country))
|
|
99
|
+
thunkApi.dispatch(handleSetCountryByIso2(data_1.entity.country));
|
|
100
|
+
if (!((_e = data_1 === null || data_1 === void 0 ? void 0 : data_1.brand) === null || _e === void 0 ? void 0 : _e.id))
|
|
101
|
+
throw new Error('brand_id_missing');
|
|
102
|
+
brandData = data_1 === null || data_1 === void 0 ? void 0 : data_1.brand;
|
|
103
|
+
return [3, 5];
|
|
104
|
+
case 3: return [4, API.brandService.retrieveBrand(brand_id)];
|
|
106
105
|
case 4:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return [4, retrieveIndividualData(type_1, boardData, serviceCallBack)];
|
|
111
|
-
case 5:
|
|
112
|
-
_d = _j.sent(), boardRes = _d.boardRes, individualRes = _d.individualRes;
|
|
113
|
-
boardData = boardRes;
|
|
114
|
-
individualData = individualRes;
|
|
115
|
-
if (!countryIso2) {
|
|
116
|
-
countryIso2 = (_f = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _f === void 0 ? void 0 : _f.country;
|
|
117
|
-
if (countryIso2)
|
|
118
|
-
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
119
|
-
}
|
|
120
|
-
return [4, API.dataService.getChannelsOfServices({ page: 0 })];
|
|
106
|
+
brandData = _f.sent();
|
|
107
|
+
_f.label = 5;
|
|
108
|
+
case 5: return [4, API.dataService.getChannelsOfServices({ page: 0 })];
|
|
121
109
|
case 6:
|
|
122
|
-
salesChannels =
|
|
123
|
-
|
|
124
|
-
|
|
110
|
+
salesChannels = _f.sent();
|
|
111
|
+
if (isInternally)
|
|
112
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('BRAND_INFO_STEP')); });
|
|
113
|
+
else
|
|
114
|
+
thunkApi.dispatch(handleNextScreenStep('BRAND_INFO_STEP'));
|
|
115
|
+
_f.label = 7;
|
|
125
116
|
case 7: return [2, {
|
|
126
117
|
data: data,
|
|
127
|
-
|
|
128
|
-
boardResponse: {
|
|
129
|
-
user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
|
|
130
|
-
brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
|
|
131
|
-
entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
|
|
132
|
-
bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
|
|
133
|
-
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
134
|
-
name: (_g = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _g === void 0 ? void 0 : _g.names,
|
|
135
|
-
contact: (_h = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _h === void 0 ? void 0 : _h.contact,
|
|
136
|
-
individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
|
|
137
|
-
business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
|
|
138
|
-
notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification
|
|
139
|
-
},
|
|
118
|
+
brandData: brandData === null || brandData === void 0 ? void 0 : brandData.brand,
|
|
140
119
|
salesChannels: salesChannels,
|
|
141
|
-
token: token
|
|
120
|
+
token: token,
|
|
121
|
+
entityInfoId: entity_id
|
|
142
122
|
}];
|
|
143
123
|
}
|
|
144
124
|
});
|
|
@@ -161,78 +141,65 @@ export var resendOTP = createAsyncThunk('brandResendOTP', function (params, thun
|
|
|
161
141
|
}
|
|
162
142
|
});
|
|
163
143
|
}); });
|
|
164
|
-
export var verifyBrandLeadOTP = createAsyncThunk('
|
|
165
|
-
var _a, brand, settings, responseBody, payload, data, publicKey,
|
|
166
|
-
var _e, _f, _g, _h, _j
|
|
167
|
-
return __generator(this, function (
|
|
168
|
-
switch (
|
|
144
|
+
export var verifyBrandLeadOTP = createAsyncThunk('brand/verifyLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
145
|
+
var _a, brand, settings, responseBody, payload, data, publicKey, countryIso2, _b, brand_id, entity_id, boardId, brandData, data_2, salesChannels;
|
|
146
|
+
var _c, _d, _e, _f, _g, _h, _j;
|
|
147
|
+
return __generator(this, function (_k) {
|
|
148
|
+
switch (_k.label) {
|
|
169
149
|
case 0:
|
|
170
150
|
_a = thunkApi.getState(), brand = _a.brand, settings = _a.settings;
|
|
171
151
|
responseBody = brand.data.verify.responseBody;
|
|
172
152
|
payload = {
|
|
173
153
|
data: params.otp,
|
|
174
|
-
service_name: (
|
|
154
|
+
service_name: (_c = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _c === void 0 ? void 0 : _c.service_name,
|
|
175
155
|
verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
|
|
176
156
|
step_name: BRAND_STEP_NAMES.PHONE_AUTH,
|
|
177
157
|
encryption_contract: ['data']
|
|
178
158
|
};
|
|
179
159
|
return [4, API.leadService.verifyLeadOTP(payload)];
|
|
180
160
|
case 1:
|
|
181
|
-
data = (
|
|
182
|
-
if ((
|
|
161
|
+
data = (_k.sent()).data;
|
|
162
|
+
if ((_d = data.errors) === null || _d === void 0 ? void 0 : _d.length)
|
|
183
163
|
throw new Error(data.errors[0].description);
|
|
184
|
-
publicKey = (
|
|
185
|
-
|
|
164
|
+
publicKey = (_e = data === null || data === void 0 ? void 0 : data.config) === null || _e === void 0 ? void 0 : _e.public_key;
|
|
165
|
+
countryIso2 = (data === null || data === void 0 ? void 0 : data.country_code) || (responseBody === null || responseBody === void 0 ? void 0 : responseBody.country_code);
|
|
166
|
+
if (publicKey)
|
|
186
167
|
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
if (!board_info_id) return [3, 3];
|
|
194
|
-
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
168
|
+
if (countryIso2)
|
|
169
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
170
|
+
_b = data || {}, brand_id = _b.brand_id, entity_id = _b.entity_id, boardId = _b.id;
|
|
171
|
+
brandData = undefined;
|
|
172
|
+
if (!(!brand_id || !countryIso2)) return [3, 3];
|
|
173
|
+
return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
195
174
|
case 2:
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
175
|
+
data_2 = _k.sent();
|
|
176
|
+
if (!countryIso2 && ((_f = data_2 === null || data_2 === void 0 ? void 0 : data_2.entity) === null || _f === void 0 ? void 0 : _f.country))
|
|
177
|
+
thunkApi.dispatch(handleSetCountryByIso2(data_2.entity.country));
|
|
178
|
+
if (!((_g = data_2 === null || data_2 === void 0 ? void 0 : data_2.brand) === null || _g === void 0 ? void 0 : _g.id))
|
|
179
|
+
throw new Error('brand_id_missing');
|
|
180
|
+
brandData = data_2;
|
|
181
|
+
return [3, 5];
|
|
182
|
+
case 3: return [4, API.brandService.retrieveBrand(brand_id)];
|
|
199
183
|
case 4:
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
return [4, retrieveIndividualData(type, boardData, serviceCallBack)];
|
|
204
|
-
case 5:
|
|
205
|
-
_d = _o.sent(), boardRes = _d.boardRes, individualRes = _d.individualRes;
|
|
206
|
-
boardData = boardRes;
|
|
207
|
-
individualData = individualRes;
|
|
208
|
-
(_k = (_j = settings.data.appConfig).onStepCompleted) === null || _k === void 0 ? void 0 : _k.call(_j, settings.data.activeScreen.name, { otp: params.otp });
|
|
209
|
-
return [4, API.dataService.getChannelsOfServices({ page: 0 })];
|
|
184
|
+
brandData = _k.sent();
|
|
185
|
+
_k.label = 5;
|
|
186
|
+
case 5: return [4, API.dataService.getChannelsOfServices({ page: 0 })];
|
|
210
187
|
case 6:
|
|
211
|
-
salesChannels =
|
|
188
|
+
salesChannels = _k.sent();
|
|
189
|
+
(_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, { otp: params.otp });
|
|
212
190
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('BRAND_INFO_STEP')); });
|
|
213
191
|
return [2, {
|
|
214
192
|
data: data,
|
|
215
|
-
|
|
216
|
-
boardResponse: {
|
|
217
|
-
user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
|
|
218
|
-
brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
|
|
219
|
-
entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
|
|
220
|
-
bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
|
|
221
|
-
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
222
|
-
name: (_l = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _l === void 0 ? void 0 : _l.names,
|
|
223
|
-
contact: (_m = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _m === void 0 ? void 0 : _m.contact,
|
|
224
|
-
individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
|
|
225
|
-
business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
|
|
226
|
-
notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification
|
|
227
|
-
},
|
|
193
|
+
brandData: brandData === null || brandData === void 0 ? void 0 : brandData.brand,
|
|
228
194
|
salesChannels: salesChannels,
|
|
195
|
+
entityInfoId: entity_id,
|
|
229
196
|
formData: params
|
|
230
197
|
}];
|
|
231
198
|
}
|
|
232
199
|
});
|
|
233
200
|
}); });
|
|
234
201
|
export var retrieveSegmentDataList = createAsyncThunk('brandRetrieveSegmentDataList', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
235
|
-
var dataBody, _a,
|
|
202
|
+
var dataBody, _a, team, location, profit, tech;
|
|
236
203
|
return __generator(this, function (_b) {
|
|
237
204
|
switch (_b.label) {
|
|
238
205
|
case 0:
|
|
@@ -240,50 +207,64 @@ export var retrieveSegmentDataList = createAsyncThunk('brandRetrieveSegmentDataL
|
|
|
240
207
|
page: 0,
|
|
241
208
|
limit: 50
|
|
242
209
|
};
|
|
243
|
-
return [4,
|
|
244
|
-
API.dataService.getSegmentLocation(dataBody),
|
|
245
|
-
API.dataService.getSegmentProfit(dataBody),
|
|
246
|
-
API.dataService.getSegmentTech(dataBody)
|
|
247
|
-
])];
|
|
210
|
+
return [4, API.dataService.getSegments(dataBody)];
|
|
248
211
|
case 1:
|
|
249
|
-
_a = _b.sent(),
|
|
212
|
+
_a = _b.sent(), team = _a.team, location = _a.location, profit = _a.profit, tech = _a.tech;
|
|
250
213
|
return [2, {
|
|
251
|
-
segmentLocation:
|
|
252
|
-
segmentProfit:
|
|
253
|
-
segmentTech:
|
|
214
|
+
segmentLocation: (location === null || location === void 0 ? void 0 : location.list) || [],
|
|
215
|
+
segmentProfit: (profit === null || profit === void 0 ? void 0 : profit.list) || [],
|
|
216
|
+
segmentTech: (tech === null || tech === void 0 ? void 0 : tech.list) || [],
|
|
217
|
+
segmentTeam: (team === null || team === void 0 ? void 0 : team.list) || []
|
|
254
218
|
}];
|
|
255
219
|
}
|
|
256
220
|
});
|
|
257
221
|
}); });
|
|
258
|
-
export var retrieveBoardStatus = createAsyncThunk('brand/retrieveBoardStatus', function (
|
|
259
|
-
var brand, board_id, data;
|
|
260
|
-
return __generator(this, function (
|
|
261
|
-
switch (
|
|
222
|
+
export var retrieveBoardStatus = createAsyncThunk('brand/retrieveBoardStatus', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
223
|
+
var brand, _a, board_id, board_info_id, recipient, _b, id, type, data;
|
|
224
|
+
return __generator(this, function (_c) {
|
|
225
|
+
switch (_c.label) {
|
|
262
226
|
case 0:
|
|
263
227
|
brand = thunkApi.getState().brand;
|
|
264
|
-
|
|
265
|
-
|
|
228
|
+
_a = brand.data.verify.responseBody || {}, board_id = _a.board_id, board_info_id = _a.board_info_id, recipient = _a.recipient;
|
|
229
|
+
if (!board_id || !board_info_id)
|
|
230
|
+
throw new Error('Internal server error');
|
|
231
|
+
_b = recipient || {}, id = _b.id, type = _b.type;
|
|
232
|
+
return [4, Promise.all([
|
|
233
|
+
API.boardService.retrieveBoardInfoStatus(board_id),
|
|
234
|
+
thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
|
|
235
|
+
])];
|
|
266
236
|
case 1:
|
|
267
|
-
data =
|
|
237
|
+
data = (_c.sent())[0];
|
|
268
238
|
thunkApi.dispatch(handlePrevScreenStep());
|
|
269
239
|
return [2, { flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
|
|
270
240
|
}
|
|
271
241
|
});
|
|
272
242
|
}); });
|
|
273
|
-
export var retrieveBoardDetails = createAsyncThunk('
|
|
274
|
-
var
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
243
|
+
export var retrieveBoardDetails = createAsyncThunk('brand/retrieveBoardDetails', function (_a) {
|
|
244
|
+
var boardId = _a.boardId, id = _a.individualId, type = _a.individualType;
|
|
245
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
246
|
+
var data, individualData, boardData, serviceCallBack, _b, boardRes, individualRes;
|
|
247
|
+
var _c, _d, _e;
|
|
248
|
+
return __generator(this, function (_f) {
|
|
249
|
+
switch (_f.label) {
|
|
250
|
+
case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
251
|
+
case 1:
|
|
252
|
+
data = _f.sent();
|
|
253
|
+
individualData = data === null || data === void 0 ? void 0 : data.user;
|
|
254
|
+
boardData = data;
|
|
255
|
+
if (!(((_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.id) !== id)) return [3, 3];
|
|
256
|
+
serviceCallBack = function () { return API.individualService.retrieveIndividual(id, type); };
|
|
257
|
+
return [4, retrieveIndividualData(type, data, serviceCallBack)];
|
|
258
|
+
case 2:
|
|
259
|
+
_b = _f.sent(), boardRes = _b.boardRes, individualRes = _b.individualRes;
|
|
260
|
+
individualData = individualRes;
|
|
261
|
+
boardData = boardRes;
|
|
262
|
+
_f.label = 3;
|
|
263
|
+
case 3: return [2, __assign(__assign({}, boardData), { brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand, bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant, name: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _d === void 0 ? void 0 : _d.names, individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals, contact: (_e = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _e === void 0 ? void 0 : _e.contact, user: individualData, board_status: boardData === null || boardData === void 0 ? void 0 : boardData.status })];
|
|
264
|
+
}
|
|
265
|
+
});
|
|
285
266
|
});
|
|
286
|
-
});
|
|
267
|
+
});
|
|
287
268
|
export var checkBrandNameAvailability = createAsyncThunk('checkBrandNameAvailability', function (_a, thunkApi) {
|
|
288
269
|
var cancelToken = _a.cancelToken, name = _a.name, onSuccess = _a.onSuccess;
|
|
289
270
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -310,9 +291,9 @@ export var checkBrandNameAvailability = createAsyncThunk('checkBrandNameAvailabi
|
|
|
310
291
|
});
|
|
311
292
|
});
|
|
312
293
|
export var updateBrand = createAsyncThunk('brandUpdateBrand', function (_a, thunkApi) {
|
|
313
|
-
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
294
|
+
var formData = _a.formData, originalFormData = _a.originalFormData, isDirty = _a.isDirty;
|
|
314
295
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
315
|
-
var _b, settings, brand, brandRes, _c, id, data_status, isNameENNonEditable, isNameARNonEditable, isChannelServicesNonEditable, salesChannels, brandName, brandLogoId, getAddress, channel_services, brandNameIsEditable, requestBody,
|
|
296
|
+
var _b, settings, brand, brandRes, _c, id, data_status, isNameENNonEditable, isNameARNonEditable, isChannelServicesNonEditable, salesChannels, brandName, brandLogoId, brandData, getAddress, channel_services, brandNameIsEditable, requestBody, brand_1, _d, segmentLocation, segmentProfit, segmentTech, segmentTeam;
|
|
316
297
|
var _e, _f;
|
|
317
298
|
return __generator(this, function (_g) {
|
|
318
299
|
switch (_g.label) {
|
|
@@ -324,6 +305,7 @@ export var updateBrand = createAsyncThunk('brandUpdateBrand', function (_a, thun
|
|
|
324
305
|
isNameARNonEditable = hasNoneEditableValue(data_status, 'name.ar');
|
|
325
306
|
isChannelServicesNonEditable = hasNoneEditableValue(data_status, 'channel_services');
|
|
326
307
|
salesChannels = formData.salesChannels, brandName = formData.brandName, brandLogoId = formData.brandLogoId;
|
|
308
|
+
brandData = brandRes;
|
|
327
309
|
getAddress = function (value, isTwitter, isWeb) {
|
|
328
310
|
if (isTwitter)
|
|
329
311
|
return '@' + value.replaceAll('@', '');
|
|
@@ -350,21 +332,21 @@ export var updateBrand = createAsyncThunk('brandUpdateBrand', function (_a, thun
|
|
|
350
332
|
ar: !isNameARNonEditable ? brandName : undefined
|
|
351
333
|
}
|
|
352
334
|
})), { logo: brandLogoId, channel_services: channel_services });
|
|
335
|
+
if (!isDirty) return [3, 2];
|
|
353
336
|
return [4, API.brandService.updateBrandInfo(requestBody)];
|
|
354
337
|
case 1:
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
return [4, API.dataService.getTeamSize({ page: 0 })];
|
|
338
|
+
brand_1 = (_g.sent()).brand;
|
|
339
|
+
brandData = brand_1;
|
|
340
|
+
_g.label = 2;
|
|
341
|
+
case 2: return [4, thunkApi.dispatch(retrieveSegmentDataList()).unwrap()];
|
|
360
342
|
case 3:
|
|
361
|
-
|
|
343
|
+
_d = _g.sent(), segmentLocation = _d.segmentLocation, segmentProfit = _d.segmentProfit, segmentTech = _d.segmentTech, segmentTeam = _d.segmentTeam;
|
|
362
344
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
363
345
|
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, id);
|
|
364
346
|
return [2, {
|
|
365
347
|
data: __assign({}, brandData),
|
|
366
348
|
formData: originalFormData,
|
|
367
|
-
teamSizeList:
|
|
349
|
+
teamSizeList: segmentTeam,
|
|
368
350
|
segmentLocationList: segmentLocation,
|
|
369
351
|
segmentProfitList: segmentProfit,
|
|
370
352
|
segmentTechList: segmentTech
|
|
@@ -374,16 +356,16 @@ export var updateBrand = createAsyncThunk('brandUpdateBrand', function (_a, thun
|
|
|
374
356
|
});
|
|
375
357
|
});
|
|
376
358
|
export var updateSegmentBrand = createAsyncThunk('brandUpdateBrandSegment', function (_a, thunkApi) {
|
|
377
|
-
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
359
|
+
var formData = _a.formData, originalFormData = _a.originalFormData, isDirty = _a.isDirty;
|
|
378
360
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
379
|
-
var _b, settings, brand, brandRes,
|
|
380
|
-
var
|
|
361
|
+
var _b, settings, brand, _c, brandRes, entityInfoId, _d, id, data_status, isSegmentLocationNonEditable, isSegmentProfitNonEditable, isSegmentTechNonEditable, isSegmentTeamsNonEditable, segmentLocation, segmentProfit, segmentTech, teamSize, segmentLocationId, segmentProfitId, segmentTechId, teamSizeId, hasSegment, requestBody, entityData, brandData, brand_2, entity, activityList;
|
|
362
|
+
var _e, _f;
|
|
381
363
|
return __generator(this, function (_g) {
|
|
382
364
|
switch (_g.label) {
|
|
383
365
|
case 0:
|
|
384
366
|
_b = thunkApi.getState(), settings = _b.settings, brand = _b.brand;
|
|
385
|
-
|
|
386
|
-
|
|
367
|
+
_c = brand.data.verify.responseBody || {}, brandRes = _c.brand, entityInfoId = _c.entityInfoId;
|
|
368
|
+
_d = brandRes || {}, id = _d.id, data_status = _d.data_status;
|
|
387
369
|
isSegmentLocationNonEditable = hasNoneEditableValue(data_status, 'segment.location_type');
|
|
388
370
|
isSegmentProfitNonEditable = hasNoneEditableValue(data_status, 'segment.profit_type');
|
|
389
371
|
isSegmentTechNonEditable = hasNoneEditableValue(data_status, 'segment.tech_type');
|
|
@@ -397,29 +379,37 @@ export var updateSegmentBrand = createAsyncThunk('brandUpdateBrandSegment', func
|
|
|
397
379
|
requestBody = __assign({ id: id }, (hasSegment && {
|
|
398
380
|
segment: { location_type: segmentLocationId, profit_type: segmentProfitId, tech_type: segmentTechId, team: teamSizeId }
|
|
399
381
|
}));
|
|
382
|
+
entityData = undefined;
|
|
383
|
+
brandData = brandRes;
|
|
384
|
+
if (!isDirty) return [3, 2];
|
|
400
385
|
return [4, API.brandService.updateBrandInfo(requestBody)];
|
|
401
386
|
case 1:
|
|
402
|
-
|
|
403
|
-
|
|
387
|
+
brand_2 = (_g.sent()).brand;
|
|
388
|
+
brandData = brand_2;
|
|
389
|
+
_g.label = 2;
|
|
404
390
|
case 2:
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
return [4, thunkApi.dispatch(retrieveDataList())];
|
|
391
|
+
if (!entityInfoId) return [3, 4];
|
|
392
|
+
return [4, API.entityService.retrieveEntity(entityInfoId)];
|
|
408
393
|
case 3:
|
|
409
|
-
_g.sent();
|
|
410
|
-
|
|
411
|
-
|
|
394
|
+
entity = (_g.sent()).entity;
|
|
395
|
+
entityData = entity;
|
|
396
|
+
_g.label = 4;
|
|
397
|
+
case 4:
|
|
398
|
+
if (entityData === null || entityData === void 0 ? void 0 : entityData.activities) {
|
|
399
|
+
entityData = __assign(__assign({}, entityData), { entity_activities: entityData.activities });
|
|
412
400
|
}
|
|
413
|
-
if (!!activities) return [3,
|
|
401
|
+
if (!!(entityData === null || entityData === void 0 ? void 0 : entityData.activities)) return [3, 6];
|
|
414
402
|
return [4, API.dataService.getActivities()];
|
|
415
|
-
case 4:
|
|
416
|
-
activityList = (_g.sent()).list;
|
|
417
|
-
brandData = __assign(__assign({}, brandData), { entity_activities: activityList || {} });
|
|
418
|
-
_g.label = 5;
|
|
419
403
|
case 5:
|
|
404
|
+
activityList = (_g.sent()).list;
|
|
405
|
+
entityData = __assign(__assign({}, entityData), { entity_activities: activityList });
|
|
406
|
+
_g.label = 6;
|
|
407
|
+
case 6: return [4, thunkApi.dispatch(retrieveDataList())];
|
|
408
|
+
case 7:
|
|
409
|
+
_g.sent();
|
|
420
410
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
421
411
|
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, id);
|
|
422
|
-
return [2, { data: __assign({}, brandData),
|
|
412
|
+
return [2, { data: __assign({}, brandData), entityData: entityData, formData: originalFormData }];
|
|
423
413
|
}
|
|
424
414
|
});
|
|
425
415
|
});
|
|
@@ -436,15 +426,15 @@ export var retrieveEntityList = createAsyncThunk('retrieveEntityList', function
|
|
|
436
426
|
});
|
|
437
427
|
}); });
|
|
438
428
|
export var updateBrandActivities = createAsyncThunk('brandUpdateBrandActivities', function (_a, thunkApi) {
|
|
439
|
-
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
429
|
+
var formData = _a.formData, originalFormData = _a.originalFormData, isDirty = _a.isDirty;
|
|
440
430
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
441
|
-
var _b, settings, brand, _c, brandRes,
|
|
442
|
-
var _e, _f, _g
|
|
443
|
-
return __generator(this, function (
|
|
444
|
-
switch (
|
|
431
|
+
var _b, settings, brand, _c, brandRes, recipient, _d, data_status, id, brandActivities, terms, isActivitiesNonEditable, isCustomerBaseLocationNonEditable, isCustomerBaseNonEditable, isTermsNonEditable, isSalesRangeNonEditable, activities, customerLocations, expectedCustomer, expectedSale, termAndConditionChecked, refundPolicy, transactionPolicy, isTermsUndefined, isAllTermsAgreed, isTermsAvailable, brandData, removedActivities, payload, requestBody, customerLocation, customerBaseId, salesId, customerBase, brand_3;
|
|
432
|
+
var _e, _f, _g;
|
|
433
|
+
return __generator(this, function (_h) {
|
|
434
|
+
switch (_h.label) {
|
|
445
435
|
case 0:
|
|
446
436
|
_b = thunkApi.getState(), settings = _b.settings, brand = _b.brand;
|
|
447
|
-
_c = brand.data.verify.responseBody || {}, brandRes = _c.brand,
|
|
437
|
+
_c = brand.data.verify.responseBody || {}, brandRes = _c.brand, recipient = _c.recipient;
|
|
448
438
|
_d = brandRes || {}, data_status = _d.data_status, id = _d.id, brandActivities = _d.activities, terms = _d.terms;
|
|
449
439
|
isActivitiesNonEditable = hasNoneEditableValue(data_status, 'activities');
|
|
450
440
|
isCustomerBaseLocationNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.operations, 'customer_base_location');
|
|
@@ -455,9 +445,10 @@ export var updateBrandActivities = createAsyncThunk('brandUpdateBrandActivities'
|
|
|
455
445
|
isTermsUndefined = termAndConditionChecked === undefined && refundPolicy === undefined && transactionPolicy === undefined;
|
|
456
446
|
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;
|
|
457
447
|
isTermsAvailable = !(isTermsNonEditable && isTermsUndefined) && !isAllTermsAgreed;
|
|
448
|
+
brandData = brandRes;
|
|
458
449
|
removedActivities = (activities === null || activities === void 0 ? void 0 : activities.length) > 0 &&
|
|
459
450
|
(brandActivities || []).filter(function (brandActivity) { return !(activities || []).some(function (activity) { return activity.id === brandActivity.id; }); });
|
|
460
|
-
if (!(!isActivitiesNonEditable && (removedActivities === null || removedActivities === void 0 ? void 0 : removedActivities.length) > 0)) return [3, 2];
|
|
451
|
+
if (!(!isActivitiesNonEditable && (removedActivities === null || removedActivities === void 0 ? void 0 : removedActivities.length) > 0 && isDirty)) return [3, 2];
|
|
461
452
|
payload = {
|
|
462
453
|
id: id,
|
|
463
454
|
activities: removedActivities.map(function (a) { return ({
|
|
@@ -466,11 +457,11 @@ export var updateBrandActivities = createAsyncThunk('brandUpdateBrandActivities'
|
|
|
466
457
|
};
|
|
467
458
|
return [4, API.brandService.removeBrandActivity(payload)];
|
|
468
459
|
case 1:
|
|
469
|
-
|
|
470
|
-
|
|
460
|
+
_h.sent();
|
|
461
|
+
_h.label = 2;
|
|
471
462
|
case 2:
|
|
472
463
|
requestBody = __assign(__assign({ id: id, activities: isActivitiesNonEditable ? undefined : (activities || []).map(function (a) { return ({ id: a.id }); }) }, (isTermsAvailable && {
|
|
473
|
-
term_by:
|
|
464
|
+
term_by: recipient === null || recipient === void 0 ? void 0 : recipient.id,
|
|
474
465
|
term: ['general', 'refund', 'chargeback']
|
|
475
466
|
})), { step_name: BRAND_STEP_NAMES.BRAND_ACTIVITIES });
|
|
476
467
|
customerLocation = (customerLocations || []).map(function (location) { return ({
|
|
@@ -484,74 +475,84 @@ export var updateBrandActivities = createAsyncThunk('brandUpdateBrandActivities'
|
|
|
484
475
|
if (salesId && !isSalesRangeNonEditable) {
|
|
485
476
|
requestBody = __assign(__assign({}, requestBody), { operations: __assign(__assign({}, requestBody.operations), { sales: salesId }) });
|
|
486
477
|
}
|
|
478
|
+
if (!isDirty) return [3, 4];
|
|
487
479
|
return [4, API.brandService.updateBrandInfo(requestBody)];
|
|
488
480
|
case 3:
|
|
489
|
-
|
|
481
|
+
brand_3 = (_h.sent()).brand;
|
|
482
|
+
brandData = brand_3;
|
|
483
|
+
_h.label = 4;
|
|
484
|
+
case 4:
|
|
490
485
|
thunkApi.dispatch(handleNextScreenStep());
|
|
491
|
-
(
|
|
486
|
+
(_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, id);
|
|
492
487
|
return [2, { data: __assign({}, brandData), formData: originalFormData }];
|
|
493
488
|
}
|
|
494
489
|
});
|
|
495
490
|
});
|
|
496
491
|
});
|
|
497
492
|
export var retrieveDataList = createAsyncThunk('brandRetrieveDataList', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
498
|
-
var settings, countryISO2, dataBody,
|
|
499
|
-
|
|
500
|
-
|
|
493
|
+
var settings, countryISO2, dataBody, _a, customer_base, sales, expected_customers;
|
|
494
|
+
var _b;
|
|
495
|
+
return __generator(this, function (_c) {
|
|
496
|
+
switch (_c.label) {
|
|
501
497
|
case 0:
|
|
502
498
|
settings = thunkApi.getState().settings;
|
|
503
499
|
countryISO2 = settings.data.businessCountry.iso2;
|
|
504
500
|
dataBody = {
|
|
505
|
-
page: 0
|
|
506
|
-
};
|
|
507
|
-
salesDataBody = {
|
|
508
501
|
page: 0,
|
|
509
502
|
country_code: [countryISO2]
|
|
510
503
|
};
|
|
511
|
-
return [4,
|
|
512
|
-
API.dataService.getCustomerBases(dataBody),
|
|
513
|
-
API.dataService.getExpectedSales(salesDataBody),
|
|
514
|
-
API.dataService.getExpectedCustomerSales(dataBody)
|
|
515
|
-
])];
|
|
504
|
+
return [4, API.dataService.getBrandOperations(dataBody)];
|
|
516
505
|
case 1:
|
|
517
|
-
_a =
|
|
506
|
+
_a = _c.sent(), customer_base = _a.customer_base, sales = _a.sales, expected_customers = _a.expected_customers;
|
|
518
507
|
return [2, {
|
|
519
|
-
customerBases:
|
|
520
|
-
expectedSales: (
|
|
521
|
-
expectedCustomerSales:
|
|
508
|
+
customerBases: (customer_base === null || customer_base === void 0 ? void 0 : customer_base.list) || [],
|
|
509
|
+
expectedSales: ((_b = sales === null || sales === void 0 ? void 0 : sales.list) === null || _b === void 0 ? void 0 : _b.length) ? sales.list : EXPECTED_SALES_LIST,
|
|
510
|
+
expectedCustomerSales: (expected_customers === null || expected_customers === void 0 ? void 0 : expected_customers.list) || [],
|
|
522
511
|
countryISO2: countryISO2
|
|
523
512
|
}];
|
|
524
513
|
}
|
|
525
514
|
});
|
|
526
515
|
}); });
|
|
527
516
|
export var updateBoardSuccess = createAsyncThunk('updateBoardBrandSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
528
|
-
var _a, settings, brand, _b,
|
|
529
|
-
var
|
|
530
|
-
return __generator(this, function (
|
|
531
|
-
switch (
|
|
517
|
+
var _a, settings, brand, _b, board_id, infoId, _c, showBoard, mode, payload, data, _d, id, type, boardInfoStatusData;
|
|
518
|
+
var _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
519
|
+
return __generator(this, function (_p) {
|
|
520
|
+
switch (_p.label) {
|
|
532
521
|
case 0:
|
|
533
522
|
_a = thunkApi.getState(), settings = _a.settings, brand = _a.brand;
|
|
534
|
-
_b = brand.data.verify.responseBody || {},
|
|
535
|
-
|
|
523
|
+
_b = brand.data.verify.responseBody || {}, board_id = _b.board_id, infoId = _b.board_info_id;
|
|
524
|
+
_c = settings.data.appConfig, showBoard = _c.showBoard, mode = _c.mode;
|
|
525
|
+
if (!board_id)
|
|
536
526
|
return [2];
|
|
537
527
|
payload = {
|
|
538
528
|
lang: settings.data.language,
|
|
539
|
-
step_name: BRAND_STEP_NAMES.BRAND_SUCCESS
|
|
540
|
-
id: id
|
|
529
|
+
step_name: BRAND_STEP_NAMES.BRAND_SUCCESS
|
|
541
530
|
};
|
|
542
|
-
return [4, API.boardService.updateBoardInfo(__assign({ id:
|
|
531
|
+
return [4, API.boardService.updateBoardInfo(__assign({ id: board_id, infoId: infoId }, payload))];
|
|
543
532
|
case 1:
|
|
544
|
-
data =
|
|
545
|
-
|
|
533
|
+
data = _p.sent();
|
|
534
|
+
sendCustomEventToGTM({
|
|
535
|
+
event: 'Send Event',
|
|
536
|
+
event_category: 'Board Flows - Brand',
|
|
537
|
+
event_action: 'Brand Update Success Page',
|
|
538
|
+
event_label: settings.data.businessCountry.iso2
|
|
539
|
+
});
|
|
540
|
+
if (!showBoard && mode === 'content') {
|
|
541
|
+
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, {});
|
|
542
|
+
(_h = (_g = settings.data.appConfig).onFlowCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, { data: data });
|
|
543
|
+
return [2, { data: data }];
|
|
544
|
+
}
|
|
545
|
+
_d = ((_j = data === null || data === void 0 ? void 0 : data.notification) === null || _j === void 0 ? void 0 : _j.recipient) || {}, id = _d.id, type = _d.type;
|
|
546
|
+
return [4, Promise.all([
|
|
547
|
+
API.boardService.retrieveBoardInfoStatus(board_id),
|
|
548
|
+
thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
|
|
549
|
+
])];
|
|
546
550
|
case 2:
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
_g.sent();
|
|
551
|
-
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, {});
|
|
552
|
-
(_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
|
|
551
|
+
boardInfoStatusData = (_p.sent())[0];
|
|
552
|
+
(_l = (_k = settings.data.appConfig).onStepCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, settings.data.activeScreen.name, {});
|
|
553
|
+
(_o = (_m = settings.data.appConfig).onFlowCompleted) === null || _o === void 0 ? void 0 : _o.call(_m, { data: data });
|
|
553
554
|
thunkApi.dispatch(handleNextScreenStep());
|
|
554
|
-
return [2, {
|
|
555
|
+
return [2, { data: data, flows: (boardInfoStatusData === null || boardInfoStatusData === void 0 ? void 0 : boardInfoStatusData.info) || [] }];
|
|
555
556
|
}
|
|
556
557
|
});
|
|
557
558
|
}); });
|
|
@@ -577,7 +578,6 @@ var initialState = {
|
|
|
577
578
|
uploadingBrandLogo: false,
|
|
578
579
|
data: {
|
|
579
580
|
flowName: FlowsTypes.BRAND,
|
|
580
|
-
currency: '',
|
|
581
581
|
verify: {
|
|
582
582
|
token: ''
|
|
583
583
|
},
|
|
@@ -633,22 +633,18 @@ export var brandSlice = createSlice({
|
|
|
633
633
|
state.customLoading = true;
|
|
634
634
|
})
|
|
635
635
|
.addCase(verifyLeadToken.fulfilled, function (state, action) {
|
|
636
|
-
var _a, _b;
|
|
636
|
+
var _a, _b, _c;
|
|
637
637
|
state.error = null;
|
|
638
638
|
state.customLoading = false;
|
|
639
|
-
var
|
|
640
|
-
var brand = boardResponse.brand, entity = boardResponse.entity;
|
|
639
|
+
var _d = action.payload, data = _d.data, brand = _d.brandData, token = _d.token, salesChannels = _d.salesChannels, entityInfoId = _d.entityInfoId;
|
|
641
640
|
state.data.brandData.brandName = (((_a = brand === null || brand === void 0 ? void 0 : brand.name) === null || _a === void 0 ? void 0 : _a.en) || '').trim();
|
|
642
|
-
(_b = brand === null || brand === void 0 ? void 0 : brand.terms) === null || _b === void 0 ? void 0 : _b.
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
state.data.brandActivities.refundPolicy = element.agree;
|
|
647
|
-
}
|
|
648
|
-
});
|
|
641
|
+
var termFlag = ((_c = (_b = brand === null || brand === void 0 ? void 0 : brand.terms) === null || _b === void 0 ? void 0 : _b.find(function (element) { return (element === null || element === void 0 ? void 0 : element.term) === 'general'; })) === null || _c === void 0 ? void 0 : _c.agree) || false;
|
|
642
|
+
state.data.brandActivities.termAndConditionChecked = termFlag;
|
|
643
|
+
state.data.brandActivities.transactionPolicy = termFlag;
|
|
644
|
+
state.data.brandActivities.refundPolicy = termFlag;
|
|
649
645
|
var mappedSalesChannels = mapSalesChannel((brand === null || brand === void 0 ? void 0 : brand.channel_services) || []);
|
|
650
646
|
state.data.brandData.salesChannels = mappedSalesChannels;
|
|
651
|
-
state.data.verify.responseBody = __assign(__assign(__assign(
|
|
647
|
+
state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { brand: brand, board_id: data.id, channel_list: (salesChannels === null || salesChannels === void 0 ? void 0 : salesChannels.list) || [], salesChannels: mappedSalesChannels, entityInfoId: entityInfoId });
|
|
652
648
|
state.data.verify.token = token;
|
|
653
649
|
})
|
|
654
650
|
.addCase(verifyLeadToken.rejected, function (state, action) {
|
|
@@ -671,24 +667,20 @@ export var brandSlice = createSlice({
|
|
|
671
667
|
state.error = null;
|
|
672
668
|
})
|
|
673
669
|
.addCase(verifyBrandLeadOTP.fulfilled, function (state, action) {
|
|
674
|
-
var _a, _b;
|
|
670
|
+
var _a, _b, _c;
|
|
675
671
|
state.loading = false;
|
|
676
672
|
state.error = null;
|
|
677
|
-
var
|
|
678
|
-
var brand = boardResponse.brand, entity = boardResponse.entity;
|
|
673
|
+
var _d = action.payload, data = _d.data, brand = _d.brandData, formData = _d.formData, salesChannels = _d.salesChannels, entityInfoId = _d.entityInfoId;
|
|
679
674
|
state.data.otpData = formData;
|
|
680
675
|
state.data.otpData.responseBody = data;
|
|
681
676
|
state.data.brandData.brandName = (((_a = brand === null || brand === void 0 ? void 0 : brand.name) === null || _a === void 0 ? void 0 : _a.en) || '').trim();
|
|
682
677
|
var mappedSalesChannels = mapSalesChannel((brand === null || brand === void 0 ? void 0 : brand.channel_services) || []);
|
|
683
678
|
state.data.brandData.salesChannels = mappedSalesChannels;
|
|
684
|
-
(_b = brand === null || brand === void 0 ? void 0 : brand.terms) === null || _b === void 0 ? void 0 : _b.
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
}
|
|
690
|
-
});
|
|
691
|
-
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 });
|
|
679
|
+
var termFlag = ((_c = (_b = brand === null || brand === void 0 ? void 0 : brand.terms) === null || _b === void 0 ? void 0 : _b.find(function (element) { return (element === null || element === void 0 ? void 0 : element.term) === 'general'; })) === null || _c === void 0 ? void 0 : _c.agree) || false;
|
|
680
|
+
state.data.brandActivities.termAndConditionChecked = termFlag;
|
|
681
|
+
state.data.brandActivities.transactionPolicy = termFlag;
|
|
682
|
+
state.data.brandActivities.refundPolicy = termFlag;
|
|
683
|
+
state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { brand: brand, board_id: data.id, channel_list: (salesChannels === null || salesChannels === void 0 ? void 0 : salesChannels.list) || [], salesChannels: mappedSalesChannels, entityInfoId: entityInfoId });
|
|
692
684
|
})
|
|
693
685
|
.addCase(verifyBrandLeadOTP.rejected, function (state, action) {
|
|
694
686
|
state.loading = false;
|
|
@@ -717,27 +709,32 @@ export var brandSlice = createSlice({
|
|
|
717
709
|
var _a = action.payload, data = _a.data, formData = _a.formData, segmentLocationList = _a.segmentLocationList, segmentProfitList = _a.segmentProfitList, segmentTechList = _a.segmentTechList, teamSizeList = _a.teamSizeList;
|
|
718
710
|
var segment = data.segment;
|
|
719
711
|
state.data.brandData = formData;
|
|
720
|
-
var selectedSegmentLocation = segmentLocationList === null || segmentLocationList === void 0 ? void 0 : segmentLocationList.find(function (location) {
|
|
712
|
+
var selectedSegmentLocation = (segmentLocationList === null || segmentLocationList === void 0 ? void 0 : segmentLocationList.find(function (location) {
|
|
721
713
|
var _a;
|
|
722
714
|
return location.id === ((_a = segment === null || segment === void 0 ? void 0 : segment.location_type) === null || _a === void 0 ? void 0 : _a.id);
|
|
723
|
-
});
|
|
724
|
-
var selectedSegmentProfit = segmentProfitList === null || segmentProfitList === void 0 ? void 0 : segmentProfitList.find(function (profit) {
|
|
715
|
+
})) || (segmentLocationList === null || segmentLocationList === void 0 ? void 0 : segmentLocationList[0]);
|
|
716
|
+
var selectedSegmentProfit = (segmentProfitList === null || segmentProfitList === void 0 ? void 0 : segmentProfitList.find(function (profit) {
|
|
725
717
|
var _a;
|
|
726
718
|
return profit.id === ((_a = segment === null || segment === void 0 ? void 0 : segment.profit_type) === null || _a === void 0 ? void 0 : _a.id);
|
|
727
|
-
});
|
|
728
|
-
var selectedSegmentTech = segmentTechList === null || segmentTechList === void 0 ? void 0 : segmentTechList.find(function (tech) {
|
|
719
|
+
})) || (segmentProfitList === null || segmentProfitList === void 0 ? void 0 : segmentProfitList[0]);
|
|
720
|
+
var selectedSegmentTech = (segmentTechList === null || segmentTechList === void 0 ? void 0 : segmentTechList.find(function (tech) {
|
|
729
721
|
var _a;
|
|
730
722
|
return tech.id === ((_a = segment === null || segment === void 0 ? void 0 : segment.tech_type) === null || _a === void 0 ? void 0 : _a.id);
|
|
731
|
-
});
|
|
723
|
+
})) || (segmentTechList === null || segmentTechList === void 0 ? void 0 : segmentTechList[1]);
|
|
732
724
|
var selectedTeamSize = teamSizeList === null || teamSizeList === void 0 ? void 0 : teamSizeList.find(function (team) {
|
|
733
725
|
var _a;
|
|
734
726
|
return team.id === ((_a = segment === null || segment === void 0 ? void 0 : segment.team) === null || _a === void 0 ? void 0 : _a.id);
|
|
735
727
|
});
|
|
736
|
-
state.data.brandSegmentData.segmentLocation = selectedSegmentLocation
|
|
737
|
-
state.data.brandSegmentData.segmentProfit = selectedSegmentProfit
|
|
738
|
-
state.data.brandSegmentData.segmentTech = selectedSegmentTech
|
|
728
|
+
state.data.brandSegmentData.segmentLocation = selectedSegmentLocation;
|
|
729
|
+
state.data.brandSegmentData.segmentProfit = selectedSegmentProfit;
|
|
730
|
+
state.data.brandSegmentData.segmentTech = selectedSegmentTech;
|
|
739
731
|
state.data.brandSegmentData.teamSize = selectedTeamSize;
|
|
740
|
-
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { teamSizeList: teamSizeList, segmentLocationList: segmentLocationList, segmentProfitList: segmentProfitList, segmentTechList: segmentTechList
|
|
732
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { brand: data, teamSizeList: teamSizeList, segmentLocationList: segmentLocationList, segmentProfitList: segmentProfitList, segmentTechList: segmentTechList, segmentDefaultValues: {
|
|
733
|
+
segmentLocation: selectedSegmentLocation,
|
|
734
|
+
segmentProfit: selectedSegmentProfit,
|
|
735
|
+
segmentTech: selectedSegmentTech,
|
|
736
|
+
teamSize: selectedTeamSize
|
|
737
|
+
} });
|
|
741
738
|
})
|
|
742
739
|
.addCase(updateBrand.rejected, function (state, action) {
|
|
743
740
|
state.loading = false;
|
|
@@ -751,14 +748,13 @@ export var brandSlice = createSlice({
|
|
|
751
748
|
var _a;
|
|
752
749
|
state.loading = false;
|
|
753
750
|
state.error = null;
|
|
754
|
-
var _b = action.payload, data = _b.data,
|
|
755
|
-
var
|
|
751
|
+
var _b = action.payload, data = _b.data, entityData = _b.entityData, formData = _b.formData;
|
|
752
|
+
var activities = data.activities, operations = data.operations, terms = data.terms;
|
|
753
|
+
var entity_activities = (entityData || {}).entity_activities;
|
|
756
754
|
var selectedActivity = entity_activities === null || entity_activities === void 0 ? void 0 : entity_activities.filter(function (activity) {
|
|
757
755
|
return activities === null || activities === void 0 ? void 0 : activities.find(function (value) { return activity.id === value.id; });
|
|
758
756
|
});
|
|
759
757
|
state.data.brandSegmentData = formData;
|
|
760
|
-
if ((_a = currencyData === null || currencyData === void 0 ? void 0 : currencyData.code) === null || _a === void 0 ? void 0 : _a.english)
|
|
761
|
-
state.data.currency = currencyData.code.english;
|
|
762
758
|
state.data.brandActivities.activities = (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : [];
|
|
763
759
|
var _c = operations || {}, customer_base = _c.customer_base, sales = _c.sales;
|
|
764
760
|
var _d = customer_base || {}, locations = _d.locations, customerBase = __rest(_d, ["locations"]);
|
|
@@ -768,14 +764,19 @@ export var brandSlice = createSlice({
|
|
|
768
764
|
state.data.brandActivities.expectedSale = sales;
|
|
769
765
|
if (!!customerBase)
|
|
770
766
|
state.data.brandActivities.expectedCustomer = customerBase;
|
|
771
|
-
terms === null || terms === void 0 ? void 0 : terms.
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
767
|
+
var termFlag = ((_a = terms === null || terms === void 0 ? void 0 : terms.find(function (element) { return (element === null || element === void 0 ? void 0 : element.term) === 'general'; })) === null || _a === void 0 ? void 0 : _a.agree) || false;
|
|
768
|
+
state.data.brandActivities.termAndConditionChecked = termFlag;
|
|
769
|
+
state.data.brandActivities.transactionPolicy = termFlag;
|
|
770
|
+
state.data.brandActivities.refundPolicy = termFlag;
|
|
771
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, state.data.verify.responseBody), { activities: entity_activities }), (entityData && { entity: entityData })), { activitiesDefaultValues: {
|
|
772
|
+
activities: selectedActivity,
|
|
773
|
+
customerLocations: locations,
|
|
774
|
+
expectedSale: sales,
|
|
775
|
+
expectedCustomer: customerBase,
|
|
776
|
+
termAndConditionChecked: termFlag,
|
|
777
|
+
transactionPolicy: termFlag,
|
|
778
|
+
refundPolicy: termFlag
|
|
779
|
+
}, segmentDefaultValues: formData });
|
|
779
780
|
})
|
|
780
781
|
.addCase(updateSegmentBrand.rejected, function (state, action) {
|
|
781
782
|
state.loading = false;
|
|
@@ -829,7 +830,7 @@ export var brandSlice = createSlice({
|
|
|
829
830
|
.addCase(retrieveBoardDetails.fulfilled, function (state, action) {
|
|
830
831
|
state.error = null;
|
|
831
832
|
state.loading = false;
|
|
832
|
-
var data =
|
|
833
|
+
var data = action.payload || {};
|
|
833
834
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
834
835
|
})
|
|
835
836
|
.addCase(retrieveBoardDetails.rejected, function (state, action) {
|
|
@@ -843,7 +844,7 @@ export var brandSlice = createSlice({
|
|
|
843
844
|
.addCase(retrieveBoardStatus.fulfilled, function (state, action) {
|
|
844
845
|
state.error = null;
|
|
845
846
|
state.loading = false;
|
|
846
|
-
var flows = action.payload.flows;
|
|
847
|
+
var flows = (action.payload || {}).flows;
|
|
847
848
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows });
|
|
848
849
|
})
|
|
849
850
|
.addCase(retrieveBoardStatus.rejected, function (state, action) {
|
|
@@ -854,12 +855,8 @@ export var brandSlice = createSlice({
|
|
|
854
855
|
var _a;
|
|
855
856
|
state.loading = false;
|
|
856
857
|
state.error = null;
|
|
857
|
-
var
|
|
858
|
-
|
|
859
|
-
var data_state = (((individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) ? individuals : individualData) || {}).data_state;
|
|
860
|
-
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, state.data.verify.responseBody), { flows: flows }), (individualData && { user: individualData })), (data_state && {
|
|
861
|
-
individuals: __assign(__assign({}, individuals), { data_state: data_state })
|
|
862
|
-
}));
|
|
858
|
+
var _b = action.payload || {}, flows = _b.flows, data = _b.data;
|
|
859
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, recipient: (_a = data === null || data === void 0 ? void 0 : data.notification) === null || _a === void 0 ? void 0 : _a.recipient });
|
|
863
860
|
})
|
|
864
861
|
.addCase(updateBoardSuccess.pending, function (state) {
|
|
865
862
|
state.loading = true;
|