@tap-payments/auth-jsconnect 2.8.62-beta → 2.8.62-development

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 (46) hide show
  1. package/build/@types/redux.d.ts +1 -0
  2. package/build/api/entity.d.ts +2 -2
  3. package/build/api/entity.js +12 -4
  4. package/build/api/index.d.ts +2 -2
  5. package/build/components/Tooltip/Tooltip.js +1 -1
  6. package/build/constants/api.d.ts +0 -1
  7. package/build/constants/api.js +0 -2
  8. package/build/constants/app.d.ts +0 -2
  9. package/build/constants/app.js +0 -2
  10. package/build/features/app/bank/bankStore.d.ts +13 -19
  11. package/build/features/app/bank/bankStore.js +183 -165
  12. package/build/features/app/board/boardStore.js +16 -10
  13. package/build/features/app/brand/brandStore.d.ts +16 -31
  14. package/build/features/app/brand/brandStore.js +243 -239
  15. package/build/features/app/business/businessStore.js +7 -1
  16. package/build/features/app/entity/entityStore.d.ts +20 -34
  17. package/build/features/app/entity/entityStore.js +204 -249
  18. package/build/features/app/individual/individualStore.d.ts +17 -36
  19. package/build/features/app/individual/individualStore.js +221 -270
  20. package/build/features/app/password/passwordStore.d.ts +19 -25
  21. package/build/features/app/password/passwordStore.js +170 -216
  22. package/build/features/app/tax/taxStore.d.ts +13 -7
  23. package/build/features/app/tax/taxStore.js +168 -147
  24. package/build/features/bank/screens/BankDetails/BankDetails.js +17 -4
  25. package/build/features/brand/screens/BrandActivities/BrandActivities.js +48 -11
  26. package/build/features/brand/screens/BrandInfo/BrandInfo.js +22 -4
  27. package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +22 -6
  28. package/build/features/business/screens/Activities/Activities.js +9 -1
  29. package/build/features/business/screens/Customers/Customers.js +9 -1
  30. package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +7 -1
  31. package/build/features/entity/screens/EntityCapital/EntityCapital.js +33 -9
  32. package/build/features/entity/screens/EntityName/EntityName.js +31 -14
  33. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +43 -10
  34. package/build/features/individual/screens/IndividualList/IndividualList.js +7 -0
  35. package/build/features/individual/screens/IndividualList/UserList.js +3 -3
  36. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +73 -18
  37. package/build/features/password/Password.js +1 -1
  38. package/build/features/shared/Button/FlowsButtons.js +7 -1
  39. package/build/features/signIn/SignIn.js +10 -2
  40. package/build/features/tax/screens/TaxDetails/TaxDetails.js +7 -2
  41. package/build/hooks/index.d.ts +1 -0
  42. package/build/hooks/index.js +1 -0
  43. package/build/hooks/useFormDirtyCheck.d.ts +10 -0
  44. package/build/hooks/useFormDirtyCheck.js +66 -0
  45. package/build/utils/common.js +4 -4
  46. package/package.json +2 -2
@@ -75,132 +75,109 @@ 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, individualData, boardData, countryCode, boardInfoData, userList, boardInfoStatus, countries, publicKey, board_id, board_info_id, notification, _b, id, type, data_1, birthCountry, individuals, _c, is_authorized, data_state;
79
- var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
80
- return __generator(this, function (_p) {
81
- switch (_p.label) {
78
+ var settings, payload, data, userList, recipientData, countries, _b, country_code, config, boardId, countryCode, publicKey, data_1, _c, business_id, recipient, board_id, board_info_id, notification, _d, id_1, type, individualData, birthCountry;
79
+ var _e, _f, _g, _h;
80
+ return __generator(this, function (_j) {
81
+ switch (_j.label) {
82
82
  case 0:
83
+ settings = thunkApi.getState().settings;
83
84
  payload = __assign({ service_name: 'tap_email', verify_token: token }, (isInternally && {
84
85
  notification: {
85
86
  sms: false
86
87
  }
87
88
  }));
88
- settings = thunkApi.getState().settings;
89
89
  return [4, API.leadService.verifyLeadToken(payload)];
90
90
  case 1:
91
- data = (_p.sent()).data;
92
- individualData = undefined;
93
- boardInfoStatus = undefined;
91
+ data = (_j.sent()).data;
92
+ recipientData = undefined;
94
93
  countries = settings.data.countries;
95
- if (((_d = data.errors) === null || _d === void 0 ? void 0 : _d.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
94
+ if (((_e = data.errors) === null || _e === void 0 ? void 0 : _e.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
96
95
  throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
97
96
  if (isInternally)
98
97
  data.step_name = INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO;
99
- if (data === null || data === void 0 ? void 0 : data.country_code) {
100
- countryCode = data === null || data === void 0 ? void 0 : data.country_code;
101
- thunkApi.dispatch(handleSetCountryByIso2(countryCode));
102
- }
103
- publicKey = (_e = data === null || data === void 0 ? void 0 : data.config) === null || _e === void 0 ? void 0 : _e.public_key;
104
- if (publicKey) {
98
+ _b = data || {}, country_code = _b.country_code, config = _b.config, boardId = _b.id;
99
+ countryCode = country_code;
100
+ publicKey = config === null || config === void 0 ? void 0 : config.public_key;
101
+ if (country_code)
102
+ thunkApi.dispatch(handleSetCountryByIso2(country_code));
103
+ if (publicKey)
105
104
  thunkApi.dispatch(handlePublicKey(publicKey));
106
- }
107
- if (!(data.step_name === INDIVIDUAl_STEP_NAMES.PHONE_INFO)) return [3, 2];
108
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PHONE_INFO_STEP'));
109
- return [3, 20];
105
+ if (!!country_code) return [3, 3];
106
+ return [4, API.boardService.retrieveBoardDetails(boardId)];
110
107
  case 2:
111
- if (!(data.step_name !== INDIVIDUAl_STEP_NAMES.PHONE_AUTH)) return [3, 19];
112
- board_id = data === null || data === void 0 ? void 0 : data.id;
113
- board_info_id = data === null || data === void 0 ? void 0 : data.board_info_id;
114
- if (!(board_id && board_info_id)) return [3, 5];
115
- return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
108
+ data_1 = _j.sent();
109
+ countryCode = (_f = data_1 === null || data_1 === void 0 ? void 0 : data_1.entity) === null || _f === void 0 ? void 0 : _f.country;
110
+ if (countryCode)
111
+ thunkApi.dispatch(handleSetCountryByIso2(countryCode));
112
+ _j.label = 3;
116
113
  case 3:
117
- boardInfoData = _p.sent();
118
- notification = (boardInfoData || {}).notification;
119
- _b = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _b.id, type = _b.type;
120
- if (!(id && type)) return [3, 5];
121
- return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
114
+ if (!(data.step_name === INDIVIDUAl_STEP_NAMES.PHONE_INFO)) return [3, 4];
115
+ thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PHONE_INFO_STEP'));
116
+ return [3, 18];
122
117
  case 4:
123
- data_1 = (_p.sent()).data;
124
- individualData = data_1 || {};
125
- _p.label = 5;
118
+ if (!(data.step_name !== INDIVIDUAl_STEP_NAMES.PHONE_AUTH)) return [3, 17];
119
+ _c = data || {}, business_id = _c.business_id, recipient = _c.recipient, board_id = _c.id, board_info_id = _c.board_info_id;
120
+ recipientData = recipient;
121
+ if (!!((_g = data === null || data === void 0 ? void 0 : data.recipient) === null || _g === void 0 ? void 0 : _g.id)) return [3, 6];
122
+ if (!(board_id && board_info_id)) return [3, 6];
123
+ return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
126
124
  case 5:
127
- if (!board_id) return [3, 7];
128
- return [4, API.boardService.retrieveBoardDetails(board_id)];
125
+ notification = (_j.sent()).notification;
126
+ recipientData = notification === null || notification === void 0 ? void 0 : notification.recipient;
127
+ if (!(recipientData === null || recipientData === void 0 ? void 0 : recipientData.id))
128
+ throw new Error('individual_id_missing');
129
+ _j.label = 6;
129
130
  case 6:
130
- boardData = _p.sent();
131
- _p.label = 7;
131
+ _d = recipientData || {}, id_1 = _d.id, type = _d.type;
132
+ return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id_1, type: type, countryCode: countryCode })).unwrap()];
132
133
  case 7:
133
- if (!countryCode && ((_f = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _f === void 0 ? void 0 : _f.country)) {
134
- countryCode = boardData.entity.country;
135
- thunkApi.dispatch(handleSetCountryByIso2(countryCode));
136
- }
137
- if (!(!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) && !isKWOrSA(countryCode))) return [3, 11];
138
- if (!((_g = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _g === void 0 ? void 0 : _g.id)) return [3, 9];
139
- return [4, thunkApi.dispatch(getIndividualList((_h = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _h === void 0 ? void 0 : _h.id)).unwrap()];
134
+ individualData = (_j.sent()).data;
135
+ if (!(!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) && !isKWOrSA(countryCode))) return [3, 10];
136
+ if (!business_id) return [3, 9];
137
+ return [4, thunkApi.dispatch(getIndividualList(business_id)).unwrap()];
140
138
  case 8:
141
- userList = _p.sent();
142
- _p.label = 9;
139
+ userList = _j.sent();
140
+ _j.label = 9;
143
141
  case 9:
144
- userList = userList === null || userList === void 0 ? void 0 : userList.filter(function (user) { return user.id === (individualData === null || individualData === void 0 ? void 0 : individualData.id); });
145
- return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
146
- case 10:
147
- boardInfoStatus = _p.sent();
142
+ userList = userList === null || userList === void 0 ? void 0 : userList.filter(function (user) { return user.id === id_1; });
148
143
  thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
149
- return [3, 18];
144
+ return [3, 16];
145
+ case 10:
146
+ if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 13];
147
+ if (!business_id) return [3, 12];
148
+ return [4, thunkApi.dispatch(getIndividualList(business_id)).unwrap()];
150
149
  case 11:
151
- if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 15];
152
- if (!((_j = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _j === void 0 ? void 0 : _j.id)) return [3, 13];
153
- return [4, thunkApi.dispatch(getIndividualList((_k = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _k === void 0 ? void 0 : _k.id)).unwrap()];
150
+ userList = _j.sent();
151
+ _j.label = 12;
154
152
  case 12:
155
- userList = _p.sent();
156
- _p.label = 13;
157
- case 13: return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
158
- case 14:
159
- boardInfoStatus = _p.sent();
160
153
  thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
161
- return [3, 18];
162
- case 15:
163
- birthCountry = ((_l = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _l === void 0 ? void 0 : _l.country) || countryCode;
164
- if (!birthCountry) return [3, 17];
154
+ return [3, 16];
155
+ case 13:
156
+ birthCountry = ((_h = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _h === void 0 ? void 0 : _h.country) || countryCode;
157
+ if (!birthCountry) return [3, 15];
165
158
  return [4, thunkApi.dispatch(getCityList(birthCountry))];
166
- case 16:
167
- _p.sent();
168
- _p.label = 17;
169
- case 17:
159
+ case 14:
160
+ _j.sent();
161
+ _j.label = 15;
162
+ case 15:
170
163
  if (isInternally)
171
164
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
172
165
  else
173
166
  thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP'));
174
- _p.label = 18;
175
- case 18: return [3, 20];
176
- case 19:
167
+ _j.label = 16;
168
+ case 16: return [3, 18];
169
+ case 17:
177
170
  if (isUpdatePhoneInfo) {
178
171
  thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_VERIFY_STEP'));
179
172
  }
180
- _p.label = 20;
181
- case 20:
182
- individuals = (boardData || {}).individuals;
183
- _c = individualData || {}, is_authorized = _c.is_authorized, data_state = _c.data_state;
184
- return [2, {
185
- data: data,
186
- boardResponse: {
187
- brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
188
- bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
189
- entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
190
- merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
191
- merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
192
- name: (_m = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _m === void 0 ? void 0 : _m.names,
193
- contact: (_o = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _o === void 0 ? void 0 : _o.contact,
194
- individuals: is_authorized ? individuals : __assign(__assign({}, individuals), (!!data_state && { data_state: data_state })),
195
- countries: countries,
196
- countryCode: countryCode,
197
- notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
198
- business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
199
- flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
200
- },
201
- token: token,
202
- userList: userList || []
203
- }];
173
+ _j.label = 18;
174
+ case 18: return [2, {
175
+ data: data,
176
+ countries: countries,
177
+ countryCode: countryCode,
178
+ token: token,
179
+ userList: userList || []
180
+ }];
204
181
  }
205
182
  });
206
183
  });
@@ -413,147 +390,139 @@ export var retrieveDataList = createAsyncThunk('individualRetrieveDataList', fun
413
390
  });
414
391
  }); });
415
392
  export var retrieveBoardStatus = createAsyncThunk('individual/retrieveBoardStatus', function (parmas, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
416
- var individual, board_id, data;
417
- return __generator(this, function (_a) {
418
- switch (_a.label) {
393
+ var individual, _a, board_id, board_info_id, data;
394
+ return __generator(this, function (_b) {
395
+ switch (_b.label) {
419
396
  case 0:
420
397
  individual = thunkApi.getState().individual;
421
- board_id = (individual.data.verify.responseBody || {}).board_id;
398
+ _a = individual.data.verify.responseBody || {}, board_id = _a.board_id, board_info_id = _a.board_info_id;
399
+ if (!board_id || !board_info_id)
400
+ throw new Error('Internal server error');
422
401
  return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
423
402
  case 1:
424
- data = _a.sent();
403
+ data = _b.sent();
404
+ return [4, thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id })).unwrap()];
405
+ case 2:
406
+ _b.sent();
425
407
  thunkApi.dispatch(handlePrevScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
426
408
  return [2, { flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
427
409
  }
428
410
  });
429
411
  }); });
430
- export var retrieveBoardDetails = createAsyncThunk('retrieveIndividualBoardDetails', function (boardId) { return __awaiter(void 0, void 0, void 0, function () {
431
- var _a, user, data;
432
- var _b, _c;
433
- return __generator(this, function (_d) {
434
- switch (_d.label) {
435
- case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
436
- case 1:
437
- _a = _d.sent(), user = _a.user, data = __rest(_a, ["user"]);
438
- return [2, {
439
- data: __assign(__assign({}, data), { brand: data === null || data === void 0 ? void 0 : data.brand, bank_account: data === null || data === void 0 ? void 0 : data.bank_account, entity: data === null || data === void 0 ? void 0 : data.entity, merchant: data === null || data === void 0 ? void 0 : data.merchant, name: (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.names, individuals: data === null || data === void 0 ? void 0 : data.individuals, contact: (_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.contact, board_status: data === null || data === void 0 ? void 0 : data.status })
440
- }];
441
- }
412
+ export var retrieveBoardDetails = createAsyncThunk('retrieveIndividualBoardDetails', function (_a, thunkApi) {
413
+ var boardId = _a.boardId, id = _a.individualId, type = _a.individualType;
414
+ return __awaiter(void 0, void 0, void 0, function () {
415
+ var _b, individual, settings, individualData, _c, user, data, data_3, data_state;
416
+ var _d, _e, _f;
417
+ return __generator(this, function (_g) {
418
+ switch (_g.label) {
419
+ case 0:
420
+ _b = thunkApi.getState(), individual = _b.individual, settings = _b.settings;
421
+ individualData = (_d = individual.data.verify.responseBody) === null || _d === void 0 ? void 0 : _d.user;
422
+ return [4, API.boardService.retrieveBoardDetails(boardId)];
423
+ case 1:
424
+ _c = _g.sent(), user = _c.user, data = __rest(_c, ["user"]);
425
+ if (!((individualData === null || individualData === void 0 ? void 0 : individualData.id) === (user === null || user === void 0 ? void 0 : user.id))) return [3, 2];
426
+ individualData = user;
427
+ return [3, 4];
428
+ case 2:
429
+ if (!(!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) && id && type)) return [3, 4];
430
+ return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: settings.data.businessCountry.iso2 })).unwrap()];
431
+ case 3:
432
+ data_3 = (_g.sent()).data;
433
+ individualData = data_3;
434
+ _g.label = 4;
435
+ case 4:
436
+ data_state = (((individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) && (data === null || data === void 0 ? void 0 : data.individuals) ? data === null || data === void 0 ? void 0 : data.individuals : individualData) || {}).data_state;
437
+ return [2, {
438
+ data: __assign(__assign(__assign(__assign({}, data), { brand: data === null || data === void 0 ? void 0 : data.brand, bank_account: data === null || data === void 0 ? void 0 : data.bank_account, entity: data === null || data === void 0 ? void 0 : data.entity, merchant: data === null || data === void 0 ? void 0 : data.merchant, name: (_e = data === null || data === void 0 ? void 0 : data.user) === null || _e === void 0 ? void 0 : _e.names, individuals: data === null || data === void 0 ? void 0 : data.individuals, contact: (_f = data === null || data === void 0 ? void 0 : data.user) === null || _f === void 0 ? void 0 : _f.contact }), (data_state && {
439
+ individuals: __assign(__assign({}, data === null || data === void 0 ? void 0 : data.individuals), { data_state: data_state })
440
+ })), { board_status: data === null || data === void 0 ? void 0 : data.status })
441
+ }];
442
+ }
443
+ });
442
444
  });
443
- }); });
445
+ });
444
446
  export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
445
- var _a, individual, settings, responseBody, _b, board_id, board_info_id, countries, payload, data, individualData, boardInfoData, userList, boardData, boardInfoStatus, countryCode, publicKey, notification, _c, id, type, data_3, birthCountry, individuals, _d, is_authorized, data_state;
446
- var _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
447
- return __generator(this, function (_t) {
448
- switch (_t.label) {
447
+ var _a, individual, settings, responseBody, countries, payload, data, userList, recipientData, publicKey, countryCode, _b, business_id, recipient, board_id, board_info_id, notification, _c, id, type, individualData, birthCountry;
448
+ var _d, _e, _f, _g, _h, _j, _k, _l;
449
+ return __generator(this, function (_m) {
450
+ switch (_m.label) {
449
451
  case 0:
450
452
  _a = thunkApi.getState(), individual = _a.individual, settings = _a.settings;
451
453
  responseBody = individual.data.verify.responseBody;
452
- _b = responseBody || {}, board_id = _b.board_id, board_info_id = _b.board_info_id;
453
454
  countries = settings.data.countries;
454
455
  payload = {
455
456
  data: params.otp,
456
- service_name: (_e = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _e === void 0 ? void 0 : _e.service_name,
457
+ service_name: (_d = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _d === void 0 ? void 0 : _d.service_name,
457
458
  verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
458
459
  step_name: INDIVIDUAl_STEP_NAMES.PHONE_AUTH,
459
460
  encryption_contract: ['data']
460
461
  };
461
462
  return [4, API.leadService.verifyLeadOTP(payload)];
462
463
  case 1:
463
- data = (_t.sent()).data;
464
- individualData = undefined;
465
- countryCode = undefined;
466
- if ((_f = data.errors) === null || _f === void 0 ? void 0 : _f.length)
464
+ data = (_m.sent()).data;
465
+ recipientData = undefined;
466
+ if ((_e = data.errors) === null || _e === void 0 ? void 0 : _e.length)
467
467
  throw new Error(data.errors[0].description);
468
- publicKey = (_g = data === null || data === void 0 ? void 0 : data.config) === null || _g === void 0 ? void 0 : _g.public_key;
469
- if (publicKey) {
468
+ publicKey = (_f = data === null || data === void 0 ? void 0 : data.config) === null || _f === void 0 ? void 0 : _f.public_key;
469
+ countryCode = data === null || data === void 0 ? void 0 : data.country_code;
470
+ if (publicKey)
470
471
  thunkApi.dispatch(handlePublicKey(publicKey));
471
- }
472
- if (data === null || data === void 0 ? void 0 : data.country_code) {
473
- countryCode = data.country_code;
474
- thunkApi.dispatch(handleSetCountryByIso2(data.country_code));
475
- }
476
- if (!board_id) return [3, 3];
477
- return [4, API.boardService.retrieveBoardDetails(board_id)];
478
- case 2:
479
- boardData = _t.sent();
480
- _t.label = 3;
481
- case 3:
482
- if (!countryCode && ((_h = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _h === void 0 ? void 0 : _h.country)) {
483
- countryCode = boardData.entity.country;
472
+ if (!((_g = settings.data.businessCountry) === null || _g === void 0 ? void 0 : _g.iso2) && countryCode)
484
473
  thunkApi.dispatch(handleSetCountryByIso2(countryCode));
485
- }
486
- if (!(board_id && board_info_id)) return [3, 6];
474
+ _b = data || {}, business_id = _b.business_id, recipient = _b.recipient, board_id = _b.id, board_info_id = _b.board_info_id;
475
+ recipientData = recipient;
476
+ if (!!((_h = data === null || data === void 0 ? void 0 : data.recipient) === null || _h === void 0 ? void 0 : _h.id)) return [3, 3];
477
+ if (!(board_id && board_info_id)) return [3, 3];
487
478
  return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
488
- case 4:
489
- boardInfoData = _t.sent();
490
- notification = (boardInfoData || {}).notification;
491
- _c = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _c.id, type = _c.type;
492
- if (!(id && type)) return [3, 6];
479
+ case 2:
480
+ notification = (_m.sent()).notification;
481
+ recipientData = notification === null || notification === void 0 ? void 0 : notification.recipient;
482
+ if (!(recipientData === null || recipientData === void 0 ? void 0 : recipientData.id))
483
+ throw new Error('individual_id_missing');
484
+ _m.label = 3;
485
+ case 3:
486
+ _c = recipientData || {}, id = _c.id, type = _c.type;
493
487
  return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
488
+ case 4:
489
+ individualData = (_m.sent()).data;
490
+ if (!(!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) && !isKWOrSA(countryCode))) return [3, 7];
491
+ if (!business_id) return [3, 6];
492
+ return [4, thunkApi.dispatch(getIndividualList(business_id)).unwrap()];
494
493
  case 5:
495
- data_3 = (_t.sent()).data;
496
- individualData = data_3 || {};
497
- _t.label = 6;
494
+ userList = _m.sent();
495
+ _m.label = 6;
498
496
  case 6:
499
- if (countryCode)
500
- thunkApi.dispatch(handleSetCountryByIso2(countryCode));
501
- if (!(!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) && !isKWOrSA(countryCode))) return [3, 10];
502
- if (!((_j = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _j === void 0 ? void 0 : _j.id)) return [3, 8];
503
- return [4, thunkApi.dispatch(getIndividualList((_k = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _k === void 0 ? void 0 : _k.id)).unwrap()];
497
+ userList = userList === null || userList === void 0 ? void 0 : userList.filter(function (user) { return user.id === id; });
498
+ thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
499
+ return [3, 13];
504
500
  case 7:
505
- userList = _t.sent();
506
- _t.label = 8;
501
+ if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 10];
502
+ if (!business_id) return [3, 9];
503
+ return [4, thunkApi.dispatch(getIndividualList(business_id)).unwrap()];
507
504
  case 8:
508
- userList = userList === null || userList === void 0 ? void 0 : userList.filter(function (user) { return user.id === (individualData === null || individualData === void 0 ? void 0 : individualData.id); });
509
- return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
505
+ userList = _m.sent();
506
+ _m.label = 9;
510
507
  case 9:
511
- boardInfoStatus = _t.sent();
512
508
  thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
513
- return [3, 17];
509
+ return [3, 13];
514
510
  case 10:
515
- if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 14];
516
- if (!((_l = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _l === void 0 ? void 0 : _l.id)) return [3, 12];
517
- return [4, thunkApi.dispatch(getIndividualList((_m = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _m === void 0 ? void 0 : _m.id))];
518
- case 11:
519
- _t.sent();
520
- _t.label = 12;
521
- case 12: return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
522
- case 13:
523
- boardInfoStatus = _t.sent();
524
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
525
- return [3, 17];
526
- case 14:
527
- birthCountry = ((_o = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _o === void 0 ? void 0 : _o.country) || countryCode;
528
- if (!birthCountry) return [3, 16];
511
+ birthCountry = ((_j = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _j === void 0 ? void 0 : _j.country) || countryCode;
512
+ if (!birthCountry) return [3, 12];
529
513
  return [4, thunkApi.dispatch(getCityList(birthCountry))];
530
- case 15:
531
- _t.sent();
532
- _t.label = 16;
533
- case 16:
514
+ case 11:
515
+ _m.sent();
516
+ _m.label = 12;
517
+ case 12:
534
518
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
535
- _t.label = 17;
536
- case 17:
537
- (_q = (_p = settings.data.appConfig).onStepCompleted) === null || _q === void 0 ? void 0 : _q.call(_p, settings.data.activeScreen.name, { otp: params.otp });
538
- individuals = (boardData || {}).individuals;
539
- _d = individualData || {}, is_authorized = _d.is_authorized, data_state = _d.data_state;
519
+ _m.label = 13;
520
+ case 13:
521
+ (_l = (_k = settings.data.appConfig).onStepCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, settings.data.activeScreen.name, { otp: params.otp });
540
522
  return [2, {
541
523
  data: data,
542
- boardResponse: {
543
- brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
544
- bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
545
- entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
546
- merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
547
- merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
548
- name: (_r = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _r === void 0 ? void 0 : _r.names,
549
- contact: (_s = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _s === void 0 ? void 0 : _s.contact,
550
- individuals: is_authorized ? individuals : __assign(__assign({}, individuals), (!!data_state && { data_state: data_state })),
551
- countries: countries,
552
- countryCode: countryCode,
553
- notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
554
- business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
555
- flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
556
- },
524
+ countries: countries,
525
+ countryCode: countryCode,
557
526
  formData: __assign({}, params),
558
527
  userList: userList
559
528
  }];
@@ -593,21 +562,20 @@ export var updatePhoneInfo = createAsyncThunk('individual/updatePhoneInfo', func
593
562
  });
594
563
  });
595
564
  export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateIndividualPersonalInfo', function (_a, thunkApi) {
596
- var formData = _a.formData, originalFormData = _a.originalFormData;
565
+ var formData = _a.formData, originalFormData = _a.originalFormData, isDirty = _a.isDirty;
597
566
  return __awaiter(void 0, void 0, void 0, function () {
598
- var _b, settings, individual, _c, notification, user, entity, id, _d, objects, ids, countryCode, name, email, mobile, gender, nid, issuedCountry, expiryDate, dob, placeOfBirthCountry, placeOfBirthCity, nationality, code, data_status, userName, identification_id_type, isGenderNonEditable, isNameENNonEditable, isNameARNonEditable, isEmailNonEditable, isMobileNumberNonEditable, isMobileCountryNonEditable, isNidNonEditable, isIssuedCountryNonEditable, isExpiryNonEditable, isIdTypeNonEditable, isNationalityNonEditable, isDOBNonEditable, isBirthCityNonEditable, isBirthCountryNonEditable, hasContact, hasPhone, hasIdentification, hasBirth, nameIsEditable, contact, requestBody, data, _e, isUser, isBuyer, isUserORBuyerType;
567
+ var _b, settings, individual, _c, recipient, user, entity, id, countryCode, name, email, mobile, gender, nid, issuedCountry, expiryDate, dob, placeOfBirthCountry, placeOfBirthCity, nationality, code, _d, data_status, objects, ids, userName, identification_id_type, isGenderNonEditable, isNameENNonEditable, isNameARNonEditable, isEmailNonEditable, isMobileNumberNonEditable, isMobileCountryNonEditable, isNidNonEditable, isIssuedCountryNonEditable, isExpiryNonEditable, isIdTypeNonEditable, isNationalityNonEditable, isDOBNonEditable, isBirthCityNonEditable, isBirthCountryNonEditable, hasContact, hasPhone, hasIdentification, hasBirth, nameIsEditable, contact, requestBody, individualData, data, _e, isUser, isBuyer, isUserORBuyerType;
599
568
  var _f, _g, _h, _j, _k;
600
569
  return __generator(this, function (_l) {
601
570
  switch (_l.label) {
602
571
  case 0:
603
572
  _b = thunkApi.getState(), settings = _b.settings, individual = _b.individual;
604
- _c = individual.data.verify.responseBody || {}, notification = _c.notification, user = _c.user, entity = _c.entity;
605
- id = (((user === null || user === void 0 ? void 0 : user.is_authorized) ? user : notification === null || notification === void 0 ? void 0 : notification.recipient) || {}).id;
606
- _d = user || {}, objects = _d.objects, ids = _d.ids;
573
+ _c = individual.data.verify.responseBody || {}, recipient = _c.recipient, user = _c.user, entity = _c.entity;
574
+ id = (((user === null || user === void 0 ? void 0 : user.is_authorized) ? user : recipient) || {}).id;
607
575
  countryCode = (originalFormData || {}).countryCode;
608
576
  name = formData.name, email = formData.email, mobile = formData.mobile, gender = formData.gender, nid = formData.nid, issuedCountry = formData.issuedCountry, expiryDate = formData.expiryDate, dob = formData.dob, placeOfBirthCountry = formData.placeOfBirthCountry, placeOfBirthCity = formData.placeOfBirthCity, nationality = formData.nationality;
609
577
  code = entity === null || entity === void 0 ? void 0 : entity.country;
610
- data_status = (user || {}).data_status;
578
+ _d = user || {}, data_status = _d.data_status, objects = _d.objects, ids = _d.ids;
611
579
  userName = getUserNameObject(name);
612
580
  identification_id_type = nid ? (nid.startsWith('1') ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA) : undefined;
613
581
  if (isOtherThanKWOrSA(settings.data.businessCountry.iso2)) {
@@ -630,7 +598,7 @@ export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateInd
630
598
  hasContact = email || mobile;
631
599
  hasPhone = mobile && (countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix);
632
600
  hasIdentification = nid && (issuedCountry || identification_id_type || expiryDate);
633
- hasBirth = placeOfBirthCity || placeOfBirthCountry;
601
+ hasBirth = (placeOfBirthCity === null || placeOfBirthCity === void 0 ? void 0 : placeOfBirthCity.id) || (placeOfBirthCountry === null || placeOfBirthCountry === void 0 ? void 0 : placeOfBirthCountry.iso2);
634
602
  nameIsEditable = userName.first && !(isNameENNonEditable && isNameARNonEditable);
635
603
  contact = hasContact && !(isEmailNonEditable && isMobileCountryNonEditable && isMobileNumberNonEditable)
636
604
  ? __assign({ email: isEmailNonEditable ? undefined : email }, (!(isMobileCountryNonEditable && isMobileNumberNonEditable) &&
@@ -676,35 +644,40 @@ export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateInd
676
644
  'date_of_birth',
677
645
  'nationality'
678
646
  ], step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_PERSONAL_INFO });
647
+ individualData = undefined;
648
+ if (!isDirty) return [3, 2];
679
649
  return [4, API.individualService.updateMultipleIndividual(requestBody)];
680
650
  case 1:
681
651
  data = _l.sent();
652
+ individualData = data;
653
+ _l.label = 2;
654
+ case 2:
682
655
  _e = getIndividualType(objects), isUser = _e.isUser, isBuyer = _e.isBuyer;
683
656
  isUserORBuyerType = isUser || isBuyer;
684
- if (!isUserORBuyerType) return [3, 3];
657
+ if (!isUserORBuyerType) return [3, 4];
685
658
  return [4, thunkApi.dispatch(retrieveDataList(code))];
686
- case 2:
687
- _l.sent();
688
- _l.label = 3;
689
659
  case 3:
660
+ _l.sent();
661
+ _l.label = 4;
662
+ case 4:
690
663
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
691
664
  (_k = (_j = settings.data.appConfig).onStepCompleted) === null || _k === void 0 ? void 0 : _k.call(_j, settings.data.activeScreen.name, requestBody);
692
- return [2, { data: data, formData: originalFormData }];
665
+ return [2, { data: individualData, formData: originalFormData }];
693
666
  }
694
667
  });
695
668
  });
696
669
  });
697
670
  export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', function (_a, thunkApi) {
698
- var formData = _a.formData, originalFormData = _a.originalFormData;
671
+ var formData = _a.formData, originalFormData = _a.originalFormData, isDirty = _a.isDirty;
699
672
  return __awaiter(void 0, void 0, void 0, function () {
700
- var _b, settings, individual, _c, notification, user, userList, business, id, _d, objects, ids, isKWOrSAValue, occupation, sourceIncome, monthlyIncome, isPEP, isInfluencer, shareCount, shareValue, civilID, signatureFileId, isAuthorized, isOccupationNonEditable, isSourceIncomeNonEditable, isPEPNonEditable, isInfluencerNonEditable, isMonthlyIncomeNonEditable, isAuthorizedNonEditable, isSharesAvailable, pepInfo, influencerInfo, occupationInfo, sourceIncomeInfo, monthlyIncomeInfo, isAuthorizedInfo, userPayload, shareHolderPayload, boardMemberPayload, buyerMemberPayload, _e, isUser, isShareholder, isBoardMember, isBuyer, isCustomer, isUserORBuyerType, payload, businessCountry, hasCivilIdDocument, hasSignatureDocument, isSendSignatureFile, civilIdDocument, signatureDocument, documentBody, documentBody, documentsList, documentBody, requestBody, data, individualData, userListRes;
673
+ var _b, settings, individual, _c, recipient, user, userList, business, id, _d, objects, ids, isKWOrSAValue, occupation, sourceIncome, monthlyIncome, isPEP, isInfluencer, shareCount, shareValue, civilID, signatureFileId, isAuthorized, isOccupationNonEditable, isSourceIncomeNonEditable, isPEPNonEditable, isInfluencerNonEditable, isMonthlyIncomeNonEditable, isAuthorizedNonEditable, isSharesAvailable, pepInfo, influencerInfo, occupationInfo, sourceIncomeInfo, monthlyIncomeInfo, isAuthorizedInfo, userPayload, shareHolderPayload, boardMemberPayload, buyerMemberPayload, _e, isUser, isShareholder, isBoardMember, isBuyer, isCustomer, isUserORBuyerType, payload, businessCountry, hasCivilIdDocument, hasSignatureDocument, isSendSignatureFile, civilIdDocument, signatureDocument, documentBody, documentBody, documentsList, documentBody, data, individualData, requestBody, user_2, userListRes;
701
674
  var _f, _g;
702
675
  return __generator(this, function (_h) {
703
676
  switch (_h.label) {
704
677
  case 0:
705
678
  _b = thunkApi.getState(), settings = _b.settings, individual = _b.individual;
706
- _c = individual.data.verify.responseBody || {}, notification = _c.notification, user = _c.user, userList = _c.userList, business = _c.business;
707
- id = (((user === null || user === void 0 ? void 0 : user.is_authorized) ? user : notification === null || notification === void 0 ? void 0 : notification.recipient) || {}).id;
679
+ _c = individual.data.verify.responseBody || {}, recipient = _c.recipient, user = _c.user, userList = _c.userList, business = _c.business;
680
+ id = (((user === null || user === void 0 ? void 0 : user.is_authorized) ? user : recipient) || {}).id;
708
681
  _d = user || {}, objects = _d.objects, ids = _d.ids;
709
682
  isKWOrSAValue = isKWOrSA(settings.data.businessCountry.iso2);
710
683
  occupation = formData.occupation, sourceIncome = formData.sourceIncome, monthlyIncome = formData.monthlyIncome, isPEP = formData.isPEP, isInfluencer = formData.isInfluencer, shareCount = formData.shareCount, shareValue = formData.shareValue, civilID = formData.civilID, signatureFileId = formData.signatureFileId, isAuthorized = formData.isAuthorized;
@@ -793,18 +766,23 @@ export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', funct
793
766
  _h.sent();
794
767
  _h.label = 6;
795
768
  case 6:
769
+ data = undefined, individualData = user || {};
796
770
  requestBody = __assign(__assign({ ids: (ids === null || ids === void 0 ? void 0 : ids.length) ? ids : [id] }, payload), { encryption_contract: [], step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO });
771
+ if (!isDirty) return [3, 8];
797
772
  return [4, API.individualService.updateMultipleIndividual(requestBody)];
798
773
  case 7:
799
774
  data = _h.sent();
800
- individualData = (sortUserList(mapUserList(data === null || data === void 0 ? void 0 : data.individuals)) || [])[0];
775
+ user_2 = (sortUserList(mapUserList(data === null || data === void 0 ? void 0 : data.individuals)) || [])[0];
776
+ individualData = user_2;
777
+ _h.label = 8;
778
+ case 8:
801
779
  userListRes = userList || [];
802
- if (!((user === null || user === void 0 ? void 0 : user.id) === (individualData === null || individualData === void 0 ? void 0 : individualData.id) && !(user === null || user === void 0 ? void 0 : user.is_authorized) && isAuthorized && (business === null || business === void 0 ? void 0 : business.id))) return [3, 9];
780
+ if (!((user === null || user === void 0 ? void 0 : user.id) === (individualData === null || individualData === void 0 ? void 0 : individualData.id) && !(user === null || user === void 0 ? void 0 : user.is_authorized) && isAuthorized && (business === null || business === void 0 ? void 0 : business.id))) return [3, 10];
803
781
  return [4, thunkApi.dispatch(getIndividualList(business === null || business === void 0 ? void 0 : business.id)).unwrap()];
804
- case 8:
805
- userListRes = _h.sent();
806
- _h.label = 9;
807
782
  case 9:
783
+ userListRes = _h.sent();
784
+ _h.label = 10;
785
+ case 10:
808
786
  thunkApi.dispatch(handleNextScreenStep());
809
787
  (_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, requestBody);
810
788
  return [2, { data: data, formData: originalFormData, individualData: individualData, userList: userListRes, isKWOrSACountry: isKWOrSAValue }];
@@ -838,49 +816,39 @@ export var checkEmailAvailability = createAsyncThunk('checkEmailAvailability', f
838
816
  });
839
817
  });
840
818
  export var updateBoardSuccess = createAsyncThunk('individualUpdateBoardSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
841
- var _a, settings, individual, _b, id, infoId, primaryUser, _c, showBoard, mode, payload, data, boardInfoStatus, individualDataRes, _d, is_authorized, userId, type;
842
- var _e, _f, _g, _h, _j, _k, _l, _m;
843
- return __generator(this, function (_o) {
844
- switch (_o.label) {
819
+ var _a, settings, individual, _b, board_id, infoId, _c, showBoard, mode, payload, data, _d, id, iType, boardInfoStatusData;
820
+ var _e, _f, _g, _h, _j, _k, _l, _m, _o;
821
+ return __generator(this, function (_p) {
822
+ switch (_p.label) {
845
823
  case 0:
846
824
  _a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
847
- _b = individual.data.verify.responseBody || {}, id = _b.board_id, infoId = _b.board_info_id, primaryUser = _b.primaryUser;
825
+ _b = individual.data.verify.responseBody || {}, board_id = _b.board_id, infoId = _b.board_info_id;
848
826
  _c = settings.data.appConfig, showBoard = _c.showBoard, mode = _c.mode;
849
- if (!id)
827
+ if (!board_id)
850
828
  return [2];
851
829
  payload = {
852
830
  lang: settings.data.language,
853
- step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_SUCCESS,
854
- id: id
831
+ step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_SUCCESS
855
832
  };
856
- return [4, API.boardService.updateBoardInfo(__assign({ id: id, infoId: infoId }, payload))];
833
+ return [4, API.boardService.updateBoardInfo(__assign({ id: board_id, infoId: infoId }, payload))];
857
834
  case 1:
858
- data = _o.sent();
835
+ data = _p.sent();
859
836
  if (!showBoard && mode === 'content') {
860
837
  (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, {});
861
838
  (_h = (_g = settings.data.appConfig).onFlowCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, { data: data });
862
839
  return [2, { response: __assign({}, data), formData: params }];
863
840
  }
864
- return [4, API.boardService.retrieveBoardInfoStatus(id)];
841
+ _d = ((_j = data === null || data === void 0 ? void 0 : data.notification) === null || _j === void 0 ? void 0 : _j.recipient) || {}, id = _d.id, iType = _d.type;
842
+ return [4, Promise.all([
843
+ API.boardService.retrieveBoardInfoStatus(board_id),
844
+ thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: iType })).unwrap()
845
+ ])];
865
846
  case 2:
866
- boardInfoStatus = _o.sent();
867
- return [4, thunkApi.dispatch(retrieveBoardDetails(id))];
868
- case 3:
869
- _o.sent();
870
- individualDataRes = undefined;
871
- _d = primaryUser || {}, is_authorized = _d.is_authorized, userId = _d.id, type = _d.object;
872
- if (!!is_authorized) return [3, 5];
873
- return [4, thunkApi
874
- .dispatch(retrieveIndividualInfo({ id: userId, type: type, countryCode: settings.data.businessCountry.iso2 }))
875
- .unwrap()];
876
- case 4:
877
- individualDataRes = _o.sent();
878
- _o.label = 5;
879
- case 5:
880
- (_k = (_j = settings.data.appConfig).onStepCompleted) === null || _k === void 0 ? void 0 : _k.call(_j, settings.data.activeScreen.name, {});
881
- (_m = (_l = settings.data.appConfig).onFlowCompleted) === null || _m === void 0 ? void 0 : _m.call(_l, { data: data });
847
+ boardInfoStatusData = (_p.sent())[0];
848
+ (_l = (_k = settings.data.appConfig).onStepCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, settings.data.activeScreen.name, {});
849
+ (_o = (_m = settings.data.appConfig).onFlowCompleted) === null || _o === void 0 ? void 0 : _o.call(_m, { data: data });
882
850
  thunkApi.dispatch(handleNextScreenStep());
883
- return [2, { response: __assign(__assign({}, data), { flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || [] }), formData: params, individualData: individualDataRes === null || individualDataRes === void 0 ? void 0 : individualDataRes.data }];
851
+ return [2, { data: data, flows: (boardInfoStatusData === null || boardInfoStatusData === void 0 ? void 0 : boardInfoStatusData.info) || [] }];
884
852
  }
885
853
  });
886
854
  }); });
@@ -978,8 +946,8 @@ export var individualSlice = createSlice({
978
946
  })
979
947
  .addCase(verifyToken.fulfilled, function (state, action) {
980
948
  state.error = null;
981
- var _a = action.payload, data = _a.data, token = _a.token, boardResponse = _a.boardResponse, userList = _a.userList;
982
- state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.verify.responseBody), boardResponse), { board_id: data.id, userList: userList });
949
+ var _a = action.payload, data = _a.data, token = _a.token, countries = _a.countries, countryCode = _a.countryCode, userList = _a.userList;
950
+ state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { countries: countries, countryCode: countryCode, board_id: data.id, userList: userList });
983
951
  state.data.verify.token = token;
984
952
  })
985
953
  .addCase(verifyToken.rejected, function (state, action) {
@@ -1019,18 +987,12 @@ export var individualSlice = createSlice({
1019
987
  state.error = null;
1020
988
  })
1021
989
  .addCase(verifyLeadOTP.fulfilled, function (state, action) {
1022
- var _a;
1023
990
  state.loading = false;
1024
991
  state.error = null;
1025
- var _b = action.payload, data = _b.data, formData = _b.formData, boardResponse = _b.boardResponse, userList = _b.userList;
1026
- var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
1027
- if (description) {
1028
- state.error = description;
1029
- return;
1030
- }
992
+ var _a = action.payload, data = _a.data, countries = _a.countries, countryCode = _a.countryCode, userList = _a.userList, formData = _a.formData;
1031
993
  state.data.otpData = formData;
1032
994
  state.data.otpData.responseBody = data;
1033
- state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), boardResponse), { userList: userList });
995
+ state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { countries: countries, countryCode: countryCode, userList: userList });
1034
996
  })
1035
997
  .addCase(verifyLeadOTP.rejected, function (state, action) {
1036
998
  state.loading = false;
@@ -1132,7 +1094,7 @@ export var individualSlice = createSlice({
1132
1094
  state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { requestEmailData: data, userList: list });
1133
1095
  })
1134
1096
  .addCase(requestDetailsByEmail.rejected, function (state, action) {
1135
- state.loading = false;
1097
+ state.addOrRequestDetailLoading = false;
1136
1098
  state.error = action.error.message;
1137
1099
  })
1138
1100
  .addCase(retrieveIndividualInfo.pending, function (state) {
@@ -1204,7 +1166,6 @@ export var individualSlice = createSlice({
1204
1166
  state.data.individualData.isAuthorized = is_authorized;
1205
1167
  })
1206
1168
  .addCase(retrieveIndividualInfo.rejected, function (state, action) {
1207
- state.addOrRequestDetailLoading = false;
1208
1169
  state.error = action.error.message;
1209
1170
  })
1210
1171
  .addCase(getIndividualList.pending, function (state) {
@@ -1311,11 +1272,11 @@ export var individualSlice = createSlice({
1311
1272
  state.loading = false;
1312
1273
  state.error = null;
1313
1274
  var _a = action.payload, data = _a.data, formData = _a.formData, individualData = _a.individualData, userList = _a.userList, isKWOrSACountry = _a.isKWOrSACountry;
1314
- state.data.individualData = formData;
1275
+ state.data.individualData = __assign(__assign({}, formData), { civilID: undefined, signatureFileId: undefined });
1315
1276
  state.data.individualData.responseBody = data;
1316
1277
  var user = (state.data.verify.responseBody || {}).user;
1317
1278
  var isSameUser = (user === null || user === void 0 ? void 0 : user.id) === (individualData === null || individualData === void 0 ? void 0 : individualData.id);
1318
- var userInfo = __assign(__assign({}, user), (isSameUser && (individualData === null || individualData === void 0 ? void 0 : individualData.documents) && { documents: individualData === null || individualData === void 0 ? void 0 : individualData.documents }));
1279
+ var userInfo = __assign(__assign({}, user), (isSameUser && individualData && __assign({}, individualData)));
1319
1280
  if (isSameUser && !isKWOrSACountry)
1320
1281
  userInfo = __assign(__assign({}, user), { is_authorized: individualData.is_authorized });
1321
1282
  var list = userList || [];
@@ -1375,18 +1336,8 @@ export var individualSlice = createSlice({
1375
1336
  var _a;
1376
1337
  state.loading = false;
1377
1338
  state.error = null;
1378
- var _b = action.payload || {}, response = _b.response, individualData = _b.individualData;
1379
- var description = (((_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
1380
- if (description) {
1381
- state.error = description;
1382
- return;
1383
- }
1384
- var flows = response.flows;
1385
- var individuals = (state.data.verify.responseBody || {}).individuals;
1386
- var data_state = (((individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) ? individuals : individualData) || {}).data_state;
1387
- state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), { flows: flows }), (data_state && {
1388
- individuals: __assign(__assign({}, individuals), { data_state: data_state })
1389
- }));
1339
+ var _b = action.payload || {}, flows = _b.flows, data = _b.data;
1340
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, recipient: (_a = data === null || data === void 0 ? void 0 : data.notification) === null || _a === void 0 ? void 0 : _a.recipient });
1390
1341
  })
1391
1342
  .addCase(updateBoardSuccess.pending, function (state) {
1392
1343
  state.loading = true;