@tap-payments/auth-jsconnect 1.0.99-test → 1.0.100-test

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/build/api/entity.d.ts +1 -0
  2. package/build/assets/locales/ar.json +3 -1
  3. package/build/assets/locales/en.json +3 -1
  4. package/build/constants/app.js +35 -5
  5. package/build/constants/validation.d.ts +1 -0
  6. package/build/constants/validation.js +1 -0
  7. package/build/features/app/bank/bankStore.js +6 -6
  8. package/build/features/app/business/businessStore.js +13 -6
  9. package/build/features/app/individual/individualStore.js +10 -9
  10. package/build/features/bank/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
  11. package/build/features/bank/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
  12. package/build/features/bank/screens/ResetPasswordSuccess/index.d.ts +3 -0
  13. package/build/features/bank/screens/ResetPasswordSuccess/index.js +2 -0
  14. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +9 -13
  15. package/build/features/business/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
  16. package/build/features/business/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
  17. package/build/features/business/screens/ResetPasswordSuccess/index.d.ts +3 -0
  18. package/build/features/business/screens/ResetPasswordSuccess/index.js +2 -0
  19. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +9 -13
  20. package/build/features/connect/screens/Merchant/validation.js +4 -2
  21. package/build/features/connect/screens/Mobile/Mobile.js +1 -1
  22. package/build/features/connect/screens/NID/NID.js +1 -1
  23. package/build/features/featuresScreens.js +15 -5
  24. package/build/features/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
  25. package/build/features/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
  26. package/build/features/individual/screens/ResetPasswordSuccess/index.d.ts +3 -0
  27. package/build/features/individual/screens/ResetPasswordSuccess/index.js +2 -0
  28. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +9 -13
  29. package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
  30. package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
  31. package/build/features/password/screens/ResetPasswordSuccess/index.d.ts +3 -0
  32. package/build/features/password/screens/ResetPasswordSuccess/index.js +2 -0
  33. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +9 -13
  34. package/build/features/shared/Button/FlowsButtons.js +3 -6
  35. package/build/features/shared/Button/SuccessButton.js +14 -0
  36. package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
  37. package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
  38. package/build/features/tax/screens/ResetPasswordSuccess/index.d.ts +3 -0
  39. package/build/features/tax/screens/ResetPasswordSuccess/index.js +2 -0
  40. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +9 -13
  41. package/build/utils/string.js +2 -1
  42. package/package.json +1 -1
@@ -1,6 +1,7 @@
1
1
  import { AxiosRequestConfig } from 'axios';
2
2
  export declare type EntityInfoBody = {
3
3
  id: string;
4
+ lead_id?: string;
4
5
  activities?: Array<string>;
5
6
  business_operation_start_at?: string;
6
7
  channel_services?: Array<string>;
@@ -240,5 +240,7 @@
240
240
  "tax_success_title": "Your tax details are updated",
241
241
  "bank_success_title": "Your bank details are updated",
242
242
  "password_success_title": "Your password is set",
243
- "bank": "bank"
243
+ "bank": "bank",
244
+ "reset_password_success_title": "لقد ارسلنا رسالة بريدية إليك",
245
+ "reset_password_success_description": "تحقق من بريدك الإلكتروني لإعادة تعيين كلمة المرور الخاصة بك."
244
246
  }
@@ -260,5 +260,7 @@
260
260
  "bank_success_title": "Your bank details are updated",
261
261
  "password_success_title": "Your password is set",
262
262
  "account_details": "Your account details",
263
- "bank": "bank"
263
+ "bank": "bank",
264
+ "reset_password_success_title": "We sent you an email",
265
+ "reset_password_success_description": "Check your email to reset your password."
264
266
  }
@@ -106,9 +106,15 @@ export var BUSINESS_SCREENS_NAVIGATION = [
106
106
  },
107
107
  {
108
108
  name: 'BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
109
+ next: 'BUSINESS_RESET_PASSWORD_SUCCESS',
110
+ prev: '',
111
+ order: 7
112
+ },
113
+ {
114
+ name: 'BUSINESS_RESET_PASSWORD_SUCCESS',
109
115
  next: '',
110
116
  prev: '',
111
- order: 6
117
+ order: 8
112
118
  }
113
119
  ];
114
120
  export var INDIVIDUAL_SCREENS_NAVIGATION = [
@@ -132,9 +138,15 @@ export var INDIVIDUAL_SCREENS_NAVIGATION = [
132
138
  },
133
139
  {
134
140
  name: 'INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
135
- next: '',
141
+ next: 'INDIVIDUAL_RESET_PASSWORD_SUCCESS',
136
142
  prev: '',
137
143
  order: 4
144
+ },
145
+ {
146
+ name: 'INDIVIDUAL_RESET_PASSWORD_SUCCESS',
147
+ next: '',
148
+ prev: '',
149
+ order: 5
138
150
  }
139
151
  ];
140
152
  export var PASSWORD_SCREENS_NAVIGATION = [
@@ -164,9 +176,15 @@ export var PASSWORD_SCREENS_NAVIGATION = [
164
176
  },
165
177
  {
166
178
  name: 'PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
167
- next: '',
179
+ next: 'PASSWORD_RESET_PASSWORD_SUCCESS',
168
180
  prev: '',
169
181
  order: 5
182
+ },
183
+ {
184
+ name: 'PASSWORD_RESET_PASSWORD_SUCCESS',
185
+ next: '',
186
+ prev: '',
187
+ order: 6
170
188
  }
171
189
  ];
172
190
  export var BANK_SCREENS_NAVIGATION = [
@@ -190,9 +208,15 @@ export var BANK_SCREENS_NAVIGATION = [
190
208
  },
191
209
  {
192
210
  name: 'BANK_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
193
- next: '',
211
+ next: 'BANK_RESET_PASSWORD_SUCCESS',
194
212
  prev: '',
195
213
  order: 4
214
+ },
215
+ {
216
+ name: 'BANK_RESET_PASSWORD_SUCCESS',
217
+ next: '',
218
+ prev: '',
219
+ order: 5
196
220
  }
197
221
  ];
198
222
  export var TAX_SCREENS_NAVIGATION = [
@@ -216,9 +240,15 @@ export var TAX_SCREENS_NAVIGATION = [
216
240
  },
217
241
  {
218
242
  name: 'TAX_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
219
- next: '',
243
+ next: 'TAX_RESET_PASSWORD_SUCCESS',
220
244
  prev: 'TAX_DETAILS_SUCCESS_STEP',
221
245
  order: 4
246
+ },
247
+ {
248
+ name: 'TAX_RESET_PASSWORD_SUCCESS',
249
+ next: '',
250
+ prev: '',
251
+ order: 5
222
252
  }
223
253
  ];
224
254
  export var DefaultDeviceInfo = {
@@ -8,3 +8,4 @@ export declare const SAUDI_NUMBER_LENGTH = 9;
8
8
  export declare const REGEX_FULL_NAME: RegExp;
9
9
  export declare const REGEX_WEBSITE: RegExp;
10
10
  export declare const REGEX_BENEFICIARY_NAME: RegExp;
11
+ export declare const REGEX_BRAND_NAME: RegExp;
@@ -8,3 +8,4 @@ export var SAUDI_NUMBER_LENGTH = 9;
8
8
  export var REGEX_FULL_NAME = /^([a-zA-Z]{2,}\s{1}[a-zA-Z]{1,}|[a-zA-Z]+\s{1}[a-zA-Z.-]{1,}\s{1}[a-zA-Z.-]{1,}\s{1}[a-zA-Z]{1,}|[a-zA-Z]+\s{1}[a-zA-Z.-]{1,}\s{1}[a-zA-Z]{1,})$/g;
9
9
  export var REGEX_WEBSITE = /^[a-zA-Z0-9]+([\-\.]{1}[a-zA-Z0-9]+)*\.[a-zA-Z]{2,63}(:[0-9]{1,5})?(\/.*)?$/;
10
10
  export var REGEX_BENEFICIARY_NAME = /^([\u0600-\u065F\u066A-\u06EF\u06FA-\u06FFa-zA-Z\s])*$/g;
11
+ export var REGEX_BRAND_NAME = /(.*[a-zA-Z0-9]){3}/g;
@@ -155,16 +155,16 @@ export var retrieveEntityInfo = createAsyncThunk('retrieveBankEntityInfo', funct
155
155
  }); });
156
156
  export var createBankAccount = createAsyncThunk('createBankAccount', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
157
157
  var _a, settings, bank, iban, beneficiaryName, bank_name, requestBody, data;
158
- var _b, _c, _d;
159
- return __generator(this, function (_e) {
160
- switch (_e.label) {
158
+ var _b, _c, _d, _e;
159
+ return __generator(this, function (_f) {
160
+ switch (_f.label) {
161
161
  case 0:
162
162
  _a = thunkApi.getState(), settings = _a.settings, bank = _a.bank;
163
163
  iban = params.iban;
164
164
  beneficiaryName = params.beneficiaryName;
165
165
  bank_name = params.bankName;
166
166
  requestBody = {
167
- wallet_id: (_b = bank.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.merchant_wallet_id,
167
+ wallet_id: (_c = (_b = bank.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.merchant) === null || _c === void 0 ? void 0 : _c.wallet_id,
168
168
  is_acknowledged: params.confirmPolicy,
169
169
  bank_account: {
170
170
  iban: iban,
@@ -176,10 +176,10 @@ export var createBankAccount = createAsyncThunk('createBankAccount', function (p
176
176
  };
177
177
  return [4, API.entityService.createBankAccount(requestBody)];
178
178
  case 1:
179
- data = (_e.sent()).data;
179
+ data = (_f.sent()).data;
180
180
  if (!data.errors) {
181
181
  thunkApi.dispatch(handleNextScreenStep());
182
- (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, requestBody);
182
+ (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, requestBody);
183
183
  }
184
184
  return [2, { data: data, formData: params }];
185
185
  }
@@ -571,10 +571,10 @@ export var businessSlice = createSlice({
571
571
  state.error = null;
572
572
  })
573
573
  .addCase(verifyLeadOTP.fulfilled, function (state, action) {
574
- var _a, _b;
574
+ var _a, _b, _c;
575
575
  state.loading = false;
576
576
  state.error = null;
577
- var _c = action.payload, data = _c.data, formData = _c.formData;
577
+ var _d = action.payload, data = _d.data, formData = _d.formData;
578
578
  var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
579
579
  if (description) {
580
580
  state.error = description;
@@ -582,7 +582,7 @@ export var businessSlice = createSlice({
582
582
  }
583
583
  state.data.otpData = formData;
584
584
  state.data.otpData.responseBody = data;
585
- var _d = state.data.verify.responseBody || {}, entity = _d.entity, entity_activities = _d.entity_activities;
585
+ var _e = state.data.verify.responseBody || {}, entity = _e.entity, entity_activities = _e.entity_activities, business_type = _e.business_type;
586
586
  var issuingDate = (_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.issuing_date;
587
587
  if (!!issuingDate) {
588
588
  var formattedDate = moment(issuingDate).format('YYYY-MM-DD');
@@ -593,6 +593,13 @@ export var businessSlice = createSlice({
593
593
  if (!!selectedActivity)
594
594
  state.data.activitiesData.activities = [selectedActivity];
595
595
  state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activities: activities });
596
+ if (!!(entity === null || entity === void 0 ? void 0 : entity.license)) {
597
+ state.data.businessTypeData.selectedLicense = {
598
+ legal_name: entity === null || entity === void 0 ? void 0 : entity.legal_name,
599
+ license: { number: (_c = entity === null || entity === void 0 ? void 0 : entity.license) === null || _c === void 0 ? void 0 : _c.number },
600
+ type: business_type
601
+ };
602
+ }
596
603
  })
597
604
  .addCase(verifyLeadOTP.rejected, function (state, action) {
598
605
  state.loading = false;
@@ -766,9 +773,9 @@ export var businessSlice = createSlice({
766
773
  state.loading = false;
767
774
  state.error = null;
768
775
  var data = action.payload.data;
769
- var message = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).message;
770
- if (message) {
771
- state.error = message;
776
+ var _b = ((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}, message = _b.message, description = _b.description;
777
+ if (message || description) {
778
+ state.error = message || description;
772
779
  return;
773
780
  }
774
781
  if ((data === null || data === void 0 ? void 0 : data.status) === 'ALREADY_TAKEN') {
@@ -183,18 +183,19 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
183
183
  }); });
184
184
  export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
185
185
  var _a, settings, individual, requestBody, data;
186
- var _b, _c, _d, _e, _f, _g, _h;
187
- return __generator(this, function (_j) {
188
- switch (_j.label) {
186
+ var _b, _c, _d, _e, _f, _g, _h, _j;
187
+ return __generator(this, function (_k) {
188
+ switch (_k.label) {
189
189
  case 0:
190
190
  _a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
191
191
  requestBody = {
192
192
  id: (_b = individual.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.individual_id,
193
- occupation: (_c = params.occupation) === null || _c === void 0 ? void 0 : _c.id,
193
+ lead_id: (_c = individual.data.verify.responseBody) === null || _c === void 0 ? void 0 : _c.id,
194
+ occupation: (_d = params.occupation) === null || _d === void 0 ? void 0 : _d.id,
194
195
  employer_name: params.employerName,
195
- employer_country: (_d = params.employerLocation) === null || _d === void 0 ? void 0 : _d.iso2,
196
- source_income: [(_e = params.sourceIncome) === null || _e === void 0 ? void 0 : _e.id],
197
- actual_income: (_f = params.monthlyIncome) === null || _f === void 0 ? void 0 : _f.id,
196
+ employer_country: (_e = params.employerLocation) === null || _e === void 0 ? void 0 : _e.iso2,
197
+ source_income: [(_f = params.sourceIncome) === null || _f === void 0 ? void 0 : _f.id],
198
+ actual_income: (_g = params.monthlyIncome) === null || _g === void 0 ? void 0 : _g.id,
198
199
  is_relative_PEP: params.isPEP,
199
200
  is_influencer: params.isInfluencer,
200
201
  encryption_contract: ['employer_name', 'employer_city', 'actual_income', 'source_income[0]'],
@@ -202,10 +203,10 @@ export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', funct
202
203
  };
203
204
  return [4, API.entityService.updateIndividualInfo(requestBody)];
204
205
  case 1:
205
- data = (_j.sent()).data;
206
+ data = (_k.sent()).data;
206
207
  if (!(data === null || data === void 0 ? void 0 : data.errors)) {
207
208
  thunkApi.dispatch(handleNextScreenStep());
208
- (_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, requestBody);
209
+ (_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, requestBody);
209
210
  }
210
211
  return [2, { data: data, formData: params }];
211
212
  }
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface ResetPasswordSuccessProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: ResetPasswordSuccessProps) => JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import SuccessScreen from '../../../shared/SuccessScreen';
5
+ var ResetPasswordSuccess = function (_a) {
6
+ var t = useTranslation().t;
7
+ return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: t("reset_password_success_description"), showEmailProviders: true }));
8
+ };
9
+ export default React.memo(ResetPasswordSuccess);
@@ -0,0 +1,3 @@
1
+ import ResetPasswordSuccess, { ResetPasswordSuccessProps } from './ResetPasswordSuccess';
2
+ export type { ResetPasswordSuccessProps };
3
+ export default ResetPasswordSuccess;
@@ -0,0 +1,2 @@
1
+ import ResetPasswordSuccess from './ResetPasswordSuccess';
2
+ export default ResetPasswordSuccess;
@@ -10,13 +10,13 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
13
- import React, { memo, useEffect, useState } from 'react';
13
+ import { memo, useEffect, useState } from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { styled } from '@mui/material/styles';
16
16
  import { FlowsButtons } from '../../../shared/Button';
17
17
  import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
18
18
  import { useAppSelector, useLanguage } from '../../../../hooks';
19
- import { allAreTruthy, getResetFlowUrl, showLastFour } from '../../../../utils';
19
+ import { getResetFlowUrl, showLastFour } from '../../../../utils';
20
20
  import { bankSelector } from '../../../app/bank/bankStore';
21
21
  import Box from '@mui/material/Box';
22
22
  import Text from '../../../../components/Text';
@@ -47,19 +47,20 @@ var SuccessWithFlowButtons = function () {
47
47
  var _a, _b, _c;
48
48
  var t = useTranslation().t;
49
49
  var isAr = useLanguage().isAr;
50
- var _d = React.useState(false), isAcceptance = _d[0], setIsAcceptance = _d[1];
51
- var _e = React.useState(false), isPayout = _e[0], setIsPayout = _e[1];
52
50
  var data = useAppSelector(bankSelector).data;
53
- var _f = data.verify.responseBody || {}, flows = _f.flows, nameObj = _f.name, entity = _f.entity, brand = _f.brand, bank = _f.bank_account;
54
- var _g = useState([]), buttons = _g[0], setButtons = _g[1];
51
+ var _d = data.verify.responseBody || {}, flows = _d.flows, nameObj = _d.name, entity = _d.entity, brand = _d.brand, bank = _d.bank_account, merchant = _d.merchant, identification_id = _d.identification_id;
52
+ var _e = useState([]), buttons = _e[0], setButtons = _e[1];
55
53
  var username = ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.first) || '') + ' ' + ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.last) || '');
56
54
  var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
57
55
  var bankName = (bank === null || bank === void 0 ? void 0 : bank.name) || t('bank');
58
56
  var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
59
57
  var taxID = (entity === null || entity === void 0 ? void 0 : entity.tax_number) || '';
60
58
  var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || '';
59
+ var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
60
+ var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
61
+ var maskedId = !!identification_id ? " ".concat(t('masking_symbols')).concat(identification_id) : '';
61
62
  var settings = useAppSelector(settingsSelector);
62
- var _h = data.verify.responseBody || { contact: {}, id: '' }, contact = _h.contact, id = _h.id;
63
+ var _f = data.verify.responseBody || { contact: {}, id: '' }, contact = _f.contact, id = _f.id;
63
64
  var email = (contact || { email: '' }).email;
64
65
  var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, id);
65
66
  var reMapFlowData = function (flows) {
@@ -71,15 +72,13 @@ var SuccessWithFlowButtons = function () {
71
72
  var name = _a.name, url = _a.url, status = _a.status;
72
73
  var type = status === 'initiated' ? 'pending' : 'completed';
73
74
  var title = t("".concat(name, "_flow_").concat(type), {
74
- individual_name: username.toLowerCase(),
75
+ individual_name: username.toLowerCase() + maskedId,
75
76
  business_type: brandName,
76
77
  license_number: t('masking_symbols') + showLastFour(licenseNumber),
77
78
  bank_name: bankName,
78
79
  iban: t('masking_symbols') + iban,
79
80
  tax_id: t('masking_symbols') + showLastFour(taxID)
80
81
  });
81
- if ("business_flow_completed" === "".concat(name, "_flow_").concat(type))
82
- setIsAcceptance(true);
83
82
  var isCompleted = status === 'completed' && name !== 'password';
84
83
  var isIndividual = name === 'individual';
85
84
  var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
@@ -96,9 +95,6 @@ var SuccessWithFlowButtons = function () {
96
95
  };
97
96
  });
98
97
  setButtons(mappedFlows);
99
- var isAllCompleted = allAreTruthy(flows, 'completed', 'status', 'password');
100
- if (isAllCompleted)
101
- setIsPayout(true);
102
98
  };
103
99
  useEffect(function () {
104
100
  if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface ResetPasswordSuccessProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: ResetPasswordSuccessProps) => JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import SuccessScreen from '../../../shared/SuccessScreen';
5
+ var ResetPasswordSuccess = function (_a) {
6
+ var t = useTranslation().t;
7
+ return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: t("reset_password_success_description"), showEmailProviders: true }));
8
+ };
9
+ export default React.memo(ResetPasswordSuccess);
@@ -0,0 +1,3 @@
1
+ import ResetPasswordSuccess, { ResetPasswordSuccessProps } from './ResetPasswordSuccess';
2
+ export type { ResetPasswordSuccessProps };
3
+ export default ResetPasswordSuccess;
@@ -0,0 +1,2 @@
1
+ import ResetPasswordSuccess from './ResetPasswordSuccess';
2
+ export default ResetPasswordSuccess;
@@ -10,14 +10,14 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
13
- import React, { memo, useEffect, useState } from 'react';
13
+ import { memo, useEffect, useState } from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { styled } from '@mui/material/styles';
16
16
  import { FlowsButtons } from '../../../shared/Button';
17
17
  import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
18
18
  import { useAppSelector, useLanguage } from '../../../../hooks';
19
19
  import { businessSelector } from '../../../app/business/businessStore';
20
- import { allAreTruthy, getResetFlowUrl, showLastFour } from '../../../../utils';
20
+ import { getResetFlowUrl, showLastFour } from '../../../../utils';
21
21
  import Box from '@mui/material/Box';
22
22
  import Text from '../../../../components/Text';
23
23
  import Container from '../../../shared/Containers/ScreenContainer';
@@ -47,19 +47,20 @@ var SuccessWithFlowButtons = function () {
47
47
  var _a, _b, _c;
48
48
  var t = useTranslation().t;
49
49
  var isAr = useLanguage().isAr;
50
- var _d = React.useState(false), isAcceptance = _d[0], setIsAcceptance = _d[1];
51
- var _e = React.useState(false), isPayout = _e[0], setIsPayout = _e[1];
52
50
  var data = useAppSelector(businessSelector).data;
53
- var _f = data.verify.responseBody || {}, flows = _f.flows, nameObj = _f.name, entity = _f.entity, brand = _f.brand, bank = _f.bank_account;
54
- var _g = useState([]), buttons = _g[0], setButtons = _g[1];
51
+ var _d = data.verify.responseBody || {}, flows = _d.flows, nameObj = _d.name, entity = _d.entity, brand = _d.brand, bank = _d.bank_account, merchant = _d.merchant, identification_id = _d.identification_id;
52
+ var _e = useState([]), buttons = _e[0], setButtons = _e[1];
55
53
  var username = ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.first) || '') + ' ' + ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.last) || '');
56
54
  var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
57
55
  var bankName = (bank === null || bank === void 0 ? void 0 : bank.bank_name) || t('bank');
58
56
  var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
59
57
  var taxID = (entity === null || entity === void 0 ? void 0 : entity.tax_number) || '';
60
58
  var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || '';
59
+ var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
60
+ var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
61
+ var maskedId = !!identification_id ? " ".concat(t('masking_symbols')).concat(identification_id) : '';
61
62
  var settings = useAppSelector(settingsSelector);
62
- var _h = data.verify.responseBody || { contact: {}, id: '' }, contact = _h.contact, id = _h.id;
63
+ var _f = data.verify.responseBody || { contact: {}, id: '' }, contact = _f.contact, id = _f.id;
63
64
  var email = (contact || { email: '' }).email;
64
65
  var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, id);
65
66
  var reMapFlowData = function (flows) {
@@ -71,15 +72,13 @@ var SuccessWithFlowButtons = function () {
71
72
  var name = _a.name, url = _a.url, status = _a.status;
72
73
  var type = status === 'initiated' ? 'pending' : 'completed';
73
74
  var title = t("".concat(name, "_flow_").concat(type), {
74
- individual_name: username.toLowerCase(),
75
+ individual_name: username.toLowerCase() + maskedId,
75
76
  business_type: brandName,
76
77
  license_number: t('masking_symbols') + showLastFour(licenseNumber),
77
78
  bank_name: bankName,
78
79
  iban: t('masking_symbols') + iban,
79
80
  tax_id: t('masking_symbols') + showLastFour(taxID)
80
81
  });
81
- if ("business_flow_completed" === "".concat(name, "_flow_").concat(type))
82
- setIsAcceptance(true);
83
82
  var isCompleted = status === 'completed' && name !== 'password';
84
83
  var isIndividual = name === 'individual';
85
84
  var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
@@ -96,9 +95,6 @@ var SuccessWithFlowButtons = function () {
96
95
  };
97
96
  });
98
97
  setButtons(mappedFlows);
99
- var isAllCompleted = allAreTruthy(flows, 'completed', 'status', 'password');
100
- if (isAllCompleted)
101
- setIsPayout(true);
102
98
  };
103
99
  useEffect(function () {
104
100
  if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
@@ -1,4 +1,4 @@
1
- import { REGEX_WEBSITE } from '../../../../constants';
1
+ import { REGEX_WEBSITE, REGEX_BRAND_NAME } from '../../../../constants';
2
2
  import * as yup from 'yup';
3
3
  export var ValidationOptions;
4
4
  (function (ValidationOptions) {
@@ -17,7 +17,9 @@ export var MerchantValidationSchema = function (userType) {
17
17
  var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
18
18
  if (length === 0)
19
19
  return true;
20
- return length < 3 ? this.createError({ message: 'enter_brand_name_english_chars_numbers_space' }) : true;
20
+ return !(value === null || value === void 0 ? void 0 : value.match(REGEX_BRAND_NAME))
21
+ ? this.createError({ message: 'enter_brand_name_english_chars_numbers_space' })
22
+ : true;
21
23
  }
22
24
  })
23
25
  .required(''),
@@ -107,6 +107,6 @@ var Mobile = function (_a) {
107
107
  var disabled = !methods.formState.isValid || !!error;
108
108
  var title = t('join_our_community');
109
109
  var subTitle = t('ide_terms_and_conditions_description');
110
- return (_jsxs(ScreenContainer, { children: [(title || subTitle) && _jsx(MIDTitle, { show: !listActive, title: title, description: subTitle }), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(MobileNumber, { show: !isBusinessListActive, countries: settingsStore.data.countries, onListOpen: function () { return handleMenuListClick(ListType.CountryCodeList); }, onListClose: function () { return handleMenuListClick(); } }) }), _jsxs(Collapse, __assign({ in: !listActive }, { children: [_jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disableBack: true, disabled: disabled || settingsStore.loading, loading: loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: !methods.watch('mobile') }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), _jsx(AbsherButton, __assign({ disabled: settingsStore.loading || loading, onClick: function () { return onBack(); } }, { children: t('absher_button_label') }))] }))] }))] })) }))] }));
110
+ return (_jsxs(ScreenContainer, { children: [(title || subTitle) && _jsx(MIDTitle, { show: !listActive, title: title, description: subTitle }), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(MobileNumber, { show: !isBusinessListActive, countries: settingsStore.data.countries, onListOpen: function () { return handleMenuListClick(ListType.CountryCodeList); }, onListClose: function () { return handleMenuListClick(); } }) }), _jsxs(Collapse, __assign({ in: !listActive }, { children: [_jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disableBack: true, disabled: disabled || settingsStore.loading, loading: loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: !methods.formState.isValid }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), _jsx(AbsherButton, __assign({ disabled: settingsStore.loading || loading, onClick: function () { return onBack(); } }, { children: t('absher_button_label') }))] }))] }))] })) }))] }));
111
111
  };
112
112
  export default React.memo(Mobile);
@@ -85,6 +85,6 @@ var NID = function (_a) {
85
85
  dispatch(handlePrevScreenStep('CONNECT_MOBILE_STEP'));
86
86
  };
87
87
  var disabled = !methods.formState.isValid || !!error;
88
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(IDNumber, { show: !collapse }) })), _jsx(DOB, { onDateClicked: handleCollapseOpenClose }), _jsxs(Collapse, __assign({ in: !collapse }, { children: [_jsx(Button, __assign({ loading: loading, isAr: isAr, disableBack: true, disabled: disabled || settingsStore.loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: !methods.watch('nid') }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), _jsx(MobileButton, __assign({ onClick: function () { return onBack(); }, disabled: loading || settingsStore.loading }, { children: t('mobile_button_label') }))] }))] }))] })) })) }));
88
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(IDNumber, { show: !collapse }) })), _jsx(DOB, { onDateClicked: handleCollapseOpenClose }), _jsxs(Collapse, __assign({ in: !collapse }, { children: [_jsx(Button, __assign({ loading: loading, isAr: isAr, disableBack: true, disabled: disabled || settingsStore.loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: !methods.formState.isValid }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), _jsx(MobileButton, __assign({ onClick: function () { return onBack(); }, disabled: loading || settingsStore.loading }, { children: t('mobile_button_label') }))] }))] }))] })) })) }));
89
89
  };
90
90
  export default React.memo(NID);
@@ -12,23 +12,28 @@ import BusinessTypePage from './business/screens/BusinessType';
12
12
  import ActivitiesPage from './business/screens/Activities';
13
13
  import SuccessPage from './business/screens/Success';
14
14
  import SuccessWithFlowButtonsPage from './business/screens/SuccessWithFlowButtons';
15
+ import ResetPasswordSuccessPage from './business/screens/ResetPasswordSuccess';
15
16
  import PasswordVerifyPage from './password/screens/Verify';
16
17
  import CreatePasswordPage from './password/screens/CreatePassword';
17
18
  import PasswordOTPPage from './password/screens/OTP';
18
19
  import SuccessPasswordPage from './password/screens/Success';
19
20
  import PasswordSuccessWithFlowPage from './password/screens/SuccessWithFlowButtons';
21
+ import PasswordResetPasswordSuccessPage from './password/screens/ResetPasswordSuccess';
20
22
  import IndividualVerifyPage from './individual/screens/Verify';
21
23
  import AdditionalIndividualInfoPage from './individual/screens/AdditionalIndividualInfo';
22
24
  import SuccessOwnerPage from './individual/screens/Success';
23
25
  import IndividualSuccessWithFlowPage from './individual/screens/SuccessWithFlowButtons';
26
+ import IndividualResetPasswordSuccessPage from './individual/screens/ResetPasswordSuccess';
24
27
  import BankVerifyPage from './bank/screens/Verify';
25
28
  import BankDetailsPage from './bank/screens/BankDetails';
26
29
  import BankSuccessPage from './bank/screens/Success';
27
30
  import BankSuccessWithFlowPage from './bank/screens/SuccessWithFlowButtons';
31
+ import BankResetPasswordSuccessPage from './bank/screens/ResetPasswordSuccess';
28
32
  import TaxVerifyPage from './tax/screens/Verify';
29
33
  import TaxDetailsPage from './tax/screens/TaxDetails';
30
34
  import TaxSuccessPage from './tax/screens/Success';
31
35
  import TaxSuccessWithFlowPage from './tax/screens/SuccessWithFlowButtons';
36
+ import TaxResetPasswordSuccessPage from './tax/screens/ResetPasswordSuccess';
32
37
  export var connectFeatureScreens = [
33
38
  {
34
39
  name: 'CONNECT_NID_STEP',
@@ -81,7 +86,8 @@ export var businessFeatureScreens = [
81
86
  element: CustomersPage
82
87
  },
83
88
  { name: 'BUSINESS_SUCCESS_STEP', element: SuccessPage },
84
- { name: 'BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP', element: SuccessWithFlowButtonsPage }
89
+ { name: 'BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP', element: SuccessWithFlowButtonsPage },
90
+ { name: 'BUSINESS_RESET_PASSWORD_SUCCESS', element: ResetPasswordSuccessPage }
85
91
  ];
86
92
  export var passwordFeatureScreens = [
87
93
  {
@@ -103,7 +109,8 @@ export var passwordFeatureScreens = [
103
109
  {
104
110
  name: 'PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
105
111
  element: PasswordSuccessWithFlowPage
106
- }
112
+ },
113
+ { name: 'PASSWORD_RESET_PASSWORD_SUCCESS', element: PasswordResetPasswordSuccessPage }
107
114
  ];
108
115
  export var individualFeatureScreens = [
109
116
  {
@@ -121,7 +128,8 @@ export var individualFeatureScreens = [
121
128
  {
122
129
  name: 'INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
123
130
  element: IndividualSuccessWithFlowPage
124
- }
131
+ },
132
+ { name: 'INDIVIDUAL_RESET_PASSWORD_SUCCESS', element: IndividualResetPasswordSuccessPage }
125
133
  ];
126
134
  export var bankFeatureScreens = [
127
135
  {
@@ -139,7 +147,8 @@ export var bankFeatureScreens = [
139
147
  {
140
148
  name: 'BANK_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
141
149
  element: BankSuccessWithFlowPage
142
- }
150
+ },
151
+ { name: 'BANK_RESET_PASSWORD_SUCCESS', element: BankResetPasswordSuccessPage }
143
152
  ];
144
153
  export var taxFeatureScreens = [
145
154
  {
@@ -157,5 +166,6 @@ export var taxFeatureScreens = [
157
166
  {
158
167
  name: 'TAX_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
159
168
  element: TaxSuccessWithFlowPage
160
- }
169
+ },
170
+ { name: 'TAX_RESET_PASSWORD_SUCCESS', element: TaxResetPasswordSuccessPage }
161
171
  ];
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface ResetPasswordSuccessProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: ResetPasswordSuccessProps) => JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import SuccessScreen from '../../../shared/SuccessScreen';
5
+ var ResetPasswordSuccess = function (_a) {
6
+ var t = useTranslation().t;
7
+ return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: t("reset_password_success_description"), showEmailProviders: true }));
8
+ };
9
+ export default React.memo(ResetPasswordSuccess);
@@ -0,0 +1,3 @@
1
+ import ResetPasswordSuccess, { ResetPasswordSuccessProps } from './ResetPasswordSuccess';
2
+ export type { ResetPasswordSuccessProps };
3
+ export default ResetPasswordSuccess;
@@ -0,0 +1,2 @@
1
+ import ResetPasswordSuccess from './ResetPasswordSuccess';
2
+ export default ResetPasswordSuccess;
@@ -10,13 +10,13 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
13
- import React, { memo, useEffect, useState } from 'react';
13
+ import { memo, useEffect, useState } from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { styled } from '@mui/material/styles';
16
16
  import { FlowsButtons } from '../../../shared/Button';
17
17
  import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
18
18
  import { useAppSelector, useLanguage } from '../../../../hooks';
19
- import { allAreTruthy, getResetFlowUrl, showLastFour } from '../../../../utils';
19
+ import { getResetFlowUrl, showLastFour } from '../../../../utils';
20
20
  import { individualSelector } from '../../../app/individual/individualStore';
21
21
  import Box from '@mui/material/Box';
22
22
  import Text from '../../../../components/Text';
@@ -47,19 +47,20 @@ var SuccessWithFlowButtons = function () {
47
47
  var _a, _b, _c;
48
48
  var t = useTranslation().t;
49
49
  var isAr = useLanguage().isAr;
50
- var _d = React.useState(false), isAcceptance = _d[0], setIsAcceptance = _d[1];
51
- var _e = React.useState(false), isPayout = _e[0], setIsPayout = _e[1];
52
50
  var data = useAppSelector(individualSelector).data;
53
- var _f = data.verify.responseBody || {}, flows = _f.flows, nameObj = _f.name, entity = _f.entity, brand = _f.brand, bank = _f.bank_account;
54
- var _g = useState([]), buttons = _g[0], setButtons = _g[1];
51
+ var _d = data.verify.responseBody || {}, flows = _d.flows, nameObj = _d.name, entity = _d.entity, brand = _d.brand, bank = _d.bank_account, merchant = _d.merchant, identification_id = _d.identification_id;
52
+ var _e = useState([]), buttons = _e[0], setButtons = _e[1];
55
53
  var username = ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.first) || '') + ' ' + ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.last) || '');
56
54
  var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
57
55
  var bankName = (bank === null || bank === void 0 ? void 0 : bank.bank_name) || t('bank');
58
56
  var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
59
57
  var taxID = (entity === null || entity === void 0 ? void 0 : entity.tax_number) || '';
60
58
  var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || '';
59
+ var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
60
+ var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
61
+ var maskedId = !!identification_id ? " ".concat(t('masking_symbols')).concat(identification_id) : '';
61
62
  var settings = useAppSelector(settingsSelector);
62
- var _h = data.verify.responseBody || { contact: {}, id: '' }, contact = _h.contact, id = _h.id;
63
+ var _f = data.verify.responseBody || { contact: {}, id: '' }, contact = _f.contact, id = _f.id;
63
64
  var email = (contact || { email: '' }).email;
64
65
  var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, id);
65
66
  var reMapFlowData = function (flows) {
@@ -71,15 +72,13 @@ var SuccessWithFlowButtons = function () {
71
72
  var name = _a.name, url = _a.url, status = _a.status;
72
73
  var type = status === 'initiated' ? 'pending' : 'completed';
73
74
  var title = t("".concat(name, "_flow_").concat(type), {
74
- individual_name: username.toLowerCase(),
75
+ individual_name: username.toLowerCase() + maskedId,
75
76
  business_type: brandName,
76
77
  license_number: t('masking_symbols') + showLastFour(licenseNumber),
77
78
  bank_name: bankName,
78
79
  iban: t('masking_symbols') + iban,
79
80
  tax_id: t('masking_symbols') + showLastFour(taxID)
80
81
  });
81
- if ("business_flow_completed" === "".concat(name, "_flow_").concat(type))
82
- setIsAcceptance(true);
83
82
  var isCompleted = status === 'completed' && name !== 'password';
84
83
  var isIndividual = name === 'individual';
85
84
  var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
@@ -96,9 +95,6 @@ var SuccessWithFlowButtons = function () {
96
95
  };
97
96
  });
98
97
  setButtons(mappedFlows);
99
- var isAllCompleted = allAreTruthy(flows, 'completed', 'status', 'password');
100
- if (isAllCompleted)
101
- setIsPayout(true);
102
98
  };
103
99
  useEffect(function () {
104
100
  if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface ResetPasswordSuccessProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: ResetPasswordSuccessProps) => JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import SuccessScreen from '../../../shared/SuccessScreen';
5
+ var ResetPasswordSuccess = function (_a) {
6
+ var t = useTranslation().t;
7
+ return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: t("reset_password_success_description"), showEmailProviders: true }));
8
+ };
9
+ export default React.memo(ResetPasswordSuccess);
@@ -0,0 +1,3 @@
1
+ import ResetPasswordSuccess, { ResetPasswordSuccessProps } from './ResetPasswordSuccess';
2
+ export type { ResetPasswordSuccessProps };
3
+ export default ResetPasswordSuccess;
@@ -0,0 +1,2 @@
1
+ import ResetPasswordSuccess from './ResetPasswordSuccess';
2
+ export default ResetPasswordSuccess;
@@ -10,13 +10,13 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
13
- import React, { memo, useEffect, useState } from 'react';
13
+ import { memo, useEffect, useState } from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { styled } from '@mui/material/styles';
16
16
  import { FlowsButtons } from '../../../shared/Button';
17
17
  import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
18
18
  import { useAppSelector, useLanguage } from '../../../../hooks';
19
- import { allAreTruthy, getResetFlowUrl, showLastFour } from '../../../../utils';
19
+ import { getResetFlowUrl, showLastFour } from '../../../../utils';
20
20
  import { passwordSelector } from '../../../app/password/passwordStore';
21
21
  import Box from '@mui/material/Box';
22
22
  import Text from '../../../../components/Text';
@@ -47,19 +47,20 @@ var SuccessWithFlowButtons = function () {
47
47
  var _a, _b, _c;
48
48
  var t = useTranslation().t;
49
49
  var isAr = useLanguage().isAr;
50
- var _d = React.useState(false), isAcceptance = _d[0], setIsAcceptance = _d[1];
51
- var _e = React.useState(false), isPayout = _e[0], setIsPayout = _e[1];
52
50
  var data = useAppSelector(passwordSelector).data;
53
- var _f = data.verify.responseBody || {}, flows = _f.flows, nameObj = _f.name, entity = _f.entity, brand = _f.brand, bank = _f.bank_account;
54
- var _g = useState([]), buttons = _g[0], setButtons = _g[1];
51
+ var _d = data.verify.responseBody || {}, flows = _d.flows, nameObj = _d.name, entity = _d.entity, brand = _d.brand, bank = _d.bank_account, merchant = _d.merchant, identification_id = _d.identification_id;
52
+ var _e = useState([]), buttons = _e[0], setButtons = _e[1];
55
53
  var username = ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.first) || '') + ' ' + ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.last) || '');
56
54
  var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
57
55
  var bankName = (bank === null || bank === void 0 ? void 0 : bank.bank_name) || t('bank');
58
56
  var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
59
57
  var taxID = (entity === null || entity === void 0 ? void 0 : entity.tax_number) || '';
60
58
  var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || '';
59
+ var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
60
+ var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
61
+ var maskedId = !!identification_id ? " ".concat(t('masking_symbols')).concat(identification_id) : '';
61
62
  var settings = useAppSelector(settingsSelector);
62
- var _h = data.verify.responseBody || { contact: {}, id: '' }, contact = _h.contact, id = _h.id;
63
+ var _f = data.verify.responseBody || { contact: {}, id: '' }, contact = _f.contact, id = _f.id;
63
64
  var email = (contact || { email: '' }).email;
64
65
  var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, id);
65
66
  var reMapFlowData = function (flows) {
@@ -71,15 +72,13 @@ var SuccessWithFlowButtons = function () {
71
72
  var name = _a.name, url = _a.url, status = _a.status;
72
73
  var type = status === 'initiated' ? 'pending' : 'completed';
73
74
  var title = t("".concat(name, "_flow_").concat(type), {
74
- individual_name: username.toLowerCase(),
75
+ individual_name: username.toLowerCase() + maskedId,
75
76
  business_type: brandName,
76
77
  license_number: t('masking_symbols') + showLastFour(licenseNumber),
77
78
  bank_name: bankName,
78
79
  iban: t('masking_symbols') + iban,
79
80
  tax_id: t('masking_symbols') + showLastFour(taxID)
80
81
  });
81
- if ("business_flow_completed" === "".concat(name, "_flow_").concat(type))
82
- setIsAcceptance(true);
83
82
  var isCompleted = status === 'completed' && name !== 'password';
84
83
  var isIndividual = name === 'individual';
85
84
  var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
@@ -96,9 +95,6 @@ var SuccessWithFlowButtons = function () {
96
95
  };
97
96
  });
98
97
  setButtons(mappedFlows);
99
- var isAllCompleted = allAreTruthy(flows, 'completed', 'status', 'password');
100
- if (isAllCompleted)
101
- setIsPayout(true);
102
98
  };
103
99
  useEffect(function () {
104
100
  if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
@@ -54,7 +54,7 @@ import Link from '@mui/material/Link';
54
54
  import { ICONS_NAMES } from '../../../constants';
55
55
  import CheckIcon from '@mui/icons-material/Check';
56
56
  import { useAppDispatch, useLanguage } from '../../../hooks';
57
- import { handleOpen, handleCurrentActiveScreen } from '../../../app/settings';
57
+ import { handleOpen, handleCurrentActiveScreen, handleNextScreenStep } from '../../../app/settings';
58
58
  import { getScreenNameBasedOnFlow } from '../../../utils';
59
59
  import API from '../../../api';
60
60
  var Image = styled('img')(function (_a) {
@@ -159,11 +159,11 @@ export default function FlowsButtons(_a) {
159
159
  step_name: 'reset_password_auth',
160
160
  encryption_contract: ['user_credentail.email']
161
161
  };
162
+ dispatch(handleNextScreenStep());
162
163
  return [4, API.authService
163
164
  .createAuth(payload)
164
165
  .then(function (response) {
165
166
  var _a;
166
- setLoading(false);
167
167
  var data = response.data;
168
168
  var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
169
169
  if (description) {
@@ -173,11 +173,8 @@ export default function FlowsButtons(_a) {
173
173
  })
174
174
  .catch(function (error) {
175
175
  alert(error);
176
- setLoading(false);
177
176
  })
178
- .finally(function () {
179
- setLoading(false);
180
- })];
177
+ .finally(function () { })];
181
178
  case 1:
182
179
  _a.sent();
183
180
  return [2];
@@ -47,6 +47,20 @@ var ButtonStyled = styled(Button)(function (_a) {
47
47
  easing: theme.transitions.easing.easeInOut,
48
48
  duration: theme.transitions.duration.complex * 2
49
49
  })
50
+ },
51
+ '&.MuiButton-contained': {
52
+ color: theme.palette.common.white,
53
+ backgroundColor: theme.palette.primary.main,
54
+ '&:hover': {
55
+ backgroundColor: theme.palette.primary.main
56
+ },
57
+ '&:active': {
58
+ backgroundColor: theme.palette.primary.main
59
+ },
60
+ ':disabled': {
61
+ backgroundColor: theme.palette.primary.main,
62
+ color: theme.palette.common.white
63
+ }
50
64
  }
51
65
  });
52
66
  });
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface ResetPasswordSuccessProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: ResetPasswordSuccessProps) => JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import SuccessScreen from '../../../shared/SuccessScreen';
5
+ var ResetPasswordSuccess = function (_a) {
6
+ var t = useTranslation().t;
7
+ return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: t("reset_password_success_description"), showEmailProviders: true }));
8
+ };
9
+ export default React.memo(ResetPasswordSuccess);
@@ -0,0 +1,3 @@
1
+ import ResetPasswordSuccess, { ResetPasswordSuccessProps } from './ResetPasswordSuccess';
2
+ export type { ResetPasswordSuccessProps };
3
+ export default ResetPasswordSuccess;
@@ -0,0 +1,2 @@
1
+ import ResetPasswordSuccess from './ResetPasswordSuccess';
2
+ export default ResetPasswordSuccess;
@@ -10,13 +10,13 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
13
- import React, { memo, useEffect, useState } from 'react';
13
+ import { memo, useEffect, useState } from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { styled } from '@mui/material/styles';
16
16
  import { FlowsButtons } from '../../../shared/Button';
17
17
  import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
18
18
  import { useAppSelector, useLanguage } from '../../../../hooks';
19
- import { allAreTruthy, getResetFlowUrl, showLastFour } from '../../../../utils';
19
+ import { getResetFlowUrl, showLastFour } from '../../../../utils';
20
20
  import { taxSelector } from '../../../app/tax/taxStore';
21
21
  import Box from '@mui/material/Box';
22
22
  import Text from '../../../../components/Text';
@@ -47,19 +47,20 @@ var SuccessWithFlowButtons = function () {
47
47
  var _a, _b, _c;
48
48
  var t = useTranslation().t;
49
49
  var isAr = useLanguage().isAr;
50
- var _d = React.useState(false), isAcceptance = _d[0], setIsAcceptance = _d[1];
51
- var _e = React.useState(false), isPayout = _e[0], setIsPayout = _e[1];
52
50
  var data = useAppSelector(taxSelector).data;
53
- var _f = data.verify.responseBody || {}, flows = _f.flows, nameObj = _f.name, entity = _f.entity, brand = _f.brand, bank = _f.bank_account;
54
- var _g = useState([]), buttons = _g[0], setButtons = _g[1];
51
+ var _d = data.verify.responseBody || {}, flows = _d.flows, nameObj = _d.name, entity = _d.entity, brand = _d.brand, bank = _d.bank_account, merchant = _d.merchant, identification_id = _d.identification_id;
52
+ var _e = useState([]), buttons = _e[0], setButtons = _e[1];
55
53
  var username = ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.first) || '') + ' ' + ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.last) || '');
56
54
  var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
57
55
  var bankName = (bank === null || bank === void 0 ? void 0 : bank.bank_name) || t('bank');
58
56
  var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
59
57
  var taxID = (entity === null || entity === void 0 ? void 0 : entity.tax_number) || '';
60
58
  var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || '';
59
+ var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
60
+ var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
61
+ var maskedId = !!identification_id ? " ".concat(t('masking_symbols')).concat(identification_id) : '';
61
62
  var settings = useAppSelector(settingsSelector);
62
- var _h = data.verify.responseBody || { contact: {}, id: '' }, contact = _h.contact, id = _h.id;
63
+ var _f = data.verify.responseBody || { contact: {}, id: '' }, contact = _f.contact, id = _f.id;
63
64
  var email = (contact || { email: '' }).email;
64
65
  var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, id);
65
66
  var reMapFlowData = function (flows) {
@@ -71,15 +72,13 @@ var SuccessWithFlowButtons = function () {
71
72
  var name = _a.name, url = _a.url, status = _a.status;
72
73
  var type = status === 'initiated' ? 'pending' : 'completed';
73
74
  var title = t("".concat(name, "_flow_").concat(type), {
74
- individual_name: username.toLowerCase(),
75
+ individual_name: username.toLowerCase() + maskedId,
75
76
  business_type: brandName,
76
77
  license_number: t('masking_symbols') + showLastFour(licenseNumber),
77
78
  bank_name: bankName,
78
79
  iban: t('masking_symbols') + iban,
79
80
  tax_id: t('masking_symbols') + showLastFour(taxID)
80
81
  });
81
- if ("business_flow_completed" === "".concat(name, "_flow_").concat(type))
82
- setIsAcceptance(true);
83
82
  var isCompleted = status === 'completed' && name !== 'password';
84
83
  var isIndividual = name === 'individual';
85
84
  var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
@@ -96,9 +95,6 @@ var SuccessWithFlowButtons = function () {
96
95
  };
97
96
  });
98
97
  setButtons(mappedFlows);
99
- var isAllCompleted = allAreTruthy(flows, 'completed', 'status', 'password');
100
- if (isAllCompleted)
101
- setIsPayout(true);
102
98
  };
103
99
  useEffect(function () {
104
100
  if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
@@ -75,6 +75,7 @@ export var capitalizeTheFirstLetterOfEachWord = function (words) {
75
75
  };
76
76
  export var getRequestHeaders = function (deviceInfo) {
77
77
  var app = deviceInfo.app, browser = deviceInfo.browser, connection = deviceInfo.connection, device = deviceInfo.device, source = deviceInfo.source;
78
+ console.log('bi:', browser.browser_id);
78
79
  return {
79
80
  al: encryptString(app.language || ''),
80
81
  at: encryptString(source || ''),
@@ -93,7 +94,7 @@ export var getRequestHeaders = function (deviceInfo) {
93
94
  bb: encryptString(''),
94
95
  bv: encryptString(browser.version || ''),
95
96
  bua: encryptString((browser.user_agent || '').substring(0, 80)),
96
- bi: encryptString(browser.browser_id || ''),
97
+ bi: browser.browser_id || '',
97
98
  ci: encryptString(connection.ip || ''),
98
99
  cm: encryptString(connection.mac || ''),
99
100
  l: encryptString((connection.latitude || 0).toString() + '-' + (connection.longitude || 0).toString())
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "1.0.99-test",
3
+ "version": "1.0.100-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",