@tap-payments/auth-jsconnect 1.0.30 → 1.0.33

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 (71) hide show
  1. package/build/@types/app.d.ts +17 -1
  2. package/build/@types/form.d.ts +16 -1
  3. package/build/api/axios.d.ts +2 -0
  4. package/build/api/axios.js +10 -0
  5. package/build/api/entity.d.ts +20 -0
  6. package/build/api/entity.js +9 -0
  7. package/build/api/firebase.d.ts +4 -0
  8. package/build/api/firebase.js +9 -0
  9. package/build/api/index.d.ts +16 -2
  10. package/build/api/index.js +7 -1
  11. package/build/api/lead.d.ts +22 -0
  12. package/build/api/lead.js +21 -1
  13. package/build/app/settings.d.ts +1 -0
  14. package/build/app/settings.js +44 -18
  15. package/build/assets/locales/ar.json +1 -1
  16. package/build/components/Input/Input.d.ts +1 -1
  17. package/build/components/Input/Input.js +3 -2
  18. package/build/components/Slide/Slide.d.ts +1 -1
  19. package/build/components/Warning/Warning.d.ts +1 -1
  20. package/build/components/Warning/Warning.js +13 -2
  21. package/build/constants/api.d.ts +5 -0
  22. package/build/constants/api.js +11 -1
  23. package/build/constants/app.d.ts +7 -1
  24. package/build/constants/app.js +7 -1
  25. package/build/constants/assets.d.ts +1 -0
  26. package/build/constants/assets.js +2 -1
  27. package/build/constants/dummy.js +3 -3
  28. package/build/constants/validation.d.ts +2 -0
  29. package/build/constants/validation.js +2 -0
  30. package/build/features/app/business/businessStore.d.ts +54 -4
  31. package/build/features/app/business/businessStore.js +325 -5
  32. package/build/features/app/connect/connectStore.d.ts +3 -1
  33. package/build/features/app/connect/connectStore.js +72 -43
  34. package/build/features/bank/screens/BankDetails/validation.js +2 -1
  35. package/build/features/business/Business.js +7 -3
  36. package/build/features/business/screens/Activities/Activities.js +3 -3
  37. package/build/features/business/screens/Activities/ActivitiesList.d.ts +2 -2
  38. package/build/features/business/screens/Activities/OperationStartDate.js +1 -1
  39. package/build/features/business/screens/BusinessType/BusinessType.d.ts +1 -8
  40. package/build/features/business/screens/BusinessType/BusinessType.js +25 -27
  41. package/build/features/business/screens/Confirm/Confirm.js +8 -9
  42. package/build/features/business/screens/Customers/CustomerLocations.d.ts +3 -3
  43. package/build/features/business/screens/IDBOD/DOB.js +1 -1
  44. package/build/features/business/screens/IDBOD/IDBOD.js +19 -12
  45. package/build/features/business/screens/OTP/OTP.d.ts +2 -5
  46. package/build/features/business/screens/OTP/OTP.js +18 -15
  47. package/build/features/business/screens/OTP/OTPInput.js +20 -5
  48. package/build/features/business/screens/Verify/OTPInput.js +7 -3
  49. package/build/features/business/screens/Verify/Verify.d.ts +1 -9
  50. package/build/features/business/screens/Verify/Verify.js +15 -17
  51. package/build/features/business/screens/Verify/index.d.ts +1 -2
  52. package/build/features/connect/screens/Individual/MobileNumber.js +23 -11
  53. package/build/features/connect/screens/Individual/Name.js +10 -1
  54. package/build/features/connect/screens/Individual/validation.js +3 -2
  55. package/build/features/connect/screens/Mobile/Mobile.js +2 -3
  56. package/build/features/connect/screens/Mobile/MobileNumber.js +22 -28
  57. package/build/features/connect/screens/NID/NID.js +1 -2
  58. package/build/features/connect/screens/OTP/OTPInput.js +3 -0
  59. package/build/features/connect/screens/Password/Password.js +2 -2
  60. package/build/features/featuresScreens.js +3 -3
  61. package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +2 -4
  62. package/build/features/shared/Button/AbsherButton.js +1 -1
  63. package/build/features/shared/Input/Input.d.ts +1 -1
  64. package/build/features/shared/SuccessScreen/SuccessScreen.js +12 -2
  65. package/build/hooks/useAppConfig.js +100 -24
  66. package/build/theme/palette.js +4 -0
  67. package/build/utils/locale.d.ts +2 -0
  68. package/build/utils/locale.js +21 -0
  69. package/build/utils/string.d.ts +26 -1
  70. package/build/utils/string.js +62 -1
  71. package/package.json +1 -1
@@ -54,7 +54,7 @@ export var defaultCountry = {
54
54
  geoNameId: '102358',
55
55
  idd_prefix: 966,
56
56
  logo: 'https://back-end.b-cdn.net/country/png/SA.png',
57
- digits: 9,
57
+ digits: 10,
58
58
  supported_by_tap: true
59
59
  };
60
60
  export var businessCountries = [
@@ -107,7 +107,7 @@ export var businessCountries = [
107
107
  geoNameId: '102358',
108
108
  idd_prefix: 966,
109
109
  logo: 'https://back-end.b-cdn.net/country/png/SA.png',
110
- digits: 9,
110
+ digits: 10,
111
111
  supported_by_tap: true
112
112
  },
113
113
  {
@@ -367,7 +367,7 @@ export var countriesCode = [
367
367
  geoNameId: '102358',
368
368
  idd_prefix: 966,
369
369
  logo: 'https://back-end.b-cdn.net/country/png/SA.png',
370
- digits: 9,
370
+ digits: 10,
371
371
  supported_by_tap: true
372
372
  },
373
373
  {
@@ -4,3 +4,5 @@ export declare const VAT_ID_LENGTH = 15;
4
4
  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
+ export declare const SAUDI_NUMBER_LENGTH = 9;
8
+ export declare const REGEX_FULL_NAME: RegExp;
@@ -4,3 +4,5 @@ export var VAT_ID_LENGTH = 15;
4
4
  export var MAX_IBAN_VALUE = 34;
5
5
  export var FL_NUMBER_LENGTH = 8;
6
6
  export var CR_NUMBER_LENGTH = 10;
7
+ export var SAUDI_NUMBER_LENGTH = 9;
8
+ 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;
@@ -1,19 +1,69 @@
1
1
  import { RootState } from '../../../app/store';
2
- import { CountryCode, ResponseData, SharedState } from '../../../@types';
2
+ import { ActivitiesFormValues, BusinessInfoFormValues, BusinessTypeFormValues, CountryCode, CRLicense, FLLicense, NIDFormValues, OTPFormValues, ResponseData, SharedState } from '../../../@types';
3
3
  export declare const getCountries: import("@reduxjs/toolkit").AsyncThunk<{
4
4
  businessCountry: any;
5
5
  countries: any;
6
6
  }, void, {}>;
7
7
  export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
8
8
  data: any;
9
+ leadData: any;
9
10
  token: string;
10
11
  }, string, {}>;
11
- export interface BusinessData {
12
- verify: ResponseData & {
13
- token: string;
12
+ export declare const verifyLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
13
+ data: any;
14
+ formData: {
15
+ isNID: boolean;
16
+ otp: string;
17
+ };
18
+ }, OTPFormValues, {}>;
19
+ export declare const updateLeadIdentity: import("@reduxjs/toolkit").AsyncThunk<{
20
+ data: any;
21
+ formData: {
22
+ type: string;
23
+ nid: string;
24
+ dob: string;
25
+ isResend: boolean;
26
+ };
27
+ }, NIDFormValues & {
28
+ isResend: boolean;
29
+ }, {}>;
30
+ export declare const retrieveCRInfos: import("@reduxjs/toolkit").AsyncThunk<{
31
+ data: any;
32
+ }, void, {}>;
33
+ export declare const retrieveFLInfos: import("@reduxjs/toolkit").AsyncThunk<{
34
+ data: any;
35
+ }, void, {}>;
36
+ export declare const updateLeadBusinessType: import("@reduxjs/toolkit").AsyncThunk<{
37
+ data: any;
38
+ formData: BusinessTypeFormValues;
39
+ }, BusinessTypeFormValues, {}>;
40
+ export declare const updateEntityInfo: import("@reduxjs/toolkit").AsyncThunk<{
41
+ data: any;
42
+ formData: {
43
+ activities: import("../../../@types").Activity[] | undefined;
44
+ salesChannels: import("../../../@types").SalesChannel[];
45
+ operationStartDate: string;
46
+ isResend: boolean;
14
47
  };
48
+ }, ActivitiesFormValues & {
49
+ isResend: boolean;
50
+ }, {}>;
51
+ declare type VerifyData = {
52
+ token: string;
53
+ };
54
+ export interface BusinessData {
55
+ verify: ResponseData & VerifyData;
15
56
  businessCountry: CountryCode;
16
57
  countries: CountryCode[];
58
+ otpData: OTPFormValues & ResponseData;
59
+ nidData: NIDFormValues & ResponseData & {
60
+ type: string;
61
+ };
62
+ businessTypeData: BusinessTypeFormValues & ResponseData;
63
+ crInfos: Array<CRLicense>;
64
+ flInfos: Array<FLLicense>;
65
+ businessInfo: BusinessInfoFormValues;
66
+ activitiesData: ActivitiesFormValues & ResponseData;
17
67
  }
18
68
  export interface BusinessState extends SharedState<BusinessData> {
19
69
  }
@@ -1,3 +1,14 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
1
12
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
13
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
14
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -37,7 +48,9 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
48
  var _a;
38
49
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
39
50
  import API from '../../../api';
40
- import { defaultCountry } from '../../../constants';
51
+ import { BusinessType } from '../../../@types';
52
+ import { BUSINESS_STEP_NAMES, defaultCountry, IDENTIFICATION_TYPE } from '../../../constants';
53
+ import { handleNextScreenStep } from '../../../app/settings';
41
54
  export var getCountries = createAsyncThunk('getCountries', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
42
55
  var settings, countriesBody, list, businessCountry;
43
56
  return __generator(this, function (_a) {
@@ -56,7 +69,7 @@ export var getCountries = createAsyncThunk('getCountries', function (_, thunkApi
56
69
  });
57
70
  }); });
58
71
  export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
59
- var payload, data;
72
+ var payload, data, leadResponse;
60
73
  return __generator(this, function (_a) {
61
74
  switch (_a.label) {
62
75
  case 0:
@@ -67,7 +80,168 @@ export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token
67
80
  return [4, API.leadService.verifyLeadToken(payload)];
68
81
  case 1:
69
82
  data = (_a.sent()).data;
70
- return [2, { data: data, token: token }];
83
+ leadResponse = undefined;
84
+ if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 3];
85
+ return [4, API.leadService.retrieveLead(data === null || data === void 0 ? void 0 : data.lead_id)];
86
+ case 2:
87
+ leadResponse = _a.sent();
88
+ if (data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH) {
89
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
90
+ }
91
+ else {
92
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_VERIFY_STEP'));
93
+ }
94
+ _a.label = 3;
95
+ case 3: return [2, { data: data, leadData: leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data, token: token }];
96
+ }
97
+ });
98
+ }); });
99
+ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
100
+ var _a, business, settings, responseBody, isNID, payload, data;
101
+ var _b, _c, _d;
102
+ return __generator(this, function (_e) {
103
+ switch (_e.label) {
104
+ case 0:
105
+ _a = thunkApi.getState(), business = _a.business, settings = _a.settings;
106
+ responseBody = business.data.verify.responseBody;
107
+ isNID = settings.data.activeScreen.name === 'BUSINESS_IDBOD_STEP';
108
+ payload = {
109
+ data: params.otp,
110
+ service_name: (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _b === void 0 ? void 0 : _b.service_name,
111
+ verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
112
+ step_name: isNID ? BUSINESS_STEP_NAMES.IDENTITY_VERIFY_AUTH : BUSINESS_STEP_NAMES.PHONE_AUTH,
113
+ encryption_contract: ['data']
114
+ };
115
+ return [4, API.leadService.verifyLeadOTP(payload)];
116
+ case 1:
117
+ data = (_e.sent()).data;
118
+ if (!data.errors) {
119
+ (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
120
+ if (isNID) {
121
+ thunkApi.dispatch(retrieveFLInfos());
122
+ thunkApi.dispatch(retrieveCRInfos());
123
+ thunkApi.dispatch(handleNextScreenStep());
124
+ }
125
+ else {
126
+ if (data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH) {
127
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
128
+ }
129
+ else {
130
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
131
+ }
132
+ }
133
+ }
134
+ return [2, { data: data, formData: __assign(__assign({}, params), { isNID: isNID }) }];
135
+ }
136
+ });
137
+ }); });
138
+ export var updateLeadIdentity = createAsyncThunk('updateLeadIdentity', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
139
+ var _a, settings, business, identification_id_type, requestBody, data;
140
+ var _b, _c;
141
+ return __generator(this, function (_d) {
142
+ switch (_d.label) {
143
+ case 0:
144
+ _a = thunkApi.getState(), settings = _a.settings, business = _a.business;
145
+ identification_id_type = params.nid.startsWith('1') ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA;
146
+ requestBody = {
147
+ identification_id: params.nid,
148
+ identification_id_type: identification_id_type,
149
+ date_of_birth: params.dob,
150
+ country_code: business.data.businessCountry.iso2,
151
+ step_name: BUSINESS_STEP_NAMES.IDENTITY_AUTH,
152
+ encryption_contract: ['country_code', 'identification_id', 'identification_id_type', 'date_of_birth']
153
+ };
154
+ return [4, API.leadService.updateLeadIdentity(requestBody)];
155
+ case 1:
156
+ data = (_d.sent()).data;
157
+ if (!data.errors && !params.isResend) {
158
+ thunkApi.dispatch(handleNextScreenStep());
159
+ (_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody);
160
+ }
161
+ return [2, { data: data, formData: __assign(__assign({}, params), { type: identification_id_type }) }];
162
+ }
163
+ });
164
+ }); });
165
+ export var retrieveCRInfos = createAsyncThunk('retrieveCRInfos', function (_a, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
166
+ var business, leadId, data;
167
+ var _b;
168
+ return __generator(this, function (_c) {
169
+ switch (_c.label) {
170
+ case 0:
171
+ business = thunkApi.getState().business;
172
+ leadId = (_b = business.data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.id;
173
+ return [4, API.leadService.retrieveCRInfos(leadId)];
174
+ case 1:
175
+ data = (_c.sent()).data;
176
+ return [2, { data: data }];
177
+ }
178
+ });
179
+ }); });
180
+ export var retrieveFLInfos = createAsyncThunk('retrieveFLInfos', function (_a, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
181
+ var business, leadId, data;
182
+ var _b;
183
+ return __generator(this, function (_c) {
184
+ switch (_c.label) {
185
+ case 0:
186
+ business = thunkApi.getState().business;
187
+ leadId = (_b = business.data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.id;
188
+ return [4, API.leadService.retrieveFLInfos(leadId)];
189
+ case 1:
190
+ data = (_c.sent()).data;
191
+ return [2, { data: data }];
192
+ }
193
+ });
194
+ }); });
195
+ export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
196
+ var _a, settings, connect, headers, payload, data;
197
+ var _b, _c, _d, _e, _f;
198
+ return __generator(this, function (_g) {
199
+ switch (_g.label) {
200
+ case 0:
201
+ _a = thunkApi.getState(), settings = _a.settings, connect = _a.connect;
202
+ headers = {
203
+ lead_id: ((_b = connect.data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.id) || '',
204
+ device_identifier: (_d = (_c = settings.data.deviceInfo) === null || _c === void 0 ? void 0 : _c.browser) === null || _d === void 0 ? void 0 : _d.browser_id
205
+ };
206
+ payload = {
207
+ freelancer_number: params.flNumber,
208
+ business_type: params.businessType,
209
+ cr_number: params.crNumber,
210
+ encryption_contract: ['freelancer_number', 'business_type', 'cr_number']
211
+ };
212
+ return [4, API.leadService.updateLead(payload, { headers: headers })];
213
+ case 1:
214
+ data = (_g.sent()).data;
215
+ if (!data.errors) {
216
+ thunkApi.dispatch(handleNextScreenStep());
217
+ (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, params);
218
+ }
219
+ return [2, { data: data, formData: params }];
220
+ }
221
+ });
222
+ }); });
223
+ export var updateEntityInfo = createAsyncThunk('updateEntityInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
224
+ var settings, requestBody, headers, data;
225
+ var _a, _b;
226
+ return __generator(this, function (_c) {
227
+ switch (_c.label) {
228
+ case 0:
229
+ settings = thunkApi.getState().settings;
230
+ requestBody = {
231
+ activities: params.activities,
232
+ channel_services: params.salesChannels,
233
+ business_operation_start_at: params.operationStartDate,
234
+ step_name: BUSINESS_STEP_NAMES.BUSINESS_INFO
235
+ };
236
+ headers = { entity_id: '123456789' };
237
+ return [4, API.entityService.updateEntityInfo(requestBody, { headers: headers })];
238
+ case 1:
239
+ data = (_c.sent()).data;
240
+ if (!data.errors && !params.isResend) {
241
+ thunkApi.dispatch(handleNextScreenStep());
242
+ (_b = (_a = settings.data.appConfig).onStepCompleted) === null || _b === void 0 ? void 0 : _b.call(_a, settings.data.activeScreen.name, requestBody);
243
+ }
244
+ return [2, { data: data, formData: __assign({}, params) }];
71
245
  }
72
246
  });
73
247
  }); });
@@ -79,6 +253,31 @@ var initialState = {
79
253
  countries: [],
80
254
  verify: {
81
255
  token: ''
256
+ },
257
+ otpData: {
258
+ otp: ''
259
+ },
260
+ nidData: {
261
+ nid: '',
262
+ dob: '1998-08-22',
263
+ type: ''
264
+ },
265
+ businessTypeData: {
266
+ businessType: '',
267
+ flNumber: '',
268
+ crNumber: ''
269
+ },
270
+ crInfos: [],
271
+ flInfos: [],
272
+ businessInfo: {
273
+ licenseNumber: '',
274
+ brandName: '',
275
+ legalName: ''
276
+ },
277
+ activitiesData: {
278
+ activities: [],
279
+ salesChannels: [],
280
+ operationStartDate: '1998-08-22'
82
281
  }
83
282
  }
84
283
  };
@@ -115,18 +314,139 @@ export var businessSlice = createSlice({
115
314
  var _a;
116
315
  state.loading = false;
117
316
  state.error = null;
118
- var _b = action.payload, data = _b.data, token = _b.token;
317
+ var _b = action.payload, data = _b.data, token = _b.token, leadData = _b.leadData;
119
318
  var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
120
319
  if (description) {
121
320
  state.error = description;
122
321
  return;
123
322
  }
124
- state.data.verify.responseBody = action.payload.data;
323
+ state.data.verify.responseBody = leadData;
125
324
  state.data.verify.token = token;
126
325
  })
127
326
  .addCase(verifyLeadToken.rejected, function (state, action) {
128
327
  state.loading = false;
129
328
  state.error = action.error.message;
329
+ })
330
+ .addCase(verifyLeadOTP.pending, function (state) {
331
+ state.loading = true;
332
+ state.error = null;
333
+ })
334
+ .addCase(verifyLeadOTP.fulfilled, function (state, action) {
335
+ var _a;
336
+ state.loading = false;
337
+ state.error = null;
338
+ var _b = action.payload, data = _b.data, formData = _b.formData;
339
+ var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
340
+ if (description) {
341
+ state.error = description;
342
+ return;
343
+ }
344
+ state.data.otpData = formData;
345
+ state.data.otpData.responseBody = data;
346
+ })
347
+ .addCase(verifyLeadOTP.rejected, function (state, action) {
348
+ state.loading = false;
349
+ state.error = action.error.message;
350
+ })
351
+ .addCase(updateLeadIdentity.pending, function (state) {
352
+ state.loading = true;
353
+ state.error = null;
354
+ })
355
+ .addCase(updateLeadIdentity.fulfilled, function (state, action) {
356
+ var _a;
357
+ state.loading = false;
358
+ state.error = null;
359
+ var _b = action.payload, data = _b.data, formData = _b.formData;
360
+ var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
361
+ if (description) {
362
+ state.error = description;
363
+ return;
364
+ }
365
+ state.data.nidData = formData;
366
+ state.data.nidData.responseBody = data;
367
+ })
368
+ .addCase(updateLeadIdentity.rejected, function (state, action) {
369
+ state.loading = false;
370
+ state.error = action.error.message;
371
+ })
372
+ .addCase(retrieveCRInfos.pending, function (state) {
373
+ state.loading = true;
374
+ state.error = null;
375
+ })
376
+ .addCase(retrieveCRInfos.fulfilled, function (state, action) {
377
+ var _a;
378
+ state.loading = false;
379
+ state.error = null;
380
+ var data = action.payload.data;
381
+ var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
382
+ if (!description) {
383
+ state.data.crInfos = data;
384
+ state.data.businessTypeData.businessType = BusinessType.CR;
385
+ }
386
+ })
387
+ .addCase(retrieveCRInfos.rejected, function (state, action) {
388
+ state.loading = false;
389
+ state.error = action.error.message;
390
+ })
391
+ .addCase(retrieveFLInfos.pending, function (state) {
392
+ state.loading = true;
393
+ state.error = null;
394
+ })
395
+ .addCase(retrieveFLInfos.fulfilled, function (state, action) {
396
+ var _a;
397
+ state.loading = false;
398
+ state.error = null;
399
+ var data = action.payload.data;
400
+ var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
401
+ if (!description) {
402
+ state.data.flInfos = data;
403
+ state.data.businessTypeData.businessType = BusinessType.FL;
404
+ }
405
+ })
406
+ .addCase(retrieveFLInfos.rejected, function (state, action) {
407
+ state.loading = false;
408
+ state.error = action.error.message;
409
+ })
410
+ .addCase(updateLeadBusinessType.pending, function (state) {
411
+ state.loading = true;
412
+ state.error = null;
413
+ })
414
+ .addCase(updateLeadBusinessType.fulfilled, function (state, action) {
415
+ var _a;
416
+ state.loading = false;
417
+ state.error = null;
418
+ var _b = action.payload, data = _b.data, formData = _b.formData;
419
+ var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
420
+ if (description) {
421
+ state.error = description;
422
+ return;
423
+ }
424
+ state.data.businessTypeData = formData;
425
+ state.data.businessTypeData.responseBody = data;
426
+ })
427
+ .addCase(updateLeadBusinessType.rejected, function (state, action) {
428
+ state.loading = false;
429
+ state.error = action.error.message;
430
+ })
431
+ .addCase(updateEntityInfo.pending, function (state) {
432
+ state.loading = true;
433
+ state.error = null;
434
+ })
435
+ .addCase(updateEntityInfo.fulfilled, function (state, action) {
436
+ var _a;
437
+ state.error = null;
438
+ var _b = action.payload, data = _b.data, formData = _b.formData;
439
+ var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
440
+ if (description) {
441
+ state.error = description;
442
+ return;
443
+ }
444
+ state.data.activitiesData = formData;
445
+ state.data.activitiesData.responseBody = data;
446
+ })
447
+ .addCase(updateEntityInfo.rejected, function (state, action) {
448
+ state.loading = false;
449
+ state.error = action.error.message;
130
450
  });
131
451
  }
132
452
  });
@@ -28,8 +28,10 @@ export declare const verifyAuth: import("@reduxjs/toolkit").AsyncThunk<{
28
28
  leadResponse: any;
29
29
  formData: OTPFormValues;
30
30
  }, OTPFormValues, {}>;
31
- export declare const verifyAuthPassword: import("@reduxjs/toolkit").AsyncThunk<{
31
+ export declare const createVerifyAuthPassword: import("@reduxjs/toolkit").AsyncThunk<{
32
32
  response: any;
33
+ createAuthResponse: any;
34
+ leadResponse: any;
33
35
  formData: PasswordFormValues;
34
36
  }, PasswordFormValues, {}>;
35
37
  export declare const updateLeadIndividual: import("@reduxjs/toolkit").AsyncThunk<{