@tap-payments/auth-jsconnect 1.0.59 → 1.0.62

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 (64) hide show
  1. package/build/@types/redux.d.ts +1 -0
  2. package/build/app/settings.js +1 -1
  3. package/build/assets/locales/ar.json +13 -4
  4. package/build/assets/locales/en.json +13 -4
  5. package/build/constants/app.js +13 -7
  6. package/build/constants/assets.d.ts +5 -0
  7. package/build/constants/assets.js +7 -2
  8. package/build/features/Landing/Landing.js +5 -8
  9. package/build/features/Landing/screens/VerifyAndRedirect/VerifyAndRedirect.js +6 -20
  10. package/build/features/app/bank/bankStore.js +4 -0
  11. package/build/features/app/business/businessStore.d.ts +1 -1
  12. package/build/features/app/business/businessStore.js +60 -53
  13. package/build/features/app/connect/connectStore.js +37 -21
  14. package/build/features/app/individual/individualStore.js +4 -0
  15. package/build/features/app/password/passwordStore.js +6 -0
  16. package/build/features/app/tax/taxStore.js +6 -0
  17. package/build/features/business/Business.js +3 -2
  18. package/build/features/business/screens/Activities/Activities.js +4 -0
  19. package/build/features/business/screens/Activities/ActivitiesList.js +5 -6
  20. package/build/features/business/screens/Activities/SalesChannels.js +4 -5
  21. package/build/features/business/screens/BusinessType/BusinessType.js +1 -6
  22. package/build/features/business/screens/BusinessType/LicenseList.js +17 -12
  23. package/build/features/business/screens/BusinessType/LicenseNumber.js +3 -3
  24. package/build/features/business/screens/Customers/Customers.js +0 -1
  25. package/build/features/business/screens/Success/Success.js +3 -2
  26. package/build/features/business/screens/{Confirm/Confirm.d.ts → SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts} +1 -3
  27. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +79 -0
  28. package/build/features/business/screens/SuccessWithFlowButtons/index.d.ts +2 -0
  29. package/build/features/business/screens/SuccessWithFlowButtons/index.js +2 -0
  30. package/build/features/business/screens/Verify/Verify.js +1 -1
  31. package/build/features/featuresScreens.js +3 -1
  32. package/build/features/password/screens/CreatePassword/CreatePassword.js +0 -1
  33. package/build/features/shared/Button/AbsherButton.js +1 -0
  34. package/build/features/shared/Button/Button.js +1 -1
  35. package/build/features/shared/Button/EmailProvidersButtons.js +5 -2
  36. package/build/features/shared/Button/FlowsButtons.d.ts +12 -0
  37. package/build/features/shared/Button/FlowsButtons.js +62 -0
  38. package/build/features/shared/Button/MobileButton.js +1 -0
  39. package/build/features/shared/Button/index.d.ts +2 -1
  40. package/build/features/shared/Button/index.js +2 -1
  41. package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +2 -1
  42. package/build/features/shared/SuccessScreen/SuccessScreen.js +2 -2
  43. package/package.json +1 -1
  44. package/build/features/business/screens/BusinessType/CRNumber.d.ts +0 -7
  45. package/build/features/business/screens/BusinessType/CRNumber.js +0 -41
  46. package/build/features/business/screens/BusinessType/CompanyLicense.d.ts +0 -11
  47. package/build/features/business/screens/BusinessType/CompanyLicense.js +0 -127
  48. package/build/features/business/screens/BusinessType/FLNumber.d.ts +0 -7
  49. package/build/features/business/screens/BusinessType/FLNumber.js +0 -41
  50. package/build/features/business/screens/BusinessType/FreelanceLicense.d.ts +0 -11
  51. package/build/features/business/screens/BusinessType/FreelanceLicense.js +0 -127
  52. package/build/features/business/screens/Confirm/Confirm.js +0 -56
  53. package/build/features/business/screens/Confirm/index.d.ts +0 -3
  54. package/build/features/business/screens/Confirm/index.js +0 -2
  55. package/build/features/connect/screens/Mobile/BusinessCountry.d.ts +0 -8
  56. package/build/features/connect/screens/Mobile/BusinessCountry.js +0 -40
  57. package/build/features/connect/screens/Password/Password.d.ts +0 -5
  58. package/build/features/connect/screens/Password/Password.js +0 -60
  59. package/build/features/connect/screens/Password/PasswordInput.d.ts +0 -5
  60. package/build/features/connect/screens/Password/PasswordInput.js +0 -39
  61. package/build/features/connect/screens/Password/index.d.ts +0 -3
  62. package/build/features/connect/screens/Password/index.js +0 -2
  63. package/build/features/connect/screens/Password/validation.d.ts +0 -8
  64. package/build/features/connect/screens/Password/validation.js +0 -4
@@ -1,6 +1,7 @@
1
1
  export interface SharedState<T> {
2
2
  error: string | null;
3
3
  loading: boolean;
4
+ customLoading?: boolean;
4
5
  data: T;
5
6
  }
6
7
  export interface ActionState<T> {
@@ -154,7 +154,7 @@ export var settingsSlice = createSlice({
154
154
  },
155
155
  handleActiveFlowScreens: function (state, action) {
156
156
  state.data.featureScreensNavigation = action.payload;
157
- state.data.activeScreen = action.payload[5];
157
+ state.data.activeScreen = action.payload[0];
158
158
  },
159
159
  handleSetAppConfig: function (state, action) {
160
160
  var _a = action.payload, appInfo = _a.appInfo, businessCountryCode = _a.businessCountryCode, language = _a.language, onError = _a.onError, onFlowCompleted = _a.onFlowCompleted, publicKey = _a.publicKey;
@@ -215,13 +215,22 @@
215
215
  "select_brand_label": "Brand List",
216
216
  "choose_brand": "Choose Brand",
217
217
  "confirm_enter_iban": "الايبان",
218
- "open_gmail": "Gmail",
219
- "open_outlook": "Outlook",
220
- "open_apple": "Apple",
218
+ "gmail_btn_open_title": "Gmail",
219
+ "outlook_btn_open_title": "Outlook",
220
+ "apple_btn_open_title": "Apple",
221
221
  "choose_any_license": "Choose Licene",
222
222
  "future_work": "Future Work",
223
223
  "add_other_fl": "Add Freelance",
224
224
  "add_other_cr": "Add CR",
225
225
  "cr_number": "CR Number",
226
- "fl_number": "FL Number"
226
+ "fl_number": "FL Number",
227
+ "tax_flow_completed": "Tax",
228
+ "individual_flow_completed": "Individual",
229
+ "bank_flow_completed": "Bank",
230
+ "password_flow_completed": "Password",
231
+ "tax_flow_pending": "Tax",
232
+ "individual_flow_pending": "Individual",
233
+ "bank_flow_pending": "Bank",
234
+ "password_flow_pending": "Password",
235
+ "continue": "Continue"
227
236
  }
@@ -229,13 +229,22 @@
229
229
  "select_brand_label": "Brand List",
230
230
  "choose_brand": "Choose Brand",
231
231
  "confirm_enter_iban": "IBAN",
232
- "open_gmail": "Gmail",
233
- "open_outlook": "Outlook",
234
- "open_apple": "Apple",
232
+ "gmail_btn_open_title": "Gmail",
233
+ "outlook_btn_open_title": "Outlook",
234
+ "apple_btn_open_title": "Apple",
235
235
  "choose_any_license": "Choose Licene",
236
236
  "future_work": "Future Work",
237
237
  "add_other_fl": "Add Freelance",
238
238
  "add_other_cr": "Add CR",
239
239
  "cr_number": "CR Number",
240
- "fl_number": "FL Number"
240
+ "fl_number": "FL Number",
241
+ "tax_flow_completed": "Tax",
242
+ "individual_flow_completed": "Individual",
243
+ "bank_flow_completed": "Bank",
244
+ "password_flow_completed": "Password",
245
+ "tax_flow_pending": "Tax",
246
+ "individual_flow_pending": "Individual",
247
+ "bank_flow_pending": "Bank",
248
+ "password_flow_pending": "Password",
249
+ "continue": "Continue"
241
250
  }
@@ -63,18 +63,18 @@ export var BUSINESS_SCREENS_NAVIGATION = [
63
63
  prev: 'BUSINESS_VERIFY_NUMBER_STEP',
64
64
  order: 2
65
65
  },
66
- {
67
- name: 'BUSINESS_OTP_STEP',
68
- next: 'BUSINESS_BUSINESS_TYPE_STEP',
69
- prev: 'BUSINESS_IDBOD_STEP',
70
- order: 3
71
- },
72
66
  {
73
67
  name: 'BUSINESS_BUSINESS_TYPE_STEP',
74
68
  next: 'BUSINESS_ACTIVITIES_STEP',
75
69
  prev: 'BUSINESS_IDBOD_STEP',
76
70
  order: 2
77
71
  },
72
+ {
73
+ name: 'BUSINESS_OTP_STEP',
74
+ next: 'BUSINESS_BUSINESS_TYPE_STEP',
75
+ prev: 'BUSINESS_IDBOD_STEP',
76
+ order: 3
77
+ },
78
78
  {
79
79
  name: 'BUSINESS_CONFIRM_STEP',
80
80
  next: 'BUSINESS_ACTIVITIES_STEP',
@@ -95,9 +95,15 @@ export var BUSINESS_SCREENS_NAVIGATION = [
95
95
  },
96
96
  {
97
97
  name: 'BUSINESS_SUCCESS_STEP',
98
- next: '',
98
+ next: 'BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
99
99
  prev: 'BUSINESS_CUSTOMERS_STEP',
100
100
  order: 6
101
+ },
102
+ {
103
+ name: 'BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
104
+ next: '',
105
+ prev: '',
106
+ order: 6
101
107
  }
102
108
  ];
103
109
  export var INDIVIDUAL_SCREENS_NAVIGATION = [
@@ -30,6 +30,7 @@ export declare const ICONS_NAMES: {
30
30
  ID_IMAGE: string;
31
31
  MOBILE_IMAGE: string;
32
32
  WHITE_ARROW: string;
33
+ BLACK_ARROW: string;
33
34
  SUCCESS: string;
34
35
  ABSHER_LOGO: string;
35
36
  EMAIL_ICON: string;
@@ -37,4 +38,8 @@ export declare const ICONS_NAMES: {
37
38
  GMAIL_ICON: string;
38
39
  OUTLOOK_ICON: string;
39
40
  APPLE_MAIL_ICON: string;
41
+ TAX_ICON: string;
42
+ BANK_ICON: string;
43
+ INDIVIDUAL_ICON: string;
44
+ PASSWORD_ICON: string;
40
45
  };
@@ -30,11 +30,16 @@ export var ICONS_NAMES = {
30
30
  ID_IMAGE: 'https://villageofwarwick.org/wp-content/uploads/2020/02/ICON99-512-1.png',
31
31
  MOBILE_IMAGE: 'https://image.shutterstock.com/image-vector/smartphone-icon-logo-260nw-767440327.jpg',
32
32
  WHITE_ARROW: 'https://tap-connecet.b-cdn.net/imgs/whiteArrow.svg',
33
+ BLACK_ARROW: 'https://dash.b-cdn.net/icons/menu/arrow_right_icon.svg',
33
34
  SUCCESS: 'https://tap-connecet.b-cdn.net/imgs/success.svg',
34
35
  ABSHER_LOGO: 'https://dash.b-cdn.net/icons/menu/Absher.svg',
35
36
  EMAIL_ICON: 'https://dash.b-cdn.net/icons/menu/email.png',
36
37
  MOBILE_ICON: 'https://dash.b-cdn.net/icons/menu/mobile.svg',
37
38
  GMAIL_ICON: 'https://dash.b-cdn.net/icons/menu/gmail-icon.svg',
38
- OUTLOOK_ICON: 'https://dash.b-cdn.net/icons/menu/outlook-mail.svg',
39
- APPLE_MAIL_ICON: 'https://dash.b-cdn.net/icons/menu/mail-ios.svg'
39
+ OUTLOOK_ICON: 'https://dash.b-cdn.net/icons/menu/outlook-icon.svg',
40
+ APPLE_MAIL_ICON: 'https://dash.b-cdn.net/icons/menu/apple-icon.svg',
41
+ TAX_ICON: 'https://email-templates.b-cdn.net/file.png',
42
+ BANK_ICON: 'https://email-templates.b-cdn.net/dollar_square.png',
43
+ INDIVIDUAL_ICON: 'https://email-templates.b-cdn.net/user.png',
44
+ PASSWORD_ICON: 'https://email-templates.b-cdn.net/lock_square.png'
40
45
  };
@@ -13,15 +13,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import React, { memo, useEffect } from 'react';
14
14
  import { useAppTheme, useAppDispatch, useAppSelector, useErrorListener, useAppConfig } from '../../hooks';
15
15
  import { settingsSelector } from '../../app/settings';
16
- import AnimationFlow from '../../components/AnimationFlow';
17
16
  import { store } from '../../app/store';
18
17
  import { ReduxProvider, ThemeProvider } from '../../components/Providers';
19
18
  import Collapse from '../../components/Collapse';
20
19
  import { getParameterByName, reactElement } from '../../utils';
21
- import { FeatureContainer } from '../shared/Containers';
22
20
  import { LANDING_SCREENS_NAVIGATION } from '../../constants';
23
21
  import { landingFeatureScreens } from '../featuresScreens';
24
- import CustomFooter from '../shared/Footer';
25
22
  import { verifyAuthToken } from '../app/landing/landingStore';
26
23
  var Landing = memo(function (props) {
27
24
  var open = React.useState(true)[0];
@@ -41,11 +38,11 @@ var Landing = memo(function (props) {
41
38
  if (!loading)
42
39
  verifyToken();
43
40
  }, [loading]);
44
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(AnimationFlow, __assign({ open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: landingFeatureScreens.map(function (_a, index) {
45
- var Element = _a.element, name = _a.name;
46
- var isActive = activeScreen.name === name;
47
- return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
48
- }) }) })) })));
41
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: landingFeatureScreens.map(function (_a, index) {
42
+ var Element = _a.element, name = _a.name;
43
+ var isActive = activeScreen.name === name;
44
+ return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
45
+ }) })));
49
46
  });
50
47
  export function LandingLib(props) {
51
48
  return (_jsx(ReduxProvider, __assign({ store: store }, { children: _jsx(Landing, __assign({}, props)) })));
@@ -4,32 +4,18 @@ import Box from '@mui/material/Box/Box';
4
4
  import { styled } from '@mui/material/styles';
5
5
  import { settingsSelector } from '../../../../app/settings';
6
6
  import { landingSelector } from '../../../app/landing/landingStore';
7
- import BouncingDotsLoader from '../../../shared/BouncingDotsLoader';
8
7
  import { useAppSelector } from '../../../../hooks';
9
- import Text from '../../../../components/Text';
8
+ import Loader from '../../../../components/AnimationFlow/Loader';
9
+ import Error from '../../../../components/AnimationFlow/Error';
10
10
  import { getParameterByName } from '../../../../utils';
11
- var TextStyledWithThreeDots = styled(Text)(function (_a) {
12
- var theme = _a.theme;
13
- return ({
14
- fontWeight: theme.typography.fontWeightBold,
15
- fontSize: theme.spacing(3),
16
- color: theme.palette.text.primary,
17
- marginBottom: '5px'
18
- });
19
- });
20
11
  var ScreenContainerStyled = styled(Box)(function (_a) {
21
12
  var theme = _a.theme;
22
13
  return ({
23
14
  display: 'flex',
24
- height: theme.spacing(23),
25
15
  justifyContent: 'center',
26
- alignItems: 'center'
27
- });
28
- });
29
- var ContainerStyled = styled(Box)(function (_a) {
30
- var theme = _a.theme;
31
- return ({
32
- display: 'flex'
16
+ alignItems: 'center',
17
+ width: '100vw',
18
+ height: '100vh'
33
19
  });
34
20
  });
35
21
  var VerifyAndRedirect = function (_a) {
@@ -50,6 +36,6 @@ var VerifyAndRedirect = function (_a) {
50
36
  }, 300);
51
37
  }
52
38
  }, [data.verify.responseBody]);
53
- return (_jsxs(ScreenContainerStyled, { children: [isLoading && (_jsxs(ContainerStyled, { children: [_jsx(TextStyledWithThreeDots, { children: "Verifying" }), _jsx(BouncingDotsLoader, {})] })), errorMessage && _jsx(TextStyledWithThreeDots, { children: errorMessage }), !isLoading && !errorMessage && _jsx(TextStyledWithThreeDots, { children: "Verified" })] }));
39
+ return (_jsxs(ScreenContainerStyled, { children: [isLoading && _jsx(Loader, {}), errorMessage && _jsx(Error, { error: errorMessage })] }));
54
40
  };
55
41
  export default React.memo(VerifyAndRedirect);
@@ -166,6 +166,7 @@ export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (p
166
166
  var initialState = {
167
167
  error: null,
168
168
  loading: false,
169
+ customLoading: false,
169
170
  data: {
170
171
  verify: {
171
172
  token: ''
@@ -198,10 +199,12 @@ export var bankSlice = createSlice({
198
199
  builder
199
200
  .addCase(verifyLeadToken.pending, function (state) {
200
201
  state.error = null;
202
+ state.customLoading = true;
201
203
  })
202
204
  .addCase(verifyLeadToken.fulfilled, function (state, action) {
203
205
  var _a;
204
206
  state.error = null;
207
+ state.customLoading = false;
205
208
  var _b = action.payload, data = _b.data, token = _b.token, leadData = _b.leadData;
206
209
  var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
207
210
  if (description) {
@@ -213,6 +216,7 @@ export var bankSlice = createSlice({
213
216
  })
214
217
  .addCase(verifyLeadToken.rejected, function (state, action) {
215
218
  state.error = action.error.message;
219
+ state.customLoading = false;
216
220
  })
217
221
  .addCase(verifyBankLeadOTP.pending, function (state) {
218
222
  state.loading = true;
@@ -29,7 +29,7 @@ export declare const updateLeadIdentity: import("@reduxjs/toolkit").AsyncThunk<{
29
29
  }, {}>;
30
30
  export declare const retrieveEntityList: import("@reduxjs/toolkit").AsyncThunk<{
31
31
  data: any;
32
- }, void, {}>;
32
+ }, string, {}>;
33
33
  export declare const updateLeadBusinessType: import("@reduxjs/toolkit").AsyncThunk<{
34
34
  data: any;
35
35
  formData: BusinessTypeFormValues;
@@ -79,10 +79,9 @@ export var getCountries = createAsyncThunk('getCountries', function (_, thunkApi
79
79
  });
80
80
  }); });
81
81
  export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
82
- var payload, data, leadResponse, steps, hasBusinessCompleted;
83
- var _a;
84
- return __generator(this, function (_b) {
85
- switch (_b.label) {
82
+ var payload, data, leadResponse;
83
+ return __generator(this, function (_a) {
84
+ switch (_a.label) {
86
85
  case 0:
87
86
  payload = {
88
87
  service_name: 'tap_email',
@@ -90,31 +89,28 @@ export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token
90
89
  };
91
90
  return [4, API.leadService.verifyLeadToken(payload)];
92
91
  case 1:
93
- data = (_b.sent()).data;
92
+ data = (_a.sent()).data;
94
93
  leadResponse = undefined;
95
- if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 3];
94
+ if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 4];
96
95
  return [4, API.leadService.retrieveLead(data === null || data === void 0 ? void 0 : data.id)];
97
96
  case 2:
98
- leadResponse = _b.sent();
99
- steps = (_a = leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data) === null || _a === void 0 ? void 0 : _a.steps;
100
- hasBusinessCompleted = Object.keys(steps).find(function (key) { return key === BUSINESS_STEP_NAMES.BUSINESS_SUCCESS; });
101
- if (hasBusinessCompleted) {
102
- thunkApi.dispatch(handleCurrentActiveScreen('BUSINESS_SUCCESS_STEP'));
103
- return [2, { data: data, leadData: leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data, token: token }];
104
- }
97
+ leadResponse = _a.sent();
98
+ return [4, thunkApi.dispatch(retrieveEntityList(data === null || data === void 0 ? void 0 : data.id))];
99
+ case 3:
100
+ _a.sent();
105
101
  if (data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH) {
106
- thunkApi.dispatch(handleCurrentActiveScreen('BUSINESS_IDBOD_STEP'));
102
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
107
103
  }
108
104
  if (data.step_name === 'business_info') {
109
- thunkApi.dispatch(handleCurrentActiveScreen('BUSINESS_BUSINESS_TYPE_STEP'));
105
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
110
106
  }
111
- _b.label = 3;
112
- case 3: return [2, { data: data, leadData: leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data, token: token }];
107
+ _a.label = 4;
108
+ case 4: return [2, { data: data, leadData: leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data, token: token }];
113
109
  }
114
110
  });
115
111
  }); });
116
112
  export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
117
- var _a, business, settings, isNID, responseBody, payload, data;
113
+ var _a, business, settings, isNID, responseBody, payload, data, steps, hasBusinessCompleted;
118
114
  var _b, _c, _d;
119
115
  return __generator(this, function (_e) {
120
116
  switch (_e.label) {
@@ -134,11 +130,16 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
134
130
  data = (_e.sent()).data;
135
131
  if (!data.errors) {
136
132
  (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
133
+ steps = (responseBody === null || responseBody === void 0 ? void 0 : responseBody.steps) || [];
134
+ hasBusinessCompleted = Object.keys(steps).find(function (key) { return key === BUSINESS_STEP_NAMES.BUSINESS_SUCCESS; });
137
135
  if (isNID) {
138
136
  thunkApi.dispatch(handleNextScreenStep());
139
137
  }
140
138
  else {
141
- if (data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH) {
139
+ if (hasBusinessCompleted) {
140
+ thunkApi.dispatch(handleCurrentActiveScreen('BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
141
+ }
142
+ else if (data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH) {
142
143
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
143
144
  }
144
145
  else {
@@ -181,17 +182,13 @@ export var updateLeadIdentity = createAsyncThunk('updateLeadIdentity', function
181
182
  }
182
183
  });
183
184
  }); });
184
- export var retrieveEntityList = createAsyncThunk('retrieveEntityList', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
185
- var business, leadId, data;
186
- var _a;
187
- return __generator(this, function (_b) {
188
- switch (_b.label) {
189
- case 0:
190
- business = thunkApi.getState().business;
191
- leadId = (_a = business.data.verify.responseBody) === null || _a === void 0 ? void 0 : _a.id;
192
- return [4, API.leadService.retrieveEntityList(leadId)];
185
+ export var retrieveEntityList = createAsyncThunk('retrieveEntityList', function (leadId, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
186
+ var data;
187
+ return __generator(this, function (_a) {
188
+ switch (_a.label) {
189
+ case 0: return [4, API.leadService.retrieveEntityList(leadId)];
193
190
  case 1:
194
- data = (_b.sent()).data;
191
+ data = (_a.sent()).data;
195
192
  return [2, { data: data }];
196
193
  }
197
194
  });
@@ -214,11 +211,13 @@ export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', f
214
211
  return [4, API.leadService.updateLead(payload)];
215
212
  case 1:
216
213
  data = (_g.sent()).data;
217
- if (!data.errors) {
218
- thunkApi.dispatch(createAccount());
219
- (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, params);
220
- }
221
- return [2, { data: data, formData: params }];
214
+ if (!!data.errors) return [3, 3];
215
+ return [4, thunkApi.dispatch(createAccount())];
216
+ case 2:
217
+ _g.sent();
218
+ (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, params);
219
+ _g.label = 3;
220
+ case 3: return [2, { data: data, formData: params }];
222
221
  }
223
222
  });
224
223
  }); });
@@ -368,6 +367,7 @@ export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (p
368
367
  var initialState = {
369
368
  error: null,
370
369
  loading: false,
370
+ customLoading: false,
371
371
  data: {
372
372
  businessCountry: defaultCountry,
373
373
  countries: [],
@@ -418,23 +418,28 @@ export var businessSlice = createSlice({
418
418
  builder
419
419
  .addCase(getCountries.fulfilled, function (state, action) {
420
420
  state.error = null;
421
+ state.customLoading = false;
421
422
  var _a = action.payload, businessCountry = _a.businessCountry, countries = _a.countries;
422
423
  state.data.countries = countries;
423
424
  state.data.businessCountry = businessCountry || defaultCountry;
424
425
  })
425
426
  .addCase(getCountries.pending, function (state) {
426
427
  state.error = null;
428
+ state.customLoading = true;
427
429
  })
428
430
  .addCase(getCountries.rejected, function (state, action) {
429
431
  state.error = action.error.message;
432
+ state.customLoading = false;
430
433
  })
431
434
  .addCase(verifyLeadToken.pending, function (state) {
432
435
  state.error = null;
436
+ state.customLoading = true;
433
437
  })
434
438
  .addCase(verifyLeadToken.fulfilled, function (state, action) {
435
- var _a, _b, _c, _d, _e;
439
+ var _a;
436
440
  state.error = null;
437
- var _f = action.payload, data = _f.data, token = _f.token, leadData = _f.leadData;
441
+ state.customLoading = false;
442
+ var _b = action.payload, data = _b.data, token = _b.token, leadData = _b.leadData;
438
443
  var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
439
444
  if (description) {
440
445
  state.error = description;
@@ -443,16 +448,10 @@ export var businessSlice = createSlice({
443
448
  state.data.verify.responseBody = __assign(__assign({}, data), leadData);
444
449
  state.data.verify.token = token;
445
450
  state.data.otpData.isNID = false;
446
- if (!!((_c = (_b = leadData === null || leadData === void 0 ? void 0 : leadData.entity) === null || _b === void 0 ? void 0 : _b.license) === null || _c === void 0 ? void 0 : _c.issuing_date)) {
447
- state.data.activitiesData.operationStartDate = convertNumbers2English(moment((_e = (_d = leadData === null || leadData === void 0 ? void 0 : leadData.entity) === null || _d === void 0 ? void 0 : _d.license) === null || _e === void 0 ? void 0 : _e.issuing_date).format('YYYY-MM-DD'));
448
- }
449
- var activities = (leadData === null || leadData === void 0 ? void 0 : leadData.entity_activities) || [];
450
- var selectedActivity = activities === null || activities === void 0 ? void 0 : activities[0];
451
- if (!!selectedActivity)
452
- state.data.activitiesData.activities = [selectedActivity];
453
451
  })
454
452
  .addCase(verifyLeadToken.rejected, function (state, action) {
455
453
  state.error = action.error.message;
454
+ state.customLoading = false;
456
455
  })
457
456
  .addCase(verifyLeadOTP.pending, function (state) {
458
457
  state.loading = true;
@@ -476,13 +475,17 @@ export var businessSlice = createSlice({
476
475
  state.error = action.error.message;
477
476
  })
478
477
  .addCase(updateLeadIdentity.pending, function (state, action) {
479
- var _a;
480
- state.loading = ((_a = action.meta.arg) === null || _a === void 0 ? void 0 : _a.isResend) ? false : true;
478
+ var _a, _b;
479
+ if ((_a = action.meta.arg) === null || _a === void 0 ? void 0 : _a.isResend)
480
+ state.customLoading = true;
481
+ if ((_b = action.meta.arg) === null || _b === void 0 ? void 0 : _b.isResend)
482
+ state.loading = true;
481
483
  state.error = null;
482
484
  })
483
485
  .addCase(updateLeadIdentity.fulfilled, function (state, action) {
484
486
  var _a;
485
487
  state.loading = false;
488
+ state.customLoading = false;
486
489
  state.error = null;
487
490
  var _b = action.payload, data = _b.data, formData = _b.formData;
488
491
  var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
@@ -497,14 +500,17 @@ export var businessSlice = createSlice({
497
500
  })
498
501
  .addCase(updateLeadIdentity.rejected, function (state, action) {
499
502
  state.loading = false;
503
+ state.customLoading = false;
500
504
  state.error = action.error.message;
501
505
  })
502
506
  .addCase(retrieveEntityList.pending, function (state) {
503
507
  state.error = null;
508
+ state.customLoading = true;
504
509
  })
505
510
  .addCase(retrieveEntityList.fulfilled, function (state, action) {
506
511
  var _a, _b;
507
512
  state.error = null;
513
+ state.customLoading = false;
508
514
  var data = action.payload.data;
509
515
  var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
510
516
  var licenseList = [];
@@ -530,31 +536,32 @@ export var businessSlice = createSlice({
530
536
  })
531
537
  .addCase(retrieveEntityList.rejected, function (state, action) {
532
538
  state.error = action.error.message;
539
+ state.customLoading = false;
533
540
  })
534
541
  .addCase(updateLeadBusinessType.pending, function (state) {
535
542
  state.loading = true;
536
543
  state.error = null;
537
544
  })
538
545
  .addCase(updateLeadBusinessType.fulfilled, function (state, action) {
539
- var _a, _b, _c, _d, _e;
540
- state.loading = true;
546
+ var _a, _b, _c, _d;
547
+ state.loading = false;
541
548
  state.error = null;
542
- var _f = action.payload, data = _f.data, formData = _f.formData;
549
+ var _e = action.payload, data = _e.data, formData = _e.formData;
543
550
  var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
544
551
  if (description) {
545
552
  state.error = description;
546
553
  return;
547
554
  }
548
555
  state.data.businessTypeData = __assign(__assign({}, state.data.businessTypeData), formData);
549
- if (!!((_c = (_b = data === null || data === void 0 ? void 0 : data.entity) === null || _b === void 0 ? void 0 : _b.license) === null || _c === void 0 ? void 0 : _c.issuing_date)) {
550
- state.data.activitiesData.operationStartDate = convertNumbers2English(moment((_e = (_d = data === null || data === void 0 ? void 0 : data.entity) === null || _d === void 0 ? void 0 : _d.license) === null || _e === void 0 ? void 0 : _e.issuing_date).format('YYYY-MM-DD'));
556
+ var entity = data.entity, entity_activities = data.entity_activities;
557
+ if (!!((_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.issuing_date)) {
558
+ state.data.activitiesData.operationStartDate = convertNumbers2English(moment((_d = (_c = data === null || data === void 0 ? void 0 : data.entity) === null || _c === void 0 ? void 0 : _c.license) === null || _d === void 0 ? void 0 : _d.issuing_date).format('YYYY-MM-DD'));
551
559
  }
552
- var activities = (data === null || data === void 0 ? void 0 : data.entity_activities) || [];
560
+ var activities = entity_activities || [];
553
561
  var selectedActivity = activities === null || activities === void 0 ? void 0 : activities[0];
554
562
  if (!!selectedActivity)
555
563
  state.data.activitiesData.activities = [selectedActivity];
556
- var licenseList = (state.data.businessTypeData.responseBody || { licenseList: [] }).licenseList;
557
- state.data.businessTypeData.responseBody = __assign(__assign({ licenseList: licenseList }, data), { activities: activities });
564
+ state.data.businessTypeData.responseBody = __assign(__assign(__assign({}, data), state.data.businessTypeData.responseBody), { activities: activities });
558
565
  })
559
566
  .addCase(updateLeadBusinessType.rejected, function (state, action) {
560
567
  state.loading = false;