@tap-payments/auth-jsconnect 2.0.35-test → 2.0.35
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 +52 -21
- package/build/@types/app.js +10 -3
- package/build/@types/form.d.ts +18 -10
- package/build/api/auth.d.ts +24 -2
- 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 +53 -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 +1 -1
- package/build/app/rootReducer.js +2 -2
- package/build/app/settings.d.ts +8 -2
- package/build/app/settings.js +29 -12
- package/build/app/store.d.ts +3 -3
- package/build/assets/locales/ar.json +258 -183
- package/build/assets/locales/en.json +190 -108
- package/build/components/AnimationFlow/AnimationFlow.d.ts +5 -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 +5 -1
- package/build/components/AnimationFlow/Dialog.js +11 -5
- 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 +7 -5
- package/build/constants/app.js +56 -23
- 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 +8 -0
- package/build/constants/validation.js +9 -1
- package/build/features/app/auth/authStore.d.ts +47 -0
- package/build/features/app/auth/authStore.js +260 -0
- package/build/features/app/bank/bankStore.d.ts +16 -0
- package/build/features/app/bank/bankStore.js +86 -39
- package/build/features/app/business/businessStore.d.ts +22 -3
- package/build/features/app/business/businessStore.js +432 -291
- package/build/features/app/connect/connectStore.d.ts +33 -31
- package/build/features/app/connect/connectStore.js +394 -308
- package/build/features/app/entity/entityStore.d.ts +30 -5
- package/build/features/app/entity/entityStore.js +258 -47
- package/build/features/app/individual/individualStore.d.ts +17 -0
- package/build/features/app/individual/individualStore.js +170 -84
- package/build/features/app/password/passwordStore.js +1 -1
- package/build/features/app/tax/taxStore.js +18 -14
- package/build/features/auth/Auth.d.ts +10 -0
- package/build/features/auth/Auth.js +87 -0
- package/build/features/auth/index.d.ts +1 -0
- package/build/features/auth/index.js +1 -0
- 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.d.ts +5 -0
- package/build/features/auth/screens/OTP/OTP.js +76 -0
- package/build/features/{otp/screens/OTPVerify/Verify.d.ts → auth/screens/OTP/OTPInput.d.ts} +0 -0
- package/build/features/{otp/screens/OTPVerify → auth/screens/OTP}/OTPInput.js +11 -7
- package/build/features/auth/screens/OTP/index.d.ts +3 -0
- package/build/features/auth/screens/OTP/index.js +2 -0
- package/build/features/{otp/screens/OTPVerify → auth/screens/OTP}/validation.d.ts +0 -0
- package/build/features/{otp/screens/OTPVerify → auth/screens/OTP}/validation.js +0 -0
- package/build/features/bank/Bank.js +12 -6
- 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/validation.js +2 -2
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +12 -8
- package/build/features/business/Business.d.ts +1 -1
- package/build/features/business/Business.js +14 -7
- 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 +0 -9
- 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 +24 -7
- package/build/features/business/screens/BusinessType/LicenseNumber.js +14 -8
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +6 -0
- package/build/features/business/screens/BusinessType/LicenseType.js +67 -0
- package/build/features/business/screens/BusinessType/validation.d.ts +19 -0
- package/build/features/business/screens/BusinessType/validation.js +50 -1
- 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/SuccessWithFlowButtons/SuccessWithFlowButtons.js +10 -7
- 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 +2 -1
- package/build/features/connect/Connect.js +47 -12
- package/build/features/connect/screens/CivilID/CivilID.d.ts +5 -0
- package/build/features/connect/screens/CivilID/CivilID.js +99 -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 +41 -27
- 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 +41 -64
- package/build/features/connect/screens/Merchant/SalesChannels.d.ts +3 -1
- package/build/features/connect/screens/Merchant/SalesChannels.js +30 -31
- package/build/features/connect/screens/Merchant/SocialMedia.d.ts +1 -4
- package/build/features/connect/screens/Merchant/SocialMedia.js +129 -109
- 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 +108 -173
- package/build/features/connect/screens/Mobile/Mobile.js +30 -12
- package/build/features/connect/screens/NID/NID.js +2 -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/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.d.ts +1 -1
- package/build/features/entity/Entity.js +16 -9
- package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +55 -0
- package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +149 -0
- 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 +71 -2
- package/build/features/entity/screens/EntityInfoConfirm/LicenseName.d.ts +5 -0
- package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +32 -0
- package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +5 -0
- package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +49 -0
- package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.d.ts +6 -0
- package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +33 -0
- package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +68 -0
- package/build/features/entity/screens/EntityInfoConfirm/validation.js +24 -0
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -5
- package/build/features/entity/screens/Verify/Verify.js +18 -5
- package/build/features/featuresScreens.d.ts +1 -1
- package/build/features/featuresScreens.js +31 -6
- package/build/features/individual/Individual.d.ts +1 -1
- package/build/features/individual/Individual.js +14 -7
- 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/SuccessWithFlowButtons/SuccessWithFlowButtons.js +12 -8
- package/build/features/individual/screens/Verify/Verify.js +18 -5
- package/build/features/password/Password.d.ts +1 -1
- package/build/features/password/Password.js +14 -7
- 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/SuccessWithFlowButtons/SuccessWithFlowButtons.js +12 -9
- package/build/features/password/screens/Verify/Verify.js +16 -3
- package/build/features/shared/Background/Background.d.ts +6 -5
- package/build/features/shared/Background/Background.js +16 -5
- 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.js +1 -1
- package/build/features/shared/UploadFile/UploadFile.d.ts +10 -3
- package/build/features/shared/UploadFile/UploadFile.js +24 -9
- package/build/features/signIn/SignIn.d.ts +1 -1
- package/build/features/signIn/SignIn.js +14 -6
- 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.d.ts +1 -1
- package/build/features/tax/Tax.js +16 -8
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +11 -7
- 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 +4 -2
- package/build/hooks/useAppDispatch.d.ts +1 -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 +3 -3
- package/build/index.js +5 -5
- package/build/utils/array.d.ts +13 -1
- package/build/utils/array.js +26 -0
- package/build/utils/common.d.ts +1 -0
- package/build/utils/common.js +3 -0
- package/build/utils/device.d.ts +1 -0
- package/build/utils/device.js +13 -0
- package/build/utils/html.d.ts +1 -0
- package/build/utils/html.js +6 -0
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +1 -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/rsa.d.ts +2 -2
- package/build/utils/rsa.js +1 -1
- package/build/utils/string.d.ts +33 -20
- package/build/utils/string.js +71 -1
- package/build/utils/validation.d.ts +2 -0
- package/build/utils/validation.js +6 -0
- package/package.json +5 -4
- 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/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/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
|
@@ -3,11 +3,14 @@ import { EntityFormValues, FlowsTypes, OTPFormValues, ResponseData, SharedState
|
|
|
3
3
|
export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
4
4
|
data: any;
|
|
5
5
|
boardResponse: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
user: any;
|
|
7
|
+
brand: any;
|
|
8
|
+
bank_account: any;
|
|
9
|
+
entity: any;
|
|
10
|
+
merchant: any;
|
|
11
|
+
name: any;
|
|
12
|
+
contact: any;
|
|
13
|
+
flows: any;
|
|
11
14
|
};
|
|
12
15
|
token: string;
|
|
13
16
|
}, string, {}>;
|
|
@@ -16,11 +19,32 @@ export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
16
19
|
}, void, {}>;
|
|
17
20
|
export declare const verifyEntityLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
18
21
|
data: any;
|
|
22
|
+
boardResponse: {
|
|
23
|
+
user: any;
|
|
24
|
+
brand: any;
|
|
25
|
+
bank_account: any;
|
|
26
|
+
entity: any;
|
|
27
|
+
merchant: any;
|
|
28
|
+
name: any;
|
|
29
|
+
contact: any;
|
|
30
|
+
flows: any;
|
|
31
|
+
};
|
|
19
32
|
formData: OTPFormValues;
|
|
20
33
|
}, OTPFormValues, {}>;
|
|
21
34
|
export declare const retrieveBoardDetails: import("@reduxjs/toolkit").AsyncThunk<{
|
|
22
35
|
data: any;
|
|
23
36
|
}, string, {}>;
|
|
37
|
+
export declare const updateEntity: import("@reduxjs/toolkit").AsyncThunk<{
|
|
38
|
+
data: any;
|
|
39
|
+
formData: EntityFormValues;
|
|
40
|
+
}, EntityFormValues, {}>;
|
|
41
|
+
interface UploadArticleParams {
|
|
42
|
+
file: File;
|
|
43
|
+
onProgress?: (value: number) => void;
|
|
44
|
+
}
|
|
45
|
+
export declare const uploadArticle: import("@reduxjs/toolkit").AsyncThunk<{
|
|
46
|
+
data: any;
|
|
47
|
+
}, UploadArticleParams, {}>;
|
|
24
48
|
export declare const updateBoardSuccess: import("@reduxjs/toolkit").AsyncThunk<{
|
|
25
49
|
response: any;
|
|
26
50
|
formData: void;
|
|
@@ -36,6 +60,7 @@ export interface EntityData {
|
|
|
36
60
|
}
|
|
37
61
|
export interface EntityState extends SharedState<EntityData> {
|
|
38
62
|
customLoading?: boolean;
|
|
63
|
+
uploading?: boolean;
|
|
39
64
|
}
|
|
40
65
|
export declare const entitySlice: import("@reduxjs/toolkit").Slice<EntityState, {
|
|
41
66
|
clearError: (state: EntityState) => void;
|
|
@@ -49,13 +49,15 @@ var _a;
|
|
|
49
49
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
50
50
|
import API from '../../../api';
|
|
51
51
|
import { FlowsTypes } from '../../../@types';
|
|
52
|
-
import {
|
|
53
|
-
import { ENTITY_STEP_NAMES
|
|
52
|
+
import { handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
|
|
53
|
+
import { ENTITY_STEP_NAMES } from '../../../constants';
|
|
54
|
+
import moment from 'moment';
|
|
55
|
+
import { convertNumbers2English } from '../../../utils';
|
|
54
56
|
export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
55
|
-
var payload, data, boardInfoData, board_id, board_info_id, info, hasEntityCompleted;
|
|
56
|
-
var _a;
|
|
57
|
-
return __generator(this, function (
|
|
58
|
-
switch (
|
|
57
|
+
var payload, data, boardData, entityData, boardInfoData, board_id, board_info_id, entityId, countryIso2, info, hasEntityCompleted;
|
|
58
|
+
var _a, _b, _c, _d;
|
|
59
|
+
return __generator(this, function (_e) {
|
|
60
|
+
switch (_e.label) {
|
|
59
61
|
case 0:
|
|
60
62
|
payload = {
|
|
61
63
|
service_name: 'tap_email',
|
|
@@ -63,32 +65,57 @@ export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function
|
|
|
63
65
|
};
|
|
64
66
|
return [4, API.leadService.verifyLeadToken(payload)];
|
|
65
67
|
case 1:
|
|
66
|
-
data = (
|
|
68
|
+
data = (_e.sent()).data;
|
|
67
69
|
boardInfoData = undefined;
|
|
68
|
-
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, 8];
|
|
71
|
+
if (!(data.step_name !== ENTITY_STEP_NAMES.PHONE_AUTH)) return [3, 8];
|
|
69
72
|
board_id = data === null || data === void 0 ? void 0 : data.id;
|
|
70
73
|
board_info_id = data === null || data === void 0 ? void 0 : data.board_info_id;
|
|
71
|
-
if (!(
|
|
74
|
+
if (!(board_id && board_info_id)) return [3, 3];
|
|
72
75
|
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
73
76
|
case 2:
|
|
74
|
-
boardInfoData =
|
|
75
|
-
|
|
76
|
-
case 3:
|
|
77
|
+
boardInfoData = _e.sent();
|
|
78
|
+
_e.label = 3;
|
|
79
|
+
case 3:
|
|
80
|
+
if (!board_id) return [3, 5];
|
|
81
|
+
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
77
82
|
case 4:
|
|
78
|
-
|
|
83
|
+
boardData = _e.sent();
|
|
84
|
+
_e.label = 5;
|
|
85
|
+
case 5:
|
|
86
|
+
entityId = (_a = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _a === void 0 ? void 0 : _a.id;
|
|
87
|
+
if (!entityId) return [3, 7];
|
|
88
|
+
return [4, API.entityService.retrieveEntity(entityId)];
|
|
89
|
+
case 6:
|
|
90
|
+
entityData = _e.sent();
|
|
91
|
+
_e.label = 7;
|
|
92
|
+
case 7:
|
|
93
|
+
countryIso2 = entityData.country;
|
|
94
|
+
if (countryIso2)
|
|
95
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
79
96
|
info = boardInfoData.info;
|
|
80
|
-
hasEntityCompleted = ((
|
|
81
|
-
if (
|
|
82
|
-
thunkApi.dispatch(handleCurrentActiveScreen('ENTITY_VERIFY_STEP'));
|
|
83
|
-
}
|
|
84
|
-
else if (hasEntityCompleted) {
|
|
97
|
+
hasEntityCompleted = ((_b = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'entity'; })) === null || _b === void 0 ? void 0 : _b.status) === 'completed';
|
|
98
|
+
if (hasEntityCompleted) {
|
|
85
99
|
thunkApi.dispatch(handleNextScreenStep('ENTITY_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
86
100
|
}
|
|
87
|
-
else
|
|
101
|
+
else {
|
|
88
102
|
thunkApi.dispatch(handleNextScreenStep('ENTITY_INFO_STEP'));
|
|
89
103
|
}
|
|
90
|
-
|
|
91
|
-
case
|
|
104
|
+
_e.label = 8;
|
|
105
|
+
case 8: return [2, {
|
|
106
|
+
data: data,
|
|
107
|
+
boardResponse: {
|
|
108
|
+
user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
|
|
109
|
+
brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
|
|
110
|
+
bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
|
|
111
|
+
entity: entityData === null || entityData === void 0 ? void 0 : entityData.entity,
|
|
112
|
+
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
113
|
+
name: (_c = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _c === void 0 ? void 0 : _c.names,
|
|
114
|
+
contact: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _d === void 0 ? void 0 : _d.contact,
|
|
115
|
+
flows: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info
|
|
116
|
+
},
|
|
117
|
+
token: token
|
|
118
|
+
}];
|
|
92
119
|
}
|
|
93
120
|
});
|
|
94
121
|
}); });
|
|
@@ -110,14 +137,13 @@ export var resendOTP = createAsyncThunk('entityResendOTP', function (params, thu
|
|
|
110
137
|
});
|
|
111
138
|
}); });
|
|
112
139
|
export var verifyEntityLeadOTP = createAsyncThunk('verifyEntityLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
113
|
-
var _a, entity, settings, responseBody,
|
|
114
|
-
var _b, _c, _d, _e;
|
|
115
|
-
return __generator(this, function (
|
|
116
|
-
switch (
|
|
140
|
+
var _a, entity, settings, responseBody, payload, data, boardData, entityData, boardInfoData, board_id, board_info_id, entityId, info, hasEntityCompleted;
|
|
141
|
+
var _b, _c, _d, _e, _f, _g, _h;
|
|
142
|
+
return __generator(this, function (_j) {
|
|
143
|
+
switch (_j.label) {
|
|
117
144
|
case 0:
|
|
118
145
|
_a = thunkApi.getState(), entity = _a.entity, settings = _a.settings;
|
|
119
146
|
responseBody = entity.data.verify.responseBody;
|
|
120
|
-
flows = (responseBody || {}).flows;
|
|
121
147
|
payload = {
|
|
122
148
|
data: params.otp,
|
|
123
149
|
service_name: (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _b === void 0 ? void 0 : _b.service_name,
|
|
@@ -127,18 +153,54 @@ export var verifyEntityLeadOTP = createAsyncThunk('verifyEntityLeadOTP', functio
|
|
|
127
153
|
};
|
|
128
154
|
return [4, API.leadService.verifyLeadOTP(payload)];
|
|
129
155
|
case 1:
|
|
130
|
-
data = (
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
156
|
+
data = (_j.sent()).data;
|
|
157
|
+
boardInfoData = undefined;
|
|
158
|
+
if (!!data.errors) return [3, 8];
|
|
159
|
+
board_id = responseBody === null || responseBody === void 0 ? void 0 : responseBody.id;
|
|
160
|
+
board_info_id = responseBody === null || responseBody === void 0 ? void 0 : responseBody.board_info_id;
|
|
161
|
+
if (!(board_id && board_info_id)) return [3, 3];
|
|
162
|
+
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
163
|
+
case 2:
|
|
164
|
+
boardInfoData = _j.sent();
|
|
165
|
+
_j.label = 3;
|
|
166
|
+
case 3:
|
|
167
|
+
if (!board_id) return [3, 5];
|
|
168
|
+
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
169
|
+
case 4:
|
|
170
|
+
boardData = _j.sent();
|
|
171
|
+
_j.label = 5;
|
|
172
|
+
case 5:
|
|
173
|
+
entityId = (_c = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _c === void 0 ? void 0 : _c.id;
|
|
174
|
+
if (!entityId) return [3, 7];
|
|
175
|
+
return [4, API.entityService.retrieveEntity(entityId)];
|
|
176
|
+
case 6:
|
|
177
|
+
entityData = _j.sent();
|
|
178
|
+
_j.label = 7;
|
|
179
|
+
case 7:
|
|
180
|
+
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, { otp: params.otp });
|
|
181
|
+
info = boardInfoData.info;
|
|
182
|
+
hasEntityCompleted = ((_f = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'entity'; })) === null || _f === void 0 ? void 0 : _f.status) === 'completed';
|
|
183
|
+
if (hasEntityCompleted) {
|
|
184
|
+
thunkApi.dispatch(handleNextScreenStep('ENTITY_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
140
185
|
}
|
|
141
|
-
|
|
186
|
+
else {
|
|
187
|
+
thunkApi.dispatch(handleNextScreenStep('ENTITY_INFO_STEP'));
|
|
188
|
+
}
|
|
189
|
+
_j.label = 8;
|
|
190
|
+
case 8: return [2, {
|
|
191
|
+
data: data,
|
|
192
|
+
boardResponse: {
|
|
193
|
+
user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
|
|
194
|
+
brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
|
|
195
|
+
bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
|
|
196
|
+
entity: entityData === null || entityData === void 0 ? void 0 : entityData.entity,
|
|
197
|
+
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
198
|
+
name: (_g = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _g === void 0 ? void 0 : _g.names,
|
|
199
|
+
contact: (_h = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _h === void 0 ? void 0 : _h.contact,
|
|
200
|
+
flows: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info
|
|
201
|
+
},
|
|
202
|
+
formData: params
|
|
203
|
+
}];
|
|
142
204
|
}
|
|
143
205
|
});
|
|
144
206
|
}); });
|
|
@@ -151,11 +213,85 @@ export var retrieveBoardDetails = createAsyncThunk('entityRetrieveEntityInfo', f
|
|
|
151
213
|
case 1:
|
|
152
214
|
data = _c.sent();
|
|
153
215
|
return [2, {
|
|
154
|
-
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.
|
|
216
|
+
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 })
|
|
155
217
|
}];
|
|
156
218
|
}
|
|
157
219
|
});
|
|
158
220
|
}); });
|
|
221
|
+
export var updateEntity = createAsyncThunk('entityUpdateEntity', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
222
|
+
var _a, settings, entity, id, brandId, articleId, requestBody, brandData, payload, data;
|
|
223
|
+
var _b, _c, _d, _e, _f, _g, _h;
|
|
224
|
+
return __generator(this, function (_j) {
|
|
225
|
+
switch (_j.label) {
|
|
226
|
+
case 0:
|
|
227
|
+
_a = thunkApi.getState(), settings = _a.settings, entity = _a.entity;
|
|
228
|
+
id = (_c = (_b = entity.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.entity) === null || _c === void 0 ? void 0 : _c.id;
|
|
229
|
+
brandId = (_e = (_d = entity.data.verify.responseBody) === null || _d === void 0 ? void 0 : _d.brand) === null || _e === void 0 ? void 0 : _e.id;
|
|
230
|
+
articleId = entity.data.entityData.articleId;
|
|
231
|
+
requestBody = {
|
|
232
|
+
id: brandId,
|
|
233
|
+
activities: (_f = (params.activities || [])) === null || _f === void 0 ? void 0 : _f.map(function (_a) {
|
|
234
|
+
var id = _a.id;
|
|
235
|
+
return ({ id: id });
|
|
236
|
+
}),
|
|
237
|
+
operations: {
|
|
238
|
+
start_date: params.operationStartDate
|
|
239
|
+
},
|
|
240
|
+
encryption_contract: ['operations.start_date']
|
|
241
|
+
};
|
|
242
|
+
return [4, API.brandService.updateBrandInfo(requestBody)];
|
|
243
|
+
case 1:
|
|
244
|
+
brandData = (_j.sent()).data;
|
|
245
|
+
payload = {
|
|
246
|
+
id: id,
|
|
247
|
+
license: {
|
|
248
|
+
number: params.licenseNumber
|
|
249
|
+
},
|
|
250
|
+
legal_name: {
|
|
251
|
+
ar: params.licenseName,
|
|
252
|
+
en: params.licenseName
|
|
253
|
+
},
|
|
254
|
+
AOA_file_id: articleId,
|
|
255
|
+
encryption_contract: ['license.number', 'legal_name.ar', 'legal_name.en']
|
|
256
|
+
};
|
|
257
|
+
return [4, API.entityService.updateEntity(payload)];
|
|
258
|
+
case 2:
|
|
259
|
+
data = _j.sent();
|
|
260
|
+
thunkApi.dispatch(handleNextScreenStep());
|
|
261
|
+
(_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, id);
|
|
262
|
+
return [2, { data: __assign(__assign({}, data), brandData), formData: params }];
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
}); });
|
|
266
|
+
export var uploadArticle = createAsyncThunk('entityUploadArticle', function (_a) {
|
|
267
|
+
var file = _a.file, onProgress = _a.onProgress;
|
|
268
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
269
|
+
var typeArray, type, uploadPayload, onUploadProgress, data;
|
|
270
|
+
var _b;
|
|
271
|
+
return __generator(this, function (_c) {
|
|
272
|
+
switch (_c.label) {
|
|
273
|
+
case 0:
|
|
274
|
+
typeArray = ((_b = file === null || file === void 0 ? void 0 : file.type) === null || _b === void 0 ? void 0 : _b.split('/')) || [];
|
|
275
|
+
type = typeArray[1] || '';
|
|
276
|
+
uploadPayload = {
|
|
277
|
+
file_link_create: true,
|
|
278
|
+
title: file === null || file === void 0 ? void 0 : file.name,
|
|
279
|
+
purpose: 'identity_document',
|
|
280
|
+
type: type,
|
|
281
|
+
file: file
|
|
282
|
+
};
|
|
283
|
+
onUploadProgress = function (progressEvent) {
|
|
284
|
+
var progress = ((progressEvent === null || progressEvent === void 0 ? void 0 : progressEvent.loaded) / (progressEvent === null || progressEvent === void 0 ? void 0 : progressEvent.total)) * 100;
|
|
285
|
+
onProgress === null || onProgress === void 0 ? void 0 : onProgress(Math.floor(progress));
|
|
286
|
+
};
|
|
287
|
+
return [4, API.entityService.uploadFileInfo(uploadPayload, { onUploadProgress: onUploadProgress })];
|
|
288
|
+
case 1:
|
|
289
|
+
data = _c.sent();
|
|
290
|
+
return [2, { data: data }];
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
});
|
|
159
295
|
export var updateBoardSuccess = createAsyncThunk('updateBoardEntitySuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
160
296
|
var _a, settings, entity, _b, id, infoId, payload, data;
|
|
161
297
|
var _c, _d, _e, _f;
|
|
@@ -180,7 +316,7 @@ export var updateBoardSuccess = createAsyncThunk('updateBoardEntitySuccess', fun
|
|
|
180
316
|
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
|
|
181
317
|
(_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
|
|
182
318
|
thunkApi.dispatch(handleNextScreenStep());
|
|
183
|
-
return [2, { response: __assign(__assign({}, data), { flows:
|
|
319
|
+
return [2, { response: __assign(__assign({}, data), { flows: data === null || data === void 0 ? void 0 : data.info }), formData: params }];
|
|
184
320
|
}
|
|
185
321
|
});
|
|
186
322
|
}); });
|
|
@@ -188,6 +324,7 @@ var initialState = {
|
|
|
188
324
|
error: null,
|
|
189
325
|
loading: false,
|
|
190
326
|
customLoading: false,
|
|
327
|
+
uploading: false,
|
|
191
328
|
data: {
|
|
192
329
|
flowName: FlowsTypes.ENTITY,
|
|
193
330
|
verify: {
|
|
@@ -197,11 +334,11 @@ var initialState = {
|
|
|
197
334
|
otp: ''
|
|
198
335
|
},
|
|
199
336
|
entityData: {
|
|
200
|
-
licenseNumber: '',
|
|
201
337
|
licenseName: '',
|
|
338
|
+
licenseNumber: '',
|
|
202
339
|
activities: [],
|
|
203
|
-
|
|
204
|
-
|
|
340
|
+
operationStartDate: '',
|
|
341
|
+
uploading: false
|
|
205
342
|
}
|
|
206
343
|
}
|
|
207
344
|
};
|
|
@@ -226,17 +363,37 @@ export var entitySlice = createSlice({
|
|
|
226
363
|
state.customLoading = true;
|
|
227
364
|
})
|
|
228
365
|
.addCase(verifyLeadToken.fulfilled, function (state, action) {
|
|
229
|
-
var _a;
|
|
366
|
+
var _a, _b, _c, _d;
|
|
230
367
|
state.error = null;
|
|
231
368
|
state.customLoading = false;
|
|
232
|
-
var
|
|
369
|
+
var _e = action.payload, data = _e.data, token = _e.token, boardResponse = _e.boardResponse;
|
|
233
370
|
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
234
371
|
if (description) {
|
|
235
372
|
state.error = description;
|
|
236
373
|
return;
|
|
237
374
|
}
|
|
238
|
-
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data),
|
|
375
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.verify.responseBody), boardResponse), { board_id: data.id });
|
|
239
376
|
state.data.verify.token = token;
|
|
377
|
+
var _f = boardResponse || {}, brand = _f.brand, entity = _f.entity;
|
|
378
|
+
var licenseNumber = (_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.number;
|
|
379
|
+
var entityDate = (_c = entity === null || entity === void 0 ? void 0 : entity.license) === null || _c === void 0 ? void 0 : _c.issuing_date;
|
|
380
|
+
var startDate = (_d = brand === null || brand === void 0 ? void 0 : brand.operations) === null || _d === void 0 ? void 0 : _d.start_date;
|
|
381
|
+
var issuingDate = undefined;
|
|
382
|
+
if (entityDate) {
|
|
383
|
+
var date = new Date(entityDate);
|
|
384
|
+
var formattedDate = moment(date).format('YYYY-MM-DD');
|
|
385
|
+
issuingDate = convertNumbers2English(formattedDate);
|
|
386
|
+
}
|
|
387
|
+
if (licenseNumber)
|
|
388
|
+
state.data.entityData.licenseNumber = licenseNumber;
|
|
389
|
+
var activities = (entity === null || entity === void 0 ? void 0 : entity.activities) || [];
|
|
390
|
+
var selectedActivity = activities === null || activities === void 0 ? void 0 : activities.filter(function (activity) {
|
|
391
|
+
var _a;
|
|
392
|
+
return (_a = brand === null || brand === void 0 ? void 0 : brand.activities) === null || _a === void 0 ? void 0 : _a.find(function (value) { return value.id === activity.id; });
|
|
393
|
+
});
|
|
394
|
+
var defaultActivities = (activities === null || activities === void 0 ? void 0 : activities[0]) ? [activities === null || activities === void 0 ? void 0 : activities[0]] : [];
|
|
395
|
+
state.data.entityData.activities = (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : defaultActivities;
|
|
396
|
+
state.data.entityData.responseBody = __assign(__assign({}, state.data.entityData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activities: activities, operationStartDate: startDate || issuingDate, selectedActivities: (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : defaultActivities });
|
|
240
397
|
})
|
|
241
398
|
.addCase(verifyLeadToken.rejected, function (state, action) {
|
|
242
399
|
state.error = action.error.message;
|
|
@@ -264,10 +421,10 @@ export var entitySlice = createSlice({
|
|
|
264
421
|
state.error = null;
|
|
265
422
|
})
|
|
266
423
|
.addCase(verifyEntityLeadOTP.fulfilled, function (state, action) {
|
|
267
|
-
var _a;
|
|
424
|
+
var _a, _b, _c, _d;
|
|
268
425
|
state.loading = false;
|
|
269
426
|
state.error = null;
|
|
270
|
-
var
|
|
427
|
+
var _e = action.payload, data = _e.data, boardResponse = _e.boardResponse, formData = _e.formData;
|
|
271
428
|
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
272
429
|
if (description) {
|
|
273
430
|
state.error = description;
|
|
@@ -275,10 +432,50 @@ export var entitySlice = createSlice({
|
|
|
275
432
|
}
|
|
276
433
|
state.data.otpData = formData;
|
|
277
434
|
state.data.otpData.responseBody = data;
|
|
435
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), boardResponse);
|
|
436
|
+
var _f = boardResponse || {}, brand = _f.brand, entity = _f.entity;
|
|
437
|
+
var licenseNumber = (_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.number;
|
|
438
|
+
var entityDate = (_c = entity === null || entity === void 0 ? void 0 : entity.license) === null || _c === void 0 ? void 0 : _c.issuing_date;
|
|
439
|
+
var startDate = (_d = brand === null || brand === void 0 ? void 0 : brand.operations) === null || _d === void 0 ? void 0 : _d.start_date;
|
|
440
|
+
var issuingDate = undefined;
|
|
441
|
+
if (entityDate) {
|
|
442
|
+
var date = new Date(entityDate);
|
|
443
|
+
var formattedDate = moment(date).format('YYYY-MM-DD');
|
|
444
|
+
issuingDate = convertNumbers2English(formattedDate);
|
|
445
|
+
}
|
|
446
|
+
if (licenseNumber)
|
|
447
|
+
state.data.entityData.licenseNumber = licenseNumber;
|
|
448
|
+
var activities = (entity === null || entity === void 0 ? void 0 : entity.activities) || [];
|
|
449
|
+
var selectedActivity = activities === null || activities === void 0 ? void 0 : activities.filter(function (activity) {
|
|
450
|
+
var _a;
|
|
451
|
+
return (_a = brand === null || brand === void 0 ? void 0 : brand.activities) === null || _a === void 0 ? void 0 : _a.find(function (value) { return value.id === activity.id; });
|
|
452
|
+
});
|
|
453
|
+
state.data.entityData.responseBody = __assign(__assign({}, state.data.entityData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activities: activities, selectedActivities: (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : [activities === null || activities === void 0 ? void 0 : activities[0]], operationStartDate: startDate || issuingDate });
|
|
278
454
|
})
|
|
279
455
|
.addCase(verifyEntityLeadOTP.rejected, function (state, action) {
|
|
280
456
|
state.loading = false;
|
|
281
457
|
state.error = action.error.message;
|
|
458
|
+
})
|
|
459
|
+
.addCase(updateEntity.pending, function (state) {
|
|
460
|
+
state.loading = true;
|
|
461
|
+
state.error = null;
|
|
462
|
+
})
|
|
463
|
+
.addCase(updateEntity.fulfilled, function (state, action) {
|
|
464
|
+
var _a;
|
|
465
|
+
state.loading = false;
|
|
466
|
+
state.error = null;
|
|
467
|
+
var _b = action.payload, data = _b.data, formData = _b.formData;
|
|
468
|
+
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
469
|
+
if (description) {
|
|
470
|
+
state.error = description;
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
state.data.entityData = formData;
|
|
474
|
+
state.data.entityData.responseBody = data;
|
|
475
|
+
})
|
|
476
|
+
.addCase(updateEntity.rejected, function (state, action) {
|
|
477
|
+
state.loading = false;
|
|
478
|
+
state.error = action.error.message;
|
|
282
479
|
})
|
|
283
480
|
.addCase(retrieveBoardDetails.pending, function (state) {
|
|
284
481
|
state.error = null;
|
|
@@ -314,6 +511,20 @@ export var entitySlice = createSlice({
|
|
|
314
511
|
.addCase(updateBoardSuccess.rejected, function (state, action) {
|
|
315
512
|
state.loading = false;
|
|
316
513
|
state.error = action.error.message;
|
|
514
|
+
})
|
|
515
|
+
.addCase(uploadArticle.pending, function (state) {
|
|
516
|
+
state.error = null;
|
|
517
|
+
state.uploading = true;
|
|
518
|
+
})
|
|
519
|
+
.addCase(uploadArticle.fulfilled, function (state, action) {
|
|
520
|
+
state.error = null;
|
|
521
|
+
state.uploading = false;
|
|
522
|
+
var data = action.payload.data;
|
|
523
|
+
state.data.entityData.articleId = data === null || data === void 0 ? void 0 : data.id;
|
|
524
|
+
})
|
|
525
|
+
.addCase(uploadArticle.rejected, function (state) {
|
|
526
|
+
state.uploading = false;
|
|
527
|
+
state.error = 'file_upload_error';
|
|
317
528
|
});
|
|
318
529
|
}
|
|
319
530
|
});
|
|
@@ -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,22 @@ 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
|
+
notification: any;
|
|
47
|
+
flows: {
|
|
48
|
+
name: string;
|
|
49
|
+
status: string;
|
|
50
|
+
url: string;
|
|
51
|
+
}[];
|
|
52
|
+
};
|
|
36
53
|
formData: {
|
|
37
54
|
otp: string;
|
|
38
55
|
};
|