@tap-payments/auth-jsconnect 2.0.34 → 2.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/build/@types/form.d.ts +6 -4
  2. package/build/api/entity.d.ts +25 -0
  3. package/build/api/entity.js +17 -1
  4. package/build/api/index.d.ts +5 -2
  5. package/build/api/individual.d.ts +1 -1
  6. package/build/api/lead.d.ts +1 -0
  7. package/build/api/lead.js +8 -1
  8. package/build/assets/locales/ar.json +3 -1
  9. package/build/assets/locales/en.json +3 -1
  10. package/build/components/FileInput/DragAndDrop.js +2 -1
  11. package/build/constants/app.js +1 -1
  12. package/build/constants/assets.d.ts +3 -0
  13. package/build/constants/assets.js +3 -0
  14. package/build/constants/validation.js +2 -2
  15. package/build/features/app/auth/authStore.js +6 -11
  16. package/build/features/app/bank/bankStore.js +16 -13
  17. package/build/features/app/business/businessStore.js +7 -4
  18. package/build/features/app/connect/connectStore.js +2 -2
  19. package/build/features/app/entity/entityStore.d.ts +27 -7
  20. package/build/features/app/entity/entityStore.js +218 -146
  21. package/build/features/app/individual/individualStore.js +14 -12
  22. package/build/features/app/tax/taxStore.js +15 -12
  23. package/build/features/bank/screens/BankDetails/BankDetails.js +1 -1
  24. package/build/features/bank/screens/BankDetails/BankName.js +2 -1
  25. package/build/features/connect/screens/Merchant/SalesChannels.js +1 -1
  26. package/build/features/connect/screens/Merchant/SocialMedia.js +2 -2
  27. package/build/features/connect/screens/Mobile/Mobile.js +2 -1
  28. package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +1 -1
  29. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +1 -0
  30. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +20 -11
  31. package/build/features/entity/screens/EntityInfoConfirm/Article.d.ts +3 -0
  32. package/build/features/entity/screens/EntityInfoConfirm/Article.js +73 -0
  33. package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +12 -6
  34. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +20 -5
  35. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +25 -4
  36. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +13 -18
  37. package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +12 -51
  38. package/build/features/entity/screens/EntityInfoConfirm/validation.js +17 -10
  39. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  40. package/build/features/entity/screens/Verify/Verify.js +5 -5
  41. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +1 -1
  42. package/build/features/password/screens/CreatePassword/CreatePassword.js +1 -1
  43. package/build/features/shared/UploadFile/UploadFile.d.ts +2 -1
  44. package/build/features/shared/UploadFile/UploadFile.js +3 -3
  45. package/build/features/tax/screens/TaxDetails/TaxDetails.js +1 -1
  46. package/build/utils/object.js +1 -1
  47. package/package.json +129 -129
  48. package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.d.ts +0 -5
  49. package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.js +0 -115
@@ -82,9 +82,11 @@ export declare type PasswordCreateFormValues = {
82
82
  confirmPassword: string;
83
83
  };
84
84
  export declare type EntityFormValues = {
85
- licenseNumber?: string;
86
- licenseName?: string;
87
- activities?: Array<Activity>;
88
- salesChannels?: Array<SaleChannel>;
85
+ licenseNumber: string;
86
+ licenseName: string;
87
+ activities: Array<Activity>;
89
88
  operationStartDate: string;
89
+ uploading?: boolean;
90
+ articleId?: string;
91
+ articleFile?: File;
90
92
  };
@@ -52,6 +52,29 @@ export declare type UploadFileBody = {
52
52
  file?: File;
53
53
  title: string | undefined;
54
54
  purpose: string;
55
+ type?: string;
56
+ };
57
+ export declare type UpdateEntityBody = {
58
+ id: string;
59
+ license: {
60
+ type?: string;
61
+ number?: string;
62
+ additional_info?: {
63
+ unified_number: string;
64
+ };
65
+ issuing_date?: number;
66
+ expiry_date?: string;
67
+ };
68
+ activities?: Array<{
69
+ id: string;
70
+ action: string;
71
+ }>;
72
+ legal_name: {
73
+ ar: string;
74
+ en: string;
75
+ };
76
+ AOA_file_id?: string;
77
+ encryption_contract?: Array<string>;
55
78
  };
56
79
  export declare type DocumentInfo = {
57
80
  type?: string;
@@ -74,5 +97,7 @@ declare const entityService: {
74
97
  updateIndividualInfo: ({ id, ...data }: EntityInfoBody) => Promise<any>;
75
98
  uploadFileInfo: (data: UploadFileBody, config?: AxiosRequestConfig) => Promise<any>;
76
99
  updateDocumentInfo: (data: DocumentUpdateBody) => Promise<any>;
100
+ retrieveEntity: (entity_id: string) => Promise<any>;
101
+ updateEntity: ({ id, ...data }: UpdateEntityBody) => Promise<any>;
77
102
  };
78
103
  export { entityService };
@@ -33,6 +33,20 @@ var updateEntityInfo = function (_a, config) {
33
33
  var id = _a.id, data = __rest(_a, ["id"]);
34
34
  return instance.put("".concat(ENDPOINT_PATHS.ENTITY, "/").concat(id), data, config);
35
35
  };
36
+ var retrieveEntity = function (entity_id) {
37
+ return httpClient({
38
+ method: 'get',
39
+ url: "".concat(ENDPOINT_PATHS.ENTITY, "/").concat(entity_id)
40
+ });
41
+ };
42
+ var updateEntity = function (_a) {
43
+ var id = _a.id, data = __rest(_a, ["id"]);
44
+ return httpClient({
45
+ method: 'put',
46
+ url: "".concat(ENDPOINT_PATHS.ENTITY, "/").concat(id),
47
+ data: data
48
+ });
49
+ };
36
50
  var createBankAccount = function (data, config) {
37
51
  return instance.put("".concat(ENDPOINT_PATHS.BANK), data, config);
38
52
  };
@@ -68,6 +82,8 @@ var entityService = {
68
82
  retrieveEntityInfo: retrieveEntityInfo,
69
83
  updateIndividualInfo: updateIndividualInfo,
70
84
  uploadFileInfo: uploadFileInfo,
71
- updateDocumentInfo: updateDocumentInfo
85
+ updateDocumentInfo: updateDocumentInfo,
86
+ retrieveEntity: retrieveEntity,
87
+ updateEntity: updateEntity
72
88
  };
73
89
  export { entityService };
@@ -3,7 +3,7 @@ import { ValidateOperatorBody } from './operator';
3
3
  import { CreateAuthBody, VerifyAuthBody, CreatePasswordBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, VerifyAuthKitOTPBody } from './auth';
4
4
  import { UpdateLeadBody, LeadVerifyBody, CreateLeadBody, LeadOTPVerifyBody, LeadIdentityUpdateBody } from './lead';
5
5
  import { CheckEmailBody, CheckBrandBody } from './availabilityServices';
6
- import { EntityInfoBody, EntityBankUpdateBody, UploadFileBody, DocumentUpdateBody, DocumentInfo } from './entity';
6
+ import { EntityInfoBody, EntityBankUpdateBody, UploadFileBody, UpdateEntityBody, DocumentUpdateBody, DocumentInfo } from './entity';
7
7
  import { CreateAccountBody } from './account';
8
8
  import { DataElementBody } from './data';
9
9
  import { BrandListBody, UpdateBrandBody, UpdateIndividualBody } from './individual';
@@ -36,6 +36,7 @@ declare const API: {
36
36
  verifyLeadToken: (data: LeadVerifyBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
37
37
  verifyLeadOTP: (data: LeadOTPVerifyBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
38
38
  retrieveEntityList: (leadId: string) => Promise<import("axios").AxiosResponse<any, any>>;
39
+ retrieveLeadIdentity: (leadId: string) => Promise<any>;
39
40
  };
40
41
  entityService: {
41
42
  createEntityInfo: ({ id, ...data }: EntityInfoBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
@@ -46,6 +47,8 @@ declare const API: {
46
47
  updateIndividualInfo: ({ id, ...data }: EntityInfoBody) => Promise<any>;
47
48
  uploadFileInfo: (data: UploadFileBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
48
49
  updateDocumentInfo: (data: DocumentUpdateBody) => Promise<any>;
50
+ retrieveEntity: (entity_id: string) => Promise<any>;
51
+ updateEntity: ({ id, ...data }: UpdateEntityBody) => Promise<any>;
49
52
  };
50
53
  availabilityServices: {
51
54
  checkEmail: (data: CheckEmailBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
@@ -105,6 +108,6 @@ declare const API: {
105
108
  updateBrandSales: ({ id, ...data }: import("./individual").UpdateSalesChannels) => void;
106
109
  };
107
110
  };
108
- export type { ValidateOperatorBody, CreateAuthBody, VerifyAuthBody, CreateLeadBody, UpdateLeadBody, LeadVerifyBody, LeadOTPVerifyBody, CheckEmailBody, CheckBrandBody, LeadIdentityUpdateBody, EntityInfoBody, CreateAccountBody, EntityBankUpdateBody, CreatePasswordBody, BrandListBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, UpdateBoardBody, UpdateBrandBody, DataElementBody, UploadFileBody, DocumentUpdateBody, DocumentInfo, VerifyAuthKitOTPBody, UpdateIndividualBody };
111
+ 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, VerifyAuthKitOTPBody, UpdateIndividualBody };
109
112
  export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, axiosInstance, getAxiosHeaders };
110
113
  export default API;
@@ -52,7 +52,7 @@ export declare type UpdateBrandBody = {
52
52
  };
53
53
  };
54
54
  term?: Array<string>;
55
- step_name: string;
55
+ step_name?: string;
56
56
  encryption_contract?: Array<string>;
57
57
  };
58
58
  export declare type UpdateSalesChannels = {
@@ -91,5 +91,6 @@ declare const leadService: {
91
91
  verifyLeadToken: (data: LeadVerifyBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
92
92
  verifyLeadOTP: (data: LeadOTPVerifyBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
93
93
  retrieveEntityList: (leadId: string) => Promise<import("axios").AxiosResponse<any, any>>;
94
+ retrieveLeadIdentity: (leadId: string) => Promise<any>;
94
95
  };
95
96
  export { leadService };
package/build/api/lead.js CHANGED
@@ -34,12 +34,19 @@ var verifyLeadOTP = function (data, config) {
34
34
  var retrieveEntityList = function (leadId) {
35
35
  return instance.get("".concat(ENDPOINT_PATHS.RETRIEVE_ENTITY_LIST, "/").concat(leadId));
36
36
  };
37
+ var retrieveLeadIdentity = function (leadId) {
38
+ return httpClient({
39
+ method: 'get',
40
+ url: "".concat(ENDPOINT_PATHS.LEAD, "/").concat(leadId, "/identity")
41
+ });
42
+ };
37
43
  var leadService = {
38
44
  createLead: createLead,
39
45
  updateLead: updateLead,
40
46
  retrieveLead: retrieveLead,
41
47
  verifyLeadToken: verifyLeadToken,
42
48
  verifyLeadOTP: verifyLeadOTP,
43
- retrieveEntityList: retrieveEntityList
49
+ retrieveEntityList: retrieveEntityList,
50
+ retrieveLeadIdentity: retrieveLeadIdentity
44
51
  };
45
52
  export { leadService };
@@ -321,5 +321,7 @@
321
321
  "invalid_android_app": "يرجى التحقق من اسم تطبيق Android",
322
322
  "invalid_call_center_number": "يرجى التحقق من رقم مركز الاتصال",
323
323
  "activities_name_hint": "activities_name_hint",
324
- "customer_base_name_hint": "customer_base_name_hint"
324
+ "customer_base_name_hint": "customer_base_name_hint",
325
+ "title_article": "Article",
326
+ "article_of_association": "Article file. PDF, JPG or PNG files up to 5mb."
325
327
  }
@@ -348,5 +348,7 @@
348
348
  "invalid_android_app": "May you please verify the entered Android application name.",
349
349
  "invalid_call_center_number": "May you please verify the entered call center number.",
350
350
  "activities_name_hint": "activities_name_hint",
351
- "customer_base_name_hint": "customer_base_name_hint"
351
+ "customer_base_name_hint": "customer_base_name_hint",
352
+ "title_article": "Article",
353
+ "article_of_association": "Article file. PDF, JPG or PNG files up to 5mb."
352
354
  }
@@ -23,7 +23,7 @@ import Collapse from '../../components/Collapse';
23
23
  import Fade from '@mui/material/Fade';
24
24
  var BoxStyled = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'active'; } })(function (_a) {
25
25
  var theme = _a.theme, active = _a.active;
26
- 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, paddingInline: theme.spacing(2.5), border: "2px dashed ".concat(active ? theme.palette.primary.main : alpha(theme.palette.divider, 0.8)), width: '350px', height: '158px', cursor: 'default', display: 'flex', justifyContent: 'center', alignItems: 'center', borderRadius: theme.spacing(2.5) }));
26
+ 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.paper, paddingInline: theme.spacing(2.5), border: "2px dashed ".concat(active ? theme.palette.primary.main : alpha(theme.palette.divider, 0.8)), width: '350px', height: '158px', cursor: 'default', display: 'flex', justifyContent: 'center', alignItems: 'center', borderRadius: theme.spacing(2.5) }));
27
27
  });
28
28
  var UploadInputStyled = styled(Input)(function () { return ({
29
29
  display: 'none'
@@ -64,6 +64,7 @@ var DescTextStyled = styled(Text)(function (_a) {
64
64
  fontSize: theme.spacing(1.5),
65
65
  width: theme.spacing(27.5),
66
66
  wordBreak: 'break-all',
67
+ textAlign: 'center',
67
68
  marginBlockStart: theme.spacing(1),
68
69
  marginBlockEnd: theme.spacing(0)
69
70
  });
@@ -317,7 +317,7 @@ export var ENTITY_SCREENS_NAVIGATION = [
317
317
  {
318
318
  name: 'ENTITY_INFO_STEP',
319
319
  next: 'ENTITY_DETAILS_SUCCESS_STEP',
320
- prev: '',
320
+ prev: 'ENTITY_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
321
321
  order: 2
322
322
  },
323
323
  {
@@ -82,6 +82,9 @@ export declare const ICONS_NAMES: {
82
82
  business_filled_icon: string;
83
83
  business_green_icon: string;
84
84
  business_white_icon: string;
85
+ entity_filled_icon: string;
86
+ entity_green_icon: string;
87
+ entity_white_icon: string;
85
88
  Arrow_filled_right_icon: string;
86
89
  Arrow_green_right_icon: string;
87
90
  Arrow_white_right_icon: string;
@@ -82,6 +82,9 @@ export var ICONS_NAMES = {
82
82
  business_filled_icon: 'https://dash.b-cdn.net/icons/menu/business-filled-blue.svg',
83
83
  business_green_icon: 'https://dash.b-cdn.net/icons/menu/business-filled-green.svg',
84
84
  business_white_icon: 'https://dash.b-cdn.net/icons/menu/business-white.svg',
85
+ entity_filled_icon: 'https://dash.b-cdn.net/icons/menu/business-filled-blue.svg',
86
+ entity_green_icon: 'https://dash.b-cdn.net/icons/menu/business-filled-green.svg',
87
+ entity_white_icon: 'https://dash.b-cdn.net/icons/menu/business-white.svg',
85
88
  Arrow_filled_right_icon: 'https://dash.b-cdn.net/icons/menu/right-arrow-filled-blue.svg',
86
89
  Arrow_green_right_icon: 'https://dash.b-cdn.net/icons/menu/right-arrow-filled-green.svg',
87
90
  Arrow_white_right_icon: 'https://dash.b-cdn.net/icons/menu/right-arrow-white.svg'
@@ -16,7 +16,7 @@ export var REGEX_BENEFICIARY_NAME = /^([\u0600-\u065F\u066A-\u06EF\u06FA-\u06FFa
16
16
  export var REGEX_ALPHANUMERIC = /^[a-zA-Z0-9!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/? ]*$/g;
17
17
  export var REGEX_BRAND_NAME = /^(([a-zA-Z0-9])+\s)*[a-zA-Z0-9]+$/;
18
18
  export var EMAIL_MAX_LENGTH = 50;
19
- export var LINKEDIN_URL = /^((http|https):\/\/)(www.linkedin.com\/)in(\/)[a-zA-Z0-9-]+$/;
20
- export var SOCIAL_USERNAME = /^[a-z\d.]{5,}$/;
19
+ export var LINKEDIN_URL = /^((http|https):\/\/)(www.linkedin.com\/)in(\/)[a-zA-Z0-9-\/]+$/;
20
+ export var SOCIAL_USERNAME = /^[A-Za-z-0-9\d._]{3,}$/;
21
21
  export var DIGITS_ONLY = /^\d+$/;
22
22
  export var REGEX_PHONE_APP_NAME = /^[a-zA-Z0-9[._-]*$/;
@@ -44,9 +44,9 @@ export var retrieveLead = createAsyncThunk('retrieveLeadAuthKit', function (lead
44
44
  var data;
45
45
  return __generator(this, function (_a) {
46
46
  switch (_a.label) {
47
- case 0: return [4, API.leadService.retrieveLead(leadId)];
47
+ case 0: return [4, API.leadService.retrieveLeadIdentity(leadId)];
48
48
  case 1:
49
- data = (_a.sent()).data;
49
+ data = _a.sent();
50
50
  return [2, data];
51
51
  }
52
52
  });
@@ -197,19 +197,14 @@ export var authSlice = createSlice({
197
197
  state.error = null;
198
198
  })
199
199
  .addCase(retrieveLead.fulfilled, function (state, action) {
200
- var _a, _b, _c, _d;
200
+ var _a, _b, _c;
201
201
  state.customLoading = false;
202
202
  state.error = null;
203
203
  var data = action.payload;
204
- var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
205
- if (description) {
206
- state.error = description;
207
- return;
208
- }
209
- state.data.nid = (_b = data === null || data === void 0 ? void 0 : data.identification) === null || _b === void 0 ? void 0 : _b.id;
204
+ state.data.nid = (_a = data === null || data === void 0 ? void 0 : data.identification) === null || _a === void 0 ? void 0 : _a.id;
210
205
  state.data.dob = data === null || data === void 0 ? void 0 : data.date_of_birth;
211
- state.data.type = (_c = data === null || data === void 0 ? void 0 : data.identification) === null || _c === void 0 ? void 0 : _c.type;
212
- state.data.countryISOCode = ((_d = data === null || data === void 0 ? void 0 : data.identification) === null || _d === void 0 ? void 0 : _d.issued_country_code) || (data === null || data === void 0 ? void 0 : data.country_code);
206
+ state.data.type = (_b = data === null || data === void 0 ? void 0 : data.identification) === null || _b === void 0 ? void 0 : _b.type;
207
+ state.data.countryISOCode = ((_c = data === null || data === void 0 ? void 0 : data.identification) === null || _c === void 0 ? void 0 : _c.issued_country_code) || (data === null || data === void 0 ? void 0 : data.country_code);
213
208
  state.data.responseBody = data;
214
209
  })
215
210
  .addCase(retrieveLead.rejected, function (state, action) {
@@ -49,13 +49,13 @@ var _a;
49
49
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
50
50
  import API from '../../../api';
51
51
  import { FlowsTypes } from '../../../@types';
52
- import { handleCurrentActiveScreen, handleNextScreenStep } from '../../../app/settings';
52
+ import { handleCurrentActiveScreen, handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
53
53
  import { BANK_STEP_NAMES, BUSINESS_FLOW_SUCCESS } from '../../../constants';
54
54
  export var verifyLeadToken = createAsyncThunk('bankVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
55
- var payload, data, boardInfoData, boardData, board_id, board_info_id, info, hasBankCompleted;
56
- var _a, _b, _c;
57
- return __generator(this, function (_d) {
58
- switch (_d.label) {
55
+ var payload, data, boardInfoData, boardData, board_id, board_info_id, countryIso2, info, hasBankCompleted;
56
+ var _a, _b, _c, _d;
57
+ return __generator(this, function (_e) {
58
+ switch (_e.label) {
59
59
  case 0:
60
60
  payload = {
61
61
  service_name: 'tap_email',
@@ -63,7 +63,7 @@ export var verifyLeadToken = createAsyncThunk('bankVerifyLeadToken', function (t
63
63
  };
64
64
  return [4, API.leadService.verifyLeadToken(payload)];
65
65
  case 1:
66
- data = (_d.sent()).data;
66
+ data = (_e.sent()).data;
67
67
  boardData = undefined;
68
68
  if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 5];
69
69
  board_id = data === null || data === void 0 ? void 0 : data.id;
@@ -71,13 +71,16 @@ export var verifyLeadToken = createAsyncThunk('bankVerifyLeadToken', function (t
71
71
  if (!(!!board_id && !!board_info_id)) return [3, 3];
72
72
  return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
73
73
  case 2:
74
- boardInfoData = _d.sent();
75
- _d.label = 3;
74
+ boardInfoData = _e.sent();
75
+ _e.label = 3;
76
76
  case 3: return [4, API.boardService.retrieveBoardDetails(board_id)];
77
77
  case 4:
78
- boardData = _d.sent();
78
+ boardData = _e.sent();
79
+ countryIso2 = (_a = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _a === void 0 ? void 0 : _a.country;
80
+ if (countryIso2)
81
+ thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
79
82
  info = boardInfoData.info;
80
- hasBankCompleted = ((_a = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'bank'; })) === null || _a === void 0 ? void 0 : _a.status) === 'completed';
83
+ hasBankCompleted = ((_b = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'bank'; })) === null || _b === void 0 ? void 0 : _b.status) === 'completed';
81
84
  if (data.step_name === BANK_STEP_NAMES.PHONE_AUTH) {
82
85
  thunkApi.dispatch(handleCurrentActiveScreen('BANK_VERIFY_STEP'));
83
86
  }
@@ -87,7 +90,7 @@ export var verifyLeadToken = createAsyncThunk('bankVerifyLeadToken', function (t
87
90
  else if (data.step_name === BANK_STEP_NAMES.BANK_INFO) {
88
91
  thunkApi.dispatch(handleNextScreenStep('BANK_BANK_DETAILS_STEP'));
89
92
  }
90
- _d.label = 5;
93
+ _e.label = 5;
91
94
  case 5: return [2, {
92
95
  data: data,
93
96
  boardResponse: {
@@ -96,8 +99,8 @@ export var verifyLeadToken = createAsyncThunk('bankVerifyLeadToken', function (t
96
99
  bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
97
100
  entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
98
101
  merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
99
- name: (_b = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _b === void 0 ? void 0 : _b.names,
100
- contact: (_c = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _c === void 0 ? void 0 : _c.contact,
102
+ name: (_c = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _c === void 0 ? void 0 : _c.names,
103
+ contact: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _d === void 0 ? void 0 : _d.contact,
101
104
  business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
102
105
  flows: BUSINESS_FLOW_SUCCESS.concat(boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info)
103
106
  },
@@ -84,7 +84,8 @@ export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', functio
84
84
  case 2:
85
85
  leadResponse = _h.sent();
86
86
  countryIso2 = (_a = leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data) === null || _a === void 0 ? void 0 : _a.country_code;
87
- thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
87
+ if (countryIso2)
88
+ thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
88
89
  if (data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH && isKW(countryIso2)) {
89
90
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_CIVIL_ID_STEP'));
90
91
  }
@@ -211,14 +212,15 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
211
212
  _b = (leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data) || {}, brand = _b.brand, country_code = _b.country_code, steps = _b.steps, board_id = _b.board_id, board_info_id = _b.board_info_id;
212
213
  brandID = brand === null || brand === void 0 ? void 0 : brand.id;
213
214
  countryIso2 = country_code;
214
- thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
215
+ if (countryIso2)
216
+ thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
215
217
  (_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, { otp: params.otp });
216
218
  hasBusinessCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_SUCCESS);
217
219
  hasBusinessCRInfoCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CR_INFO) && hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_INFO_CONFIRM);
218
220
  hasBusinessCRActivitiesCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CR_ACTIVITIES);
219
221
  hasBusinessCustomersCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CUSTOMERS);
220
222
  isIdentityAuthStep = data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH;
221
- if (!isSA(countryIso2)) return [3, 4];
223
+ if (!(isSA(countryIso2) && !isIdentityAuthStep)) return [3, 4];
222
224
  return [4, thunkApi.dispatch(retrieveEntityList({ leadId: data === null || data === void 0 ? void 0 : data.id }))];
223
225
  case 3:
224
226
  _j.sent();
@@ -771,7 +773,8 @@ export var businessSlice = createSlice({
771
773
  var _a;
772
774
  return (_a = brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.activities) === null || _a === void 0 ? void 0 : _a.find(function (value) { return activity.id === value.id; });
773
775
  });
774
- state.data.activitiesData.activities = (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : [activities === null || activities === void 0 ? void 0 : activities[0]];
776
+ var defaultActivities = (activities === null || activities === void 0 ? void 0 : activities[0]) ? [activities === null || activities === void 0 ? void 0 : activities[0]] : [];
777
+ state.data.activitiesData.activities = (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : defaultActivities;
775
778
  state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activities: activities });
776
779
  state.data.businessTypeData.entityLegalName = (business_name === null || business_name === void 0 ? void 0 : business_name.en) || '';
777
780
  if (!!(entity === null || entity === void 0 ? void 0 : entity.license)) {
@@ -711,7 +711,7 @@ export var connectSlice = createSlice({
711
711
  var _b = action.payload, authResponse = _b.authResponse, leadResponse = _b.leadResponse, isNewUser = _b.isNewUser, countryCode = _b.countryCode, userInfoMissed = _b.userInfoMissed;
712
712
  var name = leadResponse.name, contact = leadResponse.contact, brand = leadResponse.brand, brand_list = leadResponse.brand_list, channel_list = leadResponse.channel_list, is_new_individual = leadResponse.is_new_individual, id = leadResponse.id;
713
713
  var _c = contact || {}, email = _c.email, phone = _c.phone;
714
- var fullName = concatenateObjectValues(name, ['first', 'middle', 'third', 'last']);
714
+ var fullName = concatenateObjectValues(name, ['first', 'middle', 'last']);
715
715
  if (!!fullName) {
716
716
  var capitalizedName = capitalizeTheFirstLetterOfEachWord(fullName);
717
717
  state.data.individualData.name = capitalizedName;
@@ -747,7 +747,7 @@ export var connectSlice = createSlice({
747
747
  var _b = action.payload, authResponse = _b.authResponse, leadResponse = _b.leadResponse, isNewUser = _b.isNewUser, countryCode = _b.countryCode, userInfoMissed = _b.userInfoMissed;
748
748
  var name = leadResponse.name, contact = leadResponse.contact, brand = leadResponse.brand, brand_list = leadResponse.brand_list, channel_list = leadResponse.channel_list, is_new_individual = leadResponse.is_new_individual, id = leadResponse.id;
749
749
  var _c = contact || {}, email = _c.email, phone = _c.phone;
750
- var fullName = concatenateObjectValues(name, ['first', 'middle', 'third', 'last']);
750
+ var fullName = concatenateObjectValues(name, ['first', 'middle', 'last']);
751
751
  if (!!fullName) {
752
752
  var capitalizedName = capitalizeTheFirstLetterOfEachWord(fullName);
753
753
  state.data.individualData.name = capitalizedName;
@@ -3,11 +3,14 @@ import { EntityFormValues, FlowsTypes, OTPFormValues, ResponseData, SharedState
3
3
  export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
4
4
  data: any;
5
5
  boardResponse: {
6
- flows: {
7
- name: string;
8
- status: string;
9
- url: string;
10
- }[];
6
+ user: any;
7
+ brand: any;
8
+ bank_account: any;
9
+ entity: any;
10
+ merchant: any;
11
+ name: any;
12
+ contact: any;
13
+ flows: any;
11
14
  };
12
15
  token: string;
13
16
  }, string, {}>;
@@ -16,20 +19,36 @@ export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
16
19
  }, void, {}>;
17
20
  export declare const verifyEntityLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
18
21
  data: any;
22
+ boardResponse: {
23
+ user: any;
24
+ brand: any;
25
+ bank_account: any;
26
+ entity: any;
27
+ merchant: any;
28
+ name: any;
29
+ contact: any;
30
+ flows: any;
31
+ };
19
32
  formData: OTPFormValues;
20
33
  }, OTPFormValues, {}>;
21
34
  export declare const retrieveBoardDetails: import("@reduxjs/toolkit").AsyncThunk<{
22
35
  data: any;
23
36
  }, string, {}>;
24
- export declare const updateEntityInfo: import("@reduxjs/toolkit").AsyncThunk<{
37
+ export declare const updateEntity: import("@reduxjs/toolkit").AsyncThunk<{
25
38
  data: any;
26
39
  formData: EntityFormValues;
27
40
  }, EntityFormValues, {}>;
41
+ interface UploadArticleParams {
42
+ file: File;
43
+ onProgress?: (value: number) => void;
44
+ }
45
+ export declare const uploadArticle: import("@reduxjs/toolkit").AsyncThunk<{
46
+ data: any;
47
+ }, UploadArticleParams, {}>;
28
48
  export declare const updateBoardSuccess: import("@reduxjs/toolkit").AsyncThunk<{
29
49
  response: any;
30
50
  formData: void;
31
51
  } | undefined, void, {}>;
32
- export declare const retrieveChannels: import("@reduxjs/toolkit").AsyncThunk<any, void, {}>;
33
52
  declare type VerifyData = {
34
53
  token: string;
35
54
  };
@@ -41,6 +60,7 @@ export interface EntityData {
41
60
  }
42
61
  export interface EntityState extends SharedState<EntityData> {
43
62
  customLoading?: boolean;
63
+ uploading?: boolean;
44
64
  }
45
65
  export declare const entitySlice: import("@reduxjs/toolkit").Slice<EntityState, {
46
66
  clearError: (state: EntityState) => void;