@tap-payments/auth-jsconnect 2.0.32-test → 2.0.32
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 +57 -20
- package/build/@types/app.js +14 -1
- package/build/@types/form.d.ts +17 -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 +28 -5
- package/build/api/entity.js +23 -9
- package/build/api/firebase.d.ts +1 -1
- package/build/api/firebase.js +3 -1
- package/build/api/index.d.ts +41 -14
- package/build/api/individual.d.ts +76 -19
- package/build/api/individual.js +29 -2
- package/build/api/lead.d.ts +8 -6
- 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 +256 -179
- package/build/assets/locales/en.json +188 -104
- 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 +107 -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 +1 -4
- package/build/components/SocialMediaGroup/SocialMediaGroup.js +3 -55
- 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 +55 -22
- package/build/constants/assets.d.ts +20 -1
- package/build/constants/assets.js +27 -8
- 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 +265 -0
- package/build/features/app/bank/bankStore.d.ts +16 -0
- package/build/features/app/bank/bankStore.js +81 -37
- package/build/features/app/business/businessStore.d.ts +22 -3
- package/build/features/app/business/businessStore.js +430 -290
- package/build/features/app/connect/connectStore.d.ts +33 -30
- package/build/features/app/connect/connectStore.js +398 -258
- package/build/features/app/entity/entityStore.d.ts +5 -0
- package/build/features/app/entity/entityStore.js +153 -14
- package/build/features/app/individual/individualStore.d.ts +17 -0
- package/build/features/app/individual/individualStore.js +167 -83
- package/build/features/app/password/passwordStore.js +1 -1
- package/build/features/app/tax/taxStore.js +3 -2
- 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 +67 -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 +2 -2
- 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 +1 -6
- 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 +84 -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/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/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 +157 -0
- package/build/features/business/screens/VerifyPACI/VerifyPACILoading.d.ts +5 -0
- package/build/features/business/screens/VerifyPACI/VerifyPACILoading.js +22 -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 +98 -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 +27 -14
- 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 +47 -50
- package/build/features/connect/screens/Merchant/SalesChannels.d.ts +7 -0
- package/build/features/connect/screens/Merchant/SalesChannels.js +113 -0
- package/build/features/connect/screens/Merchant/SocialMedia.d.ts +1 -4
- package/build/features/connect/screens/Merchant/SocialMedia.js +131 -66
- package/build/features/connect/screens/Merchant/TAC.js +8 -2
- package/build/features/connect/screens/Merchant/validation.d.ts +22 -45
- package/build/features/connect/screens/Merchant/validation.js +117 -116
- package/build/features/connect/screens/Mobile/Mobile.js +31 -10
- package/build/features/connect/screens/NID/NID.js +2 -1
- package/build/features/connect/screens/OTP/OTP.js +5 -4
- 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 +5 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.js +22 -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 +54 -0
- package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +140 -0
- package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +52 -2
- package/build/features/entity/screens/EntityInfoConfirm/LicenseName.d.ts +5 -0
- package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +17 -0
- package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +5 -0
- package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +28 -0
- package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.d.ts +6 -0
- package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +38 -0
- package/build/features/{business/screens/Activities → entity/screens/EntityInfoConfirm}/SalesChannels.d.ts +0 -0
- package/build/features/{business/screens/Activities → entity/screens/EntityInfoConfirm}/SalesChannels.js +8 -5
- package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +107 -0
- package/build/features/entity/screens/EntityInfoConfirm/validation.js +17 -0
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -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 +1 -1
- 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 +4 -4
- package/build/features/password/Password.d.ts +1 -1
- package/build/features/password/Password.js +14 -7
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +12 -9
- 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 +9 -3
- package/build/features/shared/UploadFile/UploadFile.js +23 -8
- package/build/features/signIn/SignIn.d.ts +1 -1
- package/build/features/signIn/SignIn.js +14 -6
- 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/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -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 -5
- package/build/hooks/useScreen.d.ts +3 -0
- package/build/hooks/useScreen.js +14 -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 +129 -128
- package/build/features/app/otp/otpStore.d.ts +0 -28
- package/build/features/app/otp/otpStore.js +0 -153
- package/build/features/otp/OTP.d.ts +0 -7
- package/build/features/otp/OTP.js +0 -55
- 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 -50
- package/build/features/otp/screens/OTPVerify/index.d.ts +0 -2
- package/build/features/otp/screens/OTPVerify/index.js +0 -2
|
@@ -21,10 +21,15 @@ export declare const verifyEntityLeadOTP: import("@reduxjs/toolkit").AsyncThunk<
|
|
|
21
21
|
export declare const retrieveBoardDetails: import("@reduxjs/toolkit").AsyncThunk<{
|
|
22
22
|
data: any;
|
|
23
23
|
}, string, {}>;
|
|
24
|
+
export declare const updateEntityInfo: import("@reduxjs/toolkit").AsyncThunk<{
|
|
25
|
+
data: any;
|
|
26
|
+
formData: EntityFormValues;
|
|
27
|
+
}, EntityFormValues, {}>;
|
|
24
28
|
export declare const updateBoardSuccess: import("@reduxjs/toolkit").AsyncThunk<{
|
|
25
29
|
response: any;
|
|
26
30
|
formData: void;
|
|
27
31
|
} | undefined, void, {}>;
|
|
32
|
+
export declare const retrieveChannels: import("@reduxjs/toolkit").AsyncThunk<any, void, {}>;
|
|
28
33
|
declare type VerifyData = {
|
|
29
34
|
token: string;
|
|
30
35
|
};
|
|
@@ -51,6 +51,8 @@ import API from '../../../api';
|
|
|
51
51
|
import { FlowsTypes } from '../../../@types';
|
|
52
52
|
import { handleCurrentActiveScreen, handleNextScreenStep } from '../../../app/settings';
|
|
53
53
|
import { ENTITY_STEP_NAMES, BUSINESS_FLOW_SUCCESS } 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
57
|
var payload, data, boardInfoData, board_id, board_info_id, info, hasEntityCompleted;
|
|
56
58
|
var _a;
|
|
@@ -64,22 +66,26 @@ export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function
|
|
|
64
66
|
return [4, API.leadService.verifyLeadToken(payload)];
|
|
65
67
|
case 1:
|
|
66
68
|
data = (_b.sent()).data;
|
|
69
|
+
return [4, thunkApi.dispatch(retrieveChannels())];
|
|
70
|
+
case 2:
|
|
71
|
+
_b.sent();
|
|
67
72
|
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,
|
|
73
|
+
if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 6];
|
|
69
74
|
board_id = data === null || data === void 0 ? void 0 : data.id;
|
|
70
75
|
board_info_id = data === null || data === void 0 ? void 0 : data.board_info_id;
|
|
71
|
-
if (!(!!board_id && !!board_info_id)) return [3,
|
|
76
|
+
if (!(!!board_id && !!board_info_id)) return [3, 4];
|
|
72
77
|
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
73
|
-
case
|
|
78
|
+
case 3:
|
|
74
79
|
boardInfoData = _b.sent();
|
|
75
|
-
_b.label =
|
|
76
|
-
case
|
|
77
|
-
case
|
|
80
|
+
_b.label = 4;
|
|
81
|
+
case 4: return [4, thunkApi.dispatch(retrieveBoardDetails(board_id))];
|
|
82
|
+
case 5:
|
|
78
83
|
_b.sent();
|
|
79
84
|
info = boardInfoData.info;
|
|
80
85
|
hasEntityCompleted = ((_a = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'entity'; })) === null || _a === void 0 ? void 0 : _a.status) === 'completed';
|
|
86
|
+
thunkApi.dispatch(handleCurrentActiveScreen('ENTITY_INFO_STEP'));
|
|
81
87
|
if (data.step_name === ENTITY_STEP_NAMES.PHONE_AUTH) {
|
|
82
|
-
thunkApi.dispatch(handleCurrentActiveScreen('
|
|
88
|
+
thunkApi.dispatch(handleCurrentActiveScreen('ENTITY_INFO_STEP'));
|
|
83
89
|
}
|
|
84
90
|
else if (hasEntityCompleted) {
|
|
85
91
|
thunkApi.dispatch(handleNextScreenStep('ENTITY_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
@@ -87,8 +93,8 @@ export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function
|
|
|
87
93
|
else if (data.step_name === ENTITY_STEP_NAMES.ENTITY_INFO) {
|
|
88
94
|
thunkApi.dispatch(handleNextScreenStep('ENTITY_INFO_STEP'));
|
|
89
95
|
}
|
|
90
|
-
_b.label =
|
|
91
|
-
case
|
|
96
|
+
_b.label = 6;
|
|
97
|
+
case 6: return [2, { data: data, boardResponse: { flows: BUSINESS_FLOW_SUCCESS.concat(boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) }, token: token }];
|
|
92
98
|
}
|
|
93
99
|
});
|
|
94
100
|
}); });
|
|
@@ -156,6 +162,35 @@ export var retrieveBoardDetails = createAsyncThunk('entityRetrieveEntityInfo', f
|
|
|
156
162
|
}
|
|
157
163
|
});
|
|
158
164
|
}); });
|
|
165
|
+
export var updateEntityInfo = createAsyncThunk('updateEntityInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
166
|
+
var _a, settings, entity, requestBody, data;
|
|
167
|
+
var _b, _c, _d, _e, _f;
|
|
168
|
+
return __generator(this, function (_g) {
|
|
169
|
+
switch (_g.label) {
|
|
170
|
+
case 0:
|
|
171
|
+
_a = thunkApi.getState(), settings = _a.settings, entity = _a.entity;
|
|
172
|
+
requestBody = {
|
|
173
|
+
id: (_c = (_b = entity.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.entity) === null || _c === void 0 ? void 0 : _c.id,
|
|
174
|
+
activities: (_d = (params.activities || [])) === null || _d === void 0 ? void 0 : _d.map(function (_a) {
|
|
175
|
+
var id = _a.id;
|
|
176
|
+
return ({ id: id });
|
|
177
|
+
}),
|
|
178
|
+
license_name: params.licenseName,
|
|
179
|
+
license_number: params.licenseNumber,
|
|
180
|
+
business_operation_start_at: params.operationStartDate,
|
|
181
|
+
step_name: ENTITY_STEP_NAMES.ENTITY_INFO
|
|
182
|
+
};
|
|
183
|
+
return [4, API.entityService.updateEntityInfo(requestBody)];
|
|
184
|
+
case 1:
|
|
185
|
+
data = (_g.sent()).data;
|
|
186
|
+
if (!data.errors) {
|
|
187
|
+
thunkApi.dispatch(handleNextScreenStep());
|
|
188
|
+
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, requestBody);
|
|
189
|
+
}
|
|
190
|
+
return [2, { data: data, formData: params }];
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}); });
|
|
159
194
|
export var updateBoardSuccess = createAsyncThunk('updateBoardEntitySuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
160
195
|
var _a, settings, entity, _b, id, infoId, payload, data;
|
|
161
196
|
var _c, _d, _e, _f;
|
|
@@ -184,6 +219,21 @@ export var updateBoardSuccess = createAsyncThunk('updateBoardEntitySuccess', fun
|
|
|
184
219
|
}
|
|
185
220
|
});
|
|
186
221
|
}); });
|
|
222
|
+
export var retrieveChannels = createAsyncThunk('retrieveChannelsEntity', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
223
|
+
var body, data;
|
|
224
|
+
return __generator(this, function (_a) {
|
|
225
|
+
switch (_a.label) {
|
|
226
|
+
case 0:
|
|
227
|
+
body = {
|
|
228
|
+
page: 0
|
|
229
|
+
};
|
|
230
|
+
return [4, API.dataService.getChannelsOfServices(body)];
|
|
231
|
+
case 1:
|
|
232
|
+
data = _a.sent();
|
|
233
|
+
return [2, data];
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
}); });
|
|
187
237
|
var initialState = {
|
|
188
238
|
error: null,
|
|
189
239
|
loading: false,
|
|
@@ -197,11 +247,9 @@ var initialState = {
|
|
|
197
247
|
otp: ''
|
|
198
248
|
},
|
|
199
249
|
entityData: {
|
|
200
|
-
licenseNumber: '',
|
|
201
|
-
licenseName: '',
|
|
202
250
|
activities: [],
|
|
203
251
|
salesChannels: [],
|
|
204
|
-
operationStartDate:
|
|
252
|
+
operationStartDate: new Date().toString()
|
|
205
253
|
}
|
|
206
254
|
}
|
|
207
255
|
};
|
|
@@ -226,15 +274,49 @@ export var entitySlice = createSlice({
|
|
|
226
274
|
state.customLoading = true;
|
|
227
275
|
})
|
|
228
276
|
.addCase(verifyLeadToken.fulfilled, function (state, action) {
|
|
229
|
-
var _a;
|
|
277
|
+
var _a, _b, _c;
|
|
230
278
|
state.error = null;
|
|
231
279
|
state.customLoading = false;
|
|
232
|
-
var
|
|
280
|
+
var _d = action.payload, data = _d.data, token = _d.token, boardResponse = _d.boardResponse;
|
|
233
281
|
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
234
282
|
if (description) {
|
|
235
283
|
state.error = description;
|
|
236
284
|
return;
|
|
237
285
|
}
|
|
286
|
+
var _e = state.data.verify.responseBody || {}, brand = _e.brand, entity = _e.entity;
|
|
287
|
+
var issuingDate = brand === null || brand === void 0 ? void 0 : brand.business_operation_start_at;
|
|
288
|
+
if (!!issuingDate) {
|
|
289
|
+
var formattedDate = moment(issuingDate).format('YYYY-MM-DD');
|
|
290
|
+
state.data.entityData.operationStartDate = convertNumbers2English(formattedDate);
|
|
291
|
+
}
|
|
292
|
+
var channels = (_b = state.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.channelList;
|
|
293
|
+
var selectedChannels = (!!(channels === null || channels === void 0 ? void 0 : channels[0]) && [channels === null || channels === void 0 ? void 0 : channels[0]]) || [];
|
|
294
|
+
var _f = brand || {}, website = _f.website, social = _f.social;
|
|
295
|
+
var isHasWebsite = (website === null || website === void 0 ? void 0 : website.length) > 0;
|
|
296
|
+
var isHasTwitter = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('twitter.com'); });
|
|
297
|
+
var isHasInstagram = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('instagram.com'); });
|
|
298
|
+
var websiteData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { var _a; return ((_a = c === null || c === void 0 ? void 0 : c.name) === null || _a === void 0 ? void 0 : _a.en.toLocaleLowerCase()) === 'website'; });
|
|
299
|
+
var socialData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { var _a; return ((_a = c === null || c === void 0 ? void 0 : c.name) === null || _a === void 0 ? void 0 : _a.en.toLocaleLowerCase()) === 'social media'; });
|
|
300
|
+
if (isHasWebsite && (isHasTwitter || isHasInstagram))
|
|
301
|
+
selectedChannels = [websiteData, socialData];
|
|
302
|
+
else if (isHasTwitter || isHasInstagram)
|
|
303
|
+
selectedChannels = [socialData];
|
|
304
|
+
else if (isHasWebsite)
|
|
305
|
+
selectedChannels = [websiteData];
|
|
306
|
+
if (((_c = brand === null || brand === void 0 ? void 0 : brand.channel_services) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
|
307
|
+
selectedChannels = channels === null || channels === void 0 ? void 0 : channels.filter(function (channel) {
|
|
308
|
+
var _a;
|
|
309
|
+
return (_a = brand === null || brand === void 0 ? void 0 : brand.channel_services) === null || _a === void 0 ? void 0 : _a.find(function (storedChannel) { var _a; return ((_a = channel === null || channel === void 0 ? void 0 : channel.name) === null || _a === void 0 ? void 0 : _a.en.toLowerCase()) === storedChannel.toLowerCase(); });
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
state.data.entityData.salesChannels = selectedChannels;
|
|
313
|
+
var activities = (entity === null || entity === void 0 ? void 0 : entity.activities) || [];
|
|
314
|
+
var selectedActivity = activities === null || activities === void 0 ? void 0 : activities.filter(function (activity) {
|
|
315
|
+
var _a;
|
|
316
|
+
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; });
|
|
317
|
+
});
|
|
318
|
+
state.data.entityData.activities = (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : [activities === null || activities === void 0 ? void 0 : activities[0]];
|
|
319
|
+
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]] });
|
|
238
320
|
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), boardResponse), state.data.verify.responseBody), { board_id: data.id });
|
|
239
321
|
state.data.verify.token = token;
|
|
240
322
|
})
|
|
@@ -279,6 +361,27 @@ export var entitySlice = createSlice({
|
|
|
279
361
|
.addCase(verifyEntityLeadOTP.rejected, function (state, action) {
|
|
280
362
|
state.loading = false;
|
|
281
363
|
state.error = action.error.message;
|
|
364
|
+
})
|
|
365
|
+
.addCase(updateEntityInfo.pending, function (state) {
|
|
366
|
+
state.loading = true;
|
|
367
|
+
state.error = null;
|
|
368
|
+
})
|
|
369
|
+
.addCase(updateEntityInfo.fulfilled, function (state, action) {
|
|
370
|
+
var _a;
|
|
371
|
+
state.loading = false;
|
|
372
|
+
state.error = null;
|
|
373
|
+
var _b = action.payload, data = _b.data, formData = _b.formData;
|
|
374
|
+
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
375
|
+
if (description) {
|
|
376
|
+
state.error = description;
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
state.data.entityData = formData;
|
|
380
|
+
state.data.entityData.responseBody = data;
|
|
381
|
+
})
|
|
382
|
+
.addCase(updateEntityInfo.rejected, function (state, action) {
|
|
383
|
+
state.loading = false;
|
|
384
|
+
state.error = action.error.message;
|
|
282
385
|
})
|
|
283
386
|
.addCase(retrieveBoardDetails.pending, function (state) {
|
|
284
387
|
state.error = null;
|
|
@@ -314,6 +417,42 @@ export var entitySlice = createSlice({
|
|
|
314
417
|
.addCase(updateBoardSuccess.rejected, function (state, action) {
|
|
315
418
|
state.loading = false;
|
|
316
419
|
state.error = action.error.message;
|
|
420
|
+
})
|
|
421
|
+
.addCase(retrieveChannels.pending, function (state) {
|
|
422
|
+
state.error = null;
|
|
423
|
+
state.loading = true;
|
|
424
|
+
})
|
|
425
|
+
.addCase(retrieveChannels.fulfilled, function (state, action) {
|
|
426
|
+
var _a;
|
|
427
|
+
state.error = null;
|
|
428
|
+
state.loading = false;
|
|
429
|
+
var data = action.payload || {};
|
|
430
|
+
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
431
|
+
if (description) {
|
|
432
|
+
state.error = description;
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
var channels = data.list || [];
|
|
436
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { channelList: channels });
|
|
437
|
+
var brand = (state.data.verify.responseBody || {}).brand;
|
|
438
|
+
var selectedChannels = (!!(channels === null || channels === void 0 ? void 0 : channels[0]) && [channels === null || channels === void 0 ? void 0 : channels[0]]) || [];
|
|
439
|
+
var _b = brand || {}, website = _b.website, social = _b.social;
|
|
440
|
+
var isHasWebsite = (website === null || website === void 0 ? void 0 : website.length) > 0;
|
|
441
|
+
var isHasTwitter = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('twitter.com'); });
|
|
442
|
+
var isHasInstagram = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('instagram.com'); });
|
|
443
|
+
var websiteData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { var _a; return ((_a = c === null || c === void 0 ? void 0 : c.name) === null || _a === void 0 ? void 0 : _a.en.toLocaleLowerCase()) === 'website'; });
|
|
444
|
+
var socialData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { var _a; return ((_a = c === null || c === void 0 ? void 0 : c.name) === null || _a === void 0 ? void 0 : _a.en.toLocaleLowerCase()) === 'social media'; });
|
|
445
|
+
if (isHasWebsite && (isHasTwitter || isHasInstagram))
|
|
446
|
+
selectedChannels = [websiteData, socialData];
|
|
447
|
+
else if (isHasTwitter || isHasInstagram)
|
|
448
|
+
selectedChannels = [socialData];
|
|
449
|
+
else if (isHasWebsite)
|
|
450
|
+
selectedChannels = [websiteData];
|
|
451
|
+
state.data.entityData.salesChannels = selectedChannels;
|
|
452
|
+
})
|
|
453
|
+
.addCase(retrieveChannels.rejected, function (state, action) {
|
|
454
|
+
state.error = action.error.message;
|
|
455
|
+
state.loading = false;
|
|
317
456
|
});
|
|
318
457
|
}
|
|
319
458
|
});
|
|
@@ -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
|
};
|