@tap-payments/auth-jsconnect 2.0.4 → 2.0.5

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.
Files changed (76) hide show
  1. package/build/@types/form.d.ts +2 -0
  2. package/build/api/entity.d.ts +8 -0
  3. package/build/api/entity.js +10 -1
  4. package/build/api/index.d.ts +1 -0
  5. package/build/api/lead.d.ts +1 -0
  6. package/build/assets/locales/ar.json +4 -1
  7. package/build/assets/locales/en.json +4 -1
  8. package/build/components/FileInput/DragAndDrop.d.ts +7 -0
  9. package/build/components/FileInput/DragAndDrop.js +39 -0
  10. package/build/components/FileInput/UploadInput.d.ts +7 -0
  11. package/build/components/FileInput/UploadInput.js +38 -0
  12. package/build/components/FileInput/index.d.ts +3 -0
  13. package/build/components/FileInput/index.js +3 -0
  14. package/build/constants/api.d.ts +1 -0
  15. package/build/constants/api.js +3 -1
  16. package/build/constants/app.js +35 -5
  17. package/build/constants/assets.d.ts +1 -0
  18. package/build/constants/assets.js +1 -0
  19. package/build/constants/validation.d.ts +2 -0
  20. package/build/constants/validation.js +2 -0
  21. package/build/features/app/bank/bankStore.d.ts +1 -0
  22. package/build/features/app/bank/bankStore.js +42 -8
  23. package/build/features/app/business/businessStore.js +13 -6
  24. package/build/features/app/connect/connectStore.js +18 -16
  25. package/build/features/app/individual/individualStore.js +10 -9
  26. package/build/features/app/password/passwordStore.d.ts +4 -1
  27. package/build/features/app/password/passwordStore.js +20 -17
  28. package/build/features/bank/screens/BankDetails/BankDetails.js +2 -1
  29. package/build/features/bank/screens/BankDetails/BankStatement.d.ts +3 -0
  30. package/build/features/bank/screens/BankDetails/BankStatement.js +38 -0
  31. package/build/features/bank/screens/BankDetails/validation.d.ts +3 -0
  32. package/build/features/bank/screens/BankDetails/validation.js +1 -0
  33. package/build/features/bank/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
  34. package/build/features/bank/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
  35. package/build/features/bank/screens/ResetPasswordSuccess/index.d.ts +3 -0
  36. package/build/features/bank/screens/ResetPasswordSuccess/index.js +2 -0
  37. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +9 -13
  38. package/build/features/business/screens/Activities/Activities.js +2 -1
  39. package/build/features/business/screens/Activities/LicenseName.d.ts +5 -0
  40. package/build/features/business/screens/Activities/LicenseName.js +30 -0
  41. package/build/features/business/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
  42. package/build/features/business/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
  43. package/build/features/business/screens/ResetPasswordSuccess/index.d.ts +3 -0
  44. package/build/features/business/screens/ResetPasswordSuccess/index.js +2 -0
  45. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +9 -13
  46. package/build/features/connect/screens/Merchant/BrandList.js +1 -5
  47. package/build/features/connect/screens/Merchant/Merchant.js +10 -8
  48. package/build/features/connect/screens/Merchant/validation.js +4 -2
  49. package/build/features/connect/screens/Mobile/Mobile.js +1 -1
  50. package/build/features/connect/screens/NID/NID.js +1 -1
  51. package/build/features/featuresScreens.js +15 -5
  52. package/build/features/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
  53. package/build/features/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
  54. package/build/features/individual/screens/ResetPasswordSuccess/index.d.ts +3 -0
  55. package/build/features/individual/screens/ResetPasswordSuccess/index.js +2 -0
  56. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +9 -13
  57. package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
  58. package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
  59. package/build/features/password/screens/ResetPasswordSuccess/index.d.ts +3 -0
  60. package/build/features/password/screens/ResetPasswordSuccess/index.js +2 -0
  61. package/build/features/password/screens/Success/Success.js +2 -2
  62. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +9 -13
  63. package/build/features/shared/Button/Button.js +1 -1
  64. package/build/features/shared/Button/FlowsButtons.js +3 -6
  65. package/build/features/shared/Button/SuccessButton.js +14 -0
  66. package/build/features/shared/UploadFile/UploadFile.d.ts +21 -0
  67. package/build/features/shared/UploadFile/UploadFile.js +77 -0
  68. package/build/features/shared/UploadFile/index.d.ts +2 -0
  69. package/build/features/shared/UploadFile/index.js +2 -0
  70. package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
  71. package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
  72. package/build/features/tax/screens/ResetPasswordSuccess/index.d.ts +3 -0
  73. package/build/features/tax/screens/ResetPasswordSuccess/index.js +2 -0
  74. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +9 -13
  75. package/build/utils/string.js +2 -1
  76. package/package.json +2 -1
@@ -49,6 +49,8 @@ export declare type BankFormValues = {
49
49
  iban: string;
50
50
  beneficiaryName: string;
51
51
  bankName: string;
52
+ bankStatementId?: string;
53
+ uploading?: boolean;
52
54
  confirmPolicy: boolean;
53
55
  };
54
56
  export declare type TaxFormValues = {
@@ -1,6 +1,7 @@
1
1
  import { AxiosRequestConfig } from 'axios';
2
2
  export declare type EntityInfoBody = {
3
3
  id: string;
4
+ lead_id?: string;
4
5
  activities?: Array<string>;
5
6
  business_operation_start_at?: string;
6
7
  channel_services?: Array<string>;
@@ -36,11 +37,18 @@ export declare type EntityBankUpdateBody = {
36
37
  step_name: string;
37
38
  encryption_contract?: Array<string>;
38
39
  };
40
+ export declare type UploadFileBody = {
41
+ file_link_create: boolean;
42
+ file: File | null;
43
+ title: string | undefined;
44
+ purpose: string;
45
+ };
39
46
  declare const entityService: {
40
47
  createEntityInfo: ({ id, ...data }: EntityInfoBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
41
48
  updateEntityInfo: ({ id, ...data }: EntityInfoBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
42
49
  createBankAccount: (data: EntityBankUpdateBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
43
50
  retrieveEntityInfo: (entity_id: string, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
44
51
  updateIndividualInfo: ({ id, ...data }: EntityInfoBody) => Promise<any>;
52
+ uploadFileInfo: (data: UploadFileBody) => Promise<any>;
45
53
  };
46
54
  export { entityService };
@@ -25,6 +25,14 @@ var updateEntityInfo = function (_a, config) {
25
25
  var createBankAccount = function (data, config) {
26
26
  return instance.post("".concat(ENDPOINT_PATHS.BANK), data, config);
27
27
  };
28
+ var uploadFileInfo = function (data) {
29
+ return httpClient({
30
+ method: 'post',
31
+ url: "".concat(ENDPOINT_PATHS.FILES_PATH),
32
+ data: data,
33
+ headers: { 'Content-Type': 'multipart/form-data' }
34
+ });
35
+ };
28
36
  var updateIndividualInfo = function (_a) {
29
37
  var id = _a.id, data = __rest(_a, ["id"]);
30
38
  return httpClient({
@@ -38,6 +46,7 @@ var entityService = {
38
46
  updateEntityInfo: updateEntityInfo,
39
47
  createBankAccount: createBankAccount,
40
48
  retrieveEntityInfo: retrieveEntityInfo,
41
- updateIndividualInfo: updateIndividualInfo
49
+ updateIndividualInfo: updateIndividualInfo,
50
+ uploadFileInfo: uploadFileInfo
42
51
  };
43
52
  export { entityService };
@@ -36,6 +36,7 @@ declare const API: {
36
36
  createBankAccount: (data: EntityBankUpdateBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
37
37
  retrieveEntityInfo: (entity_id: string, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
38
38
  updateIndividualInfo: ({ id, ...data }: EntityInfoBody) => Promise<any>;
39
+ uploadFileInfo: (data: import("./entity").UploadFileBody) => Promise<any>;
39
40
  };
40
41
  availabilityServices: {
41
42
  checkEmail: (data: CheckEmailBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
@@ -27,6 +27,7 @@ declare type BrandContent = {
27
27
  about?: BrandTitle;
28
28
  };
29
29
  declare type BrandInfo = {
30
+ id?: string;
30
31
  name?: BrandTitle;
31
32
  sector?: Array<string>;
32
33
  website?: string;
@@ -240,5 +240,8 @@
240
240
  "tax_success_title": "Your tax details are updated",
241
241
  "bank_success_title": "Your bank details are updated",
242
242
  "password_success_title": "Your password is set",
243
- "bank": "bank"
243
+ "bank": "bank",
244
+ "reset_password_success_title": "لقد ارسلنا رسالة بريدية إليك",
245
+ "reset_password_success_description": "تحقق من بريدك الإلكتروني لإعادة تعيين كلمة المرور الخاصة بك.",
246
+ "license_name_label": "اسم الرخصة"
244
247
  }
@@ -260,5 +260,8 @@
260
260
  "bank_success_title": "Your bank details are updated",
261
261
  "password_success_title": "Your password is set",
262
262
  "account_details": "Your account details",
263
- "bank": "bank"
263
+ "bank": "bank",
264
+ "reset_password_success_title": "We sent you an email",
265
+ "reset_password_success_description": "Check your email to reset your password.",
266
+ "license_name_label": "License Name"
264
267
  }
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ interface DragAndDropProps {
3
+ title: string;
4
+ onSuccess?: (files: File) => void;
5
+ }
6
+ declare const DragAndDrop: ({ title, onSuccess }: DragAndDropProps) => JSX.Element;
7
+ export default DragAndDrop;
@@ -0,0 +1,39 @@
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
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import Box from '@mui/material/Box';
14
+ import { alpha, styled } from '@mui/material/styles';
15
+ import Input from '../Input';
16
+ import Text from '../Text';
17
+ import { useDropzone } from 'react-dropzone';
18
+ var BoxStyled = styled(Box)(function (_a) {
19
+ var theme = _a.theme;
20
+ return (__assign(__assign({ direction: theme.direction }, theme.typography.subtitle2), { color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightRegular, background: theme.palette.background.default, padding: theme.spacing(1.5, 2.5, 1.5), border: "1px dashed ".concat(alpha(theme.palette.divider, 0.8)), width: '50%', cursor: 'pointer' }));
21
+ });
22
+ var UploadInputStyled = styled(Input)(function () { return ({
23
+ display: 'none'
24
+ }); });
25
+ var DragAndDrop = function (_a) {
26
+ var title = _a.title, onSuccess = _a.onSuccess;
27
+ var _b = useDropzone({
28
+ maxFiles: 1,
29
+ noKeyboard: true,
30
+ noClick: true,
31
+ multiple: false,
32
+ accept: { 'image/jpeg': ['.jpeg'], 'image/png': ['.png'], 'image/jpg': ['.jpg'], 'application/pdf': ['.pdf'] },
33
+ onDrop: function (files) {
34
+ onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(files === null || files === void 0 ? void 0 : files[0]);
35
+ }
36
+ }), getRootProps = _b.getRootProps, getInputProps = _b.getInputProps;
37
+ return (_jsxs(BoxStyled, __assign({}, getRootProps({ className: 'dropzone' }), { children: [_jsx(Text, __assign({ sx: { fontSize: '12px' } }, { children: title })), _jsx(UploadInputStyled, { inputProps: __assign({}, getInputProps()) })] })));
38
+ };
39
+ export default DragAndDrop;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ interface UploadInputProps {
3
+ title: string;
4
+ onChange: (file: File) => void;
5
+ }
6
+ declare const UploadInput: ({ title, onChange }: UploadInputProps) => JSX.Element;
7
+ export default UploadInput;
@@ -0,0 +1,38 @@
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
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { styled } from '@mui/material/styles';
14
+ import React from 'react';
15
+ import Box from '@mui/material/Box';
16
+ import Input from '../../components/Input';
17
+ import Text from '../Text';
18
+ var UploadInputStyled = styled(Input)(function () { return ({
19
+ display: 'none'
20
+ }); });
21
+ var UploadBoxStyled = styled(Box)(function (_a) {
22
+ var theme = _a.theme;
23
+ return (__assign(__assign({}, theme.typography.caption), { background: theme.palette.primary.main, color: theme.palette.common.white, fontWeight: theme.typography.fontWeightRegular, padding: theme.spacing(1.5, 2.5, 1.5), cursor: 'pointer', width: '50%' }));
24
+ });
25
+ var UploadInput = function (_a) {
26
+ var title = _a.title, onChange = _a.onChange;
27
+ var fileRef = React.useRef(null);
28
+ var openDeviceMedia = function () {
29
+ var _a;
30
+ (_a = fileRef.current) === null || _a === void 0 ? void 0 : _a.click();
31
+ };
32
+ var onFileChange = function (event) {
33
+ if (event.target.files)
34
+ onChange === null || onChange === void 0 ? void 0 : onChange(event.target.files[0]);
35
+ };
36
+ return (_jsxs(UploadBoxStyled, __assign({ onClick: openDeviceMedia }, { children: [_jsx(Text, __assign({ sx: { fontSize: '12px' } }, { children: title })), _jsx(UploadInputStyled, { onChange: onFileChange, id: 'upload-file-input', inputRef: fileRef, type: 'file', inputProps: { accept: '.png,.jpg,.pdf,.jpeg' } })] })));
37
+ };
38
+ export default UploadInput;
@@ -0,0 +1,3 @@
1
+ import UploadInput from './UploadInput';
2
+ import DragAndDrop from './DragAndDrop';
3
+ export { DragAndDrop, UploadInput };
@@ -0,0 +1,3 @@
1
+ import UploadInput from './UploadInput';
2
+ import DragAndDrop from './DragAndDrop';
3
+ export { DragAndDrop, UploadInput };
@@ -27,4 +27,5 @@ export declare const ENDPOINT_PATHS: {
27
27
  BRAND_LIST: string;
28
28
  OCCUPATION: string;
29
29
  INDIVIDUAL: string;
30
+ FILES_PATH: string;
30
31
  };
@@ -26,6 +26,7 @@ var MONTHLY_INCOME_PATH = '/v2/monthlyIncome';
26
26
  var OCCUPATION_PATH = '/v2/occupation';
27
27
  var BRAND_LIST_PATH = '/brand/list';
28
28
  var FIREBASE_URL = 'https://goconnect-195cd-default-rtdb.asia-southeast1.firebasedatabase.app/locale.json';
29
+ var FILES = '/files';
29
30
  export var ENDPOINT_PATHS = {
30
31
  SANDBOX_BASE_URL: SANDBOX_BASE_URL,
31
32
  PRODUCTION_BASE_URL: PRODUCTION_BASE_URL,
@@ -54,5 +55,6 @@ export var ENDPOINT_PATHS = {
54
55
  IBAN_BANK: IBAN_PATH,
55
56
  BRAND_LIST: BRAND_LIST_PATH,
56
57
  OCCUPATION: OCCUPATION_PATH,
57
- INDIVIDUAL: INDIVIDUAL_PATH
58
+ INDIVIDUAL: INDIVIDUAL_PATH,
59
+ FILES_PATH: FILES
58
60
  };
@@ -106,9 +106,15 @@ export var BUSINESS_SCREENS_NAVIGATION = [
106
106
  },
107
107
  {
108
108
  name: 'BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
109
+ next: 'BUSINESS_RESET_PASSWORD_SUCCESS',
110
+ prev: '',
111
+ order: 7
112
+ },
113
+ {
114
+ name: 'BUSINESS_RESET_PASSWORD_SUCCESS',
109
115
  next: '',
110
116
  prev: '',
111
- order: 6
117
+ order: 8
112
118
  }
113
119
  ];
114
120
  export var INDIVIDUAL_SCREENS_NAVIGATION = [
@@ -132,9 +138,15 @@ export var INDIVIDUAL_SCREENS_NAVIGATION = [
132
138
  },
133
139
  {
134
140
  name: 'INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
135
- next: '',
141
+ next: 'INDIVIDUAL_RESET_PASSWORD_SUCCESS',
136
142
  prev: '',
137
143
  order: 4
144
+ },
145
+ {
146
+ name: 'INDIVIDUAL_RESET_PASSWORD_SUCCESS',
147
+ next: '',
148
+ prev: '',
149
+ order: 5
138
150
  }
139
151
  ];
140
152
  export var PASSWORD_SCREENS_NAVIGATION = [
@@ -164,9 +176,15 @@ export var PASSWORD_SCREENS_NAVIGATION = [
164
176
  },
165
177
  {
166
178
  name: 'PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
167
- next: '',
179
+ next: 'PASSWORD_RESET_PASSWORD_SUCCESS',
168
180
  prev: '',
169
181
  order: 5
182
+ },
183
+ {
184
+ name: 'PASSWORD_RESET_PASSWORD_SUCCESS',
185
+ next: '',
186
+ prev: '',
187
+ order: 6
170
188
  }
171
189
  ];
172
190
  export var BANK_SCREENS_NAVIGATION = [
@@ -190,9 +208,15 @@ export var BANK_SCREENS_NAVIGATION = [
190
208
  },
191
209
  {
192
210
  name: 'BANK_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
193
- next: '',
211
+ next: 'BANK_RESET_PASSWORD_SUCCESS',
194
212
  prev: '',
195
213
  order: 4
214
+ },
215
+ {
216
+ name: 'BANK_RESET_PASSWORD_SUCCESS',
217
+ next: '',
218
+ prev: '',
219
+ order: 5
196
220
  }
197
221
  ];
198
222
  export var TAX_SCREENS_NAVIGATION = [
@@ -216,9 +240,15 @@ export var TAX_SCREENS_NAVIGATION = [
216
240
  },
217
241
  {
218
242
  name: 'TAX_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
219
- next: '',
243
+ next: 'TAX_RESET_PASSWORD_SUCCESS',
220
244
  prev: 'TAX_DETAILS_SUCCESS_STEP',
221
245
  order: 4
246
+ },
247
+ {
248
+ name: 'TAX_RESET_PASSWORD_SUCCESS',
249
+ next: '',
250
+ prev: '',
251
+ order: 5
222
252
  }
223
253
  ];
224
254
  export var DefaultDeviceInfo = {
@@ -41,6 +41,7 @@ export declare const ICONS_NAMES: {
41
41
  MOBILE_ICON: string;
42
42
  SEARCH_ICON: string;
43
43
  SUCCESS_GIF: string;
44
+ DELETE_ICON: string;
44
45
  GMAIL_Filled_ICON: string;
45
46
  GMAIL_White_ICON: string;
46
47
  outlook_Filled_ICON: string;
@@ -41,6 +41,7 @@ export var ICONS_NAMES = {
41
41
  MOBILE_ICON: 'https://dash.b-cdn.net/icons/menu/mobile.svg',
42
42
  SEARCH_ICON: 'https://dash.b-cdn.net/icons/menu/search-icon.svg',
43
43
  SUCCESS_GIF: 'https://dash.b-cdn.net/icons/menu/success_icon.gif',
44
+ DELETE_ICON: 'https://dash.b-cdn.net/icons/menu/delete-icon.png',
44
45
  GMAIL_Filled_ICON: 'https://dash.b-cdn.net/icons/menu/Gmail-filled.svg',
45
46
  GMAIL_White_ICON: 'https://dash.b-cdn.net/icons/menu/Gmail-white.svg',
46
47
  outlook_Filled_ICON: 'https://dash.b-cdn.net/icons/menu/Outlook-filled.svg',
@@ -5,6 +5,8 @@ export declare const MAX_IBAN_VALUE = 34;
5
5
  export declare const FL_NUMBER_LENGTH = 8;
6
6
  export declare const CR_NUMBER_LENGTH = 10;
7
7
  export declare const SAUDI_NUMBER_LENGTH = 9;
8
+ export declare const MAX_FILE_SIZE = 1000000;
8
9
  export declare const REGEX_FULL_NAME: RegExp;
9
10
  export declare const REGEX_WEBSITE: RegExp;
10
11
  export declare const REGEX_BENEFICIARY_NAME: RegExp;
12
+ export declare const REGEX_BRAND_NAME: RegExp;
@@ -5,6 +5,8 @@ export var MAX_IBAN_VALUE = 34;
5
5
  export var FL_NUMBER_LENGTH = 8;
6
6
  export var CR_NUMBER_LENGTH = 10;
7
7
  export var SAUDI_NUMBER_LENGTH = 9;
8
+ export var MAX_FILE_SIZE = 1000000;
8
9
  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;
9
10
  export var REGEX_WEBSITE = /^[a-zA-Z0-9]+([\-\.]{1}[a-zA-Z0-9]+)*\.[a-zA-Z]{2,63}(:[0-9]{1,5})?(\/.*)?$/;
10
11
  export var REGEX_BENEFICIARY_NAME = /^([\u0600-\u065F\u066A-\u06EF\u06FA-\u06FFa-zA-Z\s])*$/g;
12
+ export var REGEX_BRAND_NAME = /(.*[a-zA-Z0-9]){3}/g;
@@ -20,6 +20,7 @@ export declare const createBankAccount: import("@reduxjs/toolkit").AsyncThunk<{
20
20
  data: any;
21
21
  formData: BankFormValues;
22
22
  }, BankFormValues, {}>;
23
+ export declare const uploadBankStatement: import("@reduxjs/toolkit").AsyncThunk<any, File, {}>;
23
24
  export declare const checkIbanBank: import("@reduxjs/toolkit").AsyncThunk<{
24
25
  data: any;
25
26
  }, {
@@ -155,36 +155,55 @@ export var retrieveEntityInfo = createAsyncThunk('retrieveBankEntityInfo', funct
155
155
  }); });
156
156
  export var createBankAccount = createAsyncThunk('createBankAccount', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
157
157
  var _a, settings, bank, iban, beneficiaryName, bank_name, requestBody, data;
158
- var _b, _c, _d;
159
- return __generator(this, function (_e) {
160
- switch (_e.label) {
158
+ var _b, _c, _d, _e;
159
+ return __generator(this, function (_f) {
160
+ switch (_f.label) {
161
161
  case 0:
162
162
  _a = thunkApi.getState(), settings = _a.settings, bank = _a.bank;
163
163
  iban = params.iban;
164
164
  beneficiaryName = params.beneficiaryName;
165
165
  bank_name = params.bankName;
166
166
  requestBody = {
167
- wallet_id: (_b = bank.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.merchant_wallet_id,
167
+ wallet_id: (_c = (_b = bank.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.merchant) === null || _c === void 0 ? void 0 : _c.wallet_id,
168
168
  is_acknowledged: params.confirmPolicy,
169
169
  bank_account: {
170
170
  iban: iban,
171
171
  beneficiary_name: beneficiaryName,
172
- bank_name: bank_name
172
+ bank_name: bank_name,
173
+ bank_statement_file_id: params.bankStatementId
173
174
  },
174
175
  step_name: BANK_STEP_NAMES.BANK_INFO,
175
176
  encryption_contract: ['bank_account.iban', 'bank_account.beneficiary_name', 'bank_account.bank_name']
176
177
  };
177
178
  return [4, API.entityService.createBankAccount(requestBody)];
178
179
  case 1:
179
- data = (_e.sent()).data;
180
+ data = (_f.sent()).data;
180
181
  if (!data.errors) {
181
182
  thunkApi.dispatch(handleNextScreenStep());
182
- (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, requestBody);
183
+ (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, requestBody);
183
184
  }
184
185
  return [2, { data: data, formData: params }];
185
186
  }
186
187
  });
187
188
  }); });
189
+ export var uploadBankStatement = createAsyncThunk('uploadBankStatement', function (file, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
190
+ var requestBody, data;
191
+ return __generator(this, function (_a) {
192
+ switch (_a.label) {
193
+ case 0:
194
+ requestBody = {
195
+ file_link_create: true,
196
+ title: file === null || file === void 0 ? void 0 : file.name,
197
+ purpose: 'identity_document',
198
+ file: file
199
+ };
200
+ return [4, API.entityService.uploadFileInfo(requestBody)];
201
+ case 1:
202
+ data = _a.sent();
203
+ return [2, data];
204
+ }
205
+ });
206
+ }); });
188
207
  export var checkIbanBank = createAsyncThunk('checkIbanBank', function (_a) {
189
208
  var iban = _a.iban, cancelToken = _a.cancelToken, onSuccess = _a.onSuccess;
190
209
  return __awaiter(void 0, void 0, void 0, function () {
@@ -252,7 +271,8 @@ var initialState = {
252
271
  iban: '',
253
272
  beneficiaryName: '',
254
273
  bankName: '',
255
- confirmPolicy: false
274
+ confirmPolicy: false,
275
+ uploading: false
256
276
  }
257
277
  }
258
278
  };
@@ -404,6 +424,20 @@ export var bankSlice = createSlice({
404
424
  if (action.error.message === 'Aborted')
405
425
  return;
406
426
  state.error = action.error.message;
427
+ })
428
+ .addCase(uploadBankStatement.pending, function (state) {
429
+ state.data.bankData.uploading = true;
430
+ state.error = null;
431
+ })
432
+ .addCase(uploadBankStatement.fulfilled, function (state, action) {
433
+ state.data.bankData.uploading = false;
434
+ state.error = null;
435
+ var id = action.payload.id;
436
+ state.data.bankData.responseBody = { fileId: id };
437
+ })
438
+ .addCase(uploadBankStatement.rejected, function (state, action) {
439
+ state.data.bankData.uploading = false;
440
+ state.error = action.error.message;
407
441
  });
408
442
  }
409
443
  });
@@ -571,10 +571,10 @@ export var businessSlice = createSlice({
571
571
  state.error = null;
572
572
  })
573
573
  .addCase(verifyLeadOTP.fulfilled, function (state, action) {
574
- var _a, _b;
574
+ var _a, _b, _c;
575
575
  state.loading = false;
576
576
  state.error = null;
577
- var _c = action.payload, data = _c.data, formData = _c.formData;
577
+ var _d = action.payload, data = _d.data, formData = _d.formData;
578
578
  var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
579
579
  if (description) {
580
580
  state.error = description;
@@ -582,7 +582,7 @@ export var businessSlice = createSlice({
582
582
  }
583
583
  state.data.otpData = formData;
584
584
  state.data.otpData.responseBody = data;
585
- var _d = state.data.verify.responseBody || {}, entity = _d.entity, entity_activities = _d.entity_activities;
585
+ var _e = state.data.verify.responseBody || {}, entity = _e.entity, entity_activities = _e.entity_activities, business_type = _e.business_type;
586
586
  var issuingDate = (_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.issuing_date;
587
587
  if (!!issuingDate) {
588
588
  var formattedDate = moment(issuingDate).format('YYYY-MM-DD');
@@ -593,6 +593,13 @@ export var businessSlice = createSlice({
593
593
  if (!!selectedActivity)
594
594
  state.data.activitiesData.activities = [selectedActivity];
595
595
  state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activities: activities });
596
+ if (!!(entity === null || entity === void 0 ? void 0 : entity.license)) {
597
+ state.data.businessTypeData.selectedLicense = {
598
+ legal_name: entity === null || entity === void 0 ? void 0 : entity.legal_name,
599
+ license: { number: (_c = entity === null || entity === void 0 ? void 0 : entity.license) === null || _c === void 0 ? void 0 : _c.number },
600
+ type: business_type
601
+ };
602
+ }
596
603
  })
597
604
  .addCase(verifyLeadOTP.rejected, function (state, action) {
598
605
  state.loading = false;
@@ -766,9 +773,9 @@ export var businessSlice = createSlice({
766
773
  state.loading = false;
767
774
  state.error = null;
768
775
  var data = action.payload.data;
769
- var message = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).message;
770
- if (message) {
771
- state.error = message;
776
+ var _b = ((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}, message = _b.message, description = _b.description;
777
+ if (message || description) {
778
+ state.error = message || description;
772
779
  return;
773
780
  }
774
781
  if ((data === null || data === void 0 ? void 0 : data.status) === 'ALREADY_TAKEN') {
@@ -309,10 +309,10 @@ export var updateLeadIndividual = createAsyncThunk('updateLeadIndividual', funct
309
309
  });
310
310
  }); });
311
311
  export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
312
- var _a, settings, connect, instagram, twitter, _b, mobileData, nidData, otpData, brandData, isAbsher, responseBody, isExistingUser, payload, data;
313
- var _c, _d, _e, _f, _g, _h, _j, _k, _l;
314
- return __generator(this, function (_m) {
315
- switch (_m.label) {
312
+ var _a, settings, connect, instagram, twitter, _b, mobileData, nidData, otpData, brandData, isAbsher, responseBody, isExistingUser, isOther, brand, payload, data;
313
+ var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
314
+ return __generator(this, function (_p) {
315
+ switch (_p.label) {
316
316
  case 0:
317
317
  _a = thunkApi.getState(), settings = _a.settings, connect = _a.connect;
318
318
  instagram = !!((_c = params.links) === null || _c === void 0 ? void 0 : _c.instagram) ? "".concat(INSTAGRAM_URL, "/").concat((_d = params.links) === null || _d === void 0 ? void 0 : _d.instagram) : '';
@@ -321,17 +321,19 @@ export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (param
321
321
  isAbsher = otpData.isAbsher;
322
322
  responseBody = (isAbsher ? nidData : mobileData).responseBody;
323
323
  isExistingUser = (responseBody === null || responseBody === void 0 ? void 0 : responseBody.new_user) === false;
324
+ isOther = ((_g = params.selectedBrandItem) === null || _g === void 0 ? void 0 : _g.id) === 'other';
325
+ brand = __assign({ name: {
326
+ en: params.brandName,
327
+ ar: params.brandName,
328
+ zh: params.brandName
329
+ }, website: (_h = params.links) === null || _h === void 0 ? void 0 : _h.website, social: [twitter, instagram] }, (isExistingUser &&
330
+ !isOther && {
331
+ id: (_j = params.selectedBrandItem) === null || _j === void 0 ? void 0 : _j.id,
332
+ name: undefined
333
+ }));
324
334
  payload = {
325
- brand: {
326
- name: {
327
- en: params.brandName,
328
- ar: params.brandName,
329
- zh: params.brandName
330
- },
331
- website: (_g = params.links) === null || _g === void 0 ? void 0 : _g.website,
332
- social: [twitter, instagram]
333
- },
334
- id: (isExistingUser ? (_h = brandData.responseBody) === null || _h === void 0 ? void 0 : _h.lead_id : (_j = otpData.responseBody) === null || _j === void 0 ? void 0 : _j.lead_id) || '',
335
+ brand: brand,
336
+ id: (isExistingUser ? (_k = brandData.responseBody) === null || _k === void 0 ? void 0 : _k.lead_id : (_l = otpData.responseBody) === null || _l === void 0 ? void 0 : _l.lead_id) || '',
335
337
  terms_conditions_accepted: params.termAndConditionChecked,
336
338
  step_name: CONNECT_STEP_NAMES.UPDATE_LEAD_MERCHANT,
337
339
  encryption_contract: [
@@ -345,10 +347,10 @@ export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (param
345
347
  };
346
348
  return [4, API.leadService.updateLead(payload)];
347
349
  case 1:
348
- data = (_m.sent()).data;
350
+ data = (_p.sent()).data;
349
351
  if (!data.errors) {
350
352
  thunkApi.dispatch(handleNextScreenStep());
351
- (_l = (_k = settings.data.appConfig).onStepCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, settings.data.activeScreen.name, params);
353
+ (_o = (_m = settings.data.appConfig).onStepCompleted) === null || _o === void 0 ? void 0 : _o.call(_m, settings.data.activeScreen.name, params);
352
354
  }
353
355
  return [2, { response: data, formData: params }];
354
356
  }
@@ -183,18 +183,19 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
183
183
  }); });
184
184
  export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
185
185
  var _a, settings, individual, requestBody, data;
186
- var _b, _c, _d, _e, _f, _g, _h;
187
- return __generator(this, function (_j) {
188
- switch (_j.label) {
186
+ var _b, _c, _d, _e, _f, _g, _h, _j;
187
+ return __generator(this, function (_k) {
188
+ switch (_k.label) {
189
189
  case 0:
190
190
  _a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
191
191
  requestBody = {
192
192
  id: (_b = individual.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.individual_id,
193
- occupation: (_c = params.occupation) === null || _c === void 0 ? void 0 : _c.id,
193
+ lead_id: (_c = individual.data.verify.responseBody) === null || _c === void 0 ? void 0 : _c.id,
194
+ occupation: (_d = params.occupation) === null || _d === void 0 ? void 0 : _d.id,
194
195
  employer_name: params.employerName,
195
- employer_country: (_d = params.employerLocation) === null || _d === void 0 ? void 0 : _d.iso2,
196
- source_income: [(_e = params.sourceIncome) === null || _e === void 0 ? void 0 : _e.id],
197
- actual_income: (_f = params.monthlyIncome) === null || _f === void 0 ? void 0 : _f.id,
196
+ employer_country: (_e = params.employerLocation) === null || _e === void 0 ? void 0 : _e.iso2,
197
+ source_income: [(_f = params.sourceIncome) === null || _f === void 0 ? void 0 : _f.id],
198
+ actual_income: (_g = params.monthlyIncome) === null || _g === void 0 ? void 0 : _g.id,
198
199
  is_relative_PEP: params.isPEP,
199
200
  is_influencer: params.isInfluencer,
200
201
  encryption_contract: ['employer_name', 'employer_city', 'actual_income', 'source_income[0]'],
@@ -202,10 +203,10 @@ export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', funct
202
203
  };
203
204
  return [4, API.entityService.updateIndividualInfo(requestBody)];
204
205
  case 1:
205
- data = (_j.sent()).data;
206
+ data = (_k.sent()).data;
206
207
  if (!(data === null || data === void 0 ? void 0 : data.errors)) {
207
208
  thunkApi.dispatch(handleNextScreenStep());
208
- (_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, requestBody);
209
+ (_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, requestBody);
209
210
  }
210
211
  return [2, { data: data, formData: params }];
211
212
  }
@@ -47,7 +47,10 @@ export declare const resetPassword: import("@reduxjs/toolkit").AsyncThunk<{
47
47
  otp: string;
48
48
  };
49
49
  }, OTPFormValues, {}>;
50
- export declare const retrieveLead: import("@reduxjs/toolkit").AsyncThunk<any, void, {}>;
50
+ export declare const retrieveLeadPassword: import("@reduxjs/toolkit").AsyncThunk<{
51
+ lead: any;
52
+ entity: any;
53
+ }, void, {}>;
51
54
  declare type VerifyData = {
52
55
  token: string;
53
56
  operationType?: string;