@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
@@ -134,9 +134,6 @@ export declare type EntityCapitalFormValues = {
134
134
  capitalShareCount: string;
135
135
  capitalShareValue: string;
136
136
  };
137
- export declare type EntityAddressFormValues = {
138
- billingAddress: Record<string, string>;
139
- };
140
137
  export declare type BusinessDataFormValues = {
141
138
  brandName: string;
142
139
  licenseNumber: string;
@@ -71,7 +71,6 @@ export declare type UpdateEntityBody = {
71
71
  id: string;
72
72
  action: string;
73
73
  }>;
74
- billing_address?: Record<string, string>;
75
74
  legal_name?: {
76
75
  ar?: string;
77
76
  en?: string;
@@ -141,9 +141,6 @@ declare const API: {
141
141
  addFilesToExistingDocument: ({ id, ...data }: DocumentBody) => Promise<any>;
142
142
  removeFilesFromDocument: ({ id, ...data }: DocumentBody) => Promise<import("axios").AxiosResponse<any, any>>;
143
143
  };
144
- addressService: {
145
- retrieveAddressFormat: (countryCode: string) => Promise<any>;
146
- };
147
144
  };
148
145
  export type { ValidateOperatorBody, CreateAuthBody, ExpressCreateAccountBody, VerifyAuthBody, CreateLeadBody, UpdateLeadBody, LeadVerifyBody, LeadOTPVerifyBody, CheckEmailBody, CheckBrandBody, LeadIdentityUpdateBody, EntityInfoBody, CreateAccountBody, EntityBankUpdateBody, CreatePasswordBody, BrandListBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, UpdateBoardBody, UpdateBrandBody, DataElementBody, UploadFileBody, UpdateEntityBody, DocumentUpdateBody, DocumentInfo, VerifyAuthExpressOTPBody, UpdateIndividualBody, UpdateEntityActivityBody, UpdateEntityCapitalBody, BankDocumentInfo, GetUserListBody, GetIndividualListBody, RequestEmailBody, DocumentBody, UpdateEntityAOAFileBody };
149
146
  export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, axiosInstance, getAxiosHeaders };
@@ -15,7 +15,6 @@ import { userService } from './user';
15
15
  import { brandService } from './brand';
16
16
  import { fileService } from './file';
17
17
  import { documentService } from './document';
18
- import { addressService } from './address';
19
18
  var API = {
20
19
  locationService: locationService,
21
20
  operatorService: operatorService,
@@ -32,8 +31,7 @@ var API = {
32
31
  userService: userService,
33
32
  brandService: brandService,
34
33
  fileService: fileService,
35
- documentService: documentService,
36
- addressService: addressService
34
+ documentService: documentService
37
35
  };
38
36
  export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, axiosInstance, getAxiosHeaders };
39
37
  export default API;
@@ -391,7 +391,6 @@
391
391
  "try_again": "حاول مرة أخرى",
392
392
  "file_delete_error": "حدث خطأ ما في حذف الملف. حاول مرة اخرى",
393
393
  "file_download_error": "حدث خطأ ما في تحميل الملف. حاول مرة اخرى",
394
- "is_required": " مطلوب",
395
394
  "title_brand_logo": "لوجو العلامة التجارية",
396
395
  "description_brand_logo": "JPG or PNG files up to 4mb."
397
396
  }
@@ -421,7 +421,6 @@
421
421
  "try_again": "Try again",
422
422
  "file_delete_error": "Something went wrong with deleting file. Please try again",
423
423
  "file_download_error": "Something went wrong with downloading file. Please try again",
424
- "is_required": " is required",
425
424
  "title_brand_logo": "Brand Logo",
426
425
  "description_brand_logo": "JPG or PNG files up to 4mb."
427
426
  }
@@ -465,33 +465,27 @@ export var ENTITY_SCREENS_NAVIGATION = [
465
465
  },
466
466
  {
467
467
  name: 'ENTITY_CAPITAL_STEP',
468
- next: 'ENTITY_ADDRESS_STEP',
468
+ next: 'ENTITY_DETAILS_SUCCESS_STEP',
469
469
  prev: 'ENTITY_NAME_STEP',
470
470
  order: 3
471
471
  },
472
- {
473
- name: 'ENTITY_ADDRESS_STEP',
474
- next: 'ENTITY_DETAILS_SUCCESS_STEP',
475
- prev: 'ENTITY_CAPITAL_STEP',
476
- order: 4
477
- },
478
472
  {
479
473
  name: 'ENTITY_DETAILS_SUCCESS_STEP',
480
474
  next: 'ENTITY_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
481
475
  prev: 'ENTITY_CAPITAL_STEP',
482
- order: 5
476
+ order: 4
483
477
  },
484
478
  {
485
479
  name: 'ENTITY_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
486
480
  next: 'ENTITY_RESET_PASSWORD_SUCCESS',
487
481
  prev: '',
488
- order: 6
482
+ order: 5
489
483
  },
490
484
  {
491
485
  name: 'ENTITY_RESET_PASSWORD_SUCCESS',
492
486
  next: '',
493
487
  prev: '',
494
- order: 7
488
+ order: 5
495
489
  }
496
490
  ];
497
491
  export var BRAND_SCREENS_NAVIGATION = [
@@ -17,7 +17,6 @@ export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
17
17
  contact: any;
18
18
  business: any;
19
19
  individuals: any;
20
- flows: any;
21
20
  };
22
21
  token: string;
23
22
  }, VerifyLeadTokenProps, {}>;
@@ -55,10 +55,10 @@ import { hasNoneEditableValue, sleep } from '../../../utils';
55
55
  export var verifyLeadToken = createAsyncThunk('bankVerifyLeadToken', 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, boardInfoData, boardData, board_id, countryIso2, info, hasBankCompleted;
59
- var _b, _c, _d, _e;
60
- return __generator(this, function (_f) {
61
- switch (_f.label) {
58
+ var payload, data, boardData, board_id, 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,37 +66,29 @@ export var verifyLeadToken = createAsyncThunk('bankVerifyLeadToken', function (_
66
66
  };
67
67
  return [4, API.leadService.verifyLeadToken(payload)];
68
68
  case 1:
69
- data = (_f.sent()).data;
69
+ data = (_e.sent()).data;
70
70
  boardData = undefined;
71
- if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 5];
71
+ if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 4];
72
72
  board_id = data === null || data === void 0 ? void 0 : data.id;
73
- if (!board_id) return [3, 4];
74
- return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
75
- case 2:
76
- boardInfoData = _f.sent();
73
+ if (!board_id) return [3, 3];
77
74
  return [4, API.boardService.retrieveBoardDetails(board_id)];
75
+ case 2:
76
+ boardData = _e.sent();
77
+ _e.label = 3;
78
78
  case 3:
79
- boardData = _f.sent();
80
- _f.label = 4;
81
- case 4:
82
79
  countryIso2 = (_b = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _b === void 0 ? void 0 : _b.country;
83
80
  if (countryIso2)
84
81
  thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
85
- info = (boardInfoData || {}).info;
86
82
  if (isInternally)
87
83
  data.step_name = BANK_STEP_NAMES.BANK_INFO;
88
- hasBankCompleted = ((_c = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'bank'; })) === null || _c === void 0 ? void 0 : _c.status) === 'completed';
89
84
  if (data.step_name === BANK_STEP_NAMES.PHONE_AUTH) {
90
85
  thunkApi.dispatch(handleCurrentActiveScreen('BANK_VERIFY_STEP'));
91
86
  }
92
- else if (hasBankCompleted) {
93
- thunkApi.dispatch(handleNextScreenStep('BANK_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
94
- }
95
87
  else if (data.step_name === BANK_STEP_NAMES.BANK_INFO) {
96
88
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('BANK_BANK_DETAILS_STEP')); });
97
89
  }
98
- _f.label = 5;
99
- case 5: return [2, {
90
+ _e.label = 4;
91
+ case 4: return [2, {
100
92
  data: data,
101
93
  boardResponse: {
102
94
  user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
@@ -104,11 +96,10 @@ export var verifyLeadToken = createAsyncThunk('bankVerifyLeadToken', function (_
104
96
  bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
105
97
  entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
106
98
  merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
107
- name: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _d === void 0 ? void 0 : _d.names,
108
- contact: (_e = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _e === void 0 ? void 0 : _e.contact,
99
+ name: (_c = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _c === void 0 ? void 0 : _c.names,
100
+ contact: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _d === void 0 ? void 0 : _d.contact,
109
101
  business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
110
- individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
111
- flows: (boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || []
102
+ individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals
112
103
  },
113
104
  token: token
114
105
  }];
@@ -134,14 +125,13 @@ export var resendOTP = createAsyncThunk('resendOTPBank', function (params, thunk
134
125
  });
135
126
  }); });
136
127
  export var verifyBankLeadOTP = createAsyncThunk('verifyBankLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
137
- var _a, bank, settings, responseBody, flows, payload, data, hasBankCompleted;
138
- var _b, _c, _d, _e;
139
- return __generator(this, function (_f) {
140
- switch (_f.label) {
128
+ var _a, bank, settings, responseBody, payload, data;
129
+ var _b, _c, _d;
130
+ return __generator(this, function (_e) {
131
+ switch (_e.label) {
141
132
  case 0:
142
133
  _a = thunkApi.getState(), bank = _a.bank, settings = _a.settings;
143
134
  responseBody = bank.data.verify.responseBody;
144
- flows = (responseBody || {}).flows;
145
135
  payload = {
146
136
  data: params.otp,
147
137
  service_name: (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _b === void 0 ? void 0 : _b.service_name,
@@ -151,16 +141,10 @@ export var verifyBankLeadOTP = createAsyncThunk('verifyBankLeadOTP', function (p
151
141
  };
152
142
  return [4, API.leadService.verifyLeadOTP(payload)];
153
143
  case 1:
154
- data = (_f.sent()).data;
144
+ data = (_e.sent()).data;
155
145
  if (!data.errors) {
156
146
  (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
157
- hasBankCompleted = ((_e = flows === null || flows === void 0 ? void 0 : flows.find(function (flow) { return flow.name === 'bank'; })) === null || _e === void 0 ? void 0 : _e.status) === 'completed';
158
- if (hasBankCompleted) {
159
- thunkApi.dispatch(handleNextScreenStep('BANK_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
160
- }
161
- else {
162
- sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('BANK_BANK_DETAILS_STEP')); });
163
- }
147
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('BANK_BANK_DETAILS_STEP')); });
164
148
  }
165
149
  return [2, { data: data, formData: params }];
166
150
  }
@@ -1,5 +1,5 @@
1
1
  import { RootState } from '../../../app/store';
2
- import { ActionState, EntityAddressFormValues, EntityCapitalFormValues, EntityNameFormValues, FlowsTypes, OTPFormValues, ResponseData, SharedState } from '../../../@types';
2
+ import { ActionState, EntityCapitalFormValues, EntityNameFormValues, FlowsTypes, OTPFormValues, ResponseData, SharedState } from '../../../@types';
3
3
  interface VerifyLeadTokenProps {
4
4
  token: string;
5
5
  isInternally?: boolean;
@@ -16,7 +16,6 @@ export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
16
16
  contact: any;
17
17
  individuals: any;
18
18
  business: any;
19
- flows: any;
20
19
  entityTypes: any;
21
20
  };
22
21
  token: string;
@@ -36,7 +35,6 @@ export declare const verifyEntityLeadOTP: import("@reduxjs/toolkit").AsyncThunk<
36
35
  contact: any;
37
36
  individuals: any;
38
37
  business: any;
39
- flows: any;
40
38
  entityTypes: any;
41
39
  };
42
40
  formData: OTPFormValues;
@@ -51,12 +49,7 @@ export declare const updateEntityName: import("@reduxjs/toolkit").AsyncThunk<{
51
49
  export declare const updateEntityCapital: import("@reduxjs/toolkit").AsyncThunk<{
52
50
  data: any;
53
51
  formData: EntityCapitalFormValues;
54
- addressFormat: any;
55
52
  }, EntityCapitalFormValues, {}>;
56
- export declare const updateEntityAddress: import("@reduxjs/toolkit").AsyncThunk<{
57
- data: any;
58
- formData: EntityAddressFormValues;
59
- }, EntityAddressFormValues, {}>;
60
53
  export declare const updateBoardSuccess: import("@reduxjs/toolkit").AsyncThunk<{
61
54
  response: any;
62
55
  formData: void;
@@ -69,7 +62,6 @@ export interface EntityData {
69
62
  otpData: OTPFormValues & ResponseData;
70
63
  entityNameData: EntityNameFormValues & ResponseData;
71
64
  entityCapitalData: EntityCapitalFormValues & ResponseData;
72
- entityAddressData: EntityAddressFormValues & ResponseData;
73
65
  flowName: FlowsTypes;
74
66
  }
75
67
  export interface EntityState extends SharedState<EntityData> {
@@ -67,10 +67,10 @@ import { convertNumbers2English, getRecentDocumentBasedOnPurpose, hasVerifiedVal
67
67
  export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function (_a, thunkApi) {
68
68
  var token = _a.token, isInternally = _a.isInternally;
69
69
  return __awaiter(void 0, void 0, void 0, function () {
70
- var payload, data, boardData, entityData, boardInfoData, entityTypes, countryIso2, board_id, entityId, info, hasEntityCompleted;
71
- var _b, _c, _d, _e;
72
- return __generator(this, function (_f) {
73
- switch (_f.label) {
70
+ var payload, data, boardData, entityData, entityTypes, countryIso2, board_id, entityId;
71
+ var _b, _c, _d;
72
+ return __generator(this, function (_e) {
73
+ switch (_e.label) {
74
74
  case 0:
75
75
  payload = {
76
76
  service_name: 'tap_email',
@@ -78,9 +78,9 @@ export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function
78
78
  };
79
79
  return [4, API.leadService.verifyLeadToken(payload)];
80
80
  case 1:
81
- data = (_f.sent()).data;
81
+ data = (_e.sent()).data;
82
82
  countryIso2 = undefined;
83
- if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 9];
83
+ if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 7];
84
84
  if (isInternally)
85
85
  data.step_name = ENTITY_STEP_NAMES.ENTITY_INFO;
86
86
  if (data === null || data === void 0 ? void 0 : data.country_code) {
@@ -88,40 +88,32 @@ export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function
88
88
  if (countryIso2)
89
89
  thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
90
90
  }
91
- if (!(data.step_name !== ENTITY_STEP_NAMES.PHONE_AUTH)) return [3, 9];
91
+ if (!(data.step_name !== ENTITY_STEP_NAMES.PHONE_AUTH)) return [3, 7];
92
92
  board_id = data === null || data === void 0 ? void 0 : data.id;
93
- if (!board_id) return [3, 4];
94
- return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
95
- case 2:
96
- boardInfoData = _f.sent();
93
+ if (!board_id) return [3, 3];
97
94
  return [4, API.boardService.retrieveBoardDetails(board_id)];
95
+ case 2:
96
+ boardData = _e.sent();
97
+ _e.label = 3;
98
98
  case 3:
99
- boardData = _f.sent();
100
- _f.label = 4;
101
- case 4:
102
99
  entityId = (_b = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _b === void 0 ? void 0 : _b.id;
103
- if (!entityId) return [3, 6];
100
+ if (!entityId) return [3, 5];
104
101
  return [4, API.entityService.retrieveEntity(entityId)];
102
+ case 4:
103
+ entityData = _e.sent();
104
+ _e.label = 5;
105
105
  case 5:
106
- entityData = _f.sent();
107
- _f.label = 6;
108
- case 6:
109
106
  if (!countryIso2) {
110
107
  countryIso2 = entityData.country;
111
108
  if (countryIso2)
112
109
  thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
113
110
  }
114
- info = (boardInfoData || {}).info;
115
- hasEntityCompleted = ((_c = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'entity'; })) === null || _c === void 0 ? void 0 : _c.status) === 'completed';
116
- if (!hasEntityCompleted) return [3, 7];
117
- thunkApi.dispatch(handleNextScreenStep('ENTITY_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
118
- return [3, 9];
119
- case 7: return [4, API.entityService.retrieveEntityType()];
120
- case 8:
121
- entityTypes = _f.sent();
111
+ return [4, API.entityService.retrieveEntityType()];
112
+ case 6:
113
+ entityTypes = _e.sent();
122
114
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('ENTITY_NAME_STEP')); });
123
- _f.label = 9;
124
- case 9: return [2, {
115
+ _e.label = 7;
116
+ case 7: return [2, {
125
117
  data: data,
126
118
  boardResponse: {
127
119
  user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
@@ -129,11 +121,10 @@ export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function
129
121
  bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
130
122
  entity: entityData === null || entityData === void 0 ? void 0 : entityData.entity,
131
123
  merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
132
- name: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _d === void 0 ? void 0 : _d.names,
133
- contact: (_e = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _e === void 0 ? void 0 : _e.contact,
124
+ name: (_c = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _c === void 0 ? void 0 : _c.names,
125
+ contact: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _d === void 0 ? void 0 : _d.contact,
134
126
  individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
135
127
  business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
136
- flows: (boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || [],
137
128
  entityTypes: entityTypes
138
129
  },
139
130
  token: token
@@ -160,10 +151,10 @@ export var resendOTP = createAsyncThunk('entityResendOTP', function (params, thu
160
151
  });
161
152
  }); });
162
153
  export var verifyEntityLeadOTP = createAsyncThunk('verifyEntityLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
163
- var _a, entity, settings, responseBody, payload, data, boardData, entityData, entityTypes, boardInfoData, board_id, entityId, info, hasEntityCompleted;
164
- var _b, _c, _d, _e, _f, _g, _h;
165
- return __generator(this, function (_j) {
166
- switch (_j.label) {
154
+ var _a, entity, settings, responseBody, payload, data, boardData, entityData, entityTypes, board_id, entityId;
155
+ var _b, _c, _d, _e, _f, _g;
156
+ return __generator(this, function (_h) {
157
+ switch (_h.label) {
167
158
  case 0:
168
159
  _a = thunkApi.getState(), entity = _a.entity, settings = _a.settings;
169
160
  responseBody = entity.data.verify.responseBody;
@@ -176,38 +167,30 @@ export var verifyEntityLeadOTP = createAsyncThunk('verifyEntityLeadOTP', functio
176
167
  };
177
168
  return [4, API.leadService.verifyLeadOTP(payload)];
178
169
  case 1:
179
- data = (_j.sent()).data;
180
- boardInfoData = undefined;
181
- if (!!data.errors) return [3, 9];
170
+ data = (_h.sent()).data;
171
+ entityTypes = undefined;
172
+ if (!!data.errors) return [3, 7];
182
173
  board_id = responseBody === null || responseBody === void 0 ? void 0 : responseBody.id;
183
- if (!board_id) return [3, 4];
184
- return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
185
- case 2:
186
- boardInfoData = _j.sent();
174
+ if (!board_id) return [3, 3];
187
175
  return [4, API.boardService.retrieveBoardDetails(board_id)];
176
+ case 2:
177
+ boardData = _h.sent();
178
+ _h.label = 3;
188
179
  case 3:
189
- boardData = _j.sent();
190
- _j.label = 4;
191
- case 4:
192
180
  entityId = (_c = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _c === void 0 ? void 0 : _c.id;
193
- if (!entityId) return [3, 6];
181
+ if (!entityId) return [3, 5];
194
182
  return [4, API.entityService.retrieveEntity(entityId)];
183
+ case 4:
184
+ entityData = _h.sent();
185
+ _h.label = 5;
195
186
  case 5:
196
- entityData = _j.sent();
197
- _j.label = 6;
198
- case 6:
199
187
  (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, { otp: params.otp });
200
- info = (boardInfoData || {}).info;
201
- hasEntityCompleted = ((_f = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'entity'; })) === null || _f === void 0 ? void 0 : _f.status) === 'completed';
202
- if (!hasEntityCompleted) return [3, 7];
203
- thunkApi.dispatch(handleNextScreenStep('ENTITY_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
204
- return [3, 9];
205
- case 7: return [4, API.entityService.retrieveEntityType()];
206
- case 8:
207
- entityTypes = _j.sent();
188
+ return [4, API.entityService.retrieveEntityType()];
189
+ case 6:
190
+ entityTypes = _h.sent();
208
191
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('ENTITY_NAME_STEP')); });
209
- _j.label = 9;
210
- case 9: return [2, {
192
+ _h.label = 7;
193
+ case 7: return [2, {
211
194
  data: data,
212
195
  boardResponse: {
213
196
  user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
@@ -215,11 +198,10 @@ export var verifyEntityLeadOTP = createAsyncThunk('verifyEntityLeadOTP', functio
215
198
  bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
216
199
  entity: entityData === null || entityData === void 0 ? void 0 : entityData.entity,
217
200
  merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
218
- name: (_g = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _g === void 0 ? void 0 : _g.names,
219
- contact: (_h = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _h === void 0 ? void 0 : _h.contact,
201
+ name: (_f = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _f === void 0 ? void 0 : _f.names,
202
+ contact: (_g = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _g === void 0 ? void 0 : _g.contact,
220
203
  individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
221
204
  business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
222
- flows: (boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || [],
223
205
  entityTypes: entityTypes
224
206
  },
225
207
  formData: params
@@ -330,7 +312,7 @@ export var updateEntityName = createAsyncThunk('entityUpdateEntityName', functio
330
312
  });
331
313
  }); });
332
314
  export var updateEntityCapital = createAsyncThunk('entityUpdateEntityCapital', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
333
- var _a, settings, entity, _b, id, data_status, isCapitalPaidNonEditable, isCapitalShareCountNonEditable, isCapitalShareValueNonEditable, isActivitiesNonEditable, hasCapitalShares, isCapitalNonEditable, activities, payload, data, list, workAddressFormat;
315
+ var _a, settings, entity, _b, id, data_status, isCapitalPaidNonEditable, isCapitalShareCountNonEditable, isCapitalShareValueNonEditable, isActivitiesNonEditable, hasCapitalShares, isCapitalNonEditable, activities, payload, data;
334
316
  var _c, _d, _e, _f;
335
317
  return __generator(this, function (_g) {
336
318
  switch (_g.label) {
@@ -358,34 +340,8 @@ export var updateEntityCapital = createAsyncThunk('entityUpdateEntityCapital', f
358
340
  return [4, API.entityService.updateEntity(payload)];
359
341
  case 1:
360
342
  data = _g.sent();
361
- return [4, API.addressService.retrieveAddressFormat(settings.data.businessCountry.iso2)];
362
- case 2:
363
- list = (_g.sent()).list;
364
- workAddressFormat = (list || []).find(function (address) { return address.type.code === 'work'; }).format;
365
343
  thunkApi.dispatch(handleNextScreenStep());
366
344
  (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, id);
367
- return [2, { data: data, formData: params, addressFormat: workAddressFormat }];
368
- }
369
- });
370
- }); });
371
- export var updateEntityAddress = createAsyncThunk('entityUpdateEntityAddress', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
372
- var _a, settings, entity, _b, id, data_status, isAddressEditable, payload, data;
373
- var _c, _d, _e;
374
- return __generator(this, function (_f) {
375
- switch (_f.label) {
376
- case 0:
377
- _a = thunkApi.getState(), settings = _a.settings, entity = _a.entity;
378
- _b = ((_c = entity.data.verify.responseBody) === null || _c === void 0 ? void 0 : _c.entity) || {}, id = _b.id, data_status = _b.data_status;
379
- isAddressEditable = true;
380
- payload = {
381
- id: id,
382
- billing_address: isAddressEditable ? params.billingAddress : undefined
383
- };
384
- return [4, API.entityService.updateEntity(payload)];
385
- case 1:
386
- data = _f.sent();
387
- thunkApi.dispatch(handleNextScreenStep());
388
- (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, id);
389
345
  return [2, { data: data, formData: params }];
390
346
  }
391
347
  });
@@ -449,9 +405,6 @@ var initialState = {
449
405
  capitalPaid: '',
450
406
  capitalShareCount: '',
451
407
  capitalShareValue: ''
452
- },
453
- entityAddressData: {
454
- billingAddress: {}
455
408
  }
456
409
  }
457
410
  };
@@ -499,7 +452,7 @@ export var entitySlice = createSlice({
499
452
  state.data.verify.token = token;
500
453
  var _f = boardResponse || {}, entity = _f.entity, entityTypes = _f.entityTypes;
501
454
  if (entity) {
502
- var _g = entity || {}, license = _g.license, type = _g.type, capital = _g.capital, activities = _g.activities, legal_name = _g.legal_name, billing_address = _g.billing_address, country = _g.country;
455
+ var _g = entity || {}, license = _g.license, type = _g.type, capital = _g.capital, activities = _g.activities, legal_name = _g.legal_name;
503
456
  var legalName = legal_name;
504
457
  var licenseNumber = license === null || license === void 0 ? void 0 : license.number;
505
458
  var unifiedNumber = (_b = license === null || license === void 0 ? void 0 : license.additional_info) === null || _b === void 0 ? void 0 : _b.unified_number;
@@ -538,10 +491,6 @@ export var entitySlice = createSlice({
538
491
  state.data.entityCapitalData.capitalShareCount = shares === null || shares === void 0 ? void 0 : shares.count;
539
492
  if (shares === null || shares === void 0 ? void 0 : shares.value)
540
493
  state.data.entityCapitalData.capitalShareValue = shares === null || shares === void 0 ? void 0 : shares.value;
541
- var billingAddress = { country: country };
542
- if (billing_address)
543
- billingAddress = __assign(__assign({}, billing_address), { country: (billing_address === null || billing_address === void 0 ? void 0 : billing_address.country) || country });
544
- state.data.entityAddressData.billingAddress = billingAddress;
545
494
  state.data.entityNameData.responseBody = __assign(__assign({}, state.data.entityNameData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id });
546
495
  }
547
496
  })
@@ -584,7 +533,7 @@ export var entitySlice = createSlice({
584
533
  state.data.otpData.responseBody = data;
585
534
  state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), boardResponse);
586
535
  var _f = boardResponse || {}, entity = _f.entity, entityTypes = _f.entityTypes;
587
- var _g = entity || {}, license = _g.license, type = _g.type, capital = _g.capital, activities = _g.activities, legal_name = _g.legal_name, billing_address = _g.billing_address, country = _g.country;
536
+ var _g = entity || {}, license = _g.license, type = _g.type, capital = _g.capital, activities = _g.activities, legal_name = _g.legal_name;
588
537
  var legalName = legal_name;
589
538
  var licenseNumber = license === null || license === void 0 ? void 0 : license.number;
590
539
  var unifiedNumber = (_b = license === null || license === void 0 ? void 0 : license.additional_info) === null || _b === void 0 ? void 0 : _b.unified_number;
@@ -623,10 +572,6 @@ export var entitySlice = createSlice({
623
572
  state.data.entityCapitalData.capitalShareCount = shares === null || shares === void 0 ? void 0 : shares.count;
624
573
  if (shares === null || shares === void 0 ? void 0 : shares.value)
625
574
  state.data.entityCapitalData.capitalShareValue = shares === null || shares === void 0 ? void 0 : shares.value;
626
- var billingAddress = { country: country };
627
- if (billing_address)
628
- billingAddress = __assign(__assign({}, billing_address), { country: (billing_address === null || billing_address === void 0 ? void 0 : billing_address.country) || country });
629
- state.data.entityAddressData.billingAddress = billingAddress;
630
575
  state.data.entityNameData = __assign(__assign({}, state.data.entityNameData), { responseBody: __assign(__assign({}, state.data.entityNameData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id }) });
631
576
  })
632
577
  .addCase(verifyEntityLeadOTP.rejected, function (state, action) {
@@ -659,29 +604,13 @@ export var entitySlice = createSlice({
659
604
  .addCase(updateEntityCapital.fulfilled, function (state, action) {
660
605
  state.loading = false;
661
606
  state.error = null;
662
- var _a = action.payload, data = _a.data, formData = _a.formData, addressFormat = _a.addressFormat;
607
+ var _a = action.payload, data = _a.data, formData = _a.formData;
663
608
  state.data.entityCapitalData = formData;
664
609
  state.data.entityCapitalData.responseBody = __assign(__assign({}, state.data.entityCapitalData.responseBody), { data: data });
665
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { addressFormat: addressFormat });
666
610
  })
667
611
  .addCase(updateEntityCapital.rejected, function (state, action) {
668
612
  state.loading = false;
669
613
  state.error = action.error.message;
670
- })
671
- .addCase(updateEntityAddress.pending, function (state) {
672
- state.loading = true;
673
- state.error = null;
674
- })
675
- .addCase(updateEntityAddress.fulfilled, function (state, action) {
676
- state.loading = false;
677
- state.error = null;
678
- var _a = action.payload, data = _a.data, formData = _a.formData;
679
- state.data.entityAddressData = __assign(__assign({}, state.data.entityAddressData), formData);
680
- state.data.entityAddressData.responseBody = __assign(__assign({}, state.data.entityAddressData.responseBody), { data: data });
681
- })
682
- .addCase(updateEntityAddress.rejected, function (state, action) {
683
- state.loading = false;
684
- state.error = action.error.message;
685
614
  })
686
615
  .addCase(retrieveBoardDetails.pending, function (state) {
687
616
  state.error = null;
@@ -21,7 +21,6 @@ export declare const verifyToken: import("@reduxjs/toolkit").AsyncThunk<{
21
21
  countryCode: any;
22
22
  notification: any;
23
23
  business: any;
24
- flows: any;
25
24
  };
26
25
  token: string;
27
26
  }, VerifyLeadTokenProps, {}>;
@@ -79,7 +78,6 @@ export declare const verifyLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
79
78
  countryCode: any;
80
79
  notification: any;
81
80
  business: any;
82
- flows: any;
83
81
  };
84
82
  formData: {
85
83
  otp: string;