@tap-payments/auth-jsconnect 2.6.12-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.
- package/build/@types/app.d.ts +2 -1
- package/build/@types/app.js +1 -0
- package/build/app/settings.js +2 -5
- package/build/constants/app.js +11 -5
- package/build/constants/dummy.d.ts +45 -0
- package/build/constants/dummy.js +330 -0
- package/build/features/app/brand/brandStore.js +2 -2
- package/build/features/app/business/businessStore.d.ts +9 -2
- package/build/features/app/business/businessStore.js +38 -22
- package/build/features/app/connectExpress/connectExpressStore.js +27 -13
- package/build/features/app/individual/individualStore.js +5 -5
- package/build/features/business/screens/BusinessType/BusinessType.js +13 -5
- package/build/features/business/screens/BusinessType/EntityName.js +3 -3
- package/build/features/business/screens/BusinessType/LicenseList.js +3 -3
- package/build/features/business/screens/BusinessType/LicenseNumber.js +9 -8
- package/build/features/business/screens/BusinessType/validation.d.ts +10 -0
- package/build/features/business/screens/BusinessType/validation.js +16 -0
- package/build/features/connect/Connect.js +3 -3
- package/build/features/connect/screens/Mobile/Mobile.js +7 -6
- package/build/features/connect/screens/Mobile/MobileNumber.js +9 -6
- package/build/features/connectExpress/ConnectExpress.js +3 -3
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +12 -4
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +6 -6
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +8 -7
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.d.ts +13 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +67 -0
- package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +4 -0
- package/build/features/connectExpress/screens/IdentityOTP/OTP.js +1 -1
- package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +1 -1
- package/build/features/connectExpress/screens/Mobile/Mobile.js +2 -2
- package/build/features/connectExpress/screens/Mobile/MobileNumber.js +9 -6
- package/build/features/entity/screens/EntityName/EntityName.js +11 -4
- package/build/features/entity/screens/EntityName/LicenseNumber.js +5 -4
- package/build/features/entity/screens/EntityName/validation.d.ts +28 -0
- package/build/features/entity/screens/EntityName/validation.js +38 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +4 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +1 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +2 -2
- package/build/hooks/useCountry.d.ts +1 -0
- package/build/hooks/useCountry.js +4 -3
- package/build/utils/string.d.ts +1 -0
- package/build/utils/string.js +3 -0
- package/package.json +1 -1
package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js
CHANGED
|
@@ -19,7 +19,7 @@ import Box from '@mui/material/Box';
|
|
|
19
19
|
import { alpha, styled } from '@mui/material/styles';
|
|
20
20
|
import { useAppDispatch, useAppSelector, useSetFromDefaultValues, useLanguage, useFormReadOnly, useDataNoneEditable, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
|
|
21
21
|
import { DocumentPurpose, IndividualType } from '../../../../@types';
|
|
22
|
-
import { deepCopy, getIndividualType,
|
|
22
|
+
import { deepCopy, getIndividualType, isKW } from '../../../../utils';
|
|
23
23
|
import Form from '../../../../components/Form';
|
|
24
24
|
import Collapse from '../../../../components/Collapse';
|
|
25
25
|
import Text from '../../../../components/Text';
|
|
@@ -62,9 +62,9 @@ var AdditionalIndividualInfo = function (_a) {
|
|
|
62
62
|
var user = (verify.responseBody || {}).user;
|
|
63
63
|
var _d = data.individualData, occupation = _d.occupation, sourceIncome = _d.sourceIncome, monthlyIncome = _d.monthlyIncome, employerName = _d.employerName, isPEP = _d.isPEP, isInfluencer = _d.isInfluencer, civilID = _d.civilID, signatureFileId = _d.signatureFileId, civilIDUploading = _d.civilIDUploading, signatureFileUploading = _d.signatureFileUploading, shareCount = _d.shareCount, shareValue = _d.shareValue;
|
|
64
64
|
var _e = user || {}, documents = _e.documents, is_authorized = _e.is_authorized, data_status = _e.data_status, data_verification = _e.data_verification, names = _e.names, role = _e.role, occupationRes = _e.occupation, is_relative_PEP = _e.is_relative_PEP, is_influencer = _e.is_influencer, objects = _e.objects;
|
|
65
|
-
var
|
|
65
|
+
var isKWCountry = React.useMemo(function () { return isKW(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
|
|
66
66
|
var methods = useForm({
|
|
67
|
-
resolver: yupResolver(IndividualInfoValidationSchema(objects,
|
|
67
|
+
resolver: yupResolver(IndividualInfoValidationSchema(objects, isKWCountry)),
|
|
68
68
|
defaultValues: {
|
|
69
69
|
occupation: occupation,
|
|
70
70
|
sourceIncome: sourceIncome,
|
|
@@ -144,7 +144,7 @@ var AdditionalIndividualInfo = function (_a) {
|
|
|
144
144
|
var isMonthlyIncomeListActive = listActive === ListType.MonthlyIncomeList;
|
|
145
145
|
var isOccupationListActive = listActive === ListType.OccupationList;
|
|
146
146
|
var disabled = !methods.formState.isValid || civilIDUploading || signatureFileUploading;
|
|
147
|
-
return (_jsxs(ScreenContainer, { children: [_jsx(Collapse, __assign({ in: !listActive && !!is_authorized, timeout: 500 }, { children: _jsx(TextBoxStyled, { children: getUserName() || '' }) })), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Box, { children: [_jsx(Occupation, { isVerified: isOccupationVerified, readOnly: readOnly['occupation'] || noneEditable['occupation'], onListOpen: function () { return handleMenuClick(ListType.OccupationList); }, onListClose: function () { return handleMenuClick(); }, show: showOccupationFile && !isMonthlyIncomeListActive && !isSourceOfIncomeListActive }), _jsx(SourceOfIncome, { readOnly: readOnly['sourceIncome'] || noneEditable['source_of_income'], onListOpen: function () { return handleMenuClick(ListType.SourceOfIncomeList); }, onListClose: function () { return handleMenuClick(); }, show: showSourceOfIncome && !isMonthlyIncomeListActive && !isOccupationListActive }), _jsx(MonthlyIncome, { readOnly: readOnly['monthlyIncome'] || noneEditable['monthly_income'], show: showSourceOfIncome && !isSourceOfIncomeListActive && !isOccupationListActive, onListOpen: function () { return handleMenuClick(ListType.MonthlyIncomeList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(ShareCount, { show: !listActive && showShares, readOnly: readOnly['shareCount'] }), _jsx(ShareValue, { show: !listActive && showShares, readOnly: readOnly['shareValue'] }), _jsxs(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: [_jsx(CivilIDFile, { show:
|
|
147
|
+
return (_jsxs(ScreenContainer, { children: [_jsx(Collapse, __assign({ in: !listActive && !!is_authorized, timeout: 500 }, { children: _jsx(TextBoxStyled, { children: getUserName() || '' }) })), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Box, { children: [_jsx(Occupation, { isVerified: isOccupationVerified, readOnly: readOnly['occupation'] || noneEditable['occupation'], onListOpen: function () { return handleMenuClick(ListType.OccupationList); }, onListClose: function () { return handleMenuClick(); }, show: showOccupationFile && !isMonthlyIncomeListActive && !isSourceOfIncomeListActive }), _jsx(SourceOfIncome, { readOnly: readOnly['sourceIncome'] || noneEditable['source_of_income'], onListOpen: function () { return handleMenuClick(ListType.SourceOfIncomeList); }, onListClose: function () { return handleMenuClick(); }, show: showSourceOfIncome && !isMonthlyIncomeListActive && !isOccupationListActive }), _jsx(MonthlyIncome, { readOnly: readOnly['monthlyIncome'] || noneEditable['monthly_income'], show: showSourceOfIncome && !isSourceOfIncomeListActive && !isOccupationListActive, onListOpen: function () { return handleMenuClick(ListType.MonthlyIncomeList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(ShareCount, { show: !listActive && showShares, readOnly: readOnly['shareCount'] }), _jsx(ShareValue, { show: !listActive && showShares, readOnly: readOnly['shareValue'] }), _jsxs(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: [_jsx(CivilIDFile, { show: isKWCountry, readOnly: readOnly['civilID'], defaultFiles: defaultCivilIdFiles }), _jsx(SignatureFile, { show: is_authorized && showSignatureFile, readOnly: readOnly['signatureFileId'], defaultFiles: defaultSignatureFiles })] })), _jsx(PEPSwitch, { show: showIsPEP && !listActive, readOnly: readOnly['isPEP'] || noneEditable['is_relative_PEP'], isVerified: isPEPSwitchVerified }), _jsx(InfluencerSwitch, { show: showIsInfluencer && isKWCountry && !listActive, readOnly: readOnly['isInfluencer'] || noneEditable['is_influencer'], isVerified: isInfluencerSwitchVerified })] }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) }))] }));
|
|
148
148
|
};
|
|
149
149
|
export default React.memo(AdditionalIndividualInfo);
|
|
150
150
|
AdditionalIndividualInfo.defaultProps = {};
|
|
@@ -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>,
|
|
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,
|
|
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 &&
|
|
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,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
|
|
6
|
-
|
|
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
|
};
|
package/build/utils/string.d.ts
CHANGED
|
@@ -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;
|
package/build/utils/string.js
CHANGED
|
@@ -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
|
};
|