@tap-payments/auth-jsconnect 2.6.10-test → 2.6.13-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 (58) hide show
  1. package/build/@types/app.d.ts +2 -1
  2. package/build/@types/app.js +1 -0
  3. package/build/api/country.d.ts +1 -0
  4. package/build/api/country.js +8 -1
  5. package/build/api/index.d.ts +1 -0
  6. package/build/app/settings.js +2 -5
  7. package/build/constants/api.d.ts +1 -0
  8. package/build/constants/api.js +3 -1
  9. package/build/constants/app.js +11 -5
  10. package/build/constants/dummy.d.ts +45 -0
  11. package/build/constants/dummy.js +330 -0
  12. package/build/features/app/brand/brandStore.d.ts +2 -0
  13. package/build/features/app/brand/brandStore.js +19 -12
  14. package/build/features/app/business/businessStore.d.ts +5 -0
  15. package/build/features/app/business/businessStore.js +107 -72
  16. package/build/features/app/connectExpress/connectExpressStore.js +27 -13
  17. package/build/features/app/entity/entityStore.d.ts +2 -0
  18. package/build/features/app/entity/entityStore.js +23 -16
  19. package/build/features/app/individual/individualStore.d.ts +2 -0
  20. package/build/features/app/individual/individualStore.js +19 -12
  21. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -3
  22. package/build/features/business/screens/BusinessType/BusinessType.js +13 -5
  23. package/build/features/business/screens/BusinessType/EntityName.js +3 -3
  24. package/build/features/business/screens/BusinessType/LicenseList.js +3 -3
  25. package/build/features/business/screens/BusinessType/LicenseNumber.js +9 -8
  26. package/build/features/business/screens/BusinessType/validation.d.ts +10 -0
  27. package/build/features/business/screens/BusinessType/validation.js +16 -0
  28. package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -3
  29. package/build/features/connect/Connect.js +3 -3
  30. package/build/features/connect/screens/Mobile/Mobile.js +7 -6
  31. package/build/features/connect/screens/Mobile/MobileNumber.js +9 -6
  32. package/build/features/connectExpress/ConnectExpress.js +3 -3
  33. package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +12 -4
  34. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +6 -6
  35. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +8 -7
  36. package/build/features/connectExpress/screens/CollectBusinessInfo/validation.d.ts +13 -0
  37. package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +67 -0
  38. package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +4 -0
  39. package/build/features/connectExpress/screens/IdentityOTP/OTP.js +1 -1
  40. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +1 -1
  41. package/build/features/connectExpress/screens/Mobile/Mobile.js +2 -2
  42. package/build/features/connectExpress/screens/Mobile/MobileNumber.js +9 -6
  43. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +4 -6
  44. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +4 -6
  45. package/build/features/entity/screens/EntityName/EntityName.js +11 -4
  46. package/build/features/entity/screens/EntityName/LicenseNumber.js +5 -4
  47. package/build/features/entity/screens/EntityName/validation.d.ts +28 -0
  48. package/build/features/entity/screens/EntityName/validation.js +38 -0
  49. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +4 -4
  50. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +2 -2
  51. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -5
  52. package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +1 -1
  53. package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +2 -2
  54. package/build/hooks/useCountry.d.ts +1 -0
  55. package/build/hooks/useCountry.js +4 -3
  56. package/build/utils/string.d.ts +1 -0
  57. package/build/utils/string.js +3 -0
  58. package/package.json +1 -1
@@ -16,7 +16,7 @@ import { useController, useFormContext } from 'react-hook-form';
16
16
  import Box from '@mui/material/Box';
17
17
  import { styled } from '@mui/material/styles';
18
18
  import { settingsSelector } from '../../../../app/settings';
19
- import { findCurrencyByIso2, hasVerifiedValue } from '../../../../utils';
19
+ import { hasVerifiedValue } from '../../../../utils';
20
20
  import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
21
21
  import Collapse from '../../../../components/Collapse';
22
22
  import Text from '../../../../components/Text';
@@ -81,7 +81,7 @@ var MonthlyIncome = function (props) {
81
81
  var income = monthlyIncomeControl.field.value;
82
82
  var error = (_a = monthlyIncomeControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
83
83
  return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 0 } }, { children: [_jsx(InputSelect, { label: t('please_enter_actual_income', {
84
- currency: t(findCurrencyByIso2(countryCode.iso2))
84
+ currency: t(data.currency)
85
85
  }), required: true, readOnly: props.readOnly, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, placeholder: t('choose_any_source_of_income'), value: (isAr ? income === null || income === void 0 ? void 0 : income.range.ar : income === null || income === void 0 ? void 0 : income.range.en) || '', warningMessage: error && t(error), endAdornment: _jsx(EndAdornmentExpanded, { isVerified: isMonthlyIncomeVerified(income), anchorEl: anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'range.en', searchValuePath: ['range.en', 'range.ar'], list: incomeList, onSelectItem: onSelectItem, renderItem: function (item) {
86
86
  return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (income === null || income === void 0 ? void 0 : income.id) }, { children: isAr ? item.range.ar : item === null || item === void 0 ? void 0 : item.range.en })) }), item.id === (income === null || income === void 0 ? void 0 : income.id) && _jsx(CheckIcon, { isVerified: isMonthlyIncomeVerified(item) })] }));
87
87
  } }) }))] })) })));
@@ -14,8 +14,7 @@ import * as React from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
16
16
  import Collapse from '@mui/material/Collapse';
17
- import { findCurrencyByIso2, formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
18
- import { settingsSelector } from '../../../../app/settings';
17
+ import { formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
19
18
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
20
19
  import { ScreenContainer } from '../../../shared/Containers';
21
20
  import Input from '../../../shared/Input';
@@ -25,11 +24,10 @@ var ShareValue = function (_a) {
25
24
  var _b;
26
25
  var show = _a.show, readOnly = _a.readOnly;
27
26
  var t = useTranslation().t;
28
- var settingsData = useAppSelector(settingsSelector).data;
27
+ var data = useAppSelector(individualSelector).data;
29
28
  var control = useFormContext().control;
30
29
  var bckError = useAppSelector(individualSelector).error;
31
30
  var dispatch = useAppDispatch();
32
- var countryCode = settingsData.businessCountry.iso2;
33
31
  var handleChange = function (_a) {
34
32
  var target = _a.target;
35
33
  if (bckError)
@@ -41,7 +39,7 @@ var ShareValue = function (_a) {
41
39
  var shareValue = shareValueControl.field.value;
42
40
  var error = (_b = shareValueControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
43
41
  return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('share_value_label', {
44
- currency: t(findCurrencyByIso2(countryCode))
42
+ currency: t(data.currency)
45
43
  }), onChange: handleChange, value: shareValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('share_value_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: shareValue, error: error }) }) })) })));
46
44
  };
47
45
  export default React.memo(ShareValue);
@@ -1,6 +1,6 @@
1
1
  import * as yup from 'yup';
2
2
  import { IndividualType } from '../../../../@types';
3
- export declare const IndividualInfoValidationSchema: (objects: Array<IndividualType>, isSACountry: boolean) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
+ export declare const IndividualInfoValidationSchema: (objects: Array<IndividualType>, isKWCountry: boolean) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
4
4
  occupation: import("yup/lib/object").OptionalObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
5
5
  sourceIncome: import("yup/lib/object").OptionalObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
6
6
  monthlyIncome: import("yup/lib/object").OptionalObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
@@ -1,6 +1,6 @@
1
1
  import * as yup from 'yup';
2
2
  import { getIndividualType } from '../../../../utils';
3
- export var IndividualInfoValidationSchema = function (objects, isSACountry) {
3
+ export var IndividualInfoValidationSchema = function (objects, isKWCountry) {
4
4
  var isUserType = getIndividualType(objects).isUser;
5
5
  return yup.object().shape({
6
6
  occupation: isUserType ? yup.object().required('alert_choose_occupation') : yup.object().optional(),
@@ -9,7 +9,7 @@ export var IndividualInfoValidationSchema = function (objects, isSACountry) {
9
9
  civilID: yup.array().optional(),
10
10
  signatureFileId: yup.array().optional(),
11
11
  isPEP: isUserType ? yup.boolean().required('please_choose_relative_pep') : yup.boolean().optional().nullable(),
12
- isInfluencer: isUserType && !isSACountry ? yup.boolean().required('please_choose_are_you_influncer') : yup.boolean().optional().nullable(),
12
+ isInfluencer: isUserType && isKWCountry ? yup.boolean().required('please_choose_are_you_influncer') : yup.boolean().optional().nullable(),
13
13
  shareCount: yup.string().optional(),
14
14
  shareValue: yup.string().optional()
15
15
  });
@@ -1,4 +1,5 @@
1
1
  export declare const useCountry: (code: string) => {
2
2
  isKuwait: boolean;
3
3
  isSaudi: boolean;
4
+ isOther: boolean;
4
5
  };
@@ -1,7 +1,8 @@
1
- import { isKW } from '../utils';
1
+ import { isKW, isSA } from '../utils';
2
2
  import { useMemo } from 'react';
3
3
  export var useCountry = function (code) {
4
4
  var isKuwait = useMemo(function () { return isKW(code); }, [code]);
5
- var isSaudi = useMemo(function () { return isKW(code); }, [code]);
6
- return { isKuwait: isKuwait, isSaudi: isSaudi };
5
+ var isSaudi = useMemo(function () { return isSA(code); }, [code]);
6
+ var isOther = useMemo(function () { return !isKW(code) && !isSA(code); }, [code]);
7
+ return { isKuwait: isKuwait, isSaudi: isSaudi, isOther: isOther };
7
8
  };
@@ -46,6 +46,7 @@ export declare const getScreenNameBasedOnFlow: (flow: string, isAuthorizedUser?:
46
46
  export declare const getEighteenYearsAgo: () => string;
47
47
  export declare const isKW: (flag: string) => boolean;
48
48
  export declare const isSA: (flag: string) => boolean;
49
+ export declare const isOtherThanKWOrSA: (flag: string) => boolean;
49
50
  export declare const isLinkedIn: (flag: string) => boolean;
50
51
  export declare const isTwitter: (flag: string) => boolean;
51
52
  export declare const isWebsite: (flag: string) => boolean;
@@ -206,6 +206,9 @@ export var isKW = function (flag) {
206
206
  export var isSA = function (flag) {
207
207
  return ['sa', 'sau'].includes(flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
208
208
  };
209
+ export var isOtherThanKWOrSA = function (flag) {
210
+ return !isKW(flag) && !isSA(flag);
211
+ };
209
212
  export var isLinkedIn = function (flag) {
210
213
  return 'linkedin' === (flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
211
214
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.6.10-test",
3
+ "version": "2.6.13-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",