@tap-payments/auth-jsconnect 2.6.9-test → 2.6.12-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.
@@ -220,7 +220,6 @@ export interface LibConfig extends LibCallbacks {
220
220
  redirectUrl?: string;
221
221
  data?: Array<string>;
222
222
  mode?: 'popup' | 'page';
223
- authId?: string;
224
223
  boardMaturity?: boolean;
225
224
  }
226
225
  export interface OSDetails {
@@ -6,5 +6,6 @@ declare const countryService: {
6
6
  list: never[];
7
7
  };
8
8
  getCities: (data: GetCitiesBody) => Promise<any>;
9
+ getCurrency: (countryCode: string) => Promise<any>;
9
10
  };
10
11
  export { countryService };
@@ -15,8 +15,15 @@ var getCities = function (data) {
15
15
  data: data
16
16
  });
17
17
  };
18
+ var getCurrency = function (countryCode) {
19
+ return httpClient({
20
+ method: 'get',
21
+ url: "".concat(ENDPOINT_PATHS.CURRENCY, "/").concat(countryCode)
22
+ });
23
+ };
18
24
  var countryService = {
19
25
  getCountries: getCountries,
20
- getCities: getCities
26
+ getCities: getCities,
27
+ getCurrency: getCurrency
21
28
  };
22
29
  export { countryService };
@@ -27,6 +27,7 @@ declare const API: {
27
27
  list: never[];
28
28
  };
29
29
  getCities: (data: import("./country").GetCitiesBody) => Promise<any>;
30
+ getCurrency: (countryCode: string) => Promise<any>;
30
31
  };
31
32
  authService: {
32
33
  createAuth: (data: CreateAuthBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
@@ -26,6 +26,7 @@ export interface SettingsData {
26
26
  merchant?: MerchantInfo;
27
27
  isMaturityExpress: boolean;
28
28
  isHijri: boolean;
29
+ authId?: string;
29
30
  }
30
31
  export interface SettingsState extends SharedState<SettingsData> {
31
32
  internalLoading: boolean;
@@ -146,13 +146,14 @@ export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', funct
146
146
  });
147
147
  }); });
148
148
  export var onCloseComplete = createAsyncThunk('settings/onCloseComplete', function (merchantId, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
149
- var settings, _a, postURL, redirectUrl, authId, bi, list, id, body, data, urlQueryStart;
149
+ var settings, _a, appConfig, authId, postURL, redirectUrl, bi, list, id, body, data, urlQueryStart;
150
150
  var _b, _c, _d, _e;
151
151
  return __generator(this, function (_f) {
152
152
  switch (_f.label) {
153
153
  case 0:
154
154
  settings = thunkApi.getState().settings;
155
- _a = settings.data.appConfig, postURL = _a.postURL, redirectUrl = _a.redirectUrl, authId = _a.authId;
155
+ _a = settings.data, appConfig = _a.appConfig, authId = _a.authId;
156
+ postURL = appConfig.postURL, redirectUrl = appConfig.redirectUrl;
156
157
  bi = settings.data.deviceInfo.browser.browser_id;
157
158
  return [4, API.entityService.getTerminalListUsingMerchantId(merchantId)];
158
159
  case 1:
@@ -189,6 +190,7 @@ var initialState = {
189
190
  internalLoading: true,
190
191
  data: {
191
192
  boardMaturity: true,
193
+ authId: '',
192
194
  open: true,
193
195
  isTapOrigin: true,
194
196
  isMaturityExpress: false,
@@ -209,7 +211,7 @@ export var settingsSlice = createSlice({
209
211
  initialState: initialState,
210
212
  reducers: {
211
213
  storeAuthId: function (state, action) {
212
- state.data.appConfig.authId = action.payload;
214
+ state.data.authId = action.payload;
213
215
  },
214
216
  updateInternalLoading: function (state, action) {
215
217
  state.internalLoading = action.payload;
@@ -55,4 +55,5 @@ export declare const ENDPOINT_PATHS: {
55
55
  SEGMENT_TECH: string;
56
56
  MERCHANT: string;
57
57
  TERMINAL: string;
58
+ CURRENCY: string;
58
59
  };
@@ -3,6 +3,7 @@ var PRODUCTION_BASE_URL = 'https://connect-mw.tap.company/middleware';
3
3
  var DEV_BASE_URL = 'https://connect-mw.dev.tap.company/middleware';
4
4
  var API_BUSINESS_COUNTRIES = 'https://godata.sandbox.tap.company/api/v1/business/country/list';
5
5
  var API_COUNTRIES = 'https://utilities.tap.company/api/v1/country/list';
6
+ var CURRENCY_PATH = 'https://utilities.tap.company/api/v1/currency/iso';
6
7
  var CITIES_PATH = '/country/state/city/list';
7
8
  var IP_PATH = '/ip';
8
9
  var OPERATOR_PATH = '/operator';
@@ -110,5 +111,6 @@ export var ENDPOINT_PATHS = {
110
111
  SEGMENT_PROFIT: SEGMENT_PROFIT_PATH,
111
112
  SEGMENT_TECH: SEGMENT_TECH_PATH,
112
113
  MERCHANT: MERCHANT_PATH,
113
- TERMINAL: TERMINAL_PATH
114
+ TERMINAL: TERMINAL_PATH,
115
+ CURRENCY: CURRENCY_PATH
114
116
  };
@@ -76,6 +76,7 @@ export declare const updateBrand: import("@reduxjs/toolkit").AsyncThunk<{
76
76
  export declare const updateSegmentBrand: import("@reduxjs/toolkit").AsyncThunk<{
77
77
  data: any;
78
78
  formData: BrandSegmentFormValues;
79
+ currencyData: any;
79
80
  }, AsyncThunkParams<BrandSegmentFormValues>, {}>;
80
81
  export declare const retrieveEntityList: import("@reduxjs/toolkit").AsyncThunk<any, {
81
82
  leadId: string;
@@ -105,6 +106,7 @@ export interface BrandData {
105
106
  brandSegmentData: BrandSegmentFormValues & ResponseData;
106
107
  brandActivities: BrandActivitiesFormValues & ResponseData;
107
108
  flowName: FlowsTypes;
109
+ currency: string;
108
110
  }
109
111
  export interface BrandState extends SharedState<BrandData> {
110
112
  customLoading?: boolean;
@@ -375,7 +375,7 @@ export var updateBrand = createAsyncThunk('brandUpdateBrand', function (_a, thun
375
375
  export var updateSegmentBrand = createAsyncThunk('brandUpdateBrandSegment', function (_a, thunkApi) {
376
376
  var formData = _a.formData, originalFormData = _a.originalFormData;
377
377
  return __awaiter(void 0, void 0, void 0, function () {
378
- var _b, settings, brand, brandRes, _c, id, data_status, isSegmentLocationNonEditable, isSegmentProfitNonEditable, isSegmentTechNonEditable, isSegmentTeamsNonEditable, segmentLocation, segmentProfit, segmentTech, teamSize, segmentLocationId, segmentProfitId, segmentTechId, teamSizeId, hasSegment, requestBody, brandData, activities, activityList;
378
+ var _b, settings, brand, brandRes, _c, id, data_status, isSegmentLocationNonEditable, isSegmentProfitNonEditable, isSegmentTechNonEditable, isSegmentTeamsNonEditable, segmentLocation, segmentProfit, segmentTech, teamSize, segmentLocationId, segmentProfitId, segmentTechId, teamSizeId, hasSegment, requestBody, brandData, currencyData, activities, activityList;
379
379
  var _d, _e, _f;
380
380
  return __generator(this, function (_g) {
381
381
  switch (_g.label) {
@@ -399,23 +399,26 @@ export var updateSegmentBrand = createAsyncThunk('brandUpdateBrandSegment', func
399
399
  return [4, API.brandService.updateBrandInfo(requestBody)];
400
400
  case 1:
401
401
  brandData = (_g.sent()).brand;
402
+ return [4, API.countryService.getCurrency(settings.data.businessCountry.iso2)];
403
+ case 2:
404
+ currencyData = _g.sent();
402
405
  activities = (((_d = brand.data.verify.responseBody) === null || _d === void 0 ? void 0 : _d.entity) || {}).activities;
403
406
  return [4, thunkApi.dispatch(retrieveDataList())];
404
- case 2:
407
+ case 3:
405
408
  _g.sent();
406
409
  if (activities) {
407
410
  brandData = __assign(__assign({}, brandData), { entity_activities: activities || {} });
408
411
  }
409
- if (!!activities) return [3, 4];
412
+ if (!!activities) return [3, 5];
410
413
  return [4, API.dataService.getActivities()];
411
- case 3:
414
+ case 4:
412
415
  activityList = (_g.sent()).list;
413
416
  brandData = __assign(__assign({}, brandData), { entity_activities: activityList || {} });
414
- _g.label = 4;
415
- case 4:
417
+ _g.label = 5;
418
+ case 5:
416
419
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
417
420
  (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, id);
418
- return [2, { data: __assign({}, brandData), formData: originalFormData }];
421
+ return [2, { data: __assign({}, brandData), formData: originalFormData, currencyData: currencyData }];
419
422
  }
420
423
  });
421
424
  });
@@ -572,6 +575,7 @@ var initialState = {
572
575
  uploadingBrandLogo: false,
573
576
  data: {
574
577
  flowName: FlowsTypes.BRAND,
578
+ currency: '',
575
579
  verify: {
576
580
  token: ''
577
581
  },
@@ -742,17 +746,20 @@ export var brandSlice = createSlice({
742
746
  state.error = null;
743
747
  })
744
748
  .addCase(updateSegmentBrand.fulfilled, function (state, action) {
749
+ var _a;
745
750
  state.loading = false;
746
751
  state.error = null;
747
- var _a = action.payload, data = _a.data, formData = _a.formData;
752
+ var _b = action.payload, data = _b.data, formData = _b.formData, currencyData = _b.currencyData;
748
753
  var entity_activities = data.entity_activities, activities = data.activities, operations = data.operations, terms = data.terms;
749
754
  var selectedActivity = entity_activities === null || entity_activities === void 0 ? void 0 : entity_activities.filter(function (activity) {
750
755
  return activities === null || activities === void 0 ? void 0 : activities.find(function (value) { return activity.id === value.id; });
751
756
  });
752
757
  state.data.brandSegmentData = formData;
758
+ if ((_a = currencyData === null || currencyData === void 0 ? void 0 : currencyData.code) === null || _a === void 0 ? void 0 : _a.english)
759
+ state.data.currency = currencyData.code.english;
753
760
  state.data.brandActivities.activities = (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : [];
754
- var _b = operations || {}, customer_base = _b.customer_base, sales = _b.sales;
755
- var _c = customer_base || {}, locations = _c.locations, customerBase = __rest(_c, ["locations"]);
761
+ var _c = operations || {}, customer_base = _c.customer_base, sales = _c.sales;
762
+ var _d = customer_base || {}, locations = _d.locations, customerBase = __rest(_d, ["locations"]);
756
763
  if (locations && locations.length)
757
764
  state.data.brandActivities.customerLocations = locations;
758
765
  if (!!sales)
@@ -1,5 +1,5 @@
1
1
  import { RootState } from '../../../app/store';
2
- import { ActivitiesFormValues, CustomersFormValues, BusinessTypeFormValues, NIDFormValues, OTPFormValues, ResponseData, SharedState, FlowsTypes, Activity, CivilFormValues, ActionState } from '../../../@types';
2
+ import { ActivitiesFormValues, CustomersFormValues, BusinessTypeFormValues, NIDFormValues, OTPFormValues, ResponseData, SharedState, FlowsTypes, CivilFormValues, ActionState } from '../../../@types';
3
3
  export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
4
4
  data: any;
5
5
  isicActivityList: any;
@@ -7,6 +7,7 @@ export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
7
7
  token: string;
8
8
  brandData: any;
9
9
  boardId: any;
10
+ currencyData: any;
10
11
  isRequireOTP?: undefined;
11
12
  } | {
12
13
  data: any;
@@ -16,6 +17,7 @@ export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
16
17
  leadData?: undefined;
17
18
  brandData?: undefined;
18
19
  boardId?: undefined;
20
+ currencyData?: undefined;
19
21
  }, string, {}>;
20
22
  export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
21
23
  data: any;
@@ -29,6 +31,7 @@ export declare const verifyLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
29
31
  };
30
32
  brand: any;
31
33
  leadData: any;
34
+ currencyData: any;
32
35
  }, OTPFormValues, {}>;
33
36
  interface verifyPACIParams {
34
37
  onSuccess?: () => void;
@@ -72,13 +75,7 @@ export declare const updateLeadBusinessType: import("@reduxjs/toolkit").AsyncThu
72
75
  entityData: any;
73
76
  isicActivityList: any;
74
77
  }, BusinessTypeFormValues, {}>;
75
- export declare const updateActivitiesInfo: import("@reduxjs/toolkit").AsyncThunk<{
76
- data: any;
77
- formData: {
78
- activities: Activity[] | undefined;
79
- operationStartDate: string;
80
- };
81
- }, ActivitiesFormValues, {}>;
78
+ export declare const updateActivitiesInfo: import("@reduxjs/toolkit").AsyncThunk<any, ActivitiesFormValues, {}>;
82
79
  export declare const retrieveDataList: import("@reduxjs/toolkit").AsyncThunk<{
83
80
  customerBases: any;
84
81
  expectedSales: any;
@@ -112,6 +109,7 @@ export interface BusinessData {
112
109
  activitiesData: ActivitiesFormValues & ResponseData;
113
110
  customersData: CustomersFormValues & ResponseData;
114
111
  flowName: FlowsTypes;
112
+ currency: string;
115
113
  }
116
114
  export interface BusinessState extends SharedState<BusinessData> {
117
115
  customLoading?: boolean;
@@ -62,11 +62,12 @@ import { BUSINESS_STEP_NAMES, IDENTIFICATION_TYPE, OTHER_CR_LICENSE, OTHER_ENTIT
62
62
  import { convertNumbers2English, hasKey, sleep, isKW, isSA, dateFormat, isOtherLicense } from '../../../utils';
63
63
  import { handleNextScreenStep, handlePublicKey, handleSetCountryByIso2 } from '../../../app/settings';
64
64
  export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
65
- var payload, data, publicKey, countryIso2, boardData, brandData, isicActivityList, leadData, _a, steps, brand, board_id, business_id, entity, brandID, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted, list, list;
65
+ var settings, payload, data, publicKey, countryIso2, boardData, brandData, currencyData, isicActivityList, leadData, _a, steps, brand, board_id, business_id, entity, brandID, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted, list, list;
66
66
  var _b, _c;
67
67
  return __generator(this, function (_d) {
68
68
  switch (_d.label) {
69
69
  case 0:
70
+ settings = thunkApi.getState().settings;
70
71
  payload = {
71
72
  service_name: 'tap_email',
72
73
  verify_token: token
@@ -85,9 +86,9 @@ export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', functio
85
86
  countryIso2 = data === null || data === void 0 ? void 0 : data.country_code;
86
87
  if (countryIso2)
87
88
  thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
88
- if (!(data.step_name !== BUSINESS_STEP_NAMES.PHONE_AUTH)) return [3, 20];
89
+ if (!(data.step_name !== BUSINESS_STEP_NAMES.PHONE_AUTH)) return [3, 21];
89
90
  boardData = undefined;
90
- brandData = void 0, isicActivityList = undefined;
91
+ brandData = void 0, currencyData = undefined, isicActivityList = undefined;
91
92
  return [4, API.leadService.retrieveLead(data === null || data === void 0 ? void 0 : data.id)];
92
93
  case 2:
93
94
  leadData = (_d.sent()).data;
@@ -100,7 +101,7 @@ export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', functio
100
101
  if (data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH && !isKW(countryIso2)) {
101
102
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
102
103
  }
103
- if (!(data.step_name === BUSINESS_STEP_NAMES.BUSINESS_INFO)) return [3, 19];
104
+ if (!(data.step_name === BUSINESS_STEP_NAMES.BUSINESS_INFO)) return [3, 20];
104
105
  _a = leadData || {}, steps = _a.steps, brand = _a.brand, board_id = _a.board_id, business_id = _a.business_id, entity = _a.entity;
105
106
  brandID = brand === null || brand === void 0 ? void 0 : brand.id;
106
107
  hasBusinessCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_SUCCESS);
@@ -118,60 +119,64 @@ export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', functio
118
119
  _d.label = 5;
119
120
  case 5:
120
121
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
121
- return [3, 19];
122
+ return [3, 20];
122
123
  case 6:
123
124
  if (!(data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH)) return [3, 7];
124
125
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
125
- return [3, 19];
126
+ return [3, 20];
126
127
  case 7:
127
128
  if (!hasBusinessCustomersCompleted) return [3, 8];
128
129
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_STEP'));
129
- return [3, 19];
130
+ return [3, 20];
130
131
  case 8:
131
- if (!hasBusinessCRActivitiesCompleted) return [3, 12];
132
- return [4, API.dataService.getActivitiesIsIc()];
132
+ if (!hasBusinessCRActivitiesCompleted) return [3, 13];
133
+ return [4, API.countryService.getCurrency(settings.data.businessCountry.iso2)];
133
134
  case 9:
135
+ currencyData = _d.sent();
136
+ return [4, API.dataService.getActivitiesIsIc()];
137
+ case 10:
134
138
  list = (_d.sent()).list;
135
139
  isicActivityList = list || [];
136
140
  return [4, thunkApi.dispatch(retrieveDataList())];
137
- case 10:
141
+ case 11:
138
142
  _d.sent();
139
143
  return [4, API.brandService.retrieveBrand(brandID)];
140
- case 11:
144
+ case 12:
141
145
  brandData = _d.sent();
142
146
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_CUSTOMERS_STEP'));
143
- return [3, 19];
144
- case 12:
145
- if (!hasBusinessCRInfoCompleted) return [3, 15];
146
- return [4, API.dataService.getActivitiesIsIc()];
147
+ return [3, 20];
147
148
  case 13:
149
+ if (!hasBusinessCRInfoCompleted) return [3, 16];
150
+ return [4, API.dataService.getActivitiesIsIc()];
151
+ case 14:
148
152
  list = (_d.sent()).list;
149
153
  isicActivityList = list || [];
150
154
  return [4, API.brandService.retrieveBrand(brandID)];
151
- case 14:
155
+ case 15:
152
156
  brandData = _d.sent();
153
157
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_ACTIVITIES_STEP'));
154
- return [3, 19];
155
- case 15: return [4, thunkApi.dispatch(retrieveAllEntityList({ businessId: business_id, entityId: entity === null || entity === void 0 ? void 0 : entity.id }))];
156
- case 16:
157
- _d.sent();
158
- if (!isSA(countryIso2)) return [3, 18];
159
- return [4, thunkApi.dispatch(retrieveEntityList({ leadId: data === null || data === void 0 ? void 0 : data.id }))];
158
+ return [3, 20];
159
+ case 16: return [4, thunkApi.dispatch(retrieveAllEntityList({ businessId: business_id, entityId: entity === null || entity === void 0 ? void 0 : entity.id }))];
160
160
  case 17:
161
161
  _d.sent();
162
- _d.label = 18;
162
+ if (!isSA(countryIso2)) return [3, 19];
163
+ return [4, thunkApi.dispatch(retrieveEntityList({ leadId: data === null || data === void 0 ? void 0 : data.id }))];
163
164
  case 18:
164
- thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
165
+ _d.sent();
165
166
  _d.label = 19;
166
- case 19: return [2, {
167
+ case 19:
168
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
169
+ _d.label = 20;
170
+ case 20: return [2, {
167
171
  data: data,
168
172
  isicActivityList: isicActivityList,
169
173
  leadData: __assign(__assign({}, leadData), { flows: (boardData === null || boardData === void 0 ? void 0 : boardData.info) || [] }),
170
174
  token: token,
171
175
  brandData: brandData === null || brandData === void 0 ? void 0 : brandData.brand,
172
- boardId: leadData === null || leadData === void 0 ? void 0 : leadData.board_id
176
+ boardId: leadData === null || leadData === void 0 ? void 0 : leadData.board_id,
177
+ currencyData: currencyData
173
178
  }];
174
- case 20: return [2, { data: data, isRequireOTP: true, token: token }];
179
+ case 21: return [2, { data: data, isRequireOTP: true, token: token }];
175
180
  }
176
181
  });
177
182
  }); });
@@ -193,7 +198,7 @@ export var resendOTP = createAsyncThunk('resendOTPBusiness', function (params, t
193
198
  });
194
199
  }); });
195
200
  export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
196
- var _a, business, settings, isNID, responseBody, stepName, payload, data, publicKey, brandData, isicActivityList, leadData, brand, country_code, steps, board_id, business_id, entity, brandID, countryIso2, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted, isIdentityAuthStep, boardResponse, list, list;
201
+ var _a, business, settings, isNID, responseBody, stepName, payload, data, publicKey, brandData, isicActivityList, currencyData, leadData, brand, country_code, steps, board_id, business_id, entity, brandID, countryIso2, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted, isIdentityAuthStep, boardResponse, list, list;
197
202
  var _b, _c, _d, _e, _f, _g, _h, _j;
198
203
  return __generator(this, function (_k) {
199
204
  switch (_k.label) {
@@ -218,7 +223,7 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
218
223
  if (publicKey) {
219
224
  thunkApi.dispatch(handlePublicKey(publicKey));
220
225
  }
221
- isicActivityList = undefined;
226
+ currencyData = undefined;
222
227
  return [4, API.leadService.retrieveLead(data === null || data === void 0 ? void 0 : data.id)];
223
228
  case 2:
224
229
  leadData = (_k.sent()).data;
@@ -248,11 +253,11 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
248
253
  case 6:
249
254
  if (!isNID) return [3, 7];
250
255
  thunkApi.dispatch(handleNextScreenStep());
251
- return [3, 22];
256
+ return [3, 23];
252
257
  case 7:
253
258
  if (!(isIdentityAuthStep && isKW(countryIso2))) return [3, 8];
254
259
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_CIVIL_ID_STEP'));
255
- return [3, 22];
260
+ return [3, 23];
256
261
  case 8:
257
262
  if (!hasBusinessCompleted) return [3, 12];
258
263
  if (!board_id) return [3, 11];
@@ -266,44 +271,47 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
266
271
  _k.label = 11;
267
272
  case 11:
268
273
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
269
- return [3, 22];
274
+ return [3, 23];
270
275
  case 12:
271
276
  if (!(data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH)) return [3, 13];
272
277
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
273
- return [3, 22];
278
+ return [3, 23];
274
279
  case 13:
275
280
  if (!hasBusinessCustomersCompleted) return [3, 14];
276
281
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_STEP'));
277
- return [3, 22];
282
+ return [3, 23];
278
283
  case 14:
279
- if (!hasBusinessCRActivitiesCompleted) return [3, 18];
280
- return [4, API.dataService.getActivitiesIsIc()];
284
+ if (!hasBusinessCRActivitiesCompleted) return [3, 19];
285
+ return [4, API.countryService.getCurrency(settings.data.businessCountry.iso2)];
281
286
  case 15:
287
+ currencyData = _k.sent();
288
+ return [4, API.dataService.getActivitiesIsIc()];
289
+ case 16:
282
290
  list = (_k.sent()).list;
283
291
  isicActivityList = list || [];
284
292
  return [4, thunkApi.dispatch(retrieveDataList())];
285
- case 16:
293
+ case 17:
286
294
  _k.sent();
287
295
  return [4, API.brandService.retrieveBrand(brandID)];
288
- case 17:
296
+ case 18:
289
297
  brandData = _k.sent();
290
298
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_CUSTOMERS_STEP'));
291
- return [3, 22];
292
- case 18:
293
- if (!hasBusinessCRInfoCompleted) return [3, 21];
294
- return [4, API.dataService.getActivitiesIsIc()];
299
+ return [3, 23];
295
300
  case 19:
301
+ if (!hasBusinessCRInfoCompleted) return [3, 22];
302
+ return [4, API.dataService.getActivitiesIsIc()];
303
+ case 20:
296
304
  list = (_k.sent()).list;
297
305
  isicActivityList = list || [];
298
306
  return [4, API.brandService.retrieveBrand(brandID)];
299
- case 20:
307
+ case 21:
300
308
  brandData = _k.sent();
301
309
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_ACTIVITIES_STEP'));
302
- return [3, 22];
303
- case 21:
310
+ return [3, 23];
311
+ case 22:
304
312
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
305
- _k.label = 22;
306
- case 22: return [2, { data: data, isicActivityList: isicActivityList, formData: __assign(__assign({}, params), { isNID: isNID }), brand: brandData === null || brandData === void 0 ? void 0 : brandData.brand, leadData: leadData }];
313
+ _k.label = 23;
314
+ case 23: return [2, { data: data, isicActivityList: isicActivityList, formData: __assign(__assign({}, params), { isNID: isNID }), brand: brandData === null || brandData === void 0 ? void 0 : brandData.brand, leadData: leadData, currencyData: currencyData }];
307
315
  }
308
316
  });
309
317
  }); });
@@ -569,7 +577,7 @@ export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', f
569
577
  });
570
578
  }); });
571
579
  export var updateActivitiesInfo = createAsyncThunk('updateActivitiesInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
572
- var _a, settings, business, _b, brand, entity_activities, entity, _c, brandActivities, brandId, activities, operationStartDate, stepName, id, removedActivities, payload, newBrandActivities, newEntityActivities, activityPayload, requestBody, data;
580
+ var _a, settings, business, _b, brand, entity_activities, entity, _c, brandActivities, brandId, activities, operationStartDate, stepName, id, removedActivities, payload, newBrandActivities, newEntityActivities, activityPayload, requestBody, data, currencyData;
573
581
  var _d, _e;
574
582
  return __generator(this, function (_f) {
575
583
  switch (_f.label) {
@@ -616,10 +624,13 @@ export var updateActivitiesInfo = createAsyncThunk('updateActivitiesInfo', funct
616
624
  case 5:
617
625
  data = _f.sent();
618
626
  thunkApi.dispatch(retrieveDataList());
627
+ return [4, API.countryService.getCurrency(settings.data.businessCountry.iso2)];
628
+ case 6:
629
+ currencyData = _f.sent();
619
630
  thunkApi.dispatch(updateStepName(stepName));
620
631
  thunkApi.dispatch(handleNextScreenStep());
621
632
  (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, requestBody);
622
- return [2, { data: data === null || data === void 0 ? void 0 : data.brand, formData: __assign({}, params) }];
633
+ return [2, __assign({ data: data === null || data === void 0 ? void 0 : data.brand, formData: __assign({}, params) }, currencyData)];
623
634
  }
624
635
  });
625
636
  }); });
@@ -755,6 +766,7 @@ var initialState = {
755
766
  uploadingArticle: false,
756
767
  data: {
757
768
  flowName: FlowsTypes.BUSINESS,
769
+ currency: '',
758
770
  verify: {
759
771
  token: ''
760
772
  },
@@ -818,10 +830,10 @@ export var businessSlice = createSlice({
818
830
  state.customLoading = true;
819
831
  })
820
832
  .addCase(verifyLeadToken.fulfilled, function (state, action) {
821
- var _a, _b;
833
+ var _a, _b, _c;
822
834
  state.error = null;
823
835
  state.customLoading = false;
824
- var _c = action.payload, data = _c.data, boardId = _c.boardId, brandData = _c.brandData, leadData = _c.leadData, token = _c.token, isRequireOTP = _c.isRequireOTP, isicActivityList = _c.isicActivityList;
836
+ var _d = action.payload, data = _d.data, boardId = _d.boardId, brandData = _d.brandData, leadData = _d.leadData, token = _d.token, isRequireOTP = _d.isRequireOTP, isicActivityList = _d.isicActivityList, currencyData = _d.currencyData;
825
837
  var responseBody = state.data.verify.responseBody;
826
838
  state.data.verify.responseBody = __assign(__assign(__assign(__assign(__assign({}, data), leadData), responseBody), { board_id: boardId, lead_id: data === null || data === void 0 ? void 0 : data.id }), (brandData && { brand: brandData }));
827
839
  if (token)
@@ -829,13 +841,13 @@ export var businessSlice = createSlice({
829
841
  state.data.otpData.isNID = false;
830
842
  if (isRequireOTP)
831
843
  return;
832
- var _d = state.data.verify.responseBody || {}, entity = _d.entity, entity_activities = _d.entity_activities, business_name = _d.business_name;
844
+ var _e = state.data.verify.responseBody || {}, entity = _e.entity, entity_activities = _e.entity_activities, business_name = _e.business_name;
833
845
  if (business_name === null || business_name === void 0 ? void 0 : business_name.en)
834
846
  state.data.businessTypeData.entityLegalName = business_name === null || business_name === void 0 ? void 0 : business_name.en;
835
847
  var issuingDate = ((_a = brandData === null || brandData === void 0 ? void 0 : brandData.operations) === null || _a === void 0 ? void 0 : _a.start_date) || ((_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.issuing_date);
836
848
  if (issuingDate)
837
849
  state.data.activitiesData.operationStartDate = convertNumbers2English(dateFormat(issuingDate));
838
- var _e = brandData || {}, terms = _e.terms, activities = _e.activities;
850
+ var _f = brandData || {}, terms = _f.terms, activities = _f.activities;
839
851
  var entityActivities = (entity_activities === null || entity_activities === void 0 ? void 0 : entity_activities.filter(function (activity) {
840
852
  return !(activities === null || activities === void 0 ? void 0 : activities.some(function (value) { return value.id === activity.id; }));
841
853
  })) || [];
@@ -846,6 +858,8 @@ export var businessSlice = createSlice({
846
858
  state.data.customersData.refundPolicy = element.agree;
847
859
  }
848
860
  });
861
+ if ((_c = currencyData === null || currencyData === void 0 ? void 0 : currencyData.code) === null || _c === void 0 ? void 0 : _c.english)
862
+ state.data.currency = currencyData.code.english;
849
863
  state.data.activitiesData.activities = selectedActivity;
850
864
  state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activityList: isicActivityList });
851
865
  })
@@ -875,20 +889,22 @@ export var businessSlice = createSlice({
875
889
  state.error = null;
876
890
  })
877
891
  .addCase(verifyLeadOTP.fulfilled, function (state, action) {
878
- var _a, _b;
892
+ var _a, _b, _c;
879
893
  state.loading = false;
880
894
  state.error = null;
881
- var _c = action.payload, data = _c.data, formData = _c.formData, brand = _c.brand, leadData = _c.leadData, isicActivityList = _c.isicActivityList;
895
+ var _d = action.payload, data = _d.data, formData = _d.formData, brand = _d.brand, leadData = _d.leadData, isicActivityList = _d.isicActivityList, currencyData = _d.currencyData;
882
896
  state.data.otpData = formData;
883
897
  state.data.otpData.responseBody = data;
898
+ if ((_a = currencyData === null || currencyData === void 0 ? void 0 : currencyData.code) === null || _a === void 0 ? void 0 : _a.english)
899
+ state.data.currency = currencyData.code.english;
884
900
  state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, leadData), state.data.verify.responseBody), (brand && { brand: brand })), { flows: (leadData === null || leadData === void 0 ? void 0 : leadData.flows) || [] });
885
- var _d = leadData || {}, entity = _d.entity, entity_activities = _d.entity_activities, business_name = _d.business_name;
901
+ var _e = leadData || {}, entity = _e.entity, entity_activities = _e.entity_activities, business_name = _e.business_name;
886
902
  if (business_name === null || business_name === void 0 ? void 0 : business_name.en)
887
903
  state.data.businessTypeData.entityLegalName = business_name === null || business_name === void 0 ? void 0 : business_name.en;
888
- var issuingDate = ((_a = brand === null || brand === void 0 ? void 0 : brand.operations) === null || _a === void 0 ? void 0 : _a.start_date) || ((_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.issuing_date);
904
+ var issuingDate = ((_b = brand === null || brand === void 0 ? void 0 : brand.operations) === null || _b === void 0 ? void 0 : _b.start_date) || ((_c = entity === null || entity === void 0 ? void 0 : entity.license) === null || _c === void 0 ? void 0 : _c.issuing_date);
889
905
  if (issuingDate)
890
906
  state.data.activitiesData.operationStartDate = convertNumbers2English(dateFormat(issuingDate));
891
- var _e = brand || {}, terms = _e.terms, activities = _e.activities;
907
+ var _f = brand || {}, terms = _f.terms, activities = _f.activities;
892
908
  var entityActivities = (entity_activities === null || entity_activities === void 0 ? void 0 : entity_activities.filter(function (activity) {
893
909
  return !(activities === null || activities === void 0 ? void 0 : activities.some(function (value) { return value.id === activity.id; }));
894
910
  })) || [];
@@ -1121,10 +1137,13 @@ export var businessSlice = createSlice({
1121
1137
  state.error = null;
1122
1138
  })
1123
1139
  .addCase(updateActivitiesInfo.fulfilled, function (state, action) {
1140
+ var _a;
1124
1141
  state.loading = false;
1125
1142
  state.error = null;
1126
- var _a = action.payload, data = _a.data, formData = _a.formData;
1143
+ var _b = action.payload, data = _b.data, formData = _b.formData, currencyData = _b.currencyData;
1127
1144
  state.data.activitiesData = formData;
1145
+ if ((_a = currencyData === null || currencyData === void 0 ? void 0 : currencyData.code) === null || _a === void 0 ? void 0 : _a.english)
1146
+ state.data.currency = currencyData.code.english;
1128
1147
  var terms = (data || {}).terms;
1129
1148
  terms === null || terms === void 0 ? void 0 : terms.forEach(function (element) {
1130
1149
  if ((element === null || element === void 0 ? void 0 : element.term) === 'general') {
@@ -64,16 +64,16 @@ import { defaultCountry } from '../../../constants';
64
64
  import { getIndividualName, capitalizeTheFirstLetterOfEachWord, sleep, findCountryByIddPrefix, concatenateObjectValues, isSA } from '../../../utils';
65
65
  export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retrieveLeadIdentityByIdAsync', function (leadId, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
66
66
  var _a, settings, connectExpress, countryCode, showBoard, data, _b, country_code, contact, phone, status, board_id, board_info_id, isRegistered, _c, boardInfo, boardData, error_1;
67
- var _d, _e;
68
- return __generator(this, function (_f) {
69
- switch (_f.label) {
67
+ var _d, _e, _f, _g;
68
+ return __generator(this, function (_h) {
69
+ switch (_h.label) {
70
70
  case 0:
71
71
  _a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
72
72
  countryCode = settings.data.businessCountry;
73
73
  showBoard = connectExpress.data.showBoard;
74
74
  return [4, API.leadService.retrieveLeadIdentity(leadId)];
75
75
  case 1:
76
- data = _f.sent();
76
+ data = _h.sent();
77
77
  _b = data || {}, country_code = _b.country_code, contact = _b.contact;
78
78
  if (country_code)
79
79
  thunkApi.dispatch(handleSetCountryByIso2(country_code));
@@ -86,8 +86,11 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retr
86
86
  thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_MOBILE_STEP'));
87
87
  return [2, { data: data, countryCode: countryCode }];
88
88
  }
89
+ if ((_d = data === null || data === void 0 ? void 0 : data.identification) === null || _d === void 0 ? void 0 : _d.authentication_id) {
90
+ thunkApi.dispatch(storeAuthId((_e = data === null || data === void 0 ? void 0 : data.identification) === null || _e === void 0 ? void 0 : _e.authentication_id));
91
+ }
89
92
  if (isRegistered && !showBoard) {
90
- (_e = (_d = settings.data.appConfig).onFlowCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, data);
93
+ (_g = (_f = settings.data.appConfig).onFlowCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, data);
91
94
  thunkApi.dispatch(handleOpen(false));
92
95
  return [2, { data: data, countryCode: countryCode }];
93
96
  }
@@ -96,19 +99,19 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retr
96
99
  return [2, { data: data, countryCode: countryCode }];
97
100
  }
98
101
  if (!(isRegistered && board_id && board_info_id)) return [3, 5];
99
- _f.label = 2;
102
+ _h.label = 2;
100
103
  case 2:
101
- _f.trys.push([2, 4, , 5]);
104
+ _h.trys.push([2, 4, , 5]);
102
105
  return [4, Promise.all([
103
106
  API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id }),
104
107
  API.boardService.retrieveBoardDetails(board_id)
105
108
  ])];
106
109
  case 3:
107
- _c = _f.sent(), boardInfo = _c[0], boardData = _c[1];
110
+ _c = _h.sent(), boardInfo = _c[0], boardData = _c[1];
108
111
  thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_SUCCESS_WITH_FLOW_BUTTONS_STEP'));
109
112
  return [2, { data: data, countryCode: countryCode, boardInfo: boardInfo, boardData: boardData }];
110
113
  case 4:
111
- error_1 = _f.sent();
114
+ error_1 = _h.sent();
112
115
  thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_ACCOUNT_ALREADY_CREATED_STEP'));
113
116
  return [2, { data: data, countryCode: countryCode }];
114
117
  case 5: return [2, { data: data, countryCode: countryCode }];
@@ -52,6 +52,7 @@ export declare const retrieveBoardDetails: import("@reduxjs/toolkit").AsyncThunk
52
52
  export declare const updateEntityName: import("@reduxjs/toolkit").AsyncThunk<{
53
53
  data: any;
54
54
  formData: EntityNameFormValues;
55
+ currencyData: any;
55
56
  }, AsyncThunkParams<EntityNameFormValues>, {}>;
56
57
  export declare const updateEntityCapital: import("@reduxjs/toolkit").AsyncThunk<{
57
58
  data: any;
@@ -71,6 +72,7 @@ export interface EntityData {
71
72
  entityNameData: EntityNameFormValues & ResponseData;
72
73
  entityCapitalData: EntityCapitalFormValues & ResponseData;
73
74
  flowName: FlowsTypes;
75
+ currency: string;
74
76
  }
75
77
  export interface EntityState extends SharedState<EntityData> {
76
78
  customLoading?: boolean;
@@ -279,7 +279,7 @@ export var retrieveBoardDetails = createAsyncThunk('entityRetrieveEntityInfo', f
279
279
  export var updateEntityName = createAsyncThunk('entityUpdateEntityName', function (_a, thunkApi) {
280
280
  var formData = _a.formData, originalFormData = _a.originalFormData;
281
281
  return __awaiter(void 0, void 0, void 0, function () {
282
- var _b, settings, entity, _c, id, data_status, data_verification, documents, issuingDate, expiryDate, licenseType, licenseNumber, articleId, unifiedNumber, legalName, certificateId, entityType, issueDate, expDate, isFL, isLegalNameENNonEditable, isLegalNameARNonEditable, isLicenseTypeNonEditable, isEntityTypeNonEditable, isLicenseNumberNonEditable, isUnifiedNumberNonEditable, isIssuingDateNonEditable, isExpiryDateNonEditable, isDocumentsNonEditable, isAOAFileNonEditable, isEntityTypeVerified, isLicenseNonEditable, isLicenseAvailable, payload, data, documentResponse, document, documentBody, documentBody, list;
282
+ var _b, settings, entity, _c, id, data_status, data_verification, documents, issuingDate, expiryDate, licenseType, licenseNumber, articleId, unifiedNumber, legalName, certificateId, entityType, issueDate, expDate, isFL, isLegalNameENNonEditable, isLegalNameARNonEditable, isLicenseTypeNonEditable, isEntityTypeNonEditable, isLicenseNumberNonEditable, isUnifiedNumberNonEditable, isIssuingDateNonEditable, isExpiryDateNonEditable, isDocumentsNonEditable, isAOAFileNonEditable, isEntityTypeVerified, isLicenseNonEditable, isLicenseAvailable, payload, data, currencyData, documentResponse, document, documentBody, documentBody, list;
283
283
  var _d, _e, _f;
284
284
  return __generator(this, function (_g) {
285
285
  switch (_g.label) {
@@ -328,19 +328,22 @@ export var updateEntityName = createAsyncThunk('entityUpdateEntityName', functio
328
328
  return [4, API.entityService.updateEntity(payload)];
329
329
  case 1:
330
330
  data = _g.sent();
331
+ return [4, API.countryService.getCurrency(settings.data.businessCountry.iso2)];
332
+ case 2:
333
+ currencyData = _g.sent();
331
334
  documentResponse = undefined;
332
335
  document = getRecentDocumentBasedOnPurpose(documents, DocumentPurpose.CR);
333
- if (!(!isDocumentsNonEditable && (certificateId || []).length > 0)) return [3, 7];
334
- if (!(document === null || document === void 0 ? void 0 : document.id)) return [3, 3];
336
+ if (!(!isDocumentsNonEditable && (certificateId || []).length > 0)) return [3, 8];
337
+ if (!(document === null || document === void 0 ? void 0 : document.id)) return [3, 4];
335
338
  documentBody = {
336
339
  id: document.id,
337
340
  images: certificateId
338
341
  };
339
342
  return [4, API.documentService.addFilesToExistingDocument(documentBody)];
340
- case 2:
341
- documentResponse = _g.sent();
342
- return [3, 5];
343
343
  case 3:
344
+ documentResponse = _g.sent();
345
+ return [3, 6];
346
+ case 4:
344
347
  documentBody = {
345
348
  entity_id: id || '',
346
349
  documents: [
@@ -351,21 +354,21 @@ export var updateEntityName = createAsyncThunk('entityUpdateEntityName', functio
351
354
  ]
352
355
  };
353
356
  return [4, API.documentService.updateDocumentInfo(documentBody)];
354
- case 4:
357
+ case 5:
355
358
  documentResponse = _g.sent();
356
- _g.label = 5;
357
- case 5: return [4, API.entityService.retrieveEntity(id)];
358
- case 6:
359
+ _g.label = 6;
360
+ case 6: return [4, API.entityService.retrieveEntity(id)];
361
+ case 7:
359
362
  data = _g.sent();
360
363
  data.documentData = documentResponse;
361
- _g.label = 7;
362
- case 7: return [4, API.dataService.getActivitiesIsIc()];
363
- case 8:
364
+ _g.label = 8;
365
+ case 8: return [4, API.dataService.getActivitiesIsIc()];
366
+ case 9:
364
367
  list = (_g.sent()).list;
365
368
  data.activityList = list;
366
369
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
367
370
  (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, id);
368
- return [2, { data: data, formData: originalFormData }];
371
+ return [2, { data: data, formData: originalFormData, currencyData: currencyData }];
369
372
  }
370
373
  });
371
374
  });
@@ -475,6 +478,7 @@ var initialState = {
475
478
  uploadingArticle: false,
476
479
  data: {
477
480
  flowName: FlowsTypes.ENTITY,
481
+ currency: '',
478
482
  verify: {
479
483
  token: ''
480
484
  },
@@ -673,10 +677,13 @@ export var entitySlice = createSlice({
673
677
  state.error = null;
674
678
  })
675
679
  .addCase(updateEntityName.fulfilled, function (state, action) {
680
+ var _a;
676
681
  state.loading = false;
677
682
  state.error = null;
678
- var _a = action.payload, data = _a.data, formData = _a.formData;
679
- var _b = data || {}, activityList = _b.activityList, rest = __rest(_b, ["activityList"]);
683
+ var _b = action.payload, data = _b.data, formData = _b.formData, currencyData = _b.currencyData;
684
+ var _c = data || {}, activityList = _c.activityList, rest = __rest(_c, ["activityList"]);
685
+ if ((_a = currencyData === null || currencyData === void 0 ? void 0 : currencyData.code) === null || _a === void 0 ? void 0 : _a.english)
686
+ state.data.currency = currencyData.code.english;
680
687
  state.data.entityNameData = __assign(__assign({}, formData), { certificateId: undefined });
681
688
  state.data.entityNameData.responseBody = __assign(__assign({}, state.data.entityNameData.responseBody), { rest: rest });
682
689
  state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { entity: data === null || data === void 0 ? void 0 : data.entity, activityList: activityList });
@@ -100,6 +100,7 @@ export declare const updatePhoneInfo: import("@reduxjs/toolkit").AsyncThunk<{
100
100
  export declare const updateIndividualPersonalInfo: import("@reduxjs/toolkit").AsyncThunk<{
101
101
  data: any;
102
102
  formData: IndividualPersonalInfoFormValues;
103
+ currencyData: any;
103
104
  }, AsyncThunkParams<IndividualPersonalInfoFormValues>, {}>;
104
105
  export declare const updateIndividualInfo: import("@reduxjs/toolkit").AsyncThunk<{
105
106
  data: any;
@@ -131,6 +132,7 @@ export interface IndividualData {
131
132
  individualPersonalData: IndividualPersonalInfoFormValues & ResponseData;
132
133
  individualData: IndividualExtraFormValues & ResponseData;
133
134
  flowName: FlowsTypes;
135
+ currency: string;
134
136
  }
135
137
  export interface IndividualState extends SharedState<IndividualData> {
136
138
  customLoading?: boolean;
@@ -553,7 +553,7 @@ export var updatePhoneInfo = createAsyncThunk('individual/updatePhoneInfo', func
553
553
  export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateIndividualPersonalInfo', function (_a, thunkApi) {
554
554
  var formData = _a.formData, originalFormData = _a.originalFormData;
555
555
  return __awaiter(void 0, void 0, void 0, function () {
556
- 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;
556
+ 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, currencyData, _e, isUser, isBuyer, isUserORBuyerType;
557
557
  var _f, _g, _h, _j, _k;
558
558
  return __generator(this, function (_l) {
559
559
  switch (_l.label) {
@@ -634,17 +634,20 @@ export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateInd
634
634
  return [4, API.individualService.updateMultipleIndividual(requestBody)];
635
635
  case 1:
636
636
  data = _l.sent();
637
+ return [4, API.countryService.getCurrency(settings.data.businessCountry.iso2)];
638
+ case 2:
639
+ currencyData = _l.sent();
637
640
  _e = getIndividualType(objects), isUser = _e.isUser, isBuyer = _e.isBuyer;
638
641
  isUserORBuyerType = isUser || isBuyer;
639
- if (!isUserORBuyerType) return [3, 3];
642
+ if (!isUserORBuyerType) return [3, 4];
640
643
  return [4, thunkApi.dispatch(retrieveDataList(code))];
641
- case 2:
642
- _l.sent();
643
- _l.label = 3;
644
644
  case 3:
645
+ _l.sent();
646
+ _l.label = 4;
647
+ case 4:
645
648
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
646
649
  (_k = (_j = settings.data.appConfig).onStepCompleted) === null || _k === void 0 ? void 0 : _k.call(_j, settings.data.activeScreen.name, requestBody);
647
- return [2, { data: data, formData: originalFormData }];
650
+ return [2, { data: data, formData: originalFormData, currencyData: currencyData }];
648
651
  }
649
652
  });
650
653
  });
@@ -841,6 +844,7 @@ var initialState = {
841
844
  cityLoading: false,
842
845
  data: {
843
846
  flowName: FlowsTypes.INDIVIDUAL,
847
+ currency: '',
844
848
  verify: {
845
849
  token: ''
846
850
  },
@@ -1223,11 +1227,14 @@ export var individualSlice = createSlice({
1223
1227
  state.error = null;
1224
1228
  })
1225
1229
  .addCase(updateIndividualPersonalInfo.fulfilled, function (state, action) {
1230
+ var _a;
1226
1231
  state.loading = false;
1227
1232
  state.error = null;
1228
- var _a = action.payload, data = _a.data, formData = _a.formData;
1233
+ var _b = action.payload, data = _b.data, formData = _b.formData, currencyData = _b.currencyData;
1229
1234
  state.data.individualPersonalData = formData;
1230
1235
  state.data.individualPersonalData.responseBody = data;
1236
+ if ((_a = currencyData === null || currencyData === void 0 ? void 0 : currencyData.code) === null || _a === void 0 ? void 0 : _a.english)
1237
+ state.data.currency = currencyData.code.english;
1231
1238
  })
1232
1239
  .addCase(updateIndividualPersonalInfo.rejected, function (state, action) {
1233
1240
  state.loading = false;
@@ -15,7 +15,7 @@ import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
16
16
  import Box from '@mui/material/Box';
17
17
  import { styled } from '@mui/material/styles';
18
- import { findCurrencyByIso2, isExist } from '../../../../utils';
18
+ import { isExist } from '../../../../utils';
19
19
  import { useLanguage, useAppSelector, useAppDispatch } from '../../../../hooks';
20
20
  import { settingsSelector } from '../../../../app/settings';
21
21
  import SimpleList from '../../../../components/SimpleList';
@@ -68,7 +68,7 @@ var ExpectedSalesRange = function (_a) {
68
68
  var expectedSaleControl = useController({ name: 'expectedSale', control: control });
69
69
  var _g = useAppSelector(brandSelector), data = _g.data, error = _g.error;
70
70
  var settingsData = useAppSelector(settingsSelector).data;
71
- var brandActivities = data.brandActivities;
71
+ var brandActivities = data.brandActivities, currency = data.currency;
72
72
  var expectedSales = (brandActivities.responseBody || {}).expectedSales;
73
73
  var expectedSalesRangeValue = expectedSaleControl.field.value;
74
74
  var countryCode = settingsData.businessCountry;
@@ -124,7 +124,7 @@ var ExpectedSalesRange = function (_a) {
124
124
  setSubIndex(item.id);
125
125
  }, [anchorEl, expectedSalesRangeValue]);
126
126
  return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(InputLabelStyled, { children: [t('expected_sales_monthly', {
127
- currency: t(findCurrencyByIso2(countryCode.iso2))
127
+ currency: t(currency)
128
128
  }), _jsx(MandatoryStyled, { children: "*" })] }), _jsx(InputStyled, { readOnly: readOnly, value: isAr ? (_b = expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.ar) !== null && _b !== void 0 ? _b : '' : (_c = expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.en) !== null && _c !== void 0 ? _c : '', onClick: !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_expected_sales'), endAdornment: _jsx(EndAdornmentExpanded, { anchorEl: anchorEl, isVerified: isVerified }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: expectedSalesRangeList, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (item) {
129
129
  var isOnlyOneItem = !item.sub || item.sub.length === 1;
130
130
  if (isOnlyOneItem)
@@ -21,7 +21,7 @@ import SimpleList from '../../../../components/SimpleList';
21
21
  import Collapse from '../../../../components/Collapse';
22
22
  import ExpandIcon from '../../../../components/ExpandIcon';
23
23
  import { businessSelector, clearError } from '../../../app/business/businessStore';
24
- import { findCurrencyByIso2, isExist } from '../../../../utils';
24
+ import { isExist } from '../../../../utils';
25
25
  import { ScreenContainer } from '../../../shared/Containers';
26
26
  import Search from '../../../shared/Search';
27
27
  import InputSelect from '../../../shared/InputSelect';
@@ -65,7 +65,7 @@ var ExpectedSalesRange = function (_a) {
65
65
  var expectedSaleControl = useController({ name: 'expectedSale', control: control });
66
66
  var _e = useAppSelector(businessSelector), data = _e.data, error = _e.error;
67
67
  var settingsData = useAppSelector(settingsSelector).data;
68
- var activitiesData = data.activitiesData;
68
+ var activitiesData = data.activitiesData, currency = data.currency;
69
69
  var expectedSales = (activitiesData.responseBody || {}).expectedSales;
70
70
  var expectedSalesRangeValue = expectedSaleControl.field.value;
71
71
  var countryCode = settingsData.businessCountry;
@@ -119,7 +119,7 @@ var ExpectedSalesRange = function (_a) {
119
119
  setSubIndex(item.id);
120
120
  }, [anchorEl, expectedSalesRangeValue]);
121
121
  return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('expected_sales_monthly', {
122
- currency: t(findCurrencyByIso2(countryCode.iso2))
122
+ currency: t(currency)
123
123
  }) }), _jsx(InputStyled, { value: (isAr ? expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.ar : expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.en) || '', onClick: !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_expected_sales'), endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: expectedSalesRangeList, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (item) {
124
124
  var isOnlyOneItem = !item.sub || item.sub.length === 1;
125
125
  if (isOnlyOneItem)
@@ -14,20 +14,18 @@ import * as React from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
16
16
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
17
- import { settingsSelector } from '../../../../app/settings';
18
- import { findCurrencyByIso2, formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
17
+ import { formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
19
18
  import { ScreenContainer } from '../../../shared/Containers';
20
19
  import Input from '../../../shared/Input';
21
- import { clearError } from '../../../app/entity/entityStore';
20
+ import { clearError, entitySelector } from '../../../app/entity/entityStore';
22
21
  import { EndAdornment } from '../../../shared/EndAdornment';
23
22
  var CapitalPaid = function (_a) {
24
23
  var _b;
25
24
  var readOnly = _a.readOnly, isVerified = _a.isVerified;
26
25
  var t = useTranslation().t;
27
- var settingsData = useAppSelector(settingsSelector).data;
26
+ var data = useAppSelector(entitySelector).data;
28
27
  var control = useFormContext().control;
29
28
  var dispatch = useAppDispatch();
30
- var countryCode = settingsData.businessCountry.iso2;
31
29
  var handleChange = function (_a) {
32
30
  var target = _a.target;
33
31
  if (error)
@@ -39,7 +37,7 @@ var CapitalPaid = function (_a) {
39
37
  var capitalPaidValue = capitalPaidControl.field.value;
40
38
  var error = (_b = capitalPaidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
41
39
  return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_paid_label', {
42
- currency: t(findCurrencyByIso2(countryCode))
40
+ currency: t(data.currency)
43
41
  }), required: true, onChange: handleChange, value: capitalPaidValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_paid_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalPaidValue, isVerified: isVerified }) }) })));
44
42
  };
45
43
  export default React.memo(CapitalPaid);
@@ -13,21 +13,19 @@ import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import * as React from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
16
- import { findCurrencyByIso2, formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
17
- import { settingsSelector } from '../../../../app/settings';
16
+ import { formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
18
17
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
19
18
  import { ScreenContainer } from '../../../shared/Containers';
20
19
  import Input from '../../../shared/Input';
21
- import { clearError } from '../../../app/entity/entityStore';
20
+ import { clearError, entitySelector } from '../../../app/entity/entityStore';
22
21
  import { EndAdornment } from '../../../shared/EndAdornment';
23
22
  var CapitalShareValue = function (_a) {
24
23
  var _b;
25
24
  var readOnly = _a.readOnly, isVerified = _a.isVerified;
26
25
  var t = useTranslation().t;
27
- var settingsData = useAppSelector(settingsSelector).data;
26
+ var data = useAppSelector(entitySelector).data;
28
27
  var control = useFormContext().control;
29
28
  var dispatch = useAppDispatch();
30
- var countryCode = settingsData.businessCountry.iso2;
31
29
  var handleChange = function (_a) {
32
30
  var target = _a.target;
33
31
  if (error)
@@ -39,7 +37,7 @@ var CapitalShareValue = function (_a) {
39
37
  var capitalShareValueValue = capitalShareValueControl.field.value;
40
38
  var error = (_b = capitalShareValueControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
41
39
  return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_share_value_label', {
42
- currency: t(findCurrencyByIso2(countryCode))
40
+ currency: t(data.currency)
43
41
  }), required: true, onChange: handleChange, value: capitalShareValueValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_value_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalShareValueValue, isVerified: isVerified }) }) })));
44
42
  };
45
43
  export default React.memo(CapitalShareValue);
@@ -16,7 +16,7 @@ import { useController, useFormContext } from 'react-hook-form';
16
16
  import Box from '@mui/material/Box';
17
17
  import { styled } from '@mui/material/styles';
18
18
  import { settingsSelector } from '../../../../app/settings';
19
- import { findCurrencyByIso2, hasVerifiedValue } from '../../../../utils';
19
+ import { hasVerifiedValue } from '../../../../utils';
20
20
  import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
21
21
  import Collapse from '../../../../components/Collapse';
22
22
  import Text from '../../../../components/Text';
@@ -81,7 +81,7 @@ var MonthlyIncome = function (props) {
81
81
  var income = monthlyIncomeControl.field.value;
82
82
  var error = (_a = monthlyIncomeControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
83
83
  return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 0 } }, { children: [_jsx(InputSelect, { label: t('please_enter_actual_income', {
84
- currency: t(findCurrencyByIso2(countryCode.iso2))
84
+ currency: t(data.currency)
85
85
  }), required: true, readOnly: props.readOnly, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, placeholder: t('choose_any_source_of_income'), value: (isAr ? income === null || income === void 0 ? void 0 : income.range.ar : income === null || income === void 0 ? void 0 : income.range.en) || '', warningMessage: error && t(error), endAdornment: _jsx(EndAdornmentExpanded, { isVerified: isMonthlyIncomeVerified(income), anchorEl: anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'range.en', searchValuePath: ['range.en', 'range.ar'], list: incomeList, onSelectItem: onSelectItem, renderItem: function (item) {
86
86
  return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (income === null || income === void 0 ? void 0 : income.id) }, { children: isAr ? item.range.ar : item === null || item === void 0 ? void 0 : item.range.en })) }), item.id === (income === null || income === void 0 ? void 0 : income.id) && _jsx(CheckIcon, { isVerified: isMonthlyIncomeVerified(item) })] }));
87
87
  } }) }))] })) })));
@@ -14,8 +14,7 @@ import * as React from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
16
16
  import Collapse from '@mui/material/Collapse';
17
- import { findCurrencyByIso2, formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
18
- import { settingsSelector } from '../../../../app/settings';
17
+ import { formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
19
18
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
20
19
  import { ScreenContainer } from '../../../shared/Containers';
21
20
  import Input from '../../../shared/Input';
@@ -25,11 +24,10 @@ var ShareValue = function (_a) {
25
24
  var _b;
26
25
  var show = _a.show, readOnly = _a.readOnly;
27
26
  var t = useTranslation().t;
28
- var settingsData = useAppSelector(settingsSelector).data;
27
+ var data = useAppSelector(individualSelector).data;
29
28
  var control = useFormContext().control;
30
29
  var bckError = useAppSelector(individualSelector).error;
31
30
  var dispatch = useAppDispatch();
32
- var countryCode = settingsData.businessCountry.iso2;
33
31
  var handleChange = function (_a) {
34
32
  var target = _a.target;
35
33
  if (bckError)
@@ -41,7 +39,7 @@ var ShareValue = function (_a) {
41
39
  var shareValue = shareValueControl.field.value;
42
40
  var error = (_b = shareValueControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
43
41
  return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('share_value_label', {
44
- currency: t(findCurrencyByIso2(countryCode))
42
+ currency: t(data.currency)
45
43
  }), onChange: handleChange, value: shareValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('share_value_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: shareValue, error: error }) }) })) })));
46
44
  };
47
45
  export default React.memo(ShareValue);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.6.9-test",
3
+ "version": "2.6.12-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",