@tap-payments/auth-jsconnect 2.1.40-test → 2.1.42-test
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/form.d.ts +6 -3
- package/build/api/entity.d.ts +8 -0
- package/build/api/entity.js +15 -0
- package/build/api/index.d.ts +2 -6
- package/build/api/index.js +1 -3
- package/build/assets/locales/ar.json +1 -5
- package/build/assets/locales/en.json +1 -5
- package/build/components/FileInput/DragAndDrop.js +1 -1
- package/build/components/ProgressBar/CircularProgressBar.d.ts +1 -3
- package/build/components/ProgressBar/CircularProgressBar.js +2 -2
- package/build/constants/assets.d.ts +0 -1
- package/build/constants/assets.js +0 -1
- package/build/constants/validation.d.ts +0 -1
- package/build/constants/validation.js +0 -1
- package/build/features/app/bank/bankStore.js +1 -1
- package/build/features/app/business/businessStore.d.ts +9 -7
- package/build/features/app/business/businessStore.js +67 -29
- package/build/features/app/individual/individualStore.d.ts +16 -4
- package/build/features/app/individual/individualStore.js +89 -11
- package/build/features/business/screens/BusinessType/Article.js +13 -10
- package/build/features/business/screens/BusinessType/BusinessType.js +4 -2
- package/build/features/business/screens/BusinessType/LicenseCertificate.js +50 -12
- package/build/features/business/screens/BusinessType/validation.d.ts +6 -3
- package/build/features/business/screens/BusinessType/validation.js +11 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +4 -18
- package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.js +62 -11
- package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.js +59 -11
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +12 -6
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +23 -2
- package/build/features/shared/UploadFile/UploadFile.js +1 -1
- package/build/theme/typography.js +1 -1
- package/package.json +1 -1
- package/build/api/file.d.ts +0 -13
- package/build/api/file.js +0 -24
- package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +0 -38
- package/build/features/shared/UploadMultipleFile/UploadFile.js +0 -184
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +0 -27
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +0 -147
- package/build/features/shared/UploadMultipleFile/index.d.ts +0 -2
- package/build/features/shared/UploadMultipleFile/index.js +0 -2
package/build/@types/form.d.ts
CHANGED
|
@@ -51,7 +51,8 @@ export declare type BusinessTypeFormValues = {
|
|
|
51
51
|
licenseNumber: string;
|
|
52
52
|
entityLegalName?: string;
|
|
53
53
|
selectedLicense?: License;
|
|
54
|
-
certificateId?:
|
|
54
|
+
certificateId?: string;
|
|
55
|
+
certificateFile?: File;
|
|
55
56
|
articleId?: string;
|
|
56
57
|
articleFile?: File;
|
|
57
58
|
};
|
|
@@ -89,8 +90,10 @@ export interface IndividualExtraFormValues extends IndividualAttachmentsFormValu
|
|
|
89
90
|
isInfluencer: boolean | null;
|
|
90
91
|
}
|
|
91
92
|
export declare type IndividualAttachmentsFormValues = {
|
|
92
|
-
civilID?:
|
|
93
|
-
|
|
93
|
+
civilID?: string;
|
|
94
|
+
civilIDFile?: File;
|
|
95
|
+
signatureFileId?: string;
|
|
96
|
+
signatureFile?: File;
|
|
94
97
|
civilIDUploading?: boolean;
|
|
95
98
|
signatureFileUploading?: boolean;
|
|
96
99
|
};
|
package/build/api/entity.d.ts
CHANGED
|
@@ -47,6 +47,13 @@ export declare type EntityBankUpdateBody = {
|
|
|
47
47
|
step_name: string;
|
|
48
48
|
encryption_contract?: Array<string>;
|
|
49
49
|
};
|
|
50
|
+
export declare type UploadFileBody = {
|
|
51
|
+
file_link_create: boolean;
|
|
52
|
+
file?: File;
|
|
53
|
+
title: string | undefined;
|
|
54
|
+
purpose: string;
|
|
55
|
+
type?: string;
|
|
56
|
+
};
|
|
50
57
|
export declare type UpdateEntityBody = {
|
|
51
58
|
id: string;
|
|
52
59
|
license?: {
|
|
@@ -114,6 +121,7 @@ declare const entityService: {
|
|
|
114
121
|
retrieveBankAccount: (id: string) => Promise<any>;
|
|
115
122
|
retrieveEntityInfo: (entity_id: string, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
116
123
|
updateIndividualInfo: ({ id, ...data }: EntityInfoBody) => Promise<any>;
|
|
124
|
+
uploadFileInfo: (data: UploadFileBody, config?: AxiosRequestConfig) => Promise<any>;
|
|
117
125
|
updateDocumentInfo: (data: DocumentUpdateBody) => Promise<any>;
|
|
118
126
|
retrieveEntity: (entity_id: string) => Promise<any>;
|
|
119
127
|
updateEntity: ({ id, ...data }: UpdateEntityBody) => Promise<any>;
|
package/build/api/entity.js
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
13
|
var t = {};
|
|
3
14
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -61,6 +72,9 @@ var retrieveBankAccount = function (id) {
|
|
|
61
72
|
url: "".concat(ENDPOINT_PATHS.BANK, "/").concat(id)
|
|
62
73
|
});
|
|
63
74
|
};
|
|
75
|
+
var uploadFileInfo = function (data, config) {
|
|
76
|
+
return httpClient(__assign({ method: 'post', url: "".concat(ENDPOINT_PATHS.FILES_PATH), data: data, headers: { 'Content-Type': 'multipart/form-data' } }, config));
|
|
77
|
+
};
|
|
64
78
|
var updateIndividualInfo = function (_a) {
|
|
65
79
|
var id = _a.id, data = __rest(_a, ["id"]);
|
|
66
80
|
return httpClient({
|
|
@@ -89,6 +103,7 @@ var entityService = {
|
|
|
89
103
|
retrieveBankAccount: retrieveBankAccount,
|
|
90
104
|
retrieveEntityInfo: retrieveEntityInfo,
|
|
91
105
|
updateIndividualInfo: updateIndividualInfo,
|
|
106
|
+
uploadFileInfo: uploadFileInfo,
|
|
92
107
|
updateDocumentInfo: updateDocumentInfo,
|
|
93
108
|
retrieveEntity: retrieveEntity,
|
|
94
109
|
updateEntity: updateEntity,
|
package/build/api/index.d.ts
CHANGED
|
@@ -3,12 +3,11 @@ import { ValidateOperatorBody } from './operator';
|
|
|
3
3
|
import { CreateAuthBody, VerifyAuthBody, CreatePasswordBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, VerifyAuthExpressOTPBody } from './auth';
|
|
4
4
|
import { UpdateLeadBody, LeadVerifyBody, CreateLeadBody, LeadOTPVerifyBody, LeadIdentityUpdateBody } from './lead';
|
|
5
5
|
import { CheckEmailBody, CheckBrandBody } from './availabilityServices';
|
|
6
|
-
import { EntityInfoBody, EntityBankUpdateBody, UpdateEntityBody, DocumentUpdateBody, DocumentInfo, UpdateEntityActivityBody, UpdateEntityCapitalBody } from './entity';
|
|
6
|
+
import { EntityInfoBody, EntityBankUpdateBody, UploadFileBody, UpdateEntityBody, DocumentUpdateBody, DocumentInfo, UpdateEntityActivityBody, UpdateEntityCapitalBody } from './entity';
|
|
7
7
|
import { CreateAccountBody } from './account';
|
|
8
8
|
import { DataElementBody } from './data';
|
|
9
9
|
import { BrandListBody, UpdateBrandBody, UpdateIndividualBody } from './individual';
|
|
10
10
|
import { UpdateBoardBody } from './board';
|
|
11
|
-
import { UploadFileBody } from './file';
|
|
12
11
|
declare const API: {
|
|
13
12
|
locationService: {
|
|
14
13
|
getIP: () => Promise<any>;
|
|
@@ -49,6 +48,7 @@ declare const API: {
|
|
|
49
48
|
retrieveBankAccount: (id: string) => Promise<any>;
|
|
50
49
|
retrieveEntityInfo: (entity_id: string, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
51
50
|
updateIndividualInfo: ({ id, ...data }: EntityInfoBody) => Promise<any>;
|
|
51
|
+
uploadFileInfo: (data: UploadFileBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
|
|
52
52
|
updateDocumentInfo: (data: DocumentUpdateBody) => Promise<any>;
|
|
53
53
|
retrieveEntity: (entity_id: string) => Promise<any>;
|
|
54
54
|
updateEntity: ({ id, ...data }: UpdateEntityBody) => Promise<any>;
|
|
@@ -121,10 +121,6 @@ declare const API: {
|
|
|
121
121
|
updateBrandSales: ({ id, ...data }: import("./individual").UpdateSalesChannels) => void;
|
|
122
122
|
getBrandListByIndividualId: (id: string) => Promise<any>;
|
|
123
123
|
};
|
|
124
|
-
fileService: {
|
|
125
|
-
uploadFile: (data: UploadFileBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
126
|
-
uploadFileInfo: (data: UploadFileBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
|
|
127
|
-
};
|
|
128
124
|
};
|
|
129
125
|
export type { ValidateOperatorBody, CreateAuthBody, VerifyAuthBody, CreateLeadBody, UpdateLeadBody, LeadVerifyBody, LeadOTPVerifyBody, CheckEmailBody, CheckBrandBody, LeadIdentityUpdateBody, EntityInfoBody, CreateAccountBody, EntityBankUpdateBody, CreatePasswordBody, BrandListBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, UpdateBoardBody, UpdateBrandBody, DataElementBody, UploadFileBody, UpdateEntityBody, DocumentUpdateBody, DocumentInfo, VerifyAuthExpressOTPBody, UpdateIndividualBody, UpdateEntityActivityBody, UpdateEntityCapitalBody };
|
|
130
126
|
export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, axiosInstance, getAxiosHeaders };
|
package/build/api/index.js
CHANGED
|
@@ -13,7 +13,6 @@ import { individualService } from './individual';
|
|
|
13
13
|
import { boardService } from './board';
|
|
14
14
|
import { userService } from './user';
|
|
15
15
|
import { brandService } from './brand';
|
|
16
|
-
import { fileService } from './file';
|
|
17
16
|
var API = {
|
|
18
17
|
locationService: locationService,
|
|
19
18
|
operatorService: operatorService,
|
|
@@ -28,8 +27,7 @@ var API = {
|
|
|
28
27
|
individualService: individualService,
|
|
29
28
|
boardService: boardService,
|
|
30
29
|
userService: userService,
|
|
31
|
-
brandService: brandService
|
|
32
|
-
fileService: fileService
|
|
30
|
+
brandService: brandService
|
|
33
31
|
};
|
|
34
32
|
export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, axiosInstance, getAxiosHeaders };
|
|
35
33
|
export default API;
|
|
@@ -141,7 +141,6 @@
|
|
|
141
141
|
"file_not_supported_alert": "نوع الملف غير مدعوم",
|
|
142
142
|
"file_size_alert": "حجم الملف اكبر من المطلوب",
|
|
143
143
|
"file_upload_error": "هناك مشكلة في رفع الملف, يرجى المحاولة لاحقاً.",
|
|
144
|
-
"file_upload_article_error": "هناك مشكلة في رفع الملف, يرجى المحاولة لاحقاً.",
|
|
145
144
|
"file_upload_failed": "أنت تواجه بعض التحديات في تحميل الملف. يرجى المحاولة مرة أخرى.",
|
|
146
145
|
"file_uploading_title": "جاري الرفع.....",
|
|
147
146
|
"fl_kw_max_length": "May you please verify the entered freelancer registration reference. (Note - the freelancer registration may contains characters and digits).",
|
|
@@ -334,8 +333,6 @@
|
|
|
334
333
|
"paci_verification_redirection_message": "You will be redirected now",
|
|
335
334
|
"commercial_reg_hint": "Commercial Registration",
|
|
336
335
|
"homemaker_reg_hint": "Home Business",
|
|
337
|
-
"file_already_exist": "File is already uploaded",
|
|
338
|
-
"file_exceed_max_limit": "You can able to upload maximum {{length}} files",
|
|
339
336
|
"unified_number_label": "Unified Number",
|
|
340
337
|
"unified_number_hint": "00000",
|
|
341
338
|
"business_expiry_date": "Expiry Date",
|
|
@@ -355,6 +352,5 @@
|
|
|
355
352
|
"capital_paid_required": "Please Enter paid amount",
|
|
356
353
|
"capital_share_count_required": "Please Enter share count",
|
|
357
354
|
"capital_share_value_required": "Please Enter share value",
|
|
358
|
-
"unified_number_required": "Unified Number Required"
|
|
359
|
-
"uploaded_file": "file"
|
|
355
|
+
"unified_number_required": "Unified Number Required"
|
|
360
356
|
}
|
|
@@ -148,7 +148,6 @@
|
|
|
148
148
|
"file_not_supported_alert": "File not supported, please try again",
|
|
149
149
|
"file_size_alert": "Your file is too big, please upload another",
|
|
150
150
|
"file_upload_error": "Something went wrong, please try again",
|
|
151
|
-
"file_upload_article_error": "Something went wrong, please try again",
|
|
152
151
|
"file_upload_failed": "You are experiencing some challenges uploading the file. Please give it another try.",
|
|
153
152
|
"file_uploading_title": "Uploading....",
|
|
154
153
|
"fl_kw_max_length": "May you please verify the entered freelancer registration reference. (Note - the freelancer registration may contains characters and digits).",
|
|
@@ -361,8 +360,6 @@
|
|
|
361
360
|
"paci_verification_redirection_message": "You will be redirected now",
|
|
362
361
|
"commercial_reg_hint": "Commercial Registration",
|
|
363
362
|
"homemaker_reg_hint": "Home Business",
|
|
364
|
-
"file_already_exist": "file is already uploaded",
|
|
365
|
-
"file_exceed_max_limit": "You can able to upload maximum {{length}} files",
|
|
366
363
|
"unified_number_label": "Unified Number",
|
|
367
364
|
"unified_number_hint": "00000",
|
|
368
365
|
"business_expiry_date": "Expiry Date",
|
|
@@ -382,6 +379,5 @@
|
|
|
382
379
|
"capital_paid_required": "Please Enter paid amount",
|
|
383
380
|
"capital_share_count_required": "Please Enter share count",
|
|
384
381
|
"capital_share_value_required": "Please Enter share value",
|
|
385
|
-
"unified_number_required": "Unified Number Required"
|
|
386
|
-
"uploaded_file": "file"
|
|
382
|
+
"unified_number_required": "Unified Number Required"
|
|
387
383
|
}
|
|
@@ -99,7 +99,7 @@ var TextDoneStyled = styled(Text)(function (_a) {
|
|
|
99
99
|
});
|
|
100
100
|
var WarningContainer = styled(Box)(function (_a) {
|
|
101
101
|
var theme = _a.theme;
|
|
102
|
-
return (__assign({ background: theme.palette.warning.dark, paddingBlock: theme.spacing(1.5), paddingInlineStart: theme.spacing(2.5), border: '0.5px solid', display: 'flex', justifyContent: 'space-around', borderColor: theme.palette.warning.main, color: theme.palette.warning.light, padding: theme.spacing(0.5, 1), borderRadius: theme.spacing(12.5)
|
|
102
|
+
return (__assign({ background: theme.palette.warning.dark, paddingBlock: theme.spacing(1.5), paddingInlineStart: theme.spacing(2.5), border: '0.5px solid', display: 'flex', justifyContent: 'space-around', borderColor: theme.palette.warning.main, color: theme.palette.warning.light, padding: theme.spacing(0.5, 1), borderRadius: theme.spacing(12.5) }, theme.typography.caption));
|
|
103
103
|
});
|
|
104
104
|
var DragAndDrop = function (_a) {
|
|
105
105
|
var title = _a.title, subTitle = _a.subTitle, description = _a.description, error = _a.error, uploadingTitle = _a.uploadingTitle, successTitle = _a.successTitle, progress = _a.progress, uploading = _a.uploading, fileExists = _a.fileExists, uploadSuccess = _a.uploadSuccess, onSuccess = _a.onSuccess, multiple = _a.multiple;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CircularProgressProps } from '@mui/material/CircularProgress';
|
|
3
|
-
import { SxProps, Theme } from '@mui/material/styles';
|
|
4
3
|
export interface CircularProps extends CircularProgressProps {
|
|
5
4
|
size: number;
|
|
6
5
|
value: number;
|
|
7
|
-
textSx?: SxProps<Theme>;
|
|
8
6
|
}
|
|
9
|
-
declare function CircularProgressWithLabel({ size, value,
|
|
7
|
+
declare function CircularProgressWithLabel({ size, value, ...props }: CircularProps): JSX.Element;
|
|
10
8
|
declare namespace CircularProgressWithLabel {
|
|
11
9
|
var defaultProps: {
|
|
12
10
|
size: number;
|
|
@@ -39,8 +39,8 @@ var BoxStyled = styled(Box)(function (_a) {
|
|
|
39
39
|
});
|
|
40
40
|
});
|
|
41
41
|
export default function CircularProgressWithLabel(_a) {
|
|
42
|
-
var size = _a.size, value = _a.value,
|
|
43
|
-
return (_jsxs(Box, __assign({ sx: { position: 'relative', display: 'inline-flex' } }, { children: [_jsx(CircularProgress, __assign({ variant: 'determinate', size: size, value: value }, props)), _jsx(BoxStyled, { children: _jsx(Typography, __assign({ variant: 'caption',
|
|
42
|
+
var size = _a.size, value = _a.value, props = __rest(_a, ["size", "value"]);
|
|
43
|
+
return (_jsxs(Box, __assign({ sx: { position: 'relative', display: 'inline-flex' } }, { children: [_jsx(CircularProgress, __assign({ variant: 'determinate', size: size, value: value }, props)), _jsx(BoxStyled, { children: _jsx(Typography, __assign({ variant: 'caption', component: 'div', color: 'text.primary' }, { children: "".concat(Math.round(value), "%") })) })] })));
|
|
44
44
|
}
|
|
45
45
|
CircularProgressWithLabel.defaultProps = {
|
|
46
46
|
size: 54,
|
|
@@ -54,7 +54,6 @@ export var ICONS_NAMES = {
|
|
|
54
54
|
UPLOAD_ICON: 'https://dash.b-cdn.net/icons/menu/upload-file.svg',
|
|
55
55
|
ACTIVE_UPLOAD_ICON: 'https://dash.b-cdn.net/icons/menu/active-upload-icon.png',
|
|
56
56
|
WARNING_ICON: 'https://dash.b-cdn.net/icons/menu/warning-icon.svg',
|
|
57
|
-
ERROR_ICON: 'https://dash.b-cdn.net/icons/menu/upload_error_icon.svg',
|
|
58
57
|
DONE_ICON: 'https://dash.b-cdn.net/icons/menu/done.svg',
|
|
59
58
|
DOC_ICON: 'https://dash.b-cdn.net/icons/menu/document-icon.svg',
|
|
60
59
|
DROP_FILE_ICON: 'https://dash.b-cdn.net/icons/menu/upload-file-sample.svg',
|
|
@@ -12,7 +12,6 @@ export declare const KW_MIN_LICENSE_LENGTH = 3;
|
|
|
12
12
|
export declare const KW_MAX_LICENSE_LENGTH = 50;
|
|
13
13
|
export declare const SAUDI_NUMBER_LENGTH = 9;
|
|
14
14
|
export declare const MAX_FILE_SIZE = 5000000;
|
|
15
|
-
export declare const MAX_FILE_SIZE_FOUR_MB = 4000000;
|
|
16
15
|
export declare const VALID_FILE_FORMATS: string[];
|
|
17
16
|
export declare const REGEX_FULL_NAME: RegExp;
|
|
18
17
|
export declare const REGEX_WEBSITE: RegExp;
|
|
@@ -12,7 +12,6 @@ export var KW_MIN_LICENSE_LENGTH = 3;
|
|
|
12
12
|
export var KW_MAX_LICENSE_LENGTH = 50;
|
|
13
13
|
export var SAUDI_NUMBER_LENGTH = 9;
|
|
14
14
|
export var MAX_FILE_SIZE = 5000000;
|
|
15
|
-
export var MAX_FILE_SIZE_FOUR_MB = 4000000;
|
|
16
15
|
export var VALID_FILE_FORMATS = ['image/jpeg', 'image/png', 'image/jpg', 'application/pdf'];
|
|
17
16
|
export var REGEX_FULL_NAME = /^([a-zA-Z]{2,}\s{1}[a-zA-Z]{1,}|[a-zA-Z]+\s{1}[a-zA-Z.-]{1,}\s{1}[a-zA-Z.-]{1,}\s{1}[a-zA-Z]{1,}|[a-zA-Z]+\s{1}[a-zA-Z.-]{1,}\s{1}[a-zA-Z]{1,})$/g;
|
|
18
17
|
export var REGEX_WEBSITE = /^[a-zA-Z0-9]+([\-\.]{1}[a-zA-Z0-9]+)*\.[a-zA-Z]{2,63}(:[0-9]{1,5})?(\/.*)?$/;
|
|
@@ -243,7 +243,7 @@ export var uploadBankStatement = createAsyncThunk('uploadBankStatement', functio
|
|
|
243
243
|
var progress = ((progressEvent === null || progressEvent === void 0 ? void 0 : progressEvent.loaded) / (progressEvent === null || progressEvent === void 0 ? void 0 : progressEvent.total)) * 100;
|
|
244
244
|
onProgress === null || onProgress === void 0 ? void 0 : onProgress(Math.floor(progress));
|
|
245
245
|
};
|
|
246
|
-
return [4, API.
|
|
246
|
+
return [4, API.entityService.uploadFileInfo(uploadPayload, { onUploadProgress: onUploadProgress })];
|
|
247
247
|
case 1:
|
|
248
248
|
data = _b.sent();
|
|
249
249
|
return [2, { data: data }];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RootState } from '../../../app/store';
|
|
2
|
-
import { ActivitiesFormValues, CustomersFormValues, BusinessTypeFormValues, NIDFormValues, OTPFormValues, ResponseData, SharedState, FlowsTypes, Activity, CivilFormValues
|
|
2
|
+
import { ActivitiesFormValues, CustomersFormValues, BusinessTypeFormValues, NIDFormValues, OTPFormValues, ResponseData, SharedState, FlowsTypes, Activity, CivilFormValues } from '../../../@types';
|
|
3
3
|
export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
4
4
|
data: any;
|
|
5
5
|
leadData: any;
|
|
@@ -59,11 +59,14 @@ export declare const updateLeadBusinessType: import("@reduxjs/toolkit").AsyncThu
|
|
|
59
59
|
documentData: any;
|
|
60
60
|
entityData: any;
|
|
61
61
|
}, BusinessTypeFormValues, {}>;
|
|
62
|
-
interface
|
|
62
|
+
interface UploadLicenseCertificateParams {
|
|
63
63
|
file: File;
|
|
64
64
|
onProgress?: (value: number) => void;
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
}
|
|
66
|
+
export declare const uploadLicenseCertificate: import("@reduxjs/toolkit").AsyncThunk<{
|
|
67
|
+
data: any;
|
|
68
|
+
}, UploadLicenseCertificateParams, {}>;
|
|
69
|
+
interface UploadArticleParams extends UploadLicenseCertificateParams {
|
|
67
70
|
}
|
|
68
71
|
export declare const uploadArticle: import("@reduxjs/toolkit").AsyncThunk<{
|
|
69
72
|
data: any;
|
|
@@ -113,16 +116,15 @@ export interface BusinessState extends SharedState<BusinessData> {
|
|
|
113
116
|
customLoading?: boolean;
|
|
114
117
|
uploading?: boolean;
|
|
115
118
|
uploadingArticle?: boolean;
|
|
116
|
-
uploadingArticleError?: string | null;
|
|
117
119
|
}
|
|
118
120
|
export declare const businessSlice: import("@reduxjs/toolkit").Slice<BusinessState, {
|
|
119
121
|
clearError: (state: BusinessState) => void;
|
|
120
122
|
stopLoader: (state: BusinessState) => void;
|
|
121
123
|
resetOTPScreen: (state: BusinessState) => void;
|
|
124
|
+
clearCertificateId: (state: BusinessState) => void;
|
|
122
125
|
clearArticleId: (state: BusinessState) => void;
|
|
123
|
-
uploadingStatus: (state: BusinessState, action: ActionState<boolean>) => void;
|
|
124
126
|
}, "business/store">;
|
|
125
|
-
export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetOTPScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>,
|
|
127
|
+
export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetOTPScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, clearCertificateId: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, clearArticleId: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
126
128
|
declare const _default: import("redux").Reducer<BusinessState, import("redux").AnyAction>;
|
|
127
129
|
export default _default;
|
|
128
130
|
export declare const businessSelector: (state: RootState) => BusinessState;
|
|
@@ -441,36 +441,36 @@ export var retrieveBoardDetails = createAsyncThunk('retrieveBoardDetails', funct
|
|
|
441
441
|
});
|
|
442
442
|
}); });
|
|
443
443
|
export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
444
|
-
var _a, settings, business, isNonSA, isFL, payload, data, entity_activities, list, accountBody, accountData, documentData, entityData, entityId, articleId, documentBody, payload_1;
|
|
445
|
-
var
|
|
446
|
-
return __generator(this, function (
|
|
447
|
-
switch (
|
|
444
|
+
var _a, settings, business, isNonSA, isFL, payload, data, entity_activities, list, accountBody, accountData, documentData, entityData, entityId, _b, articleId, certificateId, documentBody, payload_1;
|
|
445
|
+
var _c, _d, _e, _f, _g, _h;
|
|
446
|
+
return __generator(this, function (_j) {
|
|
447
|
+
switch (_j.label) {
|
|
448
448
|
case 0:
|
|
449
449
|
_a = thunkApi.getState(), settings = _a.settings, business = _a.business;
|
|
450
450
|
isNonSA = !isSA(settings.data.businessCountry.iso2);
|
|
451
|
-
isFL = ((
|
|
451
|
+
isFL = ((_c = params.selectedLicense) === null || _c === void 0 ? void 0 : _c.type) === BusinessType.FL;
|
|
452
452
|
payload = {
|
|
453
|
-
id: ((
|
|
453
|
+
id: ((_d = business.data.verify.responseBody) === null || _d === void 0 ? void 0 : _d.lead_id) || '',
|
|
454
454
|
license_number: isNonSA && isFL ? '' : params.licenseNumber,
|
|
455
455
|
license_type: isFL ? 'freelance' : 'commercial_registration',
|
|
456
|
-
business_type: (
|
|
456
|
+
business_type: (_e = params.selectedLicense) === null || _e === void 0 ? void 0 : _e.type,
|
|
457
457
|
step_name: BUSINESS_STEP_NAMES.BUSINESS_CR_INFO,
|
|
458
458
|
business: isNonSA && isFL ? undefined : { ar: params.entityLegalName, en: params.entityLegalName },
|
|
459
459
|
encryption_contract: ['license_number', 'business_type', 'license_type']
|
|
460
460
|
};
|
|
461
461
|
return [4, API.leadService.updateLead(payload)];
|
|
462
462
|
case 1:
|
|
463
|
-
data =
|
|
463
|
+
data = _j.sent();
|
|
464
464
|
entity_activities = data.entity_activities;
|
|
465
465
|
if (!!entity_activities) return [3, 3];
|
|
466
466
|
return [4, API.dataService.getActivities()];
|
|
467
467
|
case 2:
|
|
468
|
-
list = (
|
|
468
|
+
list = (_j.sent()).list;
|
|
469
469
|
data.entity_activities = list;
|
|
470
|
-
|
|
470
|
+
_j.label = 3;
|
|
471
471
|
case 3:
|
|
472
472
|
accountBody = {
|
|
473
|
-
lead_id: (
|
|
473
|
+
lead_id: (_f = business.data.verify.responseBody) === null || _f === void 0 ? void 0 : _f.lead_id,
|
|
474
474
|
notify: {
|
|
475
475
|
email: false,
|
|
476
476
|
phone: false
|
|
@@ -481,23 +481,23 @@ export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', f
|
|
|
481
481
|
};
|
|
482
482
|
return [4, API.accountService.createAccount(accountBody)];
|
|
483
483
|
case 4:
|
|
484
|
-
accountData =
|
|
484
|
+
accountData = _j.sent();
|
|
485
485
|
entityData = undefined;
|
|
486
486
|
entityId = accountData === null || accountData === void 0 ? void 0 : accountData.entity_id;
|
|
487
|
-
|
|
488
|
-
if (!
|
|
487
|
+
_b = business.data.businessTypeData, articleId = _b.articleId, certificateId = _b.certificateId;
|
|
488
|
+
if (!certificateId) return [3, 6];
|
|
489
489
|
documentBody = {
|
|
490
490
|
entity_id: entityId || '',
|
|
491
491
|
documents: [
|
|
492
492
|
{
|
|
493
|
-
images:
|
|
493
|
+
images: [certificateId]
|
|
494
494
|
}
|
|
495
495
|
]
|
|
496
496
|
};
|
|
497
497
|
return [4, API.entityService.updateDocumentInfo(documentBody)];
|
|
498
498
|
case 5:
|
|
499
|
-
documentData =
|
|
500
|
-
|
|
499
|
+
documentData = _j.sent();
|
|
500
|
+
_j.label = 6;
|
|
501
501
|
case 6:
|
|
502
502
|
if (!(articleId && entityId)) return [3, 8];
|
|
503
503
|
payload_1 = {
|
|
@@ -506,15 +506,40 @@ export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', f
|
|
|
506
506
|
};
|
|
507
507
|
return [4, API.entityService.updateEntity(payload_1)];
|
|
508
508
|
case 7:
|
|
509
|
-
entityData =
|
|
510
|
-
|
|
509
|
+
entityData = _j.sent();
|
|
510
|
+
_j.label = 8;
|
|
511
511
|
case 8:
|
|
512
512
|
thunkApi.dispatch(handleNextScreenStep());
|
|
513
|
-
(
|
|
513
|
+
(_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, params);
|
|
514
514
|
return [2, { data: data, formData: params, accountData: accountData, documentData: documentData, entityData: entityData }];
|
|
515
515
|
}
|
|
516
516
|
});
|
|
517
517
|
}); });
|
|
518
|
+
export var uploadLicenseCertificate = createAsyncThunk('uploadLicenseCertificate', function (_a) {
|
|
519
|
+
var file = _a.file, onProgress = _a.onProgress;
|
|
520
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
521
|
+
var uploadPayload, onUploadProgress, data;
|
|
522
|
+
return __generator(this, function (_b) {
|
|
523
|
+
switch (_b.label) {
|
|
524
|
+
case 0:
|
|
525
|
+
uploadPayload = {
|
|
526
|
+
file_link_create: true,
|
|
527
|
+
title: file === null || file === void 0 ? void 0 : file.name,
|
|
528
|
+
purpose: 'commercial_registration',
|
|
529
|
+
file: file
|
|
530
|
+
};
|
|
531
|
+
onUploadProgress = function (progressEvent) {
|
|
532
|
+
var progress = ((progressEvent === null || progressEvent === void 0 ? void 0 : progressEvent.loaded) / (progressEvent === null || progressEvent === void 0 ? void 0 : progressEvent.total)) * 100;
|
|
533
|
+
onProgress === null || onProgress === void 0 ? void 0 : onProgress(Math.floor(progress));
|
|
534
|
+
};
|
|
535
|
+
return [4, API.entityService.uploadFileInfo(uploadPayload, { onUploadProgress: onUploadProgress })];
|
|
536
|
+
case 1:
|
|
537
|
+
data = _b.sent();
|
|
538
|
+
return [2, { data: data }];
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
});
|
|
542
|
+
});
|
|
518
543
|
export var uploadArticle = createAsyncThunk('businessUploadArticle', function (_a) {
|
|
519
544
|
var file = _a.file, onProgress = _a.onProgress;
|
|
520
545
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -536,7 +561,7 @@ export var uploadArticle = createAsyncThunk('businessUploadArticle', function (_
|
|
|
536
561
|
var progress = ((progressEvent === null || progressEvent === void 0 ? void 0 : progressEvent.loaded) / (progressEvent === null || progressEvent === void 0 ? void 0 : progressEvent.total)) * 100;
|
|
537
562
|
onProgress === null || onProgress === void 0 ? void 0 : onProgress(Math.floor(progress));
|
|
538
563
|
};
|
|
539
|
-
return [4, API.
|
|
564
|
+
return [4, API.entityService.uploadFileInfo(uploadPayload, { onUploadProgress: onUploadProgress })];
|
|
540
565
|
case 1:
|
|
541
566
|
data = _c.sent();
|
|
542
567
|
return [2, { data: data }];
|
|
@@ -707,7 +732,6 @@ var initialState = {
|
|
|
707
732
|
customLoading: false,
|
|
708
733
|
uploading: false,
|
|
709
734
|
uploadingArticle: false,
|
|
710
|
-
uploadingArticleError: null,
|
|
711
735
|
data: {
|
|
712
736
|
flowName: FlowsTypes.BUSINESS,
|
|
713
737
|
verify: {
|
|
@@ -755,11 +779,11 @@ export var businessSlice = createSlice({
|
|
|
755
779
|
resetOTPScreen: function (state) {
|
|
756
780
|
state.data.otpData.otp = '';
|
|
757
781
|
},
|
|
782
|
+
clearCertificateId: function (state) {
|
|
783
|
+
state.data.businessTypeData.certificateId = '';
|
|
784
|
+
},
|
|
758
785
|
clearArticleId: function (state) {
|
|
759
786
|
state.data.businessTypeData.articleId = '';
|
|
760
|
-
},
|
|
761
|
-
uploadingStatus: function (state, action) {
|
|
762
|
-
state.uploading = action.payload;
|
|
763
787
|
}
|
|
764
788
|
},
|
|
765
789
|
extraReducers: function (builder) {
|
|
@@ -1040,20 +1064,34 @@ export var businessSlice = createSlice({
|
|
|
1040
1064
|
.addCase(updateLeadBusinessType.rejected, function (state, action) {
|
|
1041
1065
|
state.loading = false;
|
|
1042
1066
|
state.error = action.error.message;
|
|
1067
|
+
})
|
|
1068
|
+
.addCase(uploadLicenseCertificate.pending, function (state) {
|
|
1069
|
+
state.error = null;
|
|
1070
|
+
state.uploading = true;
|
|
1071
|
+
})
|
|
1072
|
+
.addCase(uploadLicenseCertificate.fulfilled, function (state, action) {
|
|
1073
|
+
state.error = null;
|
|
1074
|
+
state.uploading = false;
|
|
1075
|
+
var data = action.payload.data;
|
|
1076
|
+
state.data.businessTypeData.certificateId = data === null || data === void 0 ? void 0 : data.id;
|
|
1077
|
+
})
|
|
1078
|
+
.addCase(uploadLicenseCertificate.rejected, function (state) {
|
|
1079
|
+
state.uploading = false;
|
|
1080
|
+
state.error = 'file_upload_error';
|
|
1043
1081
|
})
|
|
1044
1082
|
.addCase(uploadArticle.pending, function (state) {
|
|
1045
|
-
state.
|
|
1083
|
+
state.error = null;
|
|
1046
1084
|
state.uploadingArticle = true;
|
|
1047
1085
|
})
|
|
1048
1086
|
.addCase(uploadArticle.fulfilled, function (state, action) {
|
|
1049
|
-
state.
|
|
1087
|
+
state.error = null;
|
|
1050
1088
|
state.uploadingArticle = false;
|
|
1051
1089
|
var data = action.payload.data;
|
|
1052
1090
|
state.data.businessTypeData.articleId = data === null || data === void 0 ? void 0 : data.id;
|
|
1053
1091
|
})
|
|
1054
1092
|
.addCase(uploadArticle.rejected, function (state) {
|
|
1055
1093
|
state.uploadingArticle = false;
|
|
1056
|
-
state.
|
|
1094
|
+
state.error = 'file_upload_error';
|
|
1057
1095
|
})
|
|
1058
1096
|
.addCase(updateActivitiesInfo.pending, function (state) {
|
|
1059
1097
|
state.loading = true;
|
|
@@ -1137,6 +1175,6 @@ export var businessSlice = createSlice({
|
|
|
1137
1175
|
});
|
|
1138
1176
|
}
|
|
1139
1177
|
});
|
|
1140
|
-
export var clearError = (_a = businessSlice.actions, _a.clearError), stopLoader = _a.stopLoader, resetOTPScreen = _a.resetOTPScreen,
|
|
1178
|
+
export var clearError = (_a = businessSlice.actions, _a.clearError), stopLoader = _a.stopLoader, resetOTPScreen = _a.resetOTPScreen, clearCertificateId = _a.clearCertificateId, clearArticleId = _a.clearArticleId;
|
|
1141
1179
|
export default businessSlice.reducer;
|
|
1142
1180
|
export var businessSelector = function (state) { return state.business; };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RootState } from '../../../app/store';
|
|
2
|
-
import { CountryCode, FlowsTypes, IndividualExtraFormValues, OTPFormValues, ResponseData, SharedState
|
|
2
|
+
import { CountryCode, FlowsTypes, IndividualAttachmentsFormValues, IndividualExtraFormValues, OTPFormValues, ResponseData, SharedState } from '../../../@types';
|
|
3
3
|
export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
4
4
|
data: any;
|
|
5
5
|
boardResponse: {
|
|
@@ -53,6 +53,19 @@ export declare const updateIndividualInfo: import("@reduxjs/toolkit").AsyncThunk
|
|
|
53
53
|
data: any;
|
|
54
54
|
formData: IndividualExtraFormValues;
|
|
55
55
|
}, IndividualExtraFormValues, {}>;
|
|
56
|
+
interface UploadFileParams {
|
|
57
|
+
file: File;
|
|
58
|
+
onProgress?: (value: number) => void;
|
|
59
|
+
title?: string;
|
|
60
|
+
}
|
|
61
|
+
export declare const uploadCivilIdFile: import("@reduxjs/toolkit").AsyncThunk<{
|
|
62
|
+
data: any;
|
|
63
|
+
file: File;
|
|
64
|
+
}, UploadFileParams, {}>;
|
|
65
|
+
export declare const uploadSignatureFile: import("@reduxjs/toolkit").AsyncThunk<{
|
|
66
|
+
data: any;
|
|
67
|
+
file: File;
|
|
68
|
+
}, UploadFileParams, {}>;
|
|
56
69
|
export declare const updateBoardSuccess: import("@reduxjs/toolkit").AsyncThunk<{
|
|
57
70
|
response: any;
|
|
58
71
|
formData: void;
|
|
@@ -64,6 +77,7 @@ export interface IndividualData {
|
|
|
64
77
|
verify: ResponseData & VerifyData;
|
|
65
78
|
otpData: OTPFormValues & ResponseData;
|
|
66
79
|
individualData: IndividualExtraFormValues & ResponseData;
|
|
80
|
+
attachmentsData: IndividualAttachmentsFormValues & ResponseData;
|
|
67
81
|
flowName: FlowsTypes;
|
|
68
82
|
}
|
|
69
83
|
export interface IndividualState extends SharedState<IndividualData> {
|
|
@@ -73,10 +87,8 @@ export declare const individualSlice: import("@reduxjs/toolkit").Slice<Individua
|
|
|
73
87
|
clearError: (state: IndividualState) => void;
|
|
74
88
|
stopLoader: (state: IndividualState) => void;
|
|
75
89
|
resetOTPScreen: (state: IndividualState) => void;
|
|
76
|
-
civilIDUploadingStatus: (state: IndividualState, action: ActionState<boolean>) => void;
|
|
77
|
-
signatureFileUploadingStatus: (state: IndividualState, action: ActionState<boolean>) => void;
|
|
78
90
|
}, "individual/store">;
|
|
79
|
-
export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetOTPScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string
|
|
91
|
+
export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetOTPScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
80
92
|
declare const _default: import("redux").Reducer<IndividualState, import("redux").AnyAction>;
|
|
81
93
|
export default _default;
|
|
82
94
|
export declare const individualSelector: (state: RootState) => IndividualState;
|