@tap-payments/auth-jsconnect 2.0.22 → 2.0.23

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 (70) hide show
  1. package/build/@types/app.d.ts +5 -0
  2. package/build/@types/app.js +6 -0
  3. package/build/api/auth.d.ts +1 -0
  4. package/build/api/index.d.ts +4 -2
  5. package/build/api/individual.d.ts +21 -0
  6. package/build/api/individual.js +28 -1
  7. package/build/app/rootReducer.d.ts +0 -1
  8. package/build/app/rootReducer.js +0 -2
  9. package/build/app/store.d.ts +0 -2
  10. package/build/assets/locales/ar.json +10 -1
  11. package/build/assets/locales/en.json +10 -1
  12. package/build/constants/app.d.ts +0 -5
  13. package/build/constants/app.js +0 -12
  14. package/build/constants/validation.d.ts +4 -0
  15. package/build/constants/validation.js +4 -0
  16. package/build/features/app/auth/authStore.d.ts +1 -0
  17. package/build/features/app/auth/authStore.js +5 -3
  18. package/build/features/app/bank/bankStore.d.ts +8 -0
  19. package/build/features/app/bank/bankStore.js +32 -15
  20. package/build/features/app/business/businessStore.js +1 -1
  21. package/build/features/app/connect/connectStore.d.ts +4 -2
  22. package/build/features/app/connect/connectStore.js +98 -97
  23. package/build/features/app/individual/individualStore.d.ts +17 -0
  24. package/build/features/app/individual/individualStore.js +141 -66
  25. package/build/features/app/tax/taxStore.js +1 -0
  26. package/build/features/auth/Auth.d.ts +1 -1
  27. package/build/features/auth/Auth.js +4 -3
  28. package/build/features/bank/Bank.js +2 -2
  29. package/build/features/bank/screens/BankDetails/Beneficiary.js +10 -5
  30. package/build/features/business/Business.js +2 -2
  31. package/build/features/business/screens/BusinessType/BusinessType.js +13 -6
  32. package/build/features/business/screens/BusinessType/EntityName.js +4 -4
  33. package/build/features/business/screens/Customers/CustomerLocations.js +1 -1
  34. package/build/features/business/screens/Customers/ExpectedCustomers.js +1 -1
  35. package/build/features/connect/Connect.js +2 -2
  36. package/build/features/connect/screens/Individual/Individual.js +19 -16
  37. package/build/features/connect/screens/Merchant/Merchant.js +3 -2
  38. package/build/features/connect/screens/Merchant/SocialMedia.js +4 -2
  39. package/build/features/connect/screens/Merchant/validation.js +71 -59
  40. package/build/features/connect/screens/OTP/OTP.js +5 -4
  41. package/build/features/connect/screens/OTP/OTPInput.js +3 -2
  42. package/build/features/entity/Entity.js +5 -5
  43. package/build/features/featuresScreens.d.ts +0 -1
  44. package/build/features/featuresScreens.js +0 -7
  45. package/build/features/individual/Individual.js +2 -2
  46. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  47. package/build/features/individual/screens/Verify/Verify.js +4 -4
  48. package/build/features/password/Password.js +2 -2
  49. package/build/features/signIn/SignIn.js +3 -3
  50. package/build/features/tax/Tax.js +5 -5
  51. package/build/hooks/useAppDispatch.d.ts +0 -1
  52. package/build/index.d.ts +2 -3
  53. package/build/index.js +1 -4
  54. package/build/utils/object.d.ts +1 -0
  55. package/build/utils/object.js +12 -0
  56. package/package.json +1 -1
  57. package/build/features/app/otp/otpStore.d.ts +0 -28
  58. package/build/features/app/otp/otpStore.js +0 -153
  59. package/build/features/otp/OTP.d.ts +0 -7
  60. package/build/features/otp/OTP.js +0 -58
  61. package/build/features/otp/index.d.ts +0 -0
  62. package/build/features/otp/index.js +0 -1
  63. package/build/features/otp/screens/OTPVerify/OTPInput.d.ts +0 -6
  64. package/build/features/otp/screens/OTPVerify/OTPInput.js +0 -47
  65. package/build/features/otp/screens/OTPVerify/Verify.d.ts +0 -5
  66. package/build/features/otp/screens/OTPVerify/Verify.js +0 -49
  67. package/build/features/otp/screens/OTPVerify/index.d.ts +0 -2
  68. package/build/features/otp/screens/OTPVerify/index.js +0 -2
  69. package/build/features/otp/screens/OTPVerify/validation.d.ts +0 -8
  70. package/build/features/otp/screens/OTPVerify/validation.js +0 -4
@@ -59,11 +59,11 @@ var __rest = (this && this.__rest) || function (s, e) {
59
59
  var _a;
60
60
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
61
61
  import { handleNextScreenStep } from '../../../app/settings';
62
- import { FlowsTypes } from '../../../@types';
62
+ import { FlowsTypes, AuthForType } from '../../../@types';
63
63
  import API from '../../../api';
64
64
  import { CONNECT_STEP_NAMES, IDENTIFICATION_TYPE, OTHER_BRAND } from '../../../constants';
65
65
  import { defaultCountry } from '../../../constants';
66
- import { getIndividualName, capitalizeTheFirstLetterOfEachWord, getEighteenYearsAgo, sleep, findCountryByIddPrefix } from '../../../utils';
66
+ import { getIndividualName, capitalizeTheFirstLetterOfEachWord, getEighteenYearsAgo, sleep, findCountryByIddPrefix, concatenateObjectValues } from '../../../utils';
67
67
  export var createMobileAuth = createAsyncThunk('createMobileAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
68
68
  var settings, requestBody, data;
69
69
  var _a, _b;
@@ -216,16 +216,17 @@ export var resendOTPNID = createAsyncThunk('resendOTPNID', function (params, thu
216
216
  }
217
217
  });
218
218
  }); });
219
- export var verifyAuth = createAsyncThunk('verifyAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
220
- var _a, connect, settings, isAbsher, _b, mobileData, nidData, responseBody, payload, data, lead_id, individual_id, leadBody, leadResponse, _c, isNewUser, brands, err_1, channels, countryCode, phone;
221
- var _d, _e, _f, _g;
222
- return __generator(this, function (_h) {
223
- switch (_h.label) {
219
+ export var verifyAuth = createAsyncThunk('connect/verifyAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
220
+ var _a, connect, settings, startWithNID, _b, mobileData, nidData, responseBody, stepName, payload, data, lead_id, individual_id, leadBody, leadResponse, _c, isNewUser, brands, err_1, channels, countryCode, contact, name, _d, phone, email, userInfoMissed;
221
+ var _e, _f, _g, _h;
222
+ return __generator(this, function (_j) {
223
+ switch (_j.label) {
224
224
  case 0:
225
225
  _a = thunkApi.getState(), connect = _a.connect, settings = _a.settings;
226
- isAbsher = connect.data.otpData.isAbsher;
226
+ startWithNID = connect.data.otpData.authFor === AuthForType.NATIONAL_ID;
227
227
  _b = connect.data, mobileData = _b.mobileData, nidData = _b.nidData;
228
- responseBody = (isAbsher ? nidData : mobileData).responseBody;
228
+ responseBody = (startWithNID ? nidData : mobileData).responseBody;
229
+ stepName = startWithNID ? CONNECT_STEP_NAMES.VERIFY_AUTH_NID : CONNECT_STEP_NAMES.VERIFY_AUTH_MOBILE;
229
230
  payload = {
230
231
  data: params.otp,
231
232
  auth_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_token,
@@ -235,13 +236,13 @@ export var verifyAuth = createAsyncThunk('verifyAuth', function (params, thunkAp
235
236
  sign_in: responseBody === null || responseBody === void 0 ? void 0 : responseBody.sign_in,
236
237
  remember_me: responseBody === null || responseBody === void 0 ? void 0 : responseBody.remember_me,
237
238
  scopes: responseBody === null || responseBody === void 0 ? void 0 : responseBody.scopes,
238
- step_name: isAbsher ? CONNECT_STEP_NAMES.VERIFY_AUTH_NID : CONNECT_STEP_NAMES.VERIFY_AUTH_MOBILE,
239
+ step_name: stepName,
239
240
  encryption_contract: ['data']
240
241
  };
241
242
  return [4, API.authService.verifyAuth(payload)];
242
243
  case 1:
243
- data = (_h.sent()).data;
244
- if ((_d = data.errors) === null || _d === void 0 ? void 0 : _d.length)
244
+ data = (_j.sent()).data;
245
+ if ((_e = data.errors) === null || _e === void 0 ? void 0 : _e.length)
245
246
  throw new Error(data.errors[0].description);
246
247
  lead_id = data.lead_id, individual_id = data.individual_id;
247
248
  leadBody = {
@@ -251,53 +252,56 @@ export var verifyAuth = createAsyncThunk('verifyAuth', function (params, thunkAp
251
252
  if (!lead_id) return [3, 3];
252
253
  return [4, API.leadService.retrieveLead(lead_id)];
253
254
  case 2:
254
- _c = _h.sent();
255
+ _c = _j.sent();
255
256
  return [3, 5];
256
257
  case 3: return [4, API.leadService.createLead(leadBody)];
257
258
  case 4:
258
- _c = _h.sent();
259
- _h.label = 5;
259
+ _c = _j.sent();
260
+ _j.label = 5;
260
261
  case 5:
261
262
  leadResponse = (_c).data;
262
- if ((_e = leadResponse.errors) === null || _e === void 0 ? void 0 : _e.length)
263
+ if ((_f = leadResponse.errors) === null || _f === void 0 ? void 0 : _f.length)
263
264
  throw new Error(leadResponse.errors[0].description);
264
265
  isNewUser = leadResponse.is_new_individual;
265
266
  if (!!isNewUser) return [3, 11];
266
- _h.label = 6;
267
+ _j.label = 6;
267
268
  case 6:
268
- _h.trys.push([6, 8, , 9]);
269
+ _j.trys.push([6, 8, , 9]);
269
270
  return [4, API.brandService.getBrandList({ individual_id: leadResponse.individual_id })];
270
271
  case 7:
271
- brands = (_h.sent()).brands;
272
+ brands = (_j.sent()).brands;
272
273
  leadResponse.brand_list = brands;
273
274
  return [3, 9];
274
275
  case 8:
275
- err_1 = _h.sent();
276
+ err_1 = _j.sent();
276
277
  return [3, 9];
277
278
  case 9: return [4, API.dataService.getChannelsOfServices({ page: 0 })];
278
279
  case 10:
279
- channels = (_h.sent()).list;
280
+ channels = (_j.sent()).list;
280
281
  leadResponse.channel_list = channels;
281
- _h.label = 11;
282
+ _j.label = 11;
282
283
  case 11:
283
284
  countryCode = settings.data.businessCountry;
284
- phone = ((leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.contact) || {}).phone;
285
- if (phone)
286
- countryCode = findCountryByIddPrefix(settings.data.countries, phone === null || phone === void 0 ? void 0 : phone.country_code);
287
- if (isNewUser)
285
+ contact = leadResponse.contact, name = leadResponse.name;
286
+ _d = contact || {}, phone = _d.phone, email = _d.email;
287
+ userInfoMissed = (!phone || !email || !name) && !isNewUser;
288
+ if (phone === null || phone === void 0 ? void 0 : phone.country_code)
289
+ countryCode = findCountryByIddPrefix(settings.data.countries, phone.country_code);
290
+ (_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, { otp: params.otp });
291
+ if (isNewUser || userInfoMissed) {
288
292
  thunkApi.dispatch(handleNextScreenStep('CONNECT_INDIVIDUAL_STEP'));
289
- if (!isNewUser)
290
- thunkApi.dispatch(handleNextScreenStep('CONNECT_MERCHANT_INFO_STEP'));
291
- (_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, { otp: params.otp });
292
- return [2, { authResponse: data, leadResponse: leadResponse, isNewUser: isNewUser, countryCode: countryCode }];
293
+ return [2, { authResponse: data, leadResponse: leadResponse, isNewUser: isNewUser, countryCode: countryCode, userInfoMissed: userInfoMissed }];
294
+ }
295
+ thunkApi.dispatch(handleNextScreenStep('CONNECT_MERCHANT_INFO_STEP'));
296
+ return [2, { authResponse: data, leadResponse: leadResponse, isNewUser: isNewUser, countryCode: countryCode, userInfoMissed: userInfoMissed }];
293
297
  }
294
298
  });
295
299
  }); });
296
- export var verifyPACI = createAsyncThunk('verifyPACI', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
297
- var _a, settings, connect, responseBody, expiry, interval, maxCalls, count, authResponse, isSuccess, lead_id, individual_id, leadBody, leadResponse, _b, isNewUser, brands, err_2, channels, countryCode, phone;
298
- var _c, _d, _e, _f, _g;
299
- return __generator(this, function (_h) {
300
- switch (_h.label) {
300
+ export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
301
+ var _a, settings, connect, responseBody, expiry, interval, maxCalls, count, authResponse, isSuccess, lead_id, individual_id, leadBody, leadResponse, _b, isNewUser, countryCode, contact, name_1, _c, phone, email, userInfoMissed, brands, err_2, channels;
302
+ var _d, _e, _f, _g, _h;
303
+ return __generator(this, function (_j) {
304
+ switch (_j.label) {
301
305
  case 0:
302
306
  _a = thunkApi.getState(), settings = _a.settings, connect = _a.connect;
303
307
  responseBody = connect.data.civilIdData.responseBody;
@@ -305,7 +309,7 @@ export var verifyPACI = createAsyncThunk('verifyPACI', function (params, thunkAp
305
309
  interval = 3;
306
310
  maxCalls = Math.floor(expiry / interval);
307
311
  count = 1;
308
- _h.label = 1;
312
+ _j.label = 1;
309
313
  case 1:
310
314
  if (!(count <= maxCalls)) return [3, 17];
311
315
  if (thunkApi.signal.aborted) {
@@ -313,12 +317,12 @@ export var verifyPACI = createAsyncThunk('verifyPACI', function (params, thunkAp
313
317
  }
314
318
  return [4, API.authService.getVerifyAuth(responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_token)];
315
319
  case 2:
316
- authResponse = _h.sent();
317
- isSuccess = ((_c = authResponse.status) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'success';
320
+ authResponse = _j.sent();
321
+ isSuccess = ((_d = authResponse.status) === null || _d === void 0 ? void 0 : _d.toLowerCase()) === 'success';
318
322
  if (!isSuccess) return [3, 14];
319
- return [4, ((_d = params === null || params === void 0 ? void 0 : params.onSuccess) === null || _d === void 0 ? void 0 : _d.call(params))];
323
+ return [4, ((_e = params === null || params === void 0 ? void 0 : params.onSuccess) === null || _e === void 0 ? void 0 : _e.call(params))];
320
324
  case 3:
321
- _h.sent();
325
+ _j.sent();
322
326
  lead_id = authResponse.lead_id, individual_id = authResponse.individual_id;
323
327
  leadBody = {
324
328
  country_code: settings.data.businessCountry.iso2,
@@ -327,49 +331,52 @@ export var verifyPACI = createAsyncThunk('verifyPACI', function (params, thunkAp
327
331
  if (!lead_id) return [3, 5];
328
332
  return [4, API.leadService.retrieveLead(lead_id)];
329
333
  case 4:
330
- _b = _h.sent();
334
+ _b = _j.sent();
331
335
  return [3, 7];
332
336
  case 5: return [4, API.leadService.createLead(leadBody)];
333
337
  case 6:
334
- _b = _h.sent();
335
- _h.label = 7;
338
+ _b = _j.sent();
339
+ _j.label = 7;
336
340
  case 7:
337
341
  leadResponse = (_b).data;
338
- if ((_e = leadResponse.errors) === null || _e === void 0 ? void 0 : _e.length)
342
+ if ((_f = leadResponse.errors) === null || _f === void 0 ? void 0 : _f.length)
339
343
  throw new Error(leadResponse.errors[0].description);
340
344
  isNewUser = leadResponse.is_new_individual;
345
+ countryCode = settings.data.businessCountry;
346
+ contact = leadResponse.contact, name_1 = leadResponse.name;
347
+ _c = contact || {}, phone = _c.phone, email = _c.email;
348
+ userInfoMissed = (!phone || !email || !name_1) && !isNewUser;
341
349
  if (!!isNewUser) return [3, 13];
342
- _h.label = 8;
350
+ _j.label = 8;
343
351
  case 8:
344
- _h.trys.push([8, 10, , 11]);
352
+ _j.trys.push([8, 10, , 11]);
345
353
  return [4, API.brandService.getBrandList({ individual_id: leadResponse.individual_id })];
346
354
  case 9:
347
- brands = (_h.sent()).brands;
355
+ brands = (_j.sent()).brands;
348
356
  leadResponse.brand_list = brands;
349
357
  return [3, 11];
350
358
  case 10:
351
- err_2 = _h.sent();
359
+ err_2 = _j.sent();
352
360
  return [3, 11];
353
361
  case 11: return [4, API.dataService.getChannelsOfServices({ page: 0 })];
354
362
  case 12:
355
- channels = (_h.sent()).list;
363
+ channels = (_j.sent()).list;
356
364
  leadResponse.channel_list = channels;
357
- _h.label = 13;
365
+ _j.label = 13;
358
366
  case 13:
359
- countryCode = settings.data.businessCountry;
360
- phone = ((leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.contact) || {}).phone;
361
- if (phone)
362
- countryCode = findCountryByIddPrefix(settings.data.countries, phone === null || phone === void 0 ? void 0 : phone.country_code);
363
- if (isNewUser)
367
+ if (phone === null || phone === void 0 ? void 0 : phone.country_code)
368
+ countryCode = findCountryByIddPrefix(settings.data.countries, phone.country_code);
369
+ (_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, {});
370
+ if (isNewUser || userInfoMissed) {
364
371
  thunkApi.dispatch(handleNextScreenStep('CONNECT_INDIVIDUAL_STEP'));
365
- if (!isNewUser)
366
- thunkApi.dispatch(handleNextScreenStep('CONNECT_MERCHANT_INFO_STEP'));
367
- (_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, {});
368
- return [2, { authResponse: authResponse, leadResponse: leadResponse, isNewUser: isNewUser, countryCode: countryCode }];
372
+ return [2, { authResponse: authResponse, leadResponse: leadResponse, isNewUser: isNewUser, countryCode: countryCode, userInfoMissed: userInfoMissed }];
373
+ }
374
+ thunkApi.dispatch(handleNextScreenStep('CONNECT_MERCHANT_INFO_STEP'));
375
+ return [2, { authResponse: authResponse, leadResponse: leadResponse, isNewUser: isNewUser, countryCode: countryCode, userInfoMissed: userInfoMissed }];
369
376
  case 14: return [4, sleep(interval * 1000)];
370
377
  case 15:
371
- _h.sent();
372
- _h.label = 16;
378
+ _j.sent();
379
+ _j.label = 16;
373
380
  case 16:
374
381
  count++;
375
382
  return [3, 1];
@@ -378,29 +385,22 @@ export var verifyPACI = createAsyncThunk('verifyPACI', function (params, thunkAp
378
385
  });
379
386
  }); });
380
387
  export var updateLeadIndividual = createAsyncThunk('updateLeadIndividual', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
381
- var _a, settings, connect, payload, leadResponse, brand, channels;
382
- var _b, _c, _d, _e, _f, _g;
388
+ var _a, settings, connect, _b, userInfoMissed, lead_id, phoneCountry, payload, leadResponse, brand, channels;
389
+ var _c, _d, _e, _f, _g;
383
390
  return __generator(this, function (_h) {
384
391
  switch (_h.label) {
385
392
  case 0:
386
393
  _a = thunkApi.getState(), settings = _a.settings, connect = _a.connect;
387
- payload = {
388
- name: getIndividualName(params.name),
389
- id: ((_b = connect.data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.lead_id) || '',
390
- country_code: (_c = settings.data.businessCountry) === null || _c === void 0 ? void 0 : _c.iso2,
391
- contact: __assign({ email: params.email }, (params.mobile && {
392
- phone: { country_code: (_e = (_d = params.countryCode) === null || _d === void 0 ? void 0 : _d.idd_prefix) === null || _e === void 0 ? void 0 : _e.toString(), number: params.mobile || '' }
393
- })),
394
- step_name: CONNECT_STEP_NAMES.UPDATE_LEAD_INDIVIDUAL,
395
- encryption_contract: [
394
+ _b = connect.data.otpData.responseBody || {}, userInfoMissed = _b.userInfoMissed, lead_id = _b.lead_id;
395
+ phoneCountry = (_d = (_c = params.countryCode) === null || _c === void 0 ? void 0 : _c.idd_prefix) === null || _d === void 0 ? void 0 : _d.toString();
396
+ payload = __assign(__assign({ id: lead_id || '', country_code: (_e = settings.data.businessCountry) === null || _e === void 0 ? void 0 : _e.iso2 }, (params.name && { name: getIndividualName(params.name) })), { contact: __assign(__assign({}, (params.email && { email: params.email })), (params.mobile && { phone: { country_code: phoneCountry, number: params.mobile } })), step_name: CONNECT_STEP_NAMES.UPDATE_LEAD_INDIVIDUAL, encryption_contract: [
396
397
  'name.first',
397
398
  'name.middle',
398
399
  'name.last',
399
400
  'contact.email',
400
401
  'contact.phone.country_code',
401
402
  'contact.phone.number'
402
- ]
403
- };
403
+ ] });
404
404
  return [4, API.leadService.updateLead(payload)];
405
405
  case 1:
406
406
  leadResponse = _h.sent();
@@ -410,10 +410,14 @@ export var updateLeadIndividual = createAsyncThunk('updateLeadIndividual', funct
410
410
  brand = (_h.sent()).brand;
411
411
  leadResponse.brand = __assign(__assign({}, leadResponse.brand), brand);
412
412
  _h.label = 3;
413
- case 3: return [4, API.dataService.getChannelsOfServices({ page: 0 })];
413
+ case 3:
414
+ if (!!userInfoMissed) return [3, 5];
415
+ return [4, API.dataService.getChannelsOfServices({ page: 0 })];
414
416
  case 4:
415
417
  channels = (_h.sent()).list;
416
418
  leadResponse.channel_list = channels;
419
+ _h.label = 5;
420
+ case 5:
417
421
  (_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, params);
418
422
  thunkApi.dispatch(handleNextScreenStep());
419
423
  return [2, { leadResponse: leadResponse, formData: params }];
@@ -573,7 +577,7 @@ var initialState = {
573
577
  },
574
578
  otpData: {
575
579
  otp: '',
576
- isAbsher: false
580
+ authFor: AuthForType.MOBILE
577
581
  },
578
582
  individualData: {
579
583
  name: '',
@@ -638,7 +642,7 @@ export var connectSlice = createSlice({
638
642
  }
639
643
  state.data.mobileData = formData;
640
644
  state.data.mobileData.responseBody = response;
641
- state.data.otpData.isAbsher = false;
645
+ state.data.otpData.authFor = AuthForType.MOBILE;
642
646
  })
643
647
  .addCase(createMobileAuth.pending, function (state) {
644
648
  state.loading = true;
@@ -658,7 +662,7 @@ export var connectSlice = createSlice({
658
662
  return;
659
663
  }
660
664
  state.data.mobileData.responseBody = response;
661
- state.data.otpData.isAbsher = false;
665
+ state.data.otpData.authFor = AuthForType.MOBILE;
662
666
  })
663
667
  .addCase(resendOTPMobile.pending, function (state) {
664
668
  state.error = null;
@@ -680,6 +684,7 @@ export var connectSlice = createSlice({
680
684
  state.error = description;
681
685
  return;
682
686
  }
687
+ state.data.otpData.authFor = AuthForType.NATIONAL_ID;
683
688
  state.data.civilIdData = __assign(__assign({}, formData), { responseBody: response });
684
689
  })
685
690
  .addCase(createCivilIdAuth.rejected, function (state, action) {
@@ -694,15 +699,12 @@ export var connectSlice = createSlice({
694
699
  var _a;
695
700
  state.loading = false;
696
701
  state.error = null;
697
- var _b = action.payload, authResponse = _b.authResponse, leadResponse = _b.leadResponse, isNewUser = _b.isNewUser, countryCode = _b.countryCode;
702
+ var _b = action.payload, authResponse = _b.authResponse, leadResponse = _b.leadResponse, isNewUser = _b.isNewUser, countryCode = _b.countryCode, userInfoMissed = _b.userInfoMissed;
698
703
  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;
699
704
  var _c = contact || {}, email = _c.email, phone = _c.phone;
700
- var firstName = (name === null || name === void 0 ? void 0 : name.first) + ' ';
701
- var middleName = !!(name === null || name === void 0 ? void 0 : name.middle) ? (name === null || name === void 0 ? void 0 : name.middle) + ' ' : '';
702
- var thirdName = !!(name === null || name === void 0 ? void 0 : name.third) ? (name === null || name === void 0 ? void 0 : name.third) + ' ' : '';
703
- var lastName = !!(name === null || name === void 0 ? void 0 : name.last) ? name === null || name === void 0 ? void 0 : name.last : '';
704
- if (!!name) {
705
- var capitalizedName = capitalizeTheFirstLetterOfEachWord(firstName + middleName + thirdName + lastName);
705
+ var fullName = concatenateObjectValues(name, ['first', 'middle', 'third', 'last']);
706
+ if (!!fullName) {
707
+ var capitalizedName = capitalizeTheFirstLetterOfEachWord(fullName);
706
708
  state.data.individualData.name = capitalizedName;
707
709
  }
708
710
  if (email)
@@ -720,7 +722,7 @@ export var connectSlice = createSlice({
720
722
  };
721
723
  state.data.brandData.selectedBrandItem = (brand_list === null || brand_list === void 0 ? void 0 : brand_list[0]) || {};
722
724
  }
723
- state.data.otpData.responseBody = __assign(__assign({}, authResponse), { is_new_individual: is_new_individual, lead_id: id });
725
+ state.data.otpData.responseBody = __assign(__assign({}, authResponse), { is_new_individual: is_new_individual, lead_id: id, name: name, contact: contact, userInfoMissed: userInfoMissed });
724
726
  })
725
727
  .addCase(verifyPACI.rejected, function (state, action) {
726
728
  state.loading = false;
@@ -733,15 +735,12 @@ export var connectSlice = createSlice({
733
735
  var _a;
734
736
  state.loading = false;
735
737
  state.error = null;
736
- var _b = action.payload, authResponse = _b.authResponse, leadResponse = _b.leadResponse, isNewUser = _b.isNewUser, countryCode = _b.countryCode;
738
+ var _b = action.payload, authResponse = _b.authResponse, leadResponse = _b.leadResponse, isNewUser = _b.isNewUser, countryCode = _b.countryCode, userInfoMissed = _b.userInfoMissed;
737
739
  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;
738
740
  var _c = contact || {}, email = _c.email, phone = _c.phone;
739
- var firstName = (name === null || name === void 0 ? void 0 : name.first) + ' ';
740
- var middleName = !!(name === null || name === void 0 ? void 0 : name.middle) ? (name === null || name === void 0 ? void 0 : name.middle) + ' ' : '';
741
- var thirdName = !!(name === null || name === void 0 ? void 0 : name.third) ? (name === null || name === void 0 ? void 0 : name.third) + ' ' : '';
742
- var lastName = !!(name === null || name === void 0 ? void 0 : name.last) ? name === null || name === void 0 ? void 0 : name.last : '';
743
- if (!!name) {
744
- var capitalizedName = capitalizeTheFirstLetterOfEachWord(firstName + middleName + thirdName + lastName);
741
+ var fullName = concatenateObjectValues(name, ['first', 'middle', 'third', 'last']);
742
+ if (!!fullName) {
743
+ var capitalizedName = capitalizeTheFirstLetterOfEachWord(fullName);
745
744
  state.data.individualData.name = capitalizedName;
746
745
  }
747
746
  if (email)
@@ -759,7 +758,7 @@ export var connectSlice = createSlice({
759
758
  };
760
759
  state.data.brandData.selectedBrandItem = (brand_list === null || brand_list === void 0 ? void 0 : brand_list[0]) || {};
761
760
  }
762
- state.data.otpData.responseBody = __assign(__assign({}, authResponse), { is_new_individual: is_new_individual, lead_id: id });
761
+ state.data.otpData.responseBody = __assign(__assign({}, authResponse), { is_new_individual: is_new_individual, lead_id: id, name: name, contact: contact, userInfoMissed: userInfoMissed });
763
762
  })
764
763
  .addCase(verifyAuth.pending, function (state) {
765
764
  state.loading = true;
@@ -781,7 +780,7 @@ export var connectSlice = createSlice({
781
780
  }
782
781
  state.data.nidData = formData;
783
782
  state.data.nidData.responseBody = response;
784
- state.data.otpData.isAbsher = true;
783
+ state.data.otpData.authFor = AuthForType.NATIONAL_ID;
785
784
  })
786
785
  .addCase(createNIDAuth.pending, function (state) {
787
786
  state.loading = true;
@@ -801,7 +800,7 @@ export var connectSlice = createSlice({
801
800
  return;
802
801
  }
803
802
  state.data.nidData.responseBody = response;
804
- state.data.otpData.isAbsher = true;
803
+ state.data.otpData.authFor = AuthForType.NATIONAL_ID;
805
804
  })
806
805
  .addCase(resendOTPNID.pending, function (state) {
807
806
  state.error = null;
@@ -827,7 +826,9 @@ export var connectSlice = createSlice({
827
826
  state.data.brandData.responseBody = { brand_list: brand_list.concat(OTHER_BRAND) };
828
827
  state.data.brandData.selectedBrandItem = brand_list[0];
829
828
  }
830
- state.data.brandData.responseBody = __assign(__assign({}, state.data.brandData.responseBody), { channel_list: channel_list });
829
+ if (channel_list) {
830
+ state.data.brandData.responseBody = __assign(__assign({}, state.data.brandData.responseBody), { channel_list: channel_list });
831
+ }
831
832
  state.data.individualData = formData;
832
833
  state.data.individualData.responseBody = rest;
833
834
  })
@@ -12,6 +12,7 @@ export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
12
12
  contact: any;
13
13
  countries: CountryCode[];
14
14
  countryCode: any;
15
+ notification: any;
15
16
  flows: {
16
17
  name: string;
17
18
  status: string;
@@ -33,6 +34,22 @@ export declare const retrieveBoardDetails: import("@reduxjs/toolkit").AsyncThunk
33
34
  }, string, {}>;
34
35
  export declare const verifyLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
35
36
  data: any;
37
+ boardResponse: {
38
+ user: any;
39
+ brand: any;
40
+ bank_account: any;
41
+ entity: any;
42
+ merchant: any;
43
+ name: any;
44
+ contact: any;
45
+ countries: CountryCode[];
46
+ notification: any;
47
+ flows: {
48
+ name: string;
49
+ status: string;
50
+ url: string;
51
+ }[];
52
+ };
36
53
  formData: {
37
54
  otp: string;
38
55
  };