@tap-payments/auth-jsconnect 1.0.57 → 1.0.61

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 (65) hide show
  1. package/build/@types/form.d.ts +2 -2
  2. package/build/api/entity.d.ts +20 -0
  3. package/build/api/entity.js +5 -1
  4. package/build/api/index.d.ts +3 -2
  5. package/build/assets/locales/ar.json +13 -1
  6. package/build/assets/locales/en.json +13 -1
  7. package/build/constants/api.d.ts +1 -0
  8. package/build/constants/api.js +3 -1
  9. package/build/constants/app.js +18 -18
  10. package/build/constants/assets.d.ts +7 -0
  11. package/build/constants/assets.js +8 -1
  12. package/build/features/Landing/Landing.js +5 -8
  13. package/build/features/Landing/screens/VerifyAndRedirect/VerifyAndRedirect.js +6 -20
  14. package/build/features/app/bank/bankStore.d.ts +5 -3
  15. package/build/features/app/bank/bankStore.js +81 -16
  16. package/build/features/app/business/businessStore.js +15 -17
  17. package/build/features/app/connect/connectStore.js +27 -19
  18. package/build/features/app/individual/individualStore.d.ts +4 -0
  19. package/build/features/app/individual/individualStore.js +80 -18
  20. package/build/features/bank/screens/BankDetails/BankDetails.js +7 -9
  21. package/build/features/bank/screens/BankDetails/Beneficiary.js +9 -1
  22. package/build/features/bank/screens/Success/Success.js +6 -0
  23. package/build/features/business/screens/BusinessType/LicenseNumber.js +1 -1
  24. package/build/features/business/screens/Success/Success.js +3 -2
  25. package/build/features/business/screens/{Confirm/Confirm.d.ts → SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts} +1 -3
  26. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +79 -0
  27. package/build/features/business/screens/SuccessWithFlowButtons/index.d.ts +2 -0
  28. package/build/features/business/screens/SuccessWithFlowButtons/index.js +2 -0
  29. package/build/features/connect/screens/ThankYou/ThankYou.js +1 -4
  30. package/build/features/featuresScreens.js +3 -6
  31. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +18 -15
  32. package/build/features/individual/screens/AdditionalIndividualInfo/EmployerName.js +10 -1
  33. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +1 -1
  34. package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +2 -2
  35. package/build/features/individual/screens/Success/Success.js +6 -0
  36. package/build/features/shared/Button/EmailProvidersButtons.d.ts +13 -0
  37. package/build/features/shared/Button/EmailProvidersButtons.js +92 -0
  38. package/build/features/shared/Button/FlowsButtons.d.ts +12 -0
  39. package/build/features/shared/Button/FlowsButtons.js +57 -0
  40. package/build/features/shared/Button/index.d.ts +3 -1
  41. package/build/features/shared/Button/index.js +3 -1
  42. package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +4 -2
  43. package/build/features/shared/SuccessScreen/SuccessScreen.js +4 -4
  44. package/package.json +1 -1
  45. package/build/features/business/screens/BusinessType/CRNumber.d.ts +0 -7
  46. package/build/features/business/screens/BusinessType/CRNumber.js +0 -41
  47. package/build/features/business/screens/BusinessType/CompanyLicense.d.ts +0 -11
  48. package/build/features/business/screens/BusinessType/CompanyLicense.js +0 -127
  49. package/build/features/business/screens/BusinessType/FLNumber.d.ts +0 -7
  50. package/build/features/business/screens/BusinessType/FLNumber.js +0 -41
  51. package/build/features/business/screens/BusinessType/FreelanceLicense.d.ts +0 -11
  52. package/build/features/business/screens/BusinessType/FreelanceLicense.js +0 -127
  53. package/build/features/business/screens/Confirm/Confirm.js +0 -56
  54. package/build/features/business/screens/Confirm/index.d.ts +0 -3
  55. package/build/features/business/screens/Confirm/index.js +0 -2
  56. package/build/features/connect/screens/Mobile/BusinessCountry.d.ts +0 -8
  57. package/build/features/connect/screens/Mobile/BusinessCountry.js +0 -40
  58. package/build/features/connect/screens/Password/Password.d.ts +0 -5
  59. package/build/features/connect/screens/Password/Password.js +0 -60
  60. package/build/features/connect/screens/Password/PasswordInput.d.ts +0 -5
  61. package/build/features/connect/screens/Password/PasswordInput.js +0 -39
  62. package/build/features/connect/screens/Password/index.d.ts +0 -3
  63. package/build/features/connect/screens/Password/index.js +0 -2
  64. package/build/features/connect/screens/Password/validation.d.ts +0 -8
  65. package/build/features/connect/screens/Password/validation.js +0 -4
@@ -259,14 +259,18 @@ export var updateLeadIndividual = createAsyncThunk('updateLeadIndividual', funct
259
259
  });
260
260
  }); });
261
261
  export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
262
- var _a, settings, connect, instagram, twitter, payload, data;
263
- var _b, _c, _d, _e, _f, _g, _h, _j;
264
- return __generator(this, function (_k) {
265
- switch (_k.label) {
262
+ var _a, settings, connect, instagram, twitter, _b, mobileData, nidData, otpData, brandData, isAbsher, responseBody, isExistingUser, payload, data;
263
+ var _c, _d, _e, _f, _g, _h, _j, _k, _l;
264
+ return __generator(this, function (_m) {
265
+ switch (_m.label) {
266
266
  case 0:
267
267
  _a = thunkApi.getState(), settings = _a.settings, connect = _a.connect;
268
- instagram = !!((_b = params.links) === null || _b === void 0 ? void 0 : _b.instagram) ? "".concat(INSTAGRAM_URL, "/").concat((_c = params.links) === null || _c === void 0 ? void 0 : _c.twitter) : '';
269
- twitter = !!((_d = params.links) === null || _d === void 0 ? void 0 : _d.twitter) ? "".concat(TWITTER_URL, "/").concat((_e = params.links) === null || _e === void 0 ? void 0 : _e.twitter) : '';
268
+ instagram = !!((_c = params.links) === null || _c === void 0 ? void 0 : _c.instagram) ? "".concat(INSTAGRAM_URL, "/").concat((_d = params.links) === null || _d === void 0 ? void 0 : _d.twitter) : '';
269
+ twitter = !!((_e = params.links) === null || _e === void 0 ? void 0 : _e.twitter) ? "".concat(TWITTER_URL, "/").concat((_f = params.links) === null || _f === void 0 ? void 0 : _f.twitter) : '';
270
+ _b = connect.data, mobileData = _b.mobileData, nidData = _b.nidData, otpData = _b.otpData, brandData = _b.brandData;
271
+ isAbsher = otpData.isAbsher;
272
+ responseBody = (isAbsher ? nidData : mobileData).responseBody;
273
+ isExistingUser = (responseBody === null || responseBody === void 0 ? void 0 : responseBody.new_user) === false;
270
274
  payload = {
271
275
  brand: {
272
276
  name: {
@@ -274,20 +278,20 @@ export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (param
274
278
  ar: params.brandName,
275
279
  zh: params.brandName
276
280
  },
277
- website: (_f = params.links) === null || _f === void 0 ? void 0 : _f.website,
281
+ website: (_g = params.links) === null || _g === void 0 ? void 0 : _g.website,
278
282
  social: [twitter, instagram]
279
283
  },
280
- id: ((_g = connect.data.otpData.responseBody) === null || _g === void 0 ? void 0 : _g.lead_id) || '',
284
+ id: (isExistingUser ? (_h = brandData.responseBody) === null || _h === void 0 ? void 0 : _h.lead_id : (_j = otpData.responseBody) === null || _j === void 0 ? void 0 : _j.lead_id) || '',
281
285
  terms_conditions_accepted: params.termAndConditionChecked,
282
286
  step_name: CONNECT_STEP_NAMES.UPDATE_LEAD_MERCHANT,
283
287
  encryption_contract: ['brand.name.en', 'brand.name.ar', 'brand.name.zh', 'social[0]', 'social[1]']
284
288
  };
285
289
  return [4, API.leadService.updateLead(payload)];
286
290
  case 1:
287
- data = (_k.sent()).data;
291
+ data = (_m.sent()).data;
288
292
  if (!data.errors) {
289
293
  thunkApi.dispatch(handleNextScreenStep());
290
- (_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, params);
294
+ (_l = (_k = settings.data.appConfig).onStepCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, settings.data.activeScreen.name, params);
291
295
  }
292
296
  return [2, { response: data, formData: params }];
293
297
  }
@@ -336,23 +340,27 @@ export var checkBrandNameAvailability = createAsyncThunk('checkBrandNameAvailabi
336
340
  });
337
341
  });
338
342
  export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
339
- var _a, settings, connect, payload, data;
340
- var _b, _c, _d, _e, _f;
341
- return __generator(this, function (_g) {
342
- switch (_g.label) {
343
+ var _a, settings, connect, _b, mobileData, nidData, otpData, brandData, isAbsher, responseBody, isExistingUser, payload, data;
344
+ var _c, _d, _e, _f, _g, _h;
345
+ return __generator(this, function (_j) {
346
+ switch (_j.label) {
343
347
  case 0:
344
348
  _a = thunkApi.getState(), settings = _a.settings, connect = _a.connect;
349
+ _b = connect.data, mobileData = _b.mobileData, nidData = _b.nidData, otpData = _b.otpData, brandData = _b.brandData;
350
+ isAbsher = otpData.isAbsher;
351
+ responseBody = (isAbsher ? nidData : mobileData).responseBody;
352
+ isExistingUser = (responseBody === null || responseBody === void 0 ? void 0 : responseBody.new_user) === false;
345
353
  payload = {
346
354
  step_name: CONNECT_STEP_NAMES.CONNECT_SUCCESS,
347
355
  email_url: getClientEmailUrl(),
348
- id: ((_b = connect.data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.lead_id) || '',
356
+ id: (isExistingUser ? (_c = brandData.responseBody) === null || _c === void 0 ? void 0 : _c.lead_id : (_d = otpData.responseBody) === null || _d === void 0 ? void 0 : _d.lead_id) || '',
349
357
  encryption_contract: []
350
358
  };
351
359
  return [4, API.leadService.updateLead(payload)];
352
360
  case 1:
353
- data = (_g.sent()).data;
354
- (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
355
- (_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
361
+ data = (_j.sent()).data;
362
+ (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, params);
363
+ (_h = (_g = settings.data.appConfig).onFlowCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, { data: data });
356
364
  return [2, { response: data, formData: params }];
357
365
  }
358
366
  });
@@ -608,7 +616,7 @@ export var connectSlice = createSlice({
608
616
  .addCase(checkBrandNameAvailability.fulfilled, function (state, action) {
609
617
  var _a;
610
618
  state.error = null;
611
- state.data.brandData.responseBody = (_a = action.payload) === null || _a === void 0 ? void 0 : _a.response;
619
+ state.data.brandData.responseBody = __assign(__assign({}, state.data.brandData.responseBody), (_a = action.payload) === null || _a === void 0 ? void 0 : _a.response);
612
620
  })
613
621
  .addCase(checkBrandNameAvailability.pending, function (state) {
614
622
  state.error = null;
@@ -11,6 +11,10 @@ export declare const verifyLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
11
11
  otp: string;
12
12
  };
13
13
  }, OTPFormValues, {}>;
14
+ export declare const updateIndividualInfo: import("@reduxjs/toolkit").AsyncThunk<{
15
+ data: any;
16
+ formData: IndividualExtraFormValues;
17
+ }, IndividualExtraFormValues, {}>;
14
18
  export declare const updateLeadSuccess: import("@reduxjs/toolkit").AsyncThunk<{
15
19
  response: any;
16
20
  formData: void;
@@ -50,7 +50,7 @@ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
50
50
  import API from '../../../api';
51
51
  import { removeRequestHeaders } from '../../../utils';
52
52
  import { handleNextScreenStep } from '../../../app/settings';
53
- import { defaultCountry, INDIVIDUAl_STEP_NAMES, SOURCE_OF_INCOME } from '../../../constants';
53
+ import { INDIVIDUAl_STEP_NAMES } from '../../../constants';
54
54
  export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
55
55
  var payload, data, leadResponse;
56
56
  return __generator(this, function (_a) {
@@ -77,10 +77,10 @@ export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token
77
77
  });
78
78
  }); });
79
79
  export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
80
- var _a, individual, settings, responseBody, payload, data;
81
- var _b, _c, _d;
82
- return __generator(this, function (_e) {
83
- switch (_e.label) {
80
+ var _a, individual, settings, responseBody, payload, data, steps, hasIndividualCompleted;
81
+ var _b, _c, _d, _e;
82
+ return __generator(this, function (_f) {
83
+ switch (_f.label) {
84
84
  case 0:
85
85
  _a = thunkApi.getState(), individual = _a.individual, settings = _a.settings;
86
86
  responseBody = individual.data.verify.responseBody;
@@ -93,33 +93,71 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
93
93
  };
94
94
  return [4, API.leadService.verifyLeadOTP(payload)];
95
95
  case 1:
96
- data = (_e.sent()).data;
96
+ data = (_f.sent()).data;
97
97
  if (!data.errors) {
98
98
  (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
99
- thunkApi.dispatch(handleNextScreenStep());
99
+ steps = (_e = individual.data.verify.responseBody) === null || _e === void 0 ? void 0 : _e.steps;
100
+ hasIndividualCompleted = Object.keys(steps).find(function (key) { return key === INDIVIDUAl_STEP_NAMES.INDIVIDUAl_SUCCESS; });
101
+ if (hasIndividualCompleted) {
102
+ thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_SUCCESS_STEP'));
103
+ }
104
+ else {
105
+ thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_ADDITIONAL_INDIVIDUAL_INFO_STEP'));
106
+ }
100
107
  }
101
108
  return [2, { data: data, formData: __assign({}, params) }];
102
109
  }
103
110
  });
104
111
  }); });
112
+ export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
113
+ var _a, settings, individual, requestBody, data;
114
+ var _b, _c, _d, _e, _f, _g;
115
+ return __generator(this, function (_h) {
116
+ switch (_h.label) {
117
+ case 0:
118
+ _a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
119
+ requestBody = {
120
+ id: (_c = (_b = individual.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.entity) === null || _c === void 0 ? void 0 : _c.id,
121
+ employer_name: params.employerName,
122
+ employer_city: (_d = params.employerLocation) === null || _d === void 0 ? void 0 : _d.iso2,
123
+ source_income: [(_e = params.sourceIncome) === null || _e === void 0 ? void 0 : _e.title],
124
+ actual_income: params.monthlyIncome,
125
+ is_relative_PEP: params.isPEP,
126
+ is_influencer: params.isInfluencer,
127
+ step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO
128
+ };
129
+ return [4, API.entityService.updateEntityInfo(requestBody)];
130
+ case 1:
131
+ data = (_h.sent()).data;
132
+ if (!data.errors) {
133
+ thunkApi.dispatch(handleNextScreenStep());
134
+ (_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, requestBody);
135
+ }
136
+ return [2, { data: data, formData: params }];
137
+ }
138
+ });
139
+ }); });
105
140
  export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
106
- var _a, settings, individual, payload, data;
107
- var _b, _c, _d, _e, _f;
108
- return __generator(this, function (_g) {
109
- switch (_g.label) {
141
+ var _a, settings, individual, response, payload;
142
+ var _b, _c, _d, _e, _f, _g;
143
+ return __generator(this, function (_h) {
144
+ switch (_h.label) {
110
145
  case 0:
111
146
  _a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
147
+ response = undefined;
148
+ if (!!!((_b = individual.data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.id)) return [3, 2];
112
149
  payload = {
113
150
  step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_SUCCESS,
114
- id: ((_b = individual.data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.id) || '',
151
+ id: ((_c = individual.data.otpData.responseBody) === null || _c === void 0 ? void 0 : _c.id) || '',
115
152
  encryption_contract: []
116
153
  };
117
154
  return [4, API.leadService.updateLead(payload)];
118
155
  case 1:
119
- data = (_g.sent()).data;
120
- (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
121
- (_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
122
- return [2, { response: data, formData: params }];
156
+ response = _h.sent();
157
+ (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, params);
158
+ (_g = (_f = settings.data.appConfig).onFlowCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, { data: response === null || response === void 0 ? void 0 : response.data });
159
+ _h.label = 2;
160
+ case 2: return [2, { response: response === null || response === void 0 ? void 0 : response.data, formData: params }];
123
161
  }
124
162
  });
125
163
  }); });
@@ -134,10 +172,10 @@ var initialState = {
134
172
  otp: ''
135
173
  },
136
174
  individualData: {
137
- sourceIncome: SOURCE_OF_INCOME[0],
175
+ sourceIncome: undefined,
138
176
  monthlyIncome: '',
139
177
  employerName: '',
140
- employerLocation: defaultCountry,
178
+ employerLocation: undefined,
141
179
  isPEP: null,
142
180
  isInfluencer: null
143
181
  }
@@ -159,6 +197,9 @@ export var individualSlice = createSlice({
159
197
  },
160
198
  extraReducers: function (builder) {
161
199
  builder
200
+ .addCase(verifyLeadToken.pending, function (state) {
201
+ state.error = null;
202
+ })
162
203
  .addCase(verifyLeadToken.fulfilled, function (state, action) {
163
204
  var _a;
164
205
  state.error = null;
@@ -194,6 +235,27 @@ export var individualSlice = createSlice({
194
235
  .addCase(verifyLeadOTP.rejected, function (state, action) {
195
236
  state.loading = false;
196
237
  state.error = action.error.message;
238
+ })
239
+ .addCase(updateIndividualInfo.pending, function (state) {
240
+ state.loading = true;
241
+ state.error = null;
242
+ })
243
+ .addCase(updateIndividualInfo.fulfilled, function (state, action) {
244
+ var _a;
245
+ state.loading = false;
246
+ state.error = null;
247
+ var _b = action.payload, data = _b.data, formData = _b.formData;
248
+ var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
249
+ if (description) {
250
+ state.error = description;
251
+ return;
252
+ }
253
+ state.data.individualData = formData;
254
+ state.data.individualData.responseBody = data;
255
+ })
256
+ .addCase(updateIndividualInfo.rejected, function (state, action) {
257
+ state.loading = false;
258
+ state.error = action.error.message;
197
259
  })
198
260
  .addCase(updateLeadSuccess.fulfilled, function (state, action) {
199
261
  var _a;
@@ -16,14 +16,15 @@ import IBAN from './IBAN';
16
16
  import BankName from './BankName';
17
17
  import Button from '../../../shared/Button';
18
18
  import { useAppDispatch } from '../../../../hooks';
19
- import { handleNextScreenStep } from '../../../../app/settings';
20
19
  import { BankValidation } from './validation';
21
20
  import { useTranslation } from 'react-i18next';
22
21
  import { useForm, FormProvider } from 'react-hook-form';
23
22
  import { yupResolver } from '@hookform/resolvers/yup';
24
23
  import { useLanguage } from '../../../../hooks';
25
24
  import { styled } from '@mui/material/styles';
25
+ import { bankSelector, createBankAccount } from '../../../app/bank/bankStore';
26
26
  import Form from '../../../../components/Form';
27
+ import { useSelector } from 'react-redux';
27
28
  var FormStyled = styled(Form)(function () { return ({
28
29
  display: 'flex',
29
30
  flexDirection: 'column',
@@ -37,20 +38,17 @@ var ButtonStyled = styled(Button)(function (_a) {
37
38
  });
38
39
  var BankDetails = function () {
39
40
  var dispatch = useAppDispatch();
41
+ var _a = useSelector(bankSelector), data = _a.data, loading = _a.loading, error = _a.error;
40
42
  var methods = useForm({
41
43
  resolver: yupResolver(BankValidation),
42
- defaultValues: {
43
- iban: '',
44
- beneficiaryName: '',
45
- bankName: 'National Bank'
46
- },
44
+ defaultValues: data.bankData,
47
45
  mode: 'onChange'
48
46
  });
49
- var onSubmit = function () {
50
- dispatch(handleNextScreenStep());
47
+ var onSubmit = function (data) {
48
+ dispatch(createBankAccount(data));
51
49
  };
52
50
  var t = useTranslation().t;
53
51
  var isAr = useLanguage().isAr;
54
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(IBAN, {}), _jsx(Beneficiary, {}), _jsx(BankName, {}), _jsx(ButtonStyled, __assign({ disableBack: true, disabled: !methods.formState.isValid, isAr: isAr }, { children: t('confirm') }))] })) })) }));
52
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(IBAN, {}), _jsx(Beneficiary, {}), _jsx(BankName, {}), _jsx(ButtonStyled, __assign({ disableBack: true, disabled: !methods.formState.isValid, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('confirm') }))] })) })) }));
55
53
  };
56
54
  export default BankDetails;
@@ -13,6 +13,14 @@ var FeatureStyled = styled(ScreenContainer)(function (_a) {
13
13
  marginBlockEnd: theme.spacing(3)
14
14
  });
15
15
  });
16
+ var InputStyled = styled(Input)(function (_a) {
17
+ var theme = _a.theme;
18
+ return ({
19
+ input: {
20
+ textTransform: 'capitalize'
21
+ }
22
+ });
23
+ });
16
24
  var Beneficiary = function () {
17
25
  var _a, _b;
18
26
  var t = useTranslation().t;
@@ -29,6 +37,6 @@ var Beneficiary = function () {
29
37
  var clearValue = function () {
30
38
  beneficiaryControl.field.onChange('');
31
39
  };
32
- return (_jsx(FeatureStyled, { children: _jsx(Input, { label: t('beneficiary_name'), onChange: handleBeneficiaryChange, value: beneficiaryValue, placeholder: t('beneficiary_name'), warningType: 'alert', warningMessage: error && t(error), required: true, endAdornment: !hasError && beneficiaryValue ? _jsx(CheckIcon, {}) : beneficiaryValue && _jsx(ClearIcon, { onClick: clearValue }) }) }));
40
+ return (_jsx(FeatureStyled, { children: _jsx(InputStyled, { label: t('beneficiary_name'), onChange: handleBeneficiaryChange, value: beneficiaryValue, placeholder: t('beneficiary_name'), warningType: 'alert', warningMessage: error && t(error), required: true, endAdornment: !hasError && beneficiaryValue ? _jsx(CheckIcon, {}) : beneficiaryValue && _jsx(ClearIcon, { onClick: clearValue }) }) }));
33
41
  };
34
42
  export default Beneficiary;
@@ -2,8 +2,14 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import SuccessScreen from '../../../shared/SuccessScreen';
5
+ import { useAppDispatch } from '../../../../hooks';
6
+ import { updateLeadSuccess } from '../../../app/bank/bankStore';
5
7
  var Success = function (_a) {
6
8
  var t = useTranslation().t;
9
+ var dispatch = useAppDispatch();
10
+ React.useEffect(function () {
11
+ dispatch(updateLeadSuccess());
12
+ }, []);
7
13
  var onSuccess = function () {
8
14
  window.open('mailto:');
9
15
  };
@@ -41,6 +41,6 @@ var LicenseNumber = function (_a) {
41
41
  var error = (_b = licenseNumberControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
42
42
  var length = isCR ? CR_NUMBER_LENGTH : FL_NUMBER_LENGTH;
43
43
  var label = isCR ? 'cr_number' : 'fl_number';
44
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { readOnly: readOnly, label: t(label), onChange: handleFLNumberChange, inputProps: { maxLength: length }, value: licenseNumberValue, endAdornment: (licenseNumberValue === null || licenseNumberValue === void 0 ? void 0 : licenseNumberValue.length) === length ? (_jsx(CheckIcon, {})) : (licenseNumberValue && _jsx(ClearIcon, { onClick: clearLicenseNumber })), placeholder: isCR ? '0123456789' : '12345678', warningType: 'alert', warningMessage: error && t(error, { length: length }) }) }) })));
44
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { readOnly: readOnly, label: t(label), onChange: handleFLNumberChange, inputProps: { maxLength: length }, value: licenseNumberValue, endAdornment: (licenseNumberValue === null || licenseNumberValue === void 0 ? void 0 : licenseNumberValue.length) === length ? (_jsx(CheckIcon, {})) : (licenseNumberValue && _jsx(ClearIcon, { onClick: clearLicenseNumber })), placeholder: isCR ? '01f3c5x78n' : '1a3c5b78', warningType: 'alert', warningMessage: error && t(error, { length: length }) }) }) })));
45
45
  };
46
46
  export default React.memo(LicenseNumber);
@@ -4,6 +4,7 @@ import { useAppDispatch } from '../../../../hooks';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import SuccessScreen from '../../../shared/SuccessScreen';
6
6
  import { updateLeadSuccess } from '../../../app/business/businessStore';
7
+ import { handleNextScreenStep } from '../../../../app/settings';
7
8
  var Success = function (_a) {
8
9
  var t = useTranslation().t;
9
10
  var dispatch = useAppDispatch();
@@ -11,8 +12,8 @@ var Success = function (_a) {
11
12
  dispatch(updateLeadSuccess());
12
13
  }, []);
13
14
  var onSuccess = function () {
14
- window.open('mailto:');
15
+ dispatch(handleNextScreenStep());
15
16
  };
16
- return _jsx(SuccessScreen, { title: t('ide_successfully_verified_message'), onSuccess: onSuccess });
17
+ return _jsx(SuccessScreen, { title: t('ide_successfully_verified_message'), onSuccess: onSuccess, successTitle: 'continue' });
17
18
  };
18
19
  export default React.memo(Success);
@@ -1,5 +1,3 @@
1
- import * as React from 'react';
2
- export interface ConfirmProps {
3
- }
1
+ import React from 'react';
4
2
  declare const _default: React.MemoExoticComponent<() => JSX.Element>;
5
3
  export default _default;
@@ -0,0 +1,79 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
13
+ import { memo } from 'react';
14
+ import { useTranslation } from 'react-i18next';
15
+ import { styled } from '@mui/material/styles';
16
+ import Box from '@mui/material/Box';
17
+ import Text from '../../../../components/Text';
18
+ import Container from '../../../shared/Containers/ScreenContainer';
19
+ import { FlowsButtons } from '../../../shared/Button';
20
+ import { ICONS_NAMES } from '../../../../constants';
21
+ var TextContainerStyled = styled(Box)(function (_a) {
22
+ var _b;
23
+ var theme = _a.theme;
24
+ return (_b = {
25
+ background: theme.palette.common.white,
26
+ border: '1px solid',
27
+ width: '100%',
28
+ borderColor: theme.palette.divider,
29
+ borderRadius: theme.spacing(0, 0, 1.25, 1.25)
30
+ },
31
+ _b[theme.breakpoints.up('sm')] = {
32
+ marginBottom: theme.spacing(7.5)
33
+ },
34
+ _b);
35
+ });
36
+ var TitleStyled = styled(Text)(function (_a) {
37
+ var theme = _a.theme;
38
+ return (__assign({ fontWeight: theme.typography.fontWeightRegular, color: theme.palette.text.primary, marginBlock: theme.spacing(1.75), lineHeight: 1.75, padding: '0px 20px' }, theme.typography.subtitle2));
39
+ });
40
+ var ContainerStyled = styled(Container)(function (_a) {
41
+ var theme = _a.theme;
42
+ return ({
43
+ justifyContent: 'space-between',
44
+ minHeight: theme.spacing(30),
45
+ alignItems: 'center'
46
+ });
47
+ });
48
+ var ButtonGroupStyled = styled(Box)(function (_a) {
49
+ var theme = _a.theme;
50
+ return ({
51
+ width: '100%'
52
+ });
53
+ });
54
+ var SuccessWithFlowButtons = function () {
55
+ var t = useTranslation().t;
56
+ return (_jsxs(ContainerStyled, { children: [_jsx(TextContainerStyled, { children: _jsxs(TitleStyled, { children: [t('ide_successfully_verified_message'), " "] }) }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: [
57
+ {
58
+ title: t('tax_flow_completed'),
59
+ href: '#',
60
+ src: ICONS_NAMES.TAX_ICON
61
+ },
62
+ {
63
+ title: t('individual_flow_completed'),
64
+ href: '#',
65
+ src: ICONS_NAMES.INDIVIDUAL_ICON
66
+ },
67
+ {
68
+ title: t('bank_flow_completed'),
69
+ href: '#',
70
+ src: ICONS_NAMES.BANK_ICON
71
+ },
72
+ {
73
+ title: t('password_flow_completed'),
74
+ href: '#',
75
+ src: ICONS_NAMES.PASSWORD_ICON
76
+ }
77
+ ] }) })] }));
78
+ };
79
+ export default memo(SuccessWithFlowButtons);
@@ -0,0 +1,2 @@
1
+ import SuccessWithFlowButtons from './SuccessWithFlowButtons';
2
+ export default SuccessWithFlowButtons;
@@ -0,0 +1,2 @@
1
+ import SuccessWithFlowButtons from './SuccessWithFlowButtons';
2
+ export default SuccessWithFlowButtons;
@@ -10,9 +10,6 @@ var ThankYou = function (_a) {
10
10
  React.useEffect(function () {
11
11
  dispatch(updateLeadSuccess());
12
12
  }, []);
13
- var onSuccess = function () {
14
- window.open('mailto:');
15
- };
16
- return _jsx(SuccessScreen, { title: t('ide_successfully_verified_message'), onSuccess: onSuccess });
13
+ return _jsx(SuccessScreen, { title: t('ide_successfully_verified_message'), showEmailProviders: true });
17
14
  };
18
15
  export default React.memo(ThankYou);
@@ -11,11 +11,11 @@ import BusinessOTPPage from './business/screens/OTP';
11
11
  import BusinessTypePage from './business/screens/BusinessType';
12
12
  import ActivitiesPage from './business/screens/Activities';
13
13
  import SuccessPage from './business/screens/Success';
14
+ import SuccessWithFlowButtonsPage from './business/screens/SuccessWithFlowButtons';
14
15
  import PasswordVerifyPage from './password/screens/Verify';
15
16
  import CreatePasswordPage from './password/screens/CreatePassword';
16
17
  import SuccessPasswordPage from './password/screens/Success';
17
18
  import IndividualVerifyPage from './individual/screens/Verify';
18
- import ShowIndividualInfoPage from './individual/screens/ShowIndividualInfo';
19
19
  import AdditionalIndividualInfoPage from './individual/screens/AdditionalIndividualInfo';
20
20
  import SuccessOwnerPage from './individual/screens/Success';
21
21
  import BankVerifyPage from './bank/screens/Verify';
@@ -76,7 +76,8 @@ export var businessFeatureScreens = [
76
76
  name: 'BUSINESS_CUSTOMERS_STEP',
77
77
  element: CustomersPage
78
78
  },
79
- { name: 'BUSINESS_SUCCESS_STEP', element: SuccessPage }
79
+ { name: 'BUSINESS_SUCCESS_STEP', element: SuccessPage },
80
+ { name: 'BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP', element: SuccessWithFlowButtonsPage }
80
81
  ];
81
82
  export var passwordFeatureScreens = [
82
83
  {
@@ -97,10 +98,6 @@ export var individualFeatureScreens = [
97
98
  name: 'INDIVIDUAL_VERIFY_STEP',
98
99
  element: IndividualVerifyPage
99
100
  },
100
- {
101
- name: 'INDIVIDUAL_SHOW_INDIVIDUAL_INFO_STEP',
102
- element: ShowIndividualInfoPage
103
- },
104
101
  {
105
102
  name: 'INDIVIDUAL_ADDITIONAL_INDIVIDUAL_INFO_STEP',
106
103
  element: AdditionalIndividualInfoPage
@@ -16,7 +16,7 @@ import { useForm, FormProvider } from 'react-hook-form';
16
16
  import Box from '@mui/material/Box';
17
17
  import { useTranslation } from 'react-i18next';
18
18
  import { useAppDispatch } from '../../../../hooks';
19
- import { handleNextScreenStep, handlePrevScreenStep } from '../../../../app/settings';
19
+ import { handlePrevScreenStep } from '../../../../app/settings';
20
20
  import { styled } from '@mui/material/styles';
21
21
  import Form from '../../../../components/Form';
22
22
  import Collapse from '../../../../components/Collapse';
@@ -31,6 +31,8 @@ import EmployerName from './EmployerName';
31
31
  import EmployerLocation from './EmployerLocation';
32
32
  import SourceOfIncome from './SourceOfIncome';
33
33
  import { countriesCode, SOURCE_OF_INCOME } from '../../../../constants';
34
+ import { useSelector } from 'react-redux';
35
+ import { individualSelector, updateIndividualInfo } from '../../../app/individual/individualStore';
34
36
  var InputsContainerStyled = styled(Box)(function (_a) {
35
37
  var _b;
36
38
  var theme = _a.theme, listActive = _a.listActive;
@@ -47,25 +49,26 @@ var InputsContainerStyled = styled(Box)(function (_a) {
47
49
  },
48
50
  _b);
49
51
  });
52
+ var ButtonStyled = styled(Button)(function (_a) {
53
+ var theme = _a.theme;
54
+ return ({
55
+ marginBlockStart: theme.spacing(-5)
56
+ });
57
+ });
50
58
  var AdditionalIndividualInfo = function (_a) {
59
+ var t = useTranslation().t;
60
+ var isAr = useLanguage().isAr;
61
+ var dispatch = useAppDispatch();
62
+ var _b = useSelector(individualSelector), data = _b.data, loading = _b.loading, error = _b.error;
51
63
  var methods = useForm({
52
64
  resolver: yupResolver(IndividualInfoValidationSchema),
53
- defaultValues: {
54
- monthlyIncome: '',
55
- employerName: '',
56
- isPEP: null,
57
- isInfluencer: null
58
- },
65
+ defaultValues: data.individualData,
59
66
  mode: 'onChange'
60
67
  });
61
- var t = useTranslation().t;
62
- var isAr = useLanguage().isAr;
63
- var dispatch = useAppDispatch();
64
- var _b = React.useState(false), listActive = _b[0], setListActive = _b[1];
65
- var _c = React.useState(false), employerFieldsActive = _c[0], setEmployerFieldsActive = _c[1];
68
+ var _c = React.useState(false), listActive = _c[0], setListActive = _c[1];
69
+ var _d = React.useState(false), employerFieldsActive = _d[0], setEmployerFieldsActive = _d[1];
66
70
  var onSubmit = function (data) {
67
- console.log('data', data);
68
- dispatch(handleNextScreenStep());
71
+ dispatch(updateIndividualInfo(data));
69
72
  };
70
73
  var handleSelectSource = function (country) {
71
74
  var _a;
@@ -78,7 +81,7 @@ var AdditionalIndividualInfo = function (_a) {
78
81
  var onBack = function () {
79
82
  dispatch(handlePrevScreenStep());
80
83
  };
81
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(InputsContainerStyled, __assign({ listActive: listActive }, { children: [_jsx(SourceOfIncome, { show: !listActive, list: SOURCE_OF_INCOME, onSelectSource: handleSelectSource }), _jsx(MonthlyIncome, { show: !listActive }), _jsx(EmployerName, { show: !listActive && employerFieldsActive }), _jsx(EmployerLocation, { show: employerFieldsActive, countries: countriesCode, onListOpen: function () { return setListActive(true); }, onListClose: function () { return setListActive(false); } }), _jsx(PEPSwitch, { show: !listActive }), _jsx(InfluencerSwitch, { show: !listActive })] })), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: false }, { children: t('next') })) }))] })) })) }));
84
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(InputsContainerStyled, __assign({ listActive: listActive }, { children: [_jsx(SourceOfIncome, { show: !listActive, list: SOURCE_OF_INCOME, onSelectSource: handleSelectSource }), _jsx(MonthlyIncome, { show: !listActive }), _jsx(EmployerName, { show: !listActive && employerFieldsActive }), _jsx(EmployerLocation, { show: employerFieldsActive, countries: countriesCode, onListOpen: function () { return setListActive(true); }, onListClose: function () { return setListActive(false); } }), _jsx(PEPSwitch, { show: !listActive }), _jsx(InfluencerSwitch, { show: !listActive })] })), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(ButtonStyled, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
82
85
  };
83
86
  export default React.memo(AdditionalIndividualInfo);
84
87
  AdditionalIndividualInfo.defaultProps = {};
@@ -19,6 +19,15 @@ import Input from '../../../shared/Input';
19
19
  import CheckIcon from '../../../shared/CheckIcon';
20
20
  import Collapse from '../../../../components/Collapse';
21
21
  import ClearIcon from '../../../shared/ClearIcon';
22
+ import { styled } from '@mui/material/styles';
23
+ var InputStyled = styled(Input)(function (_a) {
24
+ var theme = _a.theme;
25
+ return ({
26
+ input: {
27
+ textTransform: 'capitalize'
28
+ }
29
+ });
30
+ });
22
31
  var EmployerName = function (_a) {
23
32
  var _b;
24
33
  var show = _a.show;
@@ -35,6 +44,6 @@ var EmployerName = function (_a) {
35
44
  var clearValue = function () {
36
45
  employerNameControl.field.onChange('');
37
46
  };
38
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { pt: 2.5 } }, { children: _jsx(Input, { required: true, label: t('tap_js_employer_name'), onChange: handleEmployerNameChange, value: employerNameValue, endAdornment: !error && employerNameValue ? _jsx(CheckIcon, {}) : employerNameValue && _jsx(ClearIcon, { onClick: clearValue }), placeholder: t('tap_js_enter_employer_name'), warningType: 'alert', warningMessage: error && t(error) }) })) })));
47
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { pt: 2.5 } }, { children: _jsx(InputStyled, { required: true, label: t('tap_js_employer_name'), onChange: handleEmployerNameChange, value: employerNameValue, endAdornment: !error && employerNameValue ? _jsx(CheckIcon, {}) : employerNameValue && _jsx(ClearIcon, { onClick: clearValue }), placeholder: t('tap_js_enter_employer_name'), warningType: 'alert', warningMessage: error && t(error) }) })) })));
39
48
  };
40
49
  export default React.memo(EmployerName);
@@ -80,7 +80,7 @@ var SourceOfIncome = function (_a) {
80
80
  };
81
81
  var source = sourceIncomeControl.field.value;
82
82
  var error = (_b = sourceIncomeControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
83
- return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(Input, { required: true, label: t('tap_js_source_of_income'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_any_source_of_income'), value: (isAr ? source === null || source === void 0 ? void 0 : source.name : source === null || source === void 0 ? void 0 : source.nameEn) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'nameEn', list: sourceList, onSelectItem: onSelectItem, renderItem: function (item) {
83
+ return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(Input, { required: true, label: t('tap_js_source_of_income'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_any_source_of_income'), value: (isAr ? source === null || source === void 0 ? void 0 : source.titleAr : source === null || source === void 0 ? void 0 : source.title) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'nameEn', list: sourceList, onSelectItem: onSelectItem, renderItem: function (item) {
84
84
  return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (source === null || source === void 0 ? void 0 : source.id) }, { children: isAr ? item.titleAr : item === null || item === void 0 ? void 0 : item.title })) }), item.id === (source === null || source === void 0 ? void 0 : source.id) && _jsx(CheckIconStyled, {})] }));
85
85
  } }) }))] })) })));
86
86
  };