@tap-payments/auth-jsconnect 2.0.43-test → 2.0.43
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 +50 -20
- package/build/@types/app.js +9 -3
- package/build/@types/form.d.ts +21 -12
- package/build/api/auth.d.ts +28 -5
- package/build/api/auth.js +36 -1
- package/build/api/axios.js +2 -2
- package/build/api/brand.d.ts +2 -1
- package/build/api/brand.js +10 -1
- package/build/api/country.d.ts +3 -1
- package/build/api/country.js +3 -1
- package/build/api/data.d.ts +38 -7
- package/build/api/data.js +57 -17
- package/build/api/entity.d.ts +51 -5
- package/build/api/entity.js +39 -9
- package/build/api/firebase.d.ts +1 -1
- package/build/api/firebase.js +3 -1
- package/build/api/index.d.ts +44 -14
- package/build/api/individual.d.ts +76 -19
- package/build/api/individual.js +29 -2
- package/build/api/lead.d.ts +9 -6
- package/build/api/lead.js +8 -1
- package/build/app/rootReducer.d.ts +0 -1
- package/build/app/rootReducer.js +0 -2
- package/build/app/settings.d.ts +9 -2
- package/build/app/settings.js +22 -11
- package/build/app/store.d.ts +0 -2
- package/build/assets/locales/ar.json +258 -183
- package/build/assets/locales/en.json +190 -108
- package/build/components/AnimationFlow/AnimationFlow.d.ts +4 -1
- package/build/components/AnimationFlow/AnimationFlow.js +6 -8
- package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
- package/build/components/AnimationFlow/BottomSheet.js +4 -3
- package/build/components/AnimationFlow/Dialog.d.ts +4 -1
- package/build/components/AnimationFlow/Dialog.js +5 -3
- package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +13 -0
- package/build/components/ArabicDatePicker/ArabicDatePicker.js +94 -0
- package/build/components/ArabicDatePicker/index.d.ts +2 -0
- package/build/components/ArabicDatePicker/index.js +2 -0
- package/build/components/ArabicDatePicker/style.css +24 -0
- package/build/components/FileInput/DragAndDrop.d.ts +10 -1
- package/build/components/FileInput/DragAndDrop.js +108 -8
- package/build/components/Lottie/Lottie.d.ts +878 -0
- package/build/components/Lottie/Lottie.js +58 -0
- package/build/components/Lottie/files/pulsating_circle_waves.json +236 -0
- package/build/components/Lottie/files/success.json +425 -0
- package/build/components/Lottie/index.d.ts +3 -0
- package/build/components/Lottie/index.js +3 -0
- package/build/components/OTPField/OTPField.d.ts +2 -1
- package/build/components/OTPField/OTPField.js +2 -2
- package/build/components/OTPTimer/OTPTimer.js +1 -1
- package/build/components/ProgressBar/CircularProgressBar.d.ts +14 -0
- package/build/components/ProgressBar/CircularProgressBar.js +48 -0
- package/build/components/ProgressBar/index.d.ts +2 -0
- package/build/components/ProgressBar/index.js +2 -0
- package/build/components/RadioLabel/RadioLabel.d.ts +2 -1
- package/build/components/RadioLabel/RadioLabel.js +2 -2
- package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +2 -6
- package/build/components/SocialMediaGroup/SocialMediaGroup.js +4 -49
- package/build/constants/api.d.ts +6 -0
- package/build/constants/api.js +14 -1
- package/build/constants/app.d.ts +5 -5
- package/build/constants/app.js +62 -32
- package/build/constants/assets.d.ts +14 -0
- package/build/constants/assets.js +16 -2
- package/build/constants/dummy.d.ts +1 -1
- package/build/constants/dummy.js +2 -2
- package/build/constants/validation.d.ts +10 -0
- package/build/constants/validation.js +11 -1
- package/build/features/app/auth/authStore.d.ts +30 -4
- package/build/features/app/auth/authStore.js +182 -20
- package/build/features/app/bank/bankStore.d.ts +16 -0
- package/build/features/app/bank/bankStore.js +88 -41
- package/build/features/app/business/businessStore.d.ts +33 -5
- package/build/features/app/business/businessStore.js +487 -350
- package/build/features/app/connect/connectStore.d.ts +34 -31
- package/build/features/app/connect/connectStore.js +427 -300
- package/build/features/app/entity/entityStore.d.ts +40 -8
- package/build/features/app/entity/entityStore.js +387 -149
- package/build/features/app/individual/individualStore.d.ts +18 -0
- package/build/features/app/individual/individualStore.js +168 -89
- package/build/features/app/password/passwordStore.d.ts +1 -7
- package/build/features/app/password/passwordStore.js +31 -20
- package/build/features/app/tax/taxStore.js +23 -16
- package/build/features/auth/Auth.d.ts +2 -1
- package/build/features/auth/Auth.js +37 -9
- package/build/features/auth/screens/NID/DOB.d.ts +7 -0
- package/build/features/auth/screens/NID/DOB.js +47 -0
- package/build/features/auth/screens/NID/IDNumber.d.ts +3 -0
- package/build/features/auth/screens/NID/IDNumber.js +64 -0
- package/build/features/auth/screens/NID/NID.d.ts +5 -0
- package/build/features/auth/screens/NID/NID.js +68 -0
- package/build/features/auth/screens/NID/TAC.d.ts +3 -0
- package/build/features/auth/screens/NID/TAC.js +87 -0
- package/build/features/auth/screens/NID/index.d.ts +3 -0
- package/build/features/auth/screens/NID/index.js +2 -0
- package/build/features/auth/screens/NID/validation.d.ts +27 -0
- package/build/features/auth/screens/NID/validation.js +19 -0
- package/build/features/auth/screens/OTP/OTP.js +8 -4
- package/build/features/auth/screens/OTP/OTPInput.js +9 -2
- package/build/features/bank/Bank.js +4 -4
- package/build/features/bank/screens/BankDetails/BankDetails.js +18 -5
- package/build/features/bank/screens/BankDetails/BankName.js +2 -1
- package/build/features/bank/screens/BankDetails/BankStatement.js +41 -8
- package/build/features/bank/screens/BankDetails/Beneficiary.js +10 -11
- package/build/features/bank/screens/BankDetails/IBAN.js +4 -1
- package/build/features/bank/screens/BankDetails/validation.js +2 -2
- package/build/features/bank/screens/Success/Success.js +7 -3
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +16 -12
- package/build/features/business/Business.js +4 -4
- package/build/features/business/screens/Activities/Activities.js +16 -17
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +37 -1
- package/build/features/business/screens/Activities/ActivitiesList.js +51 -12
- package/build/features/business/screens/Activities/OperationStartDate.d.ts +15 -1
- package/build/features/business/screens/Activities/OperationStartDate.js +21 -2
- package/build/features/business/screens/Activities/validation.d.ts +0 -51
- package/build/features/business/screens/Activities/validation.js +4 -10
- package/build/features/business/screens/BusinessType/BusinessType.js +20 -7
- package/build/features/business/screens/BusinessType/EntityName.d.ts +6 -0
- package/build/features/business/screens/BusinessType/EntityName.js +56 -0
- package/build/features/business/screens/BusinessType/LicenseCertificate.d.ts +6 -0
- package/build/features/business/screens/BusinessType/LicenseCertificate.js +76 -0
- package/build/features/business/screens/BusinessType/LicenseList.js +26 -7
- package/build/features/business/screens/BusinessType/LicenseNumber.js +12 -6
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +6 -0
- package/build/features/business/screens/BusinessType/LicenseType.js +78 -0
- package/build/features/business/screens/BusinessType/validation.d.ts +19 -0
- package/build/features/business/screens/BusinessType/validation.js +52 -3
- package/build/features/business/screens/CivilID/CivilID.d.ts +5 -0
- package/build/features/business/screens/CivilID/CivilID.js +67 -0
- package/build/features/business/screens/CivilID/IDNumber.d.ts +7 -0
- package/build/features/business/screens/CivilID/IDNumber.js +59 -0
- package/build/features/business/screens/CivilID/index.d.ts +3 -0
- package/build/features/business/screens/CivilID/index.js +2 -0
- package/build/features/business/screens/CivilID/validation.d.ts +8 -0
- package/build/features/business/screens/CivilID/validation.js +4 -0
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +15 -2
- package/build/features/business/screens/Customers/CustomerLocations.js +32 -8
- package/build/features/business/screens/Customers/Customers.js +15 -9
- package/build/features/business/screens/Customers/ExpectedCustomers.js +16 -4
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +32 -14
- package/build/features/business/screens/Customers/RefundPolicy.js +8 -2
- package/build/features/business/screens/Customers/TransactionPolicy.js +8 -2
- package/build/features/business/screens/IDBOD/IDBOD.js +15 -2
- package/build/features/business/screens/OTP/OTP.js +15 -2
- package/build/features/business/screens/Success/Success.js +10 -3
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -11
- package/build/features/business/screens/Verify/Verify.js +4 -4
- package/build/features/business/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
- package/build/features/business/screens/VerifyPACI/VerifyPACI.js +159 -0
- package/build/features/business/screens/VerifyPACI/VerifyPACILoading.d.ts +6 -0
- package/build/features/business/screens/VerifyPACI/VerifyPACILoading.js +23 -0
- package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
- package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
- package/build/features/business/screens/VerifyPACI/index.d.ts +3 -0
- package/build/features/business/screens/VerifyPACI/index.js +2 -0
- package/build/features/connect/Connect.d.ts +1 -0
- package/build/features/connect/Connect.js +38 -10
- package/build/features/connect/screens/CivilID/CivilID.d.ts +5 -0
- package/build/features/connect/screens/CivilID/CivilID.js +102 -0
- package/build/features/connect/screens/CivilID/IDNumber.d.ts +7 -0
- package/build/features/connect/screens/CivilID/IDNumber.js +59 -0
- package/build/features/connect/screens/CivilID/index.d.ts +3 -0
- package/build/features/connect/screens/CivilID/index.js +2 -0
- package/build/features/connect/screens/CivilID/validation.d.ts +8 -0
- package/build/features/connect/screens/CivilID/validation.js +4 -0
- package/build/features/connect/screens/Individual/Email.js +11 -3
- package/build/features/connect/screens/Individual/Individual.js +44 -28
- package/build/features/connect/screens/Merchant/BrandList.js +15 -7
- package/build/features/connect/screens/Merchant/BrandName.js +7 -4
- package/build/features/connect/screens/Merchant/Merchant.js +48 -65
- package/build/features/connect/screens/Merchant/SalesChannels.d.ts +4 -1
- package/build/features/connect/screens/Merchant/SalesChannels.js +28 -31
- package/build/features/connect/screens/Merchant/SocialMedia.d.ts +3 -4
- package/build/features/connect/screens/Merchant/SocialMedia.js +106 -112
- package/build/features/connect/screens/Merchant/TAC.js +8 -2
- package/build/features/connect/screens/Merchant/validation.d.ts +13 -123
- package/build/features/connect/screens/Merchant/validation.js +106 -173
- package/build/features/connect/screens/Mobile/Mobile.js +33 -12
- package/build/features/connect/screens/NID/NID.js +5 -1
- package/build/features/connect/screens/OTP/OTP.js +20 -6
- package/build/features/connect/screens/OTP/OTPInput.js +3 -2
- package/build/features/connect/screens/ThankYou/ThankYou.js +8 -2
- package/build/features/connect/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +159 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.d.ts +6 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.js +23 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
- package/build/features/connect/screens/VerifyPACI/index.d.ts +3 -0
- package/build/features/connect/screens/VerifyPACI/index.js +2 -0
- package/build/features/entity/Entity.js +6 -6
- package/build/features/entity/screens/Customers/CustomerLocations.d.ts +118 -0
- package/build/features/entity/screens/Customers/CustomerLocations.js +171 -0
- package/build/features/entity/screens/Customers/Customers.d.ts +5 -0
- package/build/features/entity/screens/Customers/Customers.js +90 -0
- package/build/features/entity/screens/Customers/ExpectedCustomers.d.ts +8 -0
- package/build/features/entity/screens/Customers/ExpectedCustomers.js +98 -0
- package/build/features/entity/screens/Customers/ExpectedSalesRange.d.ts +8 -0
- package/build/features/entity/screens/Customers/ExpectedSalesRange.js +127 -0
- package/build/features/entity/screens/Customers/RefundPolicy.d.ts +36 -0
- package/build/features/entity/screens/Customers/RefundPolicy.js +84 -0
- package/build/features/entity/screens/Customers/TransactionPolicy.d.ts +3 -0
- package/build/features/entity/screens/Customers/TransactionPolicy.js +44 -0
- package/build/features/entity/screens/Customers/index.d.ts +3 -0
- package/build/features/entity/screens/Customers/index.js +2 -0
- package/build/features/entity/screens/Customers/validation.d.ts +20 -0
- package/build/features/entity/screens/Customers/validation.js +13 -0
- package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +2 -1
- package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +25 -15
- package/build/features/entity/screens/EntityInfoConfirm/Article.d.ts +3 -0
- package/build/features/entity/screens/EntityInfoConfirm/Article.js +73 -0
- package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +38 -10
- package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +20 -5
- package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +2 -1
- package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +34 -5
- package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +13 -18
- package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +75 -41
- package/build/features/entity/screens/EntityInfoConfirm/validation.js +76 -10
- package/build/features/entity/screens/Success/Success.js +7 -3
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +11 -10
- package/build/features/entity/screens/Verify/Verify.js +18 -5
- package/build/features/featuresScreens.d.ts +0 -1
- package/build/features/featuresScreens.js +30 -7
- package/build/features/individual/Individual.js +4 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +18 -25
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +15 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +11 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +2 -2
- package/build/features/individual/screens/Success/Success.js +7 -3
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +16 -12
- package/build/features/individual/screens/Verify/Verify.js +18 -5
- package/build/features/password/Password.js +4 -4
- package/build/features/password/screens/CreatePassword/CreatePassword.js +16 -3
- package/build/features/password/screens/OTP/OTP.js +15 -2
- package/build/features/password/screens/Success/Success.js +7 -3
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +16 -13
- package/build/features/password/screens/Verify/Verify.js +16 -3
- package/build/features/shared/Background/Background.d.ts +2 -5
- package/build/features/shared/Background/Background.js +7 -3
- package/build/features/shared/Button/Button.js +1 -0
- package/build/features/shared/Button/EmailProvidersButtons.d.ts +2 -1
- package/build/features/shared/Button/EmailProvidersButtons.js +7 -2
- package/build/features/shared/Button/MobileButton.d.ts +2 -1
- package/build/features/shared/Button/MobileButton.js +2 -2
- package/build/features/shared/Dialog/CloseDialog.d.ts +11 -0
- package/build/features/shared/Dialog/CloseDialog.js +71 -0
- package/build/features/shared/Dialog/DialogContainer.d.ts +8 -0
- package/build/features/shared/Dialog/DialogContainer.js +56 -0
- package/build/features/shared/Dialog/index.d.ts +4 -0
- package/build/features/shared/Dialog/index.js +4 -0
- package/build/features/shared/Input/Input.d.ts +1 -1
- package/build/features/shared/Input/Input.js +2 -2
- package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +1 -1
- package/build/features/shared/SuccessScreen/SuccessScreen.js +3 -2
- package/build/features/shared/UploadFile/UploadFile.d.ts +10 -3
- package/build/features/shared/UploadFile/UploadFile.js +24 -9
- package/build/features/signIn/SignIn.js +4 -4
- package/build/features/signIn/screens/Email/Email.js +4 -2
- package/build/features/signIn/screens/Mobile/Mobile.js +5 -1
- package/build/features/signIn/screens/OTP/OTP.js +14 -1
- package/build/features/signIn/screens/Password/Password.js +15 -2
- package/build/features/tax/Tax.js +6 -6
- package/build/features/tax/screens/Success/Success.js +9 -3
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -11
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +16 -3
- package/build/features/tax/screens/Verify/Verify.js +16 -3
- package/build/hooks/index.d.ts +2 -0
- package/build/hooks/index.js +2 -0
- package/build/hooks/useAppConfig.d.ts +3 -1
- package/build/hooks/useAppConfig.js +2 -2
- package/build/hooks/useAppDispatch.d.ts +0 -1
- package/build/hooks/useErrorListener.js +0 -6
- package/build/hooks/useScreen.d.ts +3 -0
- package/build/hooks/useScreen.js +14 -0
- package/build/hooks/useSetFromDefaultValues.d.ts +2 -0
- package/build/hooks/useSetFromDefaultValues.js +24 -0
- package/build/index.d.ts +2 -3
- package/build/index.js +1 -4
- package/build/utils/array.d.ts +50 -1
- package/build/utils/array.js +66 -0
- package/build/utils/common.d.ts +1 -0
- package/build/utils/common.js +3 -0
- package/build/utils/date.d.ts +1 -0
- package/build/utils/date.js +5 -0
- package/build/utils/device.d.ts +1 -0
- package/build/utils/device.js +13 -0
- package/build/utils/index.d.ts +2 -0
- package/build/utils/index.js +2 -0
- package/build/utils/locale.js +1 -1
- package/build/utils/object.d.ts +1 -0
- package/build/utils/object.js +12 -0
- package/build/utils/string.d.ts +14 -0
- package/build/utils/string.js +85 -3
- package/build/utils/validation.d.ts +2 -0
- package/build/utils/validation.js +6 -0
- package/package.json +4 -3
- package/build/features/app/otp/otpStore.d.ts +0 -28
- package/build/features/app/otp/otpStore.js +0 -153
- package/build/features/business/screens/Activities/SalesChannels.d.ts +0 -5
- package/build/features/business/screens/Activities/SalesChannels.js +0 -112
- package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.d.ts +0 -5
- package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.js +0 -112
- package/build/features/otp/OTP.d.ts +0 -7
- package/build/features/otp/OTP.js +0 -58
- package/build/features/otp/index.d.ts +0 -0
- package/build/features/otp/index.js +0 -1
- package/build/features/otp/screens/OTPVerify/OTPInput.d.ts +0 -6
- package/build/features/otp/screens/OTPVerify/OTPInput.js +0 -47
- package/build/features/otp/screens/OTPVerify/Verify.d.ts +0 -5
- package/build/features/otp/screens/OTPVerify/Verify.js +0 -49
- package/build/features/otp/screens/OTPVerify/index.d.ts +0 -2
- package/build/features/otp/screens/OTPVerify/index.js +0 -2
- package/build/features/otp/screens/OTPVerify/validation.d.ts +0 -8
- package/build/features/otp/screens/OTPVerify/validation.js +0 -4
|
@@ -12,6 +12,7 @@ export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
12
12
|
contact: any;
|
|
13
13
|
countries: CountryCode[];
|
|
14
14
|
countryCode: any;
|
|
15
|
+
notification: any;
|
|
15
16
|
flows: {
|
|
16
17
|
name: string;
|
|
17
18
|
status: string;
|
|
@@ -33,6 +34,23 @@ export declare const retrieveBoardDetails: import("@reduxjs/toolkit").AsyncThunk
|
|
|
33
34
|
}, string, {}>;
|
|
34
35
|
export declare const verifyLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
35
36
|
data: any;
|
|
37
|
+
boardResponse: {
|
|
38
|
+
user: any;
|
|
39
|
+
brand: any;
|
|
40
|
+
bank_account: any;
|
|
41
|
+
entity: any;
|
|
42
|
+
merchant: any;
|
|
43
|
+
name: any;
|
|
44
|
+
contact: any;
|
|
45
|
+
countries: CountryCode[];
|
|
46
|
+
countryCode: any;
|
|
47
|
+
notification: any;
|
|
48
|
+
flows: {
|
|
49
|
+
name: string;
|
|
50
|
+
status: string;
|
|
51
|
+
url: string;
|
|
52
|
+
}[];
|
|
53
|
+
};
|
|
36
54
|
formData: {
|
|
37
55
|
otp: string;
|
|
38
56
|
};
|
|
@@ -49,13 +49,13 @@ var _a;
|
|
|
49
49
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
50
50
|
import API from '../../../api';
|
|
51
51
|
import { FlowsTypes } from '../../../@types';
|
|
52
|
-
import {
|
|
52
|
+
import { handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
|
|
53
53
|
import { BUSINESS_FLOW_SUCCESS, INDIVIDUAl_STEP_NAMES } from '../../../constants';
|
|
54
54
|
export var verifyLeadToken = createAsyncThunk('individualVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
55
|
-
var payload, settings, data, boardData, countryCode, boardInfoData, countries, board_id, board_info_id,
|
|
56
|
-
var
|
|
57
|
-
return __generator(this, function (
|
|
58
|
-
switch (
|
|
55
|
+
var payload, settings, data, boardData, individualData, countryCode, boardInfoData, countries, board_id, board_info_id, notification, _a, id, type, info, hasIndividualCompleted;
|
|
56
|
+
var _b, _c, _d, _e;
|
|
57
|
+
return __generator(this, function (_f) {
|
|
58
|
+
switch (_f.label) {
|
|
59
59
|
case 0:
|
|
60
60
|
payload = {
|
|
61
61
|
service_name: 'tap_email',
|
|
@@ -64,50 +64,68 @@ export var verifyLeadToken = createAsyncThunk('individualVerifyLeadToken', funct
|
|
|
64
64
|
settings = thunkApi.getState().settings;
|
|
65
65
|
return [4, API.leadService.verifyLeadToken(payload)];
|
|
66
66
|
case 1:
|
|
67
|
-
data = (
|
|
67
|
+
data = (_f.sent()).data;
|
|
68
68
|
boardInfoData = undefined;
|
|
69
69
|
countries = settings.data.countries;
|
|
70
|
-
if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3,
|
|
70
|
+
if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 10];
|
|
71
|
+
if (data === null || data === void 0 ? void 0 : data.country_code) {
|
|
72
|
+
countryCode = data === null || data === void 0 ? void 0 : data.country_code;
|
|
73
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryCode));
|
|
74
|
+
}
|
|
75
|
+
if (!(data.step_name !== INDIVIDUAl_STEP_NAMES.PHONE_AUTH)) return [3, 10];
|
|
71
76
|
board_id = data === null || data === void 0 ? void 0 : data.id;
|
|
72
77
|
board_info_id = data === null || data === void 0 ? void 0 : data.board_info_id;
|
|
73
|
-
if (!(
|
|
78
|
+
if (!(board_id && board_info_id)) return [3, 4];
|
|
74
79
|
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
75
80
|
case 2:
|
|
76
|
-
boardInfoData =
|
|
77
|
-
|
|
78
|
-
|
|
81
|
+
boardInfoData = _f.sent();
|
|
82
|
+
notification = (boardInfoData || {}).notification;
|
|
83
|
+
_a = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _a.id, type = _a.type;
|
|
84
|
+
if (!(id && type)) return [3, 4];
|
|
85
|
+
return [4, API.individualService.retrieveIndividual(id, type)];
|
|
86
|
+
case 3:
|
|
87
|
+
individualData = _f.sent();
|
|
88
|
+
_f.label = 4;
|
|
79
89
|
case 4:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
countryCode = entity === null || entity === void 0 ? void 0 : entity.country;
|
|
83
|
-
info = boardInfoData.info;
|
|
84
|
-
hasIndividualCompleted = ((_a = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'individual'; })) === null || _a === void 0 ? void 0 : _a.status) === 'completed';
|
|
85
|
-
return [4, thunkApi.dispatch(retrieveDataList(entity === null || entity === void 0 ? void 0 : entity.country))];
|
|
90
|
+
if (!board_id) return [3, 6];
|
|
91
|
+
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
86
92
|
case 5:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
boardData = _f.sent();
|
|
94
|
+
_f.label = 6;
|
|
95
|
+
case 6:
|
|
96
|
+
if (!countryCode) {
|
|
97
|
+
countryCode = (_b = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _b === void 0 ? void 0 : _b.country;
|
|
98
|
+
if (countryCode)
|
|
99
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryCode));
|
|
93
100
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
101
|
+
info = (boardInfoData || {}).info;
|
|
102
|
+
hasIndividualCompleted = ((_c = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'individual'; })) === null || _c === void 0 ? void 0 : _c.status) === 'completed';
|
|
103
|
+
if (!hasIndividualCompleted) return [3, 7];
|
|
104
|
+
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
105
|
+
return [3, 10];
|
|
106
|
+
case 7:
|
|
107
|
+
if (!countryCode) return [3, 9];
|
|
108
|
+
return [4, thunkApi.dispatch(retrieveDataList(countryCode))];
|
|
109
|
+
case 8:
|
|
110
|
+
_f.sent();
|
|
111
|
+
_f.label = 9;
|
|
112
|
+
case 9:
|
|
113
|
+
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_ADDITIONAL_INDIVIDUAL_INFO_STEP'));
|
|
114
|
+
_f.label = 10;
|
|
115
|
+
case 10: return [2, {
|
|
99
116
|
data: data,
|
|
100
117
|
boardResponse: {
|
|
101
|
-
user:
|
|
118
|
+
user: individualData === null || individualData === void 0 ? void 0 : individualData.user,
|
|
102
119
|
brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
|
|
103
120
|
bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
|
|
104
121
|
entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
|
|
105
122
|
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
106
|
-
name: (
|
|
107
|
-
contact: (
|
|
123
|
+
name: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _d === void 0 ? void 0 : _d.names,
|
|
124
|
+
contact: (_e = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _e === void 0 ? void 0 : _e.contact,
|
|
108
125
|
countries: countries,
|
|
109
126
|
countryCode: countryCode,
|
|
110
|
-
|
|
127
|
+
notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
|
|
128
|
+
flows: BUSINESS_FLOW_SUCCESS.concat((boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || [])
|
|
111
129
|
},
|
|
112
130
|
token: token
|
|
113
131
|
}];
|
|
@@ -132,16 +150,24 @@ export var resendOTP = createAsyncThunk('resendOTPIndividual', function (params,
|
|
|
132
150
|
});
|
|
133
151
|
}); });
|
|
134
152
|
export var retrieveDataList = createAsyncThunk('individualRetrieveDataList', function (countryCode) { return __awaiter(void 0, void 0, void 0, function () {
|
|
135
|
-
var _a, sourceIncome, monthlyIncome, occupation;
|
|
153
|
+
var monthlyIncomeBody, dataBody, _a, sourceIncome, monthlyIncome, occupation;
|
|
136
154
|
return __generator(this, function (_b) {
|
|
137
155
|
switch (_b.label) {
|
|
138
|
-
case 0:
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
156
|
+
case 0:
|
|
157
|
+
monthlyIncomeBody = {
|
|
158
|
+
page: 0,
|
|
159
|
+
country_code: [countryCode]
|
|
160
|
+
};
|
|
161
|
+
dataBody = {
|
|
162
|
+
page: 0
|
|
163
|
+
};
|
|
164
|
+
return [4, Promise.all([
|
|
165
|
+
API.dataService.getSourceOfIncome(dataBody),
|
|
166
|
+
API.dataService.getMonthlyIncome(monthlyIncomeBody),
|
|
167
|
+
API.dataService.getOccupation(dataBody)
|
|
168
|
+
])];
|
|
143
169
|
case 1:
|
|
144
|
-
_a = _b.sent(), sourceIncome = _a[0]
|
|
170
|
+
_a = _b.sent(), sourceIncome = _a[0], monthlyIncome = _a[1], occupation = _a[2];
|
|
145
171
|
return [2, {
|
|
146
172
|
sourceIncome: sourceIncome,
|
|
147
173
|
monthlyIncome: monthlyIncome,
|
|
@@ -159,70 +185,114 @@ export var retrieveBoardDetails = createAsyncThunk('retrieveIndividualBoardDetai
|
|
|
159
185
|
case 1:
|
|
160
186
|
data = _c.sent();
|
|
161
187
|
return [2, {
|
|
162
|
-
data: __assign(__assign({}, data), { user: data === null || data === void 0 ? void 0 : data.user, brand: data === null || data === void 0 ? void 0 : data.brand, bank_account: data === null || data === void 0 ? void 0 : data.bank_account, entity: data === null || data === void 0 ? void 0 : data.entity, merchant: data === null || data === void 0 ? void 0 : data.merchant, name: (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.
|
|
188
|
+
data: __assign(__assign({}, data), { user: data === null || data === void 0 ? void 0 : data.user, brand: data === null || data === void 0 ? void 0 : data.brand, bank_account: data === null || data === void 0 ? void 0 : data.bank_account, entity: data === null || data === void 0 ? void 0 : data.entity, merchant: data === null || data === void 0 ? void 0 : data.merchant, name: (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.names, contact: (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.contact })
|
|
163
189
|
}];
|
|
164
190
|
}
|
|
165
191
|
});
|
|
166
192
|
}); });
|
|
167
193
|
export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
168
|
-
var _a, individual, settings, responseBody, payload, data,
|
|
169
|
-
var
|
|
170
|
-
return __generator(this, function (
|
|
171
|
-
switch (
|
|
194
|
+
var _a, individual, settings, responseBody, _b, board_id, board_info_id, countries, payload, data, boardInfoData, individualData, boardData, countryCode, notification, _c, id, type, info, hasIndividualCompleted;
|
|
195
|
+
var _d, _e, _f, _g, _h, _j, _k;
|
|
196
|
+
return __generator(this, function (_l) {
|
|
197
|
+
switch (_l.label) {
|
|
172
198
|
case 0:
|
|
173
199
|
_a = thunkApi.getState(), individual = _a.individual, settings = _a.settings;
|
|
174
200
|
responseBody = individual.data.verify.responseBody;
|
|
201
|
+
_b = responseBody || {}, board_id = _b.board_id, board_info_id = _b.board_info_id;
|
|
202
|
+
countries = settings.data.countries;
|
|
175
203
|
payload = {
|
|
176
204
|
data: params.otp,
|
|
177
|
-
service_name: (
|
|
205
|
+
service_name: (_d = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _d === void 0 ? void 0 : _d.service_name,
|
|
178
206
|
verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
|
|
179
207
|
step_name: INDIVIDUAl_STEP_NAMES.PHONE_AUTH,
|
|
180
208
|
encryption_contract: ['data']
|
|
181
209
|
};
|
|
182
210
|
return [4, API.leadService.verifyLeadOTP(payload)];
|
|
183
211
|
case 1:
|
|
184
|
-
data = (
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
212
|
+
data = (_l.sent()).data;
|
|
213
|
+
countryCode = undefined;
|
|
214
|
+
if (!!(data === null || data === void 0 ? void 0 : data.errors)) return [3, 10];
|
|
215
|
+
if (!(board_id && board_info_id)) return [3, 4];
|
|
216
|
+
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
217
|
+
case 2:
|
|
218
|
+
boardInfoData = _l.sent();
|
|
219
|
+
notification = (boardInfoData || {}).notification;
|
|
220
|
+
_c = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _c.id, type = _c.type;
|
|
221
|
+
if (!(id && type)) return [3, 4];
|
|
222
|
+
return [4, API.individualService.retrieveIndividual(id, type)];
|
|
223
|
+
case 3:
|
|
224
|
+
individualData = _l.sent();
|
|
225
|
+
_l.label = 4;
|
|
226
|
+
case 4:
|
|
227
|
+
if (!board_id) return [3, 6];
|
|
228
|
+
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
229
|
+
case 5:
|
|
230
|
+
boardData = _l.sent();
|
|
231
|
+
_l.label = 6;
|
|
232
|
+
case 6:
|
|
233
|
+
countryCode = (_e = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _e === void 0 ? void 0 : _e.country;
|
|
234
|
+
info = (boardInfoData || {}).info;
|
|
235
|
+
hasIndividualCompleted = ((_f = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'individual'; })) === null || _f === void 0 ? void 0 : _f.status) === 'completed';
|
|
236
|
+
(_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, { otp: params.otp });
|
|
237
|
+
if (!hasIndividualCompleted) return [3, 7];
|
|
238
|
+
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
239
|
+
return [3, 10];
|
|
240
|
+
case 7:
|
|
241
|
+
if (!countryCode) return [3, 9];
|
|
242
|
+
return [4, thunkApi.dispatch(retrieveDataList(countryCode))];
|
|
243
|
+
case 8:
|
|
244
|
+
_l.sent();
|
|
245
|
+
_l.label = 9;
|
|
246
|
+
case 9:
|
|
247
|
+
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_ADDITIONAL_INDIVIDUAL_INFO_STEP'));
|
|
248
|
+
_l.label = 10;
|
|
249
|
+
case 10: return [2, {
|
|
250
|
+
data: data,
|
|
251
|
+
boardResponse: {
|
|
252
|
+
user: individualData === null || individualData === void 0 ? void 0 : individualData.user,
|
|
253
|
+
brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
|
|
254
|
+
bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
|
|
255
|
+
entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
|
|
256
|
+
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
257
|
+
name: (_j = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _j === void 0 ? void 0 : _j.names,
|
|
258
|
+
contact: (_k = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _k === void 0 ? void 0 : _k.contact,
|
|
259
|
+
countries: countries,
|
|
260
|
+
countryCode: countryCode,
|
|
261
|
+
notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
|
|
262
|
+
flows: BUSINESS_FLOW_SUCCESS.concat((boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || [])
|
|
263
|
+
},
|
|
264
|
+
formData: __assign({}, params)
|
|
265
|
+
}];
|
|
197
266
|
}
|
|
198
267
|
});
|
|
199
268
|
}); });
|
|
200
269
|
export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
201
|
-
var _a, settings, individual, requestBody, data;
|
|
202
|
-
var
|
|
203
|
-
return __generator(this, function (
|
|
204
|
-
switch (
|
|
270
|
+
var _a, settings, individual, _b, id, type, requestBody, data;
|
|
271
|
+
var _c, _d, _e, _f, _g, _h, _j, _k;
|
|
272
|
+
return __generator(this, function (_l) {
|
|
273
|
+
switch (_l.label) {
|
|
205
274
|
case 0:
|
|
206
275
|
_a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
|
|
276
|
+
_b = ((_d = (_c = individual.data.verify.responseBody) === null || _c === void 0 ? void 0 : _c.notification) === null || _d === void 0 ? void 0 : _d.recipient) || {}, id = _b.id, type = _b.type;
|
|
207
277
|
requestBody = {
|
|
208
|
-
id:
|
|
209
|
-
|
|
210
|
-
occupation: (
|
|
278
|
+
id: id,
|
|
279
|
+
type: type,
|
|
280
|
+
occupation: { id: (_e = params.occupation) === null || _e === void 0 ? void 0 : _e.id },
|
|
211
281
|
employer_name: params.employerName,
|
|
212
|
-
employer_country: (
|
|
213
|
-
source_income: [(
|
|
214
|
-
|
|
282
|
+
employer_country: (_f = params.employerLocation) === null || _f === void 0 ? void 0 : _f.iso2,
|
|
283
|
+
source_income: [{ id: (_g = params.sourceIncome) === null || _g === void 0 ? void 0 : _g.id }],
|
|
284
|
+
monthly_income: { id: (_h = params.monthlyIncome) === null || _h === void 0 ? void 0 : _h.id },
|
|
215
285
|
is_relative_PEP: params.isPEP,
|
|
216
286
|
is_influencer: params.isInfluencer,
|
|
217
|
-
encryption_contract: ['employer_name', '
|
|
287
|
+
encryption_contract: ['employer_name', 'employer_country'],
|
|
218
288
|
step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO
|
|
219
289
|
};
|
|
220
|
-
return [4, API.
|
|
290
|
+
return [4, API.individualService.updateIndividual(requestBody)];
|
|
221
291
|
case 1:
|
|
222
|
-
data = (
|
|
292
|
+
data = (_l.sent()).data;
|
|
223
293
|
if (!(data === null || data === void 0 ? void 0 : data.errors)) {
|
|
224
294
|
thunkApi.dispatch(handleNextScreenStep());
|
|
225
|
-
(
|
|
295
|
+
(_k = (_j = settings.data.appConfig).onStepCompleted) === null || _k === void 0 ? void 0 : _k.call(_j, settings.data.activeScreen.name, requestBody);
|
|
226
296
|
}
|
|
227
297
|
return [2, { data: data, formData: params }];
|
|
228
298
|
}
|
|
@@ -252,7 +322,7 @@ export var updateBoardSuccess = createAsyncThunk('individualUpdateBoardSuccess',
|
|
|
252
322
|
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
|
|
253
323
|
(_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
|
|
254
324
|
thunkApi.dispatch(handleNextScreenStep());
|
|
255
|
-
return [2, { response: __assign(__assign({}, data), { flows: BUSINESS_FLOW_SUCCESS.concat(data === null || data === void 0 ? void 0 : data.info) }), formData: params }];
|
|
325
|
+
return [2, { response: __assign(__assign({}, data), { flows: BUSINESS_FLOW_SUCCESS.concat((data === null || data === void 0 ? void 0 : data.info) || []) }), formData: params }];
|
|
256
326
|
}
|
|
257
327
|
});
|
|
258
328
|
}); });
|
|
@@ -308,25 +378,20 @@ export var individualSlice = createSlice({
|
|
|
308
378
|
state.error = description;
|
|
309
379
|
return;
|
|
310
380
|
}
|
|
311
|
-
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data),
|
|
381
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.verify.responseBody), boardResponse), { board_id: data.id });
|
|
312
382
|
state.data.verify.token = token;
|
|
313
|
-
var _c = boardResponse || {}, countries = _c.countries,
|
|
314
|
-
var _d =
|
|
383
|
+
var _c = boardResponse || {}, countries = _c.countries, user = _c.user, countryCode = _c.countryCode;
|
|
384
|
+
var _d = user || {}, source_income = _d.source_income, monthly_income = _d.monthly_income, occupation = _d.occupation, is_relative_PEP = _d.is_relative_PEP, is_influencer = _d.is_influencer;
|
|
315
385
|
var _e = state.data.individualData.responseBody || {}, sourceIncomeList = _e.sourceIncomeList, monthlyIncomeList = _e.monthlyIncomeList, occupationList = _e.occupationList;
|
|
316
|
-
var selectedSourceIncome = (sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList.find(function (source) { var _a
|
|
386
|
+
var selectedSourceIncome = (sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList.find(function (source) { var _a; return (source === null || source === void 0 ? void 0 : source.id) === ((_a = source_income === null || source_income === void 0 ? void 0 : source_income[0]) === null || _a === void 0 ? void 0 : _a.id); })) ||
|
|
387
|
+
(sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList[0]);
|
|
317
388
|
if (!!selectedSourceIncome)
|
|
318
389
|
state.data.individualData.sourceIncome = selectedSourceIncome;
|
|
319
|
-
var
|
|
320
|
-
if (!!selectedMonthlyIncome)
|
|
321
|
-
state.data.individualData.monthlyIncome = selectedMonthlyIncome;
|
|
322
|
-
var code = (data === null || data === void 0 ? void 0 : data.employer_country) || countryCode;
|
|
390
|
+
var code = (user === null || user === void 0 ? void 0 : user.employer_country) || countryCode;
|
|
323
391
|
if (!!code) {
|
|
324
392
|
var employerLocation = (countries || []).find(function (country) { return country.iso2 === code; });
|
|
325
393
|
state.data.individualData.employerLocation = employerLocation;
|
|
326
394
|
}
|
|
327
|
-
var selectedOccupation = (occupationList === null || occupationList === void 0 ? void 0 : occupationList.find(function (o) { var _a; return ((_a = o === null || o === void 0 ? void 0 : o.name_en) === null || _a === void 0 ? void 0 : _a.toLocaleLowerCase()) === (occupation === null || occupation === void 0 ? void 0 : occupation.toLocaleLowerCase()); })) || (occupationList === null || occupationList === void 0 ? void 0 : occupationList[0]);
|
|
328
|
-
if (!!selectedOccupation)
|
|
329
|
-
state.data.individualData.occupation = selectedOccupation;
|
|
330
395
|
state.data.individualData.isPEP = is_relative_PEP;
|
|
331
396
|
state.data.individualData.isInfluencer = is_influencer;
|
|
332
397
|
})
|
|
@@ -359,7 +424,7 @@ export var individualSlice = createSlice({
|
|
|
359
424
|
var _a;
|
|
360
425
|
state.loading = false;
|
|
361
426
|
state.error = null;
|
|
362
|
-
var _b = action.payload, data = _b.data, formData = _b.formData;
|
|
427
|
+
var _b = action.payload, data = _b.data, formData = _b.formData, boardResponse = _b.boardResponse;
|
|
363
428
|
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
364
429
|
if (description) {
|
|
365
430
|
state.error = description;
|
|
@@ -367,7 +432,21 @@ export var individualSlice = createSlice({
|
|
|
367
432
|
}
|
|
368
433
|
state.data.otpData = formData;
|
|
369
434
|
state.data.otpData.responseBody = data;
|
|
370
|
-
state.data.
|
|
435
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), boardResponse);
|
|
436
|
+
var _c = boardResponse || {}, countries = _c.countries, user = _c.user, countryCode = _c.countryCode;
|
|
437
|
+
var _d = user || {}, source_income = _d.source_income, monthly_income = _d.monthly_income, occupation = _d.occupation, is_relative_PEP = _d.is_relative_PEP, is_influencer = _d.is_influencer;
|
|
438
|
+
var _e = state.data.individualData.responseBody || {}, sourceIncomeList = _e.sourceIncomeList, monthlyIncomeList = _e.monthlyIncomeList, occupationList = _e.occupationList;
|
|
439
|
+
var selectedSourceIncome = (sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList.find(function (source) { var _a; return (source === null || source === void 0 ? void 0 : source.id) === ((_a = source_income === null || source_income === void 0 ? void 0 : source_income[0]) === null || _a === void 0 ? void 0 : _a.id); })) ||
|
|
440
|
+
(sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList[0]);
|
|
441
|
+
if (!!selectedSourceIncome)
|
|
442
|
+
state.data.individualData.sourceIncome = selectedSourceIncome;
|
|
443
|
+
var code = (user === null || user === void 0 ? void 0 : user.employer_country) || countryCode;
|
|
444
|
+
if (!!code) {
|
|
445
|
+
var employerLocation = (countries || []).find(function (country) { return country.iso2 === code; });
|
|
446
|
+
state.data.individualData.employerLocation = employerLocation;
|
|
447
|
+
}
|
|
448
|
+
state.data.individualData.isPEP = is_relative_PEP;
|
|
449
|
+
state.data.individualData.isInfluencer = is_influencer;
|
|
371
450
|
})
|
|
372
451
|
.addCase(verifyLeadOTP.rejected, function (state, action) {
|
|
373
452
|
state.loading = false;
|
|
@@ -382,7 +461,7 @@ export var individualSlice = createSlice({
|
|
|
382
461
|
state.error = null;
|
|
383
462
|
var _a = action.payload, sourceIncome = _a.sourceIncome, monthlyIncome = _a.monthlyIncome, occupation = _a.occupation;
|
|
384
463
|
var data = state.data.individualData.responseBody;
|
|
385
|
-
state.data.individualData.responseBody = __assign(__assign({}, data), { sourceIncomeList: sourceIncome || [], monthlyIncomeList: monthlyIncome || [], occupationList: occupation || [] });
|
|
464
|
+
state.data.individualData.responseBody = __assign(__assign({}, data), { sourceIncomeList: (sourceIncome === null || sourceIncome === void 0 ? void 0 : sourceIncome.list) || [], monthlyIncomeList: (monthlyIncome === null || monthlyIncome === void 0 ? void 0 : monthlyIncome.list) || [], occupationList: (occupation === null || occupation === void 0 ? void 0 : occupation.list) || [] });
|
|
386
465
|
})
|
|
387
466
|
.addCase(retrieveDataList.rejected, function (state, action) {
|
|
388
467
|
state.loading = false;
|
|
@@ -417,8 +496,8 @@ export var individualSlice = createSlice({
|
|
|
417
496
|
state.error = null;
|
|
418
497
|
state.loading = false;
|
|
419
498
|
var data = (action.payload || {}).data;
|
|
420
|
-
var
|
|
421
|
-
state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), data), { entity: entity
|
|
499
|
+
var entity = (data || {}).entity;
|
|
500
|
+
state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), data), { entity: entity });
|
|
422
501
|
})
|
|
423
502
|
.addCase(retrieveBoardDetails.rejected, function (state, action) {
|
|
424
503
|
state.error = action.error.message;
|
|
@@ -2,13 +2,7 @@ import { RootState } from '../../../app/store';
|
|
|
2
2
|
import { FlowsTypes, OTPFormValues, PasswordCreateFormValues, ResponseData, SharedState } from '../../../@types';
|
|
3
3
|
export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
4
4
|
data: any;
|
|
5
|
-
boardResponse:
|
|
6
|
-
flows: {
|
|
7
|
-
name: string;
|
|
8
|
-
status: string;
|
|
9
|
-
url: string;
|
|
10
|
-
}[];
|
|
11
|
-
};
|
|
5
|
+
boardResponse: any;
|
|
12
6
|
token: string;
|
|
13
7
|
}, string, {}>;
|
|
14
8
|
export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
@@ -49,13 +49,13 @@ var _a;
|
|
|
49
49
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
50
50
|
import API from '../../../api';
|
|
51
51
|
import { FlowsTypes } from '../../../@types';
|
|
52
|
-
import { handleCurrentActiveScreen, handleNextScreenStep } from '../../../app/settings';
|
|
52
|
+
import { handleCurrentActiveScreen, handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
|
|
53
53
|
import { BUSINESS_FLOW_SUCCESS, PASSWORD_OPERATION_TYPE, PASSWORD_STEP_NAMES } from '../../../constants';
|
|
54
54
|
export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
55
|
-
var payload, data, boardInfoData, board_id, board_info_id, info, hasPasswordCompleted;
|
|
56
|
-
var _a;
|
|
57
|
-
return __generator(this, function (
|
|
58
|
-
switch (
|
|
55
|
+
var payload, data, boardInfoData, boardData, board_id, board_info_id, countryIso2, info, hasPasswordCompleted;
|
|
56
|
+
var _a, _b, _c, _d;
|
|
57
|
+
return __generator(this, function (_e) {
|
|
58
|
+
switch (_e.label) {
|
|
59
59
|
case 0:
|
|
60
60
|
payload = {
|
|
61
61
|
service_name: 'tap_email',
|
|
@@ -63,21 +63,28 @@ export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', functio
|
|
|
63
63
|
};
|
|
64
64
|
return [4, API.leadService.verifyLeadToken(payload)];
|
|
65
65
|
case 1:
|
|
66
|
-
data = (
|
|
67
|
-
|
|
68
|
-
if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3,
|
|
66
|
+
data = (_e.sent()).data;
|
|
67
|
+
boardData = undefined;
|
|
68
|
+
if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 6];
|
|
69
69
|
board_id = data === null || data === void 0 ? void 0 : data.id;
|
|
70
70
|
board_info_id = data === null || data === void 0 ? void 0 : data.board_info_id;
|
|
71
|
-
if (!(
|
|
71
|
+
if (!(board_id && board_info_id)) return [3, 3];
|
|
72
72
|
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
73
73
|
case 2:
|
|
74
|
-
boardInfoData =
|
|
75
|
-
|
|
76
|
-
case 3:
|
|
74
|
+
boardInfoData = _e.sent();
|
|
75
|
+
_e.label = 3;
|
|
76
|
+
case 3:
|
|
77
|
+
if (!board_id) return [3, 5];
|
|
78
|
+
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
77
79
|
case 4:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
boardData = _e.sent();
|
|
81
|
+
_e.label = 5;
|
|
82
|
+
case 5:
|
|
83
|
+
countryIso2 = (_a = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _a === void 0 ? void 0 : _a.country;
|
|
84
|
+
if (countryIso2)
|
|
85
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
86
|
+
info = (boardInfoData || {}).info;
|
|
87
|
+
hasPasswordCompleted = ((_b = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'password'; })) === null || _b === void 0 ? void 0 : _b.status) === 'completed';
|
|
81
88
|
if (data.step_name === PASSWORD_STEP_NAMES.PHONE_AUTH) {
|
|
82
89
|
thunkApi.dispatch(handleCurrentActiveScreen('PASSWORD_VERIFY_STEP'));
|
|
83
90
|
}
|
|
@@ -87,8 +94,12 @@ export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', functio
|
|
|
87
94
|
else if (data.step_name === PASSWORD_STEP_NAMES.PASSWORD_INFO) {
|
|
88
95
|
thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
|
|
89
96
|
}
|
|
90
|
-
|
|
91
|
-
case
|
|
97
|
+
_e.label = 6;
|
|
98
|
+
case 6: return [2, {
|
|
99
|
+
data: data,
|
|
100
|
+
boardResponse: __assign(__assign({}, boardData === null || boardData === void 0 ? void 0 : boardData.business), { flows: BUSINESS_FLOW_SUCCESS.concat((boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || []), user: boardData === null || boardData === void 0 ? void 0 : boardData.user, 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: (_c = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _c === void 0 ? void 0 : _c.names, contact: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _d === void 0 ? void 0 : _d.contact }),
|
|
101
|
+
token: token
|
|
102
|
+
}];
|
|
92
103
|
}
|
|
93
104
|
});
|
|
94
105
|
}); });
|
|
@@ -118,7 +129,7 @@ export var retrieveBoardDetails = createAsyncThunk('retrievePasswordBoardDetails
|
|
|
118
129
|
case 1:
|
|
119
130
|
data = _c.sent();
|
|
120
131
|
return [2, {
|
|
121
|
-
data: __assign(__assign({}, data), { user: data === null || data === void 0 ? void 0 : data.user, brand: data === null || data === void 0 ? void 0 : data.brand, bank_account: data === null || data === void 0 ? void 0 : data.bank_account, entity: data === null || data === void 0 ? void 0 : data.entity, merchant: data === null || data === void 0 ? void 0 : data.merchant, name: (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.
|
|
132
|
+
data: __assign(__assign({}, data), { user: data === null || data === void 0 ? void 0 : data.user, brand: data === null || data === void 0 ? void 0 : data.brand, bank_account: data === null || data === void 0 ? void 0 : data.bank_account, entity: data === null || data === void 0 ? void 0 : data.entity, merchant: data === null || data === void 0 ? void 0 : data.merchant, name: (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.names, contact: (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.contact })
|
|
122
133
|
}];
|
|
123
134
|
}
|
|
124
135
|
});
|
|
@@ -202,7 +213,7 @@ export var updateBoardSuccess = createAsyncThunk('passwordUpdateBoardSuccess', f
|
|
|
202
213
|
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
|
|
203
214
|
(_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
|
|
204
215
|
thunkApi.dispatch(handleNextScreenStep());
|
|
205
|
-
return [2, { response: __assign(__assign({}, data), { flows: BUSINESS_FLOW_SUCCESS.concat(data === null || data === void 0 ? void 0 : data.info) }), formData: params }];
|
|
216
|
+
return [2, { response: __assign(__assign({}, data), { flows: BUSINESS_FLOW_SUCCESS.concat((data === null || data === void 0 ? void 0 : data.info) || []) }), formData: params }];
|
|
206
217
|
}
|
|
207
218
|
});
|
|
208
219
|
}); });
|
|
@@ -227,7 +238,7 @@ export var verifyOperationToken = createAsyncThunk('verifyOperationToken', funct
|
|
|
227
238
|
_a.label = 3;
|
|
228
239
|
case 3:
|
|
229
240
|
thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
|
|
230
|
-
return [2, { data: data, token: token, boardId: boardId, flows: BUSINESS_FLOW_SUCCESS.concat(boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) }];
|
|
241
|
+
return [2, { data: data, token: token, boardId: boardId, flows: BUSINESS_FLOW_SUCCESS.concat((boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || []) }];
|
|
231
242
|
}
|
|
232
243
|
});
|
|
233
244
|
}); });
|