@tap-payments/auth-jsconnect 2.3.40-test → 2.3.43-test

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 (38) hide show
  1. package/build/@types/form.d.ts +0 -3
  2. package/build/api/entity.d.ts +0 -1
  3. package/build/api/index.d.ts +0 -3
  4. package/build/api/index.js +1 -3
  5. package/build/assets/locales/ar.json +0 -1
  6. package/build/assets/locales/en.json +0 -1
  7. package/build/constants/app.js +4 -10
  8. package/build/features/app/bank/bankStore.d.ts +0 -1
  9. package/build/features/app/bank/bankStore.js +21 -37
  10. package/build/features/app/entity/entityStore.d.ts +1 -9
  11. package/build/features/app/entity/entityStore.js +48 -119
  12. package/build/features/app/individual/individualStore.d.ts +0 -2
  13. package/build/features/app/individual/individualStore.js +71 -91
  14. package/build/features/app/tax/taxStore.js +18 -36
  15. package/build/features/bank/screens/Verify/OTPInput.js +5 -3
  16. package/build/features/brand/screens/BrandInfo/BrandInfo.js +2 -2
  17. package/build/features/brand/screens/Verify/OTPInput.js +5 -3
  18. package/build/features/business/screens/Verify/OTPInput.js +5 -3
  19. package/build/features/entity/screens/EntityCapital/EntityCapital.js +2 -2
  20. package/build/features/entity/screens/Verify/OTPInput.js +5 -3
  21. package/build/features/featuresScreens.js +0 -5
  22. package/build/features/individual/screens/Verify/OTPInput.js +5 -3
  23. package/build/features/password/screens/Verify/OTPInput.js +5 -3
  24. package/build/features/shared/Address/Address.js +13 -20
  25. package/build/features/shared/Address/CountryList.js +3 -3
  26. package/build/features/shared/Button/FlowsButtons.js +14 -19
  27. package/build/features/shared/OTP/OTP.d.ts +2 -1
  28. package/build/features/shared/OTP/OTP.js +2 -2
  29. package/build/features/tax/screens/Verify/OTPInput.js +5 -3
  30. package/build/utils/error.d.ts +1 -0
  31. package/build/utils/error.js +3 -0
  32. package/package.json +1 -1
  33. package/build/api/address.d.ts +0 -4
  34. package/build/api/address.js +0 -12
  35. package/build/features/entity/screens/EntityAddress/EntityAddress.d.ts +0 -5
  36. package/build/features/entity/screens/EntityAddress/EntityAddress.js +0 -42
  37. package/build/features/entity/screens/EntityAddress/index.d.ts +0 -2
  38. package/build/features/entity/screens/EntityAddress/index.js +0 -2
@@ -75,10 +75,10 @@ import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountry
75
75
  export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a, thunkApi) {
76
76
  var token = _a.token, isInternally = _a.isInternally, isUpdatePhoneInfo = _a.isUpdatePhoneInfo;
77
77
  return __awaiter(void 0, void 0, void 0, function () {
78
- var payload, settings, data, boardData, individualData, countryCode, boardInfoData, boardInfoStatus, countries, board_id, board_info_id, notification, _b, id, type, data_1, info, hasIndividualCompleted, birthCountry;
79
- var _c, _d, _e, _f, _g, _h, _j, _k;
80
- return __generator(this, function (_l) {
81
- switch (_l.label) {
78
+ var payload, settings, data, boardData, individualData, countryCode, boardInfoData, countries, board_id, board_info_id, notification, _b, id, type, data_1, birthCountry;
79
+ var _c, _d, _e, _f, _g, _h, _j;
80
+ return __generator(this, function (_k) {
81
+ switch (_k.label) {
82
82
  case 0:
83
83
  payload = {
84
84
  service_name: 'tap_email',
@@ -87,8 +87,8 @@ export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a
87
87
  settings = thunkApi.getState().settings;
88
88
  return [4, API.leadService.verifyLeadToken(payload)];
89
89
  case 1:
90
- data = (_l.sent()).data;
91
- boardInfoStatus = undefined;
90
+ data = (_k.sent()).data;
91
+ boardInfoData = undefined;
92
92
  countries = settings.data.countries;
93
93
  if (((_c = data.errors) === null || _c === void 0 ? void 0 : _c.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
94
94
  throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
@@ -100,70 +100,61 @@ export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a
100
100
  }
101
101
  if (!(data.step_name === INDIVIDUAl_STEP_NAMES.PHONE_INFO)) return [3, 2];
102
102
  thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PHONE_INFO_STEP'));
103
- return [3, 17];
103
+ return [3, 15];
104
104
  case 2:
105
- if (!(data.step_name !== INDIVIDUAl_STEP_NAMES.PHONE_AUTH)) return [3, 16];
105
+ if (!(data.step_name !== INDIVIDUAl_STEP_NAMES.PHONE_AUTH)) return [3, 14];
106
106
  board_id = data === null || data === void 0 ? void 0 : data.id;
107
107
  board_info_id = data === null || data === void 0 ? void 0 : data.board_info_id;
108
108
  if (!(board_id && board_info_id)) return [3, 5];
109
109
  return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
110
110
  case 3:
111
- boardInfoData = _l.sent();
111
+ boardInfoData = _k.sent();
112
112
  notification = (boardInfoData || {}).notification;
113
113
  _b = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _b.id, type = _b.type;
114
114
  if (!(id && type)) return [3, 5];
115
115
  return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
116
116
  case 4:
117
- data_1 = (_l.sent()).data;
117
+ data_1 = (_k.sent()).data;
118
118
  individualData = data_1 || {};
119
- _l.label = 5;
119
+ _k.label = 5;
120
120
  case 5:
121
- if (!board_id) return [3, 8];
121
+ if (!board_id) return [3, 7];
122
122
  return [4, API.boardService.retrieveBoardDetails(board_id)];
123
123
  case 6:
124
- boardData = _l.sent();
125
- return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
124
+ boardData = _k.sent();
125
+ _k.label = 7;
126
126
  case 7:
127
- boardInfoStatus = _l.sent();
128
- _l.label = 8;
129
- case 8:
130
127
  if (!countryCode) {
131
128
  countryCode = (_d = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _d === void 0 ? void 0 : _d.country;
132
129
  if (countryCode)
133
130
  thunkApi.dispatch(handleSetCountryByIso2(countryCode));
134
131
  }
135
- info = (boardInfoStatus || {}).info;
136
- hasIndividualCompleted = ((_e = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'individual'; })) === null || _e === void 0 ? void 0 : _e.status) === 'completed';
137
- if (!hasIndividualCompleted) return [3, 9];
138
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
139
- return [3, 15];
132
+ if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 10];
133
+ if (!((_e = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _e === void 0 ? void 0 : _e.id)) return [3, 9];
134
+ return [4, thunkApi.dispatch(getIndividualList((_f = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _f === void 0 ? void 0 : _f.id))];
135
+ case 8:
136
+ _k.sent();
137
+ _k.label = 9;
140
138
  case 9:
141
- if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 12];
142
- if (!((_f = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _f === void 0 ? void 0 : _f.id)) return [3, 11];
143
- return [4, thunkApi.dispatch(getIndividualList((_g = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _g === void 0 ? void 0 : _g.id))];
139
+ thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
140
+ return [3, 13];
144
141
  case 10:
145
- _l.sent();
146
- _l.label = 11;
142
+ birthCountry = ((_g = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _g === void 0 ? void 0 : _g.country) || countryCode;
143
+ if (!birthCountry) return [3, 12];
144
+ return [4, thunkApi.dispatch(getCityList(birthCountry))];
147
145
  case 11:
148
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
149
- return [3, 15];
146
+ _k.sent();
147
+ _k.label = 12;
150
148
  case 12:
151
- birthCountry = ((_h = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _h === void 0 ? void 0 : _h.country) || countryCode;
152
- if (!birthCountry) return [3, 14];
153
- return [4, thunkApi.dispatch(getCityList(birthCountry))];
154
- case 13:
155
- _l.sent();
156
- _l.label = 14;
157
- case 14:
158
149
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
159
- _l.label = 15;
160
- case 15: return [3, 17];
161
- case 16:
150
+ _k.label = 13;
151
+ case 13: return [3, 15];
152
+ case 14:
162
153
  if (isUpdatePhoneInfo) {
163
154
  thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_VERIFY_STEP'));
164
155
  }
165
- _l.label = 17;
166
- case 17: return [2, {
156
+ _k.label = 15;
157
+ case 15: return [2, {
167
158
  data: data,
168
159
  boardResponse: {
169
160
  brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
@@ -171,14 +162,13 @@ export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a
171
162
  entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
172
163
  merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
173
164
  merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
174
- name: (_j = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _j === void 0 ? void 0 : _j.names,
175
- contact: (_k = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _k === void 0 ? void 0 : _k.contact,
165
+ name: (_h = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _h === void 0 ? void 0 : _h.names,
166
+ contact: (_j = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _j === void 0 ? void 0 : _j.contact,
176
167
  individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
177
168
  countries: countries,
178
169
  countryCode: countryCode,
179
170
  notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
180
- business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
181
- flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
171
+ business: boardData === null || boardData === void 0 ? void 0 : boardData.business
182
172
  },
183
173
  token: token
184
174
  }];
@@ -411,10 +401,10 @@ export var retrieveBoardDetails = createAsyncThunk('retrieveIndividualBoardDetai
411
401
  });
412
402
  }); });
413
403
  export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
414
- var _a, individual, settings, responseBody, _b, board_id, board_info_id, countries, payload, data, boardInfoData, individualData, boardData, boardInfoStatus, countryCode, notification, _c, id, type, data_3, info, hasIndividualCompleted, birthCountry;
415
- var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
416
- return __generator(this, function (_q) {
417
- switch (_q.label) {
404
+ var _a, individual, settings, responseBody, _b, board_id, board_info_id, countries, payload, data, boardInfoData, individualData, boardData, countryCode, notification, _c, id, type, data_3, birthCountry;
405
+ var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
406
+ return __generator(this, function (_p) {
407
+ switch (_p.label) {
418
408
  case 0:
419
409
  _a = thunkApi.getState(), individual = _a.individual, settings = _a.settings;
420
410
  responseBody = individual.data.verify.responseBody;
@@ -429,62 +419,53 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
429
419
  };
430
420
  return [4, API.leadService.verifyLeadOTP(payload)];
431
421
  case 1:
432
- data = (_q.sent()).data;
433
- boardInfoStatus = undefined;
422
+ data = (_p.sent()).data;
423
+ boardData = undefined;
434
424
  if ((_e = data.errors) === null || _e === void 0 ? void 0 : _e.length)
435
425
  throw new Error(data.errors[0].description);
436
- if (!board_id) return [3, 4];
426
+ if (!board_id) return [3, 3];
437
427
  return [4, API.boardService.retrieveBoardDetails(board_id)];
438
428
  case 2:
439
- boardData = _q.sent();
440
- return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
429
+ boardData = _p.sent();
430
+ _p.label = 3;
441
431
  case 3:
442
- boardInfoStatus = _q.sent();
443
- _q.label = 4;
444
- case 4:
445
432
  countryCode = (_f = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _f === void 0 ? void 0 : _f.country;
446
- if (!(board_id && board_info_id)) return [3, 7];
433
+ if (!(board_id && board_info_id)) return [3, 6];
447
434
  return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
448
- case 5:
449
- boardInfoData = _q.sent();
435
+ case 4:
436
+ boardInfoData = _p.sent();
450
437
  notification = (boardInfoData || {}).notification;
451
438
  _c = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _c.id, type = _c.type;
452
- if (!(id && type)) return [3, 7];
439
+ if (!(id && type)) return [3, 6];
453
440
  return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
454
- case 6:
455
- data_3 = (_q.sent()).data;
441
+ case 5:
442
+ data_3 = (_p.sent()).data;
456
443
  individualData = data_3 || {};
457
- _q.label = 7;
458
- case 7:
444
+ _p.label = 6;
445
+ case 6:
459
446
  if (countryCode)
460
447
  thunkApi.dispatch(handleSetCountryByIso2(countryCode));
461
- info = (boardInfoStatus || {}).info;
462
- hasIndividualCompleted = ((_g = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'individual'; })) === null || _g === void 0 ? void 0 : _g.status) === 'completed';
463
- if (!hasIndividualCompleted) return [3, 8];
464
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
465
- return [3, 14];
448
+ if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 9];
449
+ if (!((_g = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _g === void 0 ? void 0 : _g.id)) return [3, 8];
450
+ return [4, thunkApi.dispatch(getIndividualList((_h = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _h === void 0 ? void 0 : _h.id))];
451
+ case 7:
452
+ _p.sent();
453
+ _p.label = 8;
466
454
  case 8:
467
- if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 11];
468
- if (!((_h = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _h === void 0 ? void 0 : _h.id)) return [3, 10];
469
- return [4, thunkApi.dispatch(getIndividualList((_j = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _j === void 0 ? void 0 : _j.id))];
455
+ thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
456
+ return [3, 12];
470
457
  case 9:
471
- _q.sent();
472
- _q.label = 10;
458
+ birthCountry = ((_j = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _j === void 0 ? void 0 : _j.country) || countryCode;
459
+ if (!birthCountry) return [3, 11];
460
+ return [4, thunkApi.dispatch(getCityList(birthCountry))];
473
461
  case 10:
474
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
475
- return [3, 14];
462
+ _p.sent();
463
+ _p.label = 11;
476
464
  case 11:
477
- birthCountry = ((_k = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _k === void 0 ? void 0 : _k.country) || countryCode;
478
- if (!birthCountry) return [3, 13];
479
- return [4, thunkApi.dispatch(getCityList(birthCountry))];
480
- case 12:
481
- _q.sent();
482
- _q.label = 13;
483
- case 13:
484
465
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
485
- _q.label = 14;
486
- case 14:
487
- (_m = (_l = settings.data.appConfig).onStepCompleted) === null || _m === void 0 ? void 0 : _m.call(_l, settings.data.activeScreen.name, { otp: params.otp });
466
+ _p.label = 12;
467
+ case 12:
468
+ (_l = (_k = settings.data.appConfig).onStepCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, settings.data.activeScreen.name, { otp: params.otp });
488
469
  return [2, {
489
470
  data: data,
490
471
  boardResponse: {
@@ -493,14 +474,13 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
493
474
  entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
494
475
  merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
495
476
  merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
496
- name: (_o = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _o === void 0 ? void 0 : _o.names,
497
- contact: (_p = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _p === void 0 ? void 0 : _p.contact,
477
+ name: (_m = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _m === void 0 ? void 0 : _m.names,
478
+ contact: (_o = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _o === void 0 ? void 0 : _o.contact,
498
479
  individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
499
480
  countries: countries,
500
481
  countryCode: countryCode,
501
482
  notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
502
- business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
503
- flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
483
+ business: boardData === null || boardData === void 0 ? void 0 : boardData.business
504
484
  },
505
485
  formData: __assign({}, params)
506
486
  }];
@@ -55,10 +55,10 @@ import { getRecentDocumentBasedOnPurpose, hasNoneEditableValue, sleep } from '..
55
55
  export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (_a, thunkApi) {
56
56
  var token = _a.token, isInternally = _a.isInternally;
57
57
  return __awaiter(void 0, void 0, void 0, function () {
58
- var payload, data, boardData, boardInfoData, info, countryIso2, hasTaxCompleted;
59
- var _b, _c, _d, _e;
60
- return __generator(this, function (_f) {
61
- switch (_f.label) {
58
+ var payload, data, boardData, countryIso2;
59
+ var _b, _c, _d;
60
+ return __generator(this, function (_e) {
61
+ switch (_e.label) {
62
62
  case 0:
63
63
  payload = {
64
64
  service_name: 'tap_email',
@@ -66,30 +66,22 @@ export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (_a
66
66
  };
67
67
  return [4, API.leadService.verifyLeadToken(payload)];
68
68
  case 1:
69
- data = (_f.sent()).data;
70
- boardInfoData = undefined;
69
+ data = (_e.sent()).data;
70
+ boardData = undefined;
71
71
  if (((_b = data.errors) === null || _b === void 0 ? void 0 : _b.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
72
72
  throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
73
73
  if (isInternally)
74
74
  data.step_name = TAX_STEP_NAMES.TAX_INFO;
75
- if (!data.id) return [3, 4];
76
- return [4, API.boardService.retrieveBoardInfoStatus(data.id)];
77
- case 2:
78
- boardInfoData = _f.sent();
75
+ if (!data.id) return [3, 3];
79
76
  return [4, API.boardService.retrieveBoardDetails(data === null || data === void 0 ? void 0 : data.id)];
77
+ case 2:
78
+ boardData = _e.sent();
79
+ _e.label = 3;
80
80
  case 3:
81
- boardData = _f.sent();
82
- _f.label = 4;
83
- case 4:
84
- info = (boardInfoData || {}).info;
85
81
  countryIso2 = (_c = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _c === void 0 ? void 0 : _c.country;
86
82
  if (countryIso2)
87
83
  thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
88
- hasTaxCompleted = ((_d = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'tax'; })) === null || _d === void 0 ? void 0 : _d.status) === 'completed';
89
- if (hasTaxCompleted) {
90
- thunkApi.dispatch(handleNextScreenStep('TAX_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
91
- }
92
- else if (data.step_name === TAX_STEP_NAMES.PHONE_AUTH) {
84
+ if (data.step_name === TAX_STEP_NAMES.PHONE_AUTH) {
93
85
  thunkApi.dispatch(handleCurrentActiveScreen('TAX_VERIFY_STEP'));
94
86
  }
95
87
  else if (data.step_name === TAX_STEP_NAMES.TAX_INFO) {
@@ -97,7 +89,7 @@ export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (_a
97
89
  }
98
90
  return [2, {
99
91
  data: data,
100
- boardResponse: __assign(__assign({}, boardData === null || boardData === void 0 ? void 0 : boardData.business), { flows: (boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || [], entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity, brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand, user: boardData === null || boardData === void 0 ? void 0 : boardData.user, bank: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, vatID: (_e = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _e === void 0 ? void 0 : _e.vat_id, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant, individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals, business: boardData === null || boardData === void 0 ? void 0 : boardData.business }),
92
+ boardResponse: __assign(__assign({}, boardData === null || boardData === void 0 ? void 0 : boardData.business), { entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity, brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand, user: boardData === null || boardData === void 0 ? void 0 : boardData.user, bank: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, vatID: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _d === void 0 ? void 0 : _d.vat_id, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant, individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals, business: boardData === null || boardData === void 0 ? void 0 : boardData.business }),
101
93
  token: token
102
94
  }];
103
95
  }
@@ -133,10 +125,10 @@ export var retrieveEntityInfo = createAsyncThunk('retrieveTaxEntityInfo', functi
133
125
  });
134
126
  }); });
135
127
  export var verifyTaxLeadOTP = createAsyncThunk('verifyTaxLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
136
- var _a, tax, settings, responseBody, payload, data, flows, hasTaxCompleted;
137
- var _b, _c, _d, _e, _f, _g;
138
- return __generator(this, function (_h) {
139
- switch (_h.label) {
128
+ var _a, tax, settings, responseBody, payload, data;
129
+ var _b, _c, _d, _e;
130
+ return __generator(this, function (_f) {
131
+ switch (_f.label) {
140
132
  case 0:
141
133
  _a = thunkApi.getState(), tax = _a.tax, settings = _a.settings;
142
134
  responseBody = tax.data.verify.responseBody;
@@ -149,22 +141,12 @@ export var verifyTaxLeadOTP = createAsyncThunk('verifyTaxLeadOTP', function (par
149
141
  };
150
142
  return [4, API.leadService.verifyLeadOTP(payload)];
151
143
  case 1:
152
- data = (_h.sent()).data;
144
+ data = (_f.sent()).data;
153
145
  if ((_c = data.errors) === null || _c === void 0 ? void 0 : _c.length)
154
146
  throw new Error(data.errors[0].description);
155
147
  (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, { otp: params.otp });
156
- flows = (responseBody || {}).flows;
157
- hasTaxCompleted = ((_f = flows === null || flows === void 0 ? void 0 : flows.find(function (flow) { return flow.name === 'tax'; })) === null || _f === void 0 ? void 0 : _f.status) === 'completed';
158
- if (!hasTaxCompleted) return [3, 3];
159
- return [4, thunkApi.dispatch(retrieveEntityInfo((_g = responseBody === null || responseBody === void 0 ? void 0 : responseBody.entity) === null || _g === void 0 ? void 0 : _g.id))];
160
- case 2:
161
- _h.sent();
162
- thunkApi.dispatch(handleNextScreenStep('TAX_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
163
- return [3, 4];
164
- case 3:
165
148
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('TAX_TAX_DETAILS_STEP')); });
166
- _h.label = 4;
167
- case 4: return [2, { data: data, formData: params }];
149
+ return [2, { data: data, formData: params }];
168
150
  }
169
151
  });
170
152
  }); });
@@ -17,8 +17,9 @@ import OTPField from '../../../shared/OTP';
17
17
  import { useController, useFormContext } from 'react-hook-form';
18
18
  import { useTranslation } from 'react-i18next';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
- import { useAppDispatch } from '../../../../hooks';
21
- import { resendOTP } from '../../../app/bank/bankStore';
20
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
21
+ import { isTokenExpired } from '../../../../utils';
22
+ import { resendOTP, bankSelector } from '../../../app/bank/bankStore';
22
23
  var BoxStyled = styled(Box)(function (_a) {
23
24
  var theme = _a.theme;
24
25
  return ({
@@ -33,6 +34,7 @@ var OTPInput = function (_a) {
33
34
  var t = useTranslation().t;
34
35
  var otpControl = useController({ name: 'otp', control: control });
35
36
  var dispatch = useAppDispatch();
37
+ var error = useAppSelector(bankSelector).error;
36
38
  var handleOnOTPChange = function (otp) {
37
39
  otpControl.field.onChange(otp);
38
40
  };
@@ -42,6 +44,6 @@ var OTPInput = function (_a) {
42
44
  dispatch(resendOTP());
43
45
  };
44
46
  var otpValue = otpControl.field.value;
45
- return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
47
+ return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, hasError: isTokenExpired(error), onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
46
48
  };
47
49
  export default React.memo(OTPInput);
@@ -46,7 +46,7 @@ var BrandInfo = function (_a) {
46
46
  var t = useTranslation().t;
47
47
  var isAr = useLanguage().isAr;
48
48
  var settingData = useAppSelector(settingsSelector).data;
49
- var _e = useAppSelector(brandSelector), data = _e.data, loading = _e.loading, error = _e.error;
49
+ var _e = useAppSelector(brandSelector), data = _e.data, loading = _e.loading, error = _e.error, uploadingBrandLogo = _e.uploadingBrandLogo;
50
50
  var _f = data.brandData, brandName = _f.brandName, segment = _f.segment, teamSize = _f.teamSize, salesChannels = _f.salesChannels, brandLogoId = _f.brandLogoId, responseBody = _f.responseBody;
51
51
  var _g = ((_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.brand) || {}, logo_details = _g.logo_details, data_status = _g.data_status;
52
52
  var methods = useForm({
@@ -77,7 +77,7 @@ var BrandInfo = function (_a) {
77
77
  methods.setError('brandName', { message: 'brand_name_already_exist' });
78
78
  }, [responseBody]);
79
79
  var brandErrChecks = !methods.formState.isValid || !!methods.formState.errors.brandName || !!error;
80
- var disabled = brandErrChecks || brandNameChecking;
80
+ var disabled = brandErrChecks || brandNameChecking || uploadingBrandLogo;
81
81
  var handleMenuClick = function (flag) {
82
82
  setListActive(flag);
83
83
  };
@@ -17,8 +17,9 @@ import OTPField from '../../../shared/OTP';
17
17
  import { useController, useFormContext } from 'react-hook-form';
18
18
  import { useTranslation } from 'react-i18next';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
- import { useAppDispatch } from '../../../../hooks';
21
- import { resendOTP } from '../../../app/brand/brandStore';
20
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
21
+ import { brandSelector, resendOTP } from '../../../app/brand/brandStore';
22
+ import { isTokenExpired } from '../../../../utils';
22
23
  var BoxStyled = styled(Box)(function (_a) {
23
24
  var theme = _a.theme;
24
25
  return ({
@@ -33,6 +34,7 @@ var OTPInput = function (_a) {
33
34
  var t = useTranslation().t;
34
35
  var otpControl = useController({ name: 'otp', control: control });
35
36
  var dispatch = useAppDispatch();
37
+ var error = useAppSelector(brandSelector).error;
36
38
  var handleOnOTPChange = function (otp) {
37
39
  otpControl.field.onChange(otp);
38
40
  };
@@ -42,6 +44,6 @@ var OTPInput = function (_a) {
42
44
  dispatch(resendOTP());
43
45
  };
44
46
  var otpValue = otpControl.field.value;
45
- return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
47
+ return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, hasError: isTokenExpired(error), onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
46
48
  };
47
49
  export default React.memo(OTPInput);
@@ -11,14 +11,15 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import * as React from 'react';
14
- import { useAppDispatch } from '../../../../hooks';
14
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
15
15
  import Box from '@mui/material/Box/Box';
16
16
  import { styled } from '@mui/material/styles';
17
17
  import OTPField from '../../../shared/OTP';
18
18
  import { useController, useFormContext } from 'react-hook-form';
19
19
  import { useTranslation } from 'react-i18next';
20
20
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
21
- import { resendOTP } from '../../../app/business/businessStore';
21
+ import { isTokenExpired } from '../../../../utils';
22
+ import { businessSelector, resendOTP } from '../../../app/business/businessStore';
22
23
  var BoxStyled = styled(Box)(function (_a) {
23
24
  var theme = _a.theme;
24
25
  return ({
@@ -33,6 +34,7 @@ var OTPInput = function (_a) {
33
34
  var t = useTranslation().t;
34
35
  var otpControl = useController({ name: 'otp', control: control });
35
36
  var dispatch = useAppDispatch();
37
+ var error = useAppSelector(businessSelector).error;
36
38
  var handleOnOTPChange = function (otp) {
37
39
  otpControl.field.onChange(otp);
38
40
  };
@@ -42,6 +44,6 @@ var OTPInput = function (_a) {
42
44
  dispatch(resendOTP());
43
45
  };
44
46
  var otpValue = otpControl.field.value;
45
- return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
47
+ return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, hasError: isTokenExpired(error), onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
46
48
  };
47
49
  export default React.memo(OTPInput);
@@ -33,7 +33,7 @@ var FormStyled = styled(Form)(function () { return ({
33
33
  }); });
34
34
  var EntityCapital = function (_a) {
35
35
  var _b = React.useState(false), anchorEl = _b[0], setAnchorEl = _b[1];
36
- var _c = useAppSelector(entitySelector), data = _c.data, loading = _c.loading, error = _c.error;
36
+ var _c = useAppSelector(entitySelector), data = _c.data, loading = _c.loading, error = _c.error, uploading = _c.uploading;
37
37
  var isAr = useLanguage().isAr;
38
38
  var t = useTranslation().t;
39
39
  var dispatch = useAppDispatch();
@@ -71,7 +71,7 @@ var EntityCapital = function (_a) {
71
71
  var handleActivitiesOpenClose = function (flag) {
72
72
  setAnchorEl(flag);
73
73
  };
74
- var disabled = !methods.formState.isValid || !!error;
74
+ var disabled = !methods.formState.isValid || !!error || uploading;
75
75
  return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(ActivityList, { readOnly: readOnly['activities'] || noneEditable['activities'], onListOpen: function () { return handleActivitiesOpenClose(true); }, onListClose: function () { return handleActivitiesOpenClose(false); } }), _jsxs(Collapse, __assign({ in: !anchorEl }, { children: [_jsx(CapitalPaid, { readOnly: readOnly['capitalPaid'] || noneEditable['capital.paid'] }), _jsx(CapitalShareCount, { readOnly: readOnly['capitalShareCount'] || noneEditable['capital.shares.count'] }), _jsx(CapitalShareValue, { readOnly: readOnly['capitalShareValue'] || noneEditable['capital.shares.value'] }), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] }))] })) })) }));
76
76
  };
77
77
  export default EntityCapital;
@@ -17,8 +17,9 @@ import OTPField from '../../../shared/OTP';
17
17
  import { useController, useFormContext } from 'react-hook-form';
18
18
  import { useTranslation } from 'react-i18next';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
- import { useAppDispatch } from '../../../../hooks';
21
- import { resendOTP } from '../../../app/entity/entityStore';
20
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
21
+ import { isTokenExpired } from '../../../../utils';
22
+ import { entitySelector, resendOTP } from '../../../app/entity/entityStore';
22
23
  var BoxStyled = styled(Box)(function (_a) {
23
24
  var theme = _a.theme;
24
25
  return ({
@@ -33,6 +34,7 @@ var OTPInput = function (_a) {
33
34
  var t = useTranslation().t;
34
35
  var otpControl = useController({ name: 'otp', control: control });
35
36
  var dispatch = useAppDispatch();
37
+ var error = useAppSelector(entitySelector).error;
36
38
  var handleOnOTPChange = function (otp) {
37
39
  otpControl.field.onChange(otp);
38
40
  };
@@ -42,6 +44,6 @@ var OTPInput = function (_a) {
42
44
  dispatch(resendOTP());
43
45
  };
44
46
  var otpValue = otpControl.field.value;
45
- return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
47
+ return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, hasError: isTokenExpired(error), onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
46
48
  };
47
49
  export default React.memo(OTPInput);
@@ -65,7 +65,6 @@ import SignInPasswordPage from './signIn/screens/Password';
65
65
  import EntityVerifyPage from './entity/screens/Verify';
66
66
  import EntityNamePage from './entity/screens/EntityName';
67
67
  import EntityCapitalPage from './entity/screens/EntityCapital';
68
- import EntityAddressPage from './entity/screens/EntityAddress';
69
68
  import EntitySuccessPage from './entity/screens/Success';
70
69
  import EntitySuccessWithFlowPage from './entity/screens/SuccessWithFlowButtons';
71
70
  import EntityResetPasswordSuccessPage from './entity/screens/ResetPasswordSuccess';
@@ -345,10 +344,6 @@ export var entityFeatureScreens = [
345
344
  name: 'ENTITY_CAPITAL_STEP',
346
345
  element: EntityCapitalPage
347
346
  },
348
- {
349
- name: 'ENTITY_ADDRESS_STEP',
350
- element: EntityAddressPage
351
- },
352
347
  {
353
348
  name: 'ENTITY_DETAILS_SUCCESS_STEP',
354
349
  element: EntitySuccessPage
@@ -11,14 +11,15 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import * as React from 'react';
14
- import { useAppDispatch } from '../../../../hooks';
14
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
15
15
  import Box from '@mui/material/Box/Box';
16
16
  import { styled } from '@mui/material/styles';
17
17
  import OTPField from '../../../shared/OTP';
18
18
  import { useController, useFormContext } from 'react-hook-form';
19
19
  import { useTranslation } from 'react-i18next';
20
20
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
21
- import { resendOTP } from '../../../app/individual/individualStore';
21
+ import { isTokenExpired } from '../../../../utils';
22
+ import { individualSelector, resendOTP } from '../../../app/individual/individualStore';
22
23
  var BoxStyled = styled(Box)(function (_a) {
23
24
  var theme = _a.theme;
24
25
  return ({
@@ -33,6 +34,7 @@ var OTPInput = function (_a) {
33
34
  var t = useTranslation().t;
34
35
  var otpControl = useController({ name: 'otp', control: control });
35
36
  var dispatch = useAppDispatch();
37
+ var error = useAppSelector(individualSelector).error;
36
38
  var handleOnOTPChange = function (otp) {
37
39
  otpControl.field.onChange(otp);
38
40
  };
@@ -42,6 +44,6 @@ var OTPInput = function (_a) {
42
44
  dispatch(resendOTP());
43
45
  };
44
46
  var otpValue = otpControl.field.value;
45
- return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
47
+ return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, hasError: isTokenExpired(error), onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
46
48
  };
47
49
  export default React.memo(OTPInput);
@@ -11,14 +11,15 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import * as React from 'react';
14
- import { useAppDispatch } from '../../../../hooks';
14
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
15
15
  import Box from '@mui/material/Box/Box';
16
16
  import { styled } from '@mui/material/styles';
17
17
  import OTPField from '../../../shared/OTP';
18
18
  import { useController, useFormContext } from 'react-hook-form';
19
19
  import { useTranslation } from 'react-i18next';
20
20
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
21
- import { resendOTP } from '../../../app/password/passwordStore';
21
+ import { isTokenExpired } from '../../../../utils';
22
+ import { passwordSelector, resendOTP } from '../../../app/password/passwordStore';
22
23
  var BoxStyled = styled(Box)(function (_a) {
23
24
  var theme = _a.theme;
24
25
  return ({
@@ -33,6 +34,7 @@ var OTPInput = function (_a) {
33
34
  var t = useTranslation().t;
34
35
  var otpControl = useController({ name: 'otp', control: control });
35
36
  var dispatch = useAppDispatch();
37
+ var error = useAppSelector(passwordSelector).error;
36
38
  var handleOnOTPChange = function (otp) {
37
39
  otpControl.field.onChange(otp);
38
40
  };
@@ -42,6 +44,6 @@ var OTPInput = function (_a) {
42
44
  dispatch(resendOTP());
43
45
  };
44
46
  var otpValue = otpControl.field.value;
45
- return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
47
+ return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, hasError: isTokenExpired(error), onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
46
48
  };
47
49
  export default React.memo(OTPInput);