@tap-payments/auth-jsconnect 2.11.0-sandbox → 2.11.0
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/form.d.ts +4 -2
- package/build/@types/terminal.d.ts +32 -44
- package/build/api/account.d.ts +2 -2
- package/build/api/account.js +7 -4
- package/build/api/auth.d.ts +8 -2
- package/build/api/auth.js +7 -3
- package/build/api/axios.d.ts +1 -1
- package/build/api/entity.d.ts +3 -0
- package/build/api/headers.d.ts +5 -0
- package/build/api/headers.js +3 -0
- package/build/api/index.d.ts +6 -6
- package/build/api/lead.d.ts +1 -0
- package/build/api/operator.d.ts +1 -1
- package/build/api/operator.js +5 -2
- package/build/api/terminal.d.ts +3 -6
- package/build/api/terminal.js +22 -12
- package/build/assets/currencies/AEDSymbol.js +1 -1
- package/build/assets/currencies/SARSymbol.js +1 -1
- package/build/assets/locales/ar.json +10 -6
- package/build/assets/locales/en.json +13 -8
- package/build/components/DeviceCard/DeviceCard.d.ts +3 -2
- package/build/components/DeviceCard/DeviceCard.js +9 -10
- package/build/components/TruncatedTooltipText/TruncatedTooltipText.d.ts +7 -0
- package/build/components/TruncatedTooltipText/TruncatedTooltipText.js +33 -0
- package/build/components/TruncatedTooltipText/index.d.ts +2 -0
- package/build/components/TruncatedTooltipText/index.js +2 -0
- package/build/constants/api.d.ts +2 -0
- package/build/constants/api.js +4 -0
- package/build/constants/app.d.ts +12 -2
- package/build/constants/app.js +142 -41
- package/build/constants/flows.d.ts +2 -1
- package/build/constants/flows.js +2 -1
- package/build/constants/validation.d.ts +1 -0
- package/build/constants/validation.js +1 -0
- package/build/features/app/auth/authStore.js +64 -54
- package/build/features/app/bank/bankStore.js +24 -20
- package/build/features/app/board/boardStore.js +11 -7
- package/build/features/app/brand/brandStore.js +22 -18
- package/build/features/app/business/businessStore.js +45 -36
- package/build/features/app/connect/connectStore.d.ts +6 -5
- package/build/features/app/connect/connectStore.js +48 -31
- package/build/features/app/connectExpress/connectExpressStore.d.ts +6 -5
- package/build/features/app/connectExpress/connectExpressStore.js +61 -20
- package/build/features/app/entity/entityStore.js +21 -17
- package/build/features/app/individual/individualStore.js +34 -28
- package/build/features/app/password/passwordStore.js +44 -46
- package/build/features/app/signIn/signInStore.js +12 -16
- package/build/features/app/tax/taxStore.js +20 -16
- package/build/features/app/terminal/terminalStore.d.ts +8 -7
- package/build/features/app/terminal/terminalStore.js +93 -63
- package/build/features/auth/screens/AuthenticationList/AuthenticationList.js +10 -7
- package/build/features/auth/screens/AuthenticationList/EntityLicenseType.d.ts +4 -1
- package/build/features/auth/screens/AuthenticationList/EntityLicenseType.js +6 -4
- package/build/features/auth/screens/AuthenticationList/EntityList.js +11 -3
- package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +1 -1
- package/build/features/business/screens/BusinessType/BusinessType.js +15 -5
- package/build/features/business/screens/BusinessType/EntityLicenseList.js +11 -5
- package/build/features/business/screens/BusinessType/LicenseList.js +20 -12
- package/build/features/business/screens/BusinessType/UnifiedNumber.d.ts +35 -0
- package/build/features/business/screens/BusinessType/UnifiedNumber.js +84 -0
- package/build/features/business/screens/BusinessType/validation.d.ts +6 -3
- package/build/features/business/screens/BusinessType/validation.js +31 -10
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +1 -1
- package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +10 -10
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +4 -1
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.js +6 -4
- package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +11 -3
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +1 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +27 -16
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +2 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.js +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.d.ts +36 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.js +81 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.d.ts +6 -3
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +57 -21
- package/build/features/connectExpress/screens/Mobile/Mobile.js +7 -6
- package/build/features/entity/screens/EntityName/EntityName.js +16 -15
- package/build/features/entity/screens/EntityName/UnifiedNumber.js +2 -2
- package/build/features/entity/screens/EntityName/validation.d.ts +50 -48
- package/build/features/entity/screens/EntityName/validation.js +100 -85
- package/build/features/featuresScreens.js +63 -3
- package/build/features/shared/Button/FlowsButtons.d.ts +1 -0
- package/build/features/shared/Button/FlowsButtons.js +1 -1
- package/build/features/shared/OTPVerifySecurityError/OTPVerifySecurityError.js +9 -0
- package/build/features/shared/OTPVerifySecurityError/index.d.ts +2 -0
- package/build/features/shared/OTPVerifySecurityError/index.js +2 -0
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +2 -1
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +3 -2
- package/build/features/terminal/Terminal.js +2 -2
- package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.js +8 -9
- package/build/features/terminal/screens/LinkNewTerminal/styles.js +2 -2
- package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.js +5 -6
- package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.js +15 -10
- package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.js +59 -12
- package/build/features/terminal/screens/POSDeviceListPage/POSDeviceListPage.d.ts +3 -0
- package/build/features/terminal/screens/POSDeviceListPage/POSDeviceListPage.js +50 -0
- package/build/features/terminal/screens/POSDeviceListPage/index.d.ts +2 -0
- package/build/features/terminal/screens/POSDeviceListPage/index.js +2 -0
- package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -5
- package/build/features/terminal/screens/TerminalDeviceList/DeviceList.d.ts +3 -3
- package/build/features/terminal/screens/TerminalDeviceList/DeviceList.js +2 -2
- package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.js +26 -17
- package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.js +5 -7
- package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.js +12 -11
- package/build/features/terminal/screens/Verify/Verify.js +6 -2
- package/build/features/terminal/screens/shared/POSDeviceList.d.ts +11 -0
- package/build/features/terminal/screens/shared/POSDeviceList.js +30 -0
- package/build/features/terminal/screens/shared/index.d.ts +2 -2
- package/build/features/terminal/screens/shared/index.js +2 -2
- package/build/features/terminal/screens/shared/styles.d.ts +1 -1
- package/build/features/terminal/screens/shared/styles.js +1 -1
- package/build/features/terminal/screens/shared/utils.d.ts +4 -4
- package/build/features/terminal/screens/shared/utils.js +9 -9
- package/build/utils/common.js +11 -4
- package/build/utils/error.d.ts +3 -0
- package/build/utils/error.js +9 -0
- package/build/utils/string.d.ts +2 -1
- package/build/utils/string.js +3 -2
- package/build/utils/validation.js +1 -1
- package/package.json +3 -3
- package/build/features/terminal/screens/TerminalListPage/TerminalListPage.js +0 -42
- package/build/features/terminal/screens/TerminalListPage/index.d.ts +0 -2
- package/build/features/terminal/screens/TerminalListPage/index.js +0 -2
- package/build/features/terminal/screens/shared/TerminalList.d.ts +0 -11
- package/build/features/terminal/screens/shared/TerminalList.js +0 -25
- /package/build/features/{terminal/screens/TerminalListPage/TerminalListPage.d.ts → shared/OTPVerifySecurityError/OTPVerifySecurityError.d.ts} +0 -0
|
@@ -54,12 +54,23 @@ var EntityName = function (_a) {
|
|
|
54
54
|
var isCR = licenseType === BusinessType.CR;
|
|
55
55
|
var _j = data.verify.responseBody || {}, entity = _j.entity, flows = _j.flows, entityTypes = _j.entityTypes;
|
|
56
56
|
var _k = entity || {}, AOA_file = _k.AOA_file, id = _k.id, documents = _k.documents, data_status = _k.data_status, data_verification = _k.data_verification, legal_name = _k.legal_name, type = _k.type, license = _k.license;
|
|
57
|
+
var noneEditable = useDataNoneEditable(data_status, [
|
|
58
|
+
'legal_name.en',
|
|
59
|
+
'legal_name.ar',
|
|
60
|
+
'type',
|
|
61
|
+
'license.number',
|
|
62
|
+
'license.additional_info',
|
|
63
|
+
'license.issuing_date',
|
|
64
|
+
'license.expiry_date',
|
|
65
|
+
'documents',
|
|
66
|
+
'AOA_file_id'
|
|
67
|
+
]);
|
|
57
68
|
var getSchema = function () {
|
|
58
69
|
if (isSACountry)
|
|
59
|
-
return EntityNameValidationSchema();
|
|
70
|
+
return EntityNameValidationSchema(noneEditable);
|
|
60
71
|
if (isKWCountry)
|
|
61
|
-
return EntityNameKWValidationSchema();
|
|
62
|
-
return EntityNameOtherCountryValidationSchema();
|
|
72
|
+
return EntityNameKWValidationSchema(noneEditable);
|
|
73
|
+
return EntityNameOtherCountryValidationSchema(noneEditable);
|
|
63
74
|
};
|
|
64
75
|
var methods = useForm({
|
|
65
76
|
resolver: yupResolver(getSchema()),
|
|
@@ -93,17 +104,6 @@ var EntityName = function (_a) {
|
|
|
93
104
|
articleId: defaultArticleFile === null || defaultArticleFile === void 0 ? void 0 : defaultArticleFile.id
|
|
94
105
|
}).isDirty;
|
|
95
106
|
var originalReadOnly = useFormReadOnly(methods, { certificateId: defaultCertificateFiles, articleId: defaultArticleFile });
|
|
96
|
-
var noneEditable = useDataNoneEditable(data_status, [
|
|
97
|
-
'legal_name.en',
|
|
98
|
-
'legal_name.ar',
|
|
99
|
-
'type',
|
|
100
|
-
'license.number',
|
|
101
|
-
'license.additional_info',
|
|
102
|
-
'license.issuing_date',
|
|
103
|
-
'license.expiry_date',
|
|
104
|
-
'documents',
|
|
105
|
-
'AOA_file_id'
|
|
106
|
-
]);
|
|
107
107
|
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
|
|
108
108
|
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
109
109
|
var dataVerified = useDataVerified(data_verification, [
|
|
@@ -155,8 +155,9 @@ var EntityName = function (_a) {
|
|
|
155
155
|
}, [methods.formState.isValid]);
|
|
156
156
|
var disabled = !methods.formState.isValid || uploading || uploadingArticle;
|
|
157
157
|
var showLicenseNumber = isKWCountry ? isCR : true;
|
|
158
|
+
var showExpiryDate = isSACountry ? !isCR : true;
|
|
158
159
|
var showUnifiedNumber = isSACountry ? isCR : false;
|
|
159
160
|
var disableBack = settingsData.appConfig.mode === 'content';
|
|
160
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: _jsx(LegalName, { readOnly: readOnly['legalName'] || (noneEditable['legal_name.en'] && noneEditable['legal_name.ar']), isVerified: isLegalNameVerified }) })), _jsx(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl }, { children: _jsx(EntityTypeList, { readOnly: readOnly['entityType'] || noneEditable['type'], onListOpen: function () { return handleEntityOpenClose(true); }, onListClose: function () { return handleEntityOpenClose(false); }, isVerified: isEntityTypeVerified }) })), _jsxs(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: [_jsx(
|
|
161
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: _jsx(LegalName, { readOnly: readOnly['legalName'] || (noneEditable['legal_name.en'] && noneEditable['legal_name.ar']), isVerified: isLegalNameVerified }) })), _jsx(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl }, { children: _jsx(EntityTypeList, { readOnly: readOnly['entityType'] || noneEditable['type'], onListOpen: function () { return handleEntityOpenClose(true); }, onListClose: function () { return handleEntityOpenClose(false); }, isVerified: isEntityTypeVerified }) })), _jsxs(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: [_jsx(UnifiedNumber, { show: showUnifiedNumber, readOnly: readOnly['unifiedNumber'] || noneEditable['license.additional_info'], isVerified: isUnifiedNumberVerified }), _jsx(LicenseNumber, { show: showLicenseNumber, readOnly: readOnly['licenseNumber'] || noneEditable['license.number'], isVerified: isLicenseNumberVerified })] })), _jsx(Collapse, __assign({ in: !expiryAnchorEl && !entityTypeAnchorEl }, { children: _jsx(IssuingDate, { onDateClicked: handleIssueDateOpenClose, readOnly: readOnly['issuingDate'] || noneEditable['license.issuing_date'], isVerified: isIssuingDateVerified }) })), _jsx(Collapse, __assign({ in: !issueAnchorEl && !entityTypeAnchorEl && showExpiryDate }, { children: _jsx(ExpiryDate, { onDateClicked: handleExpiryDateOpenClose, readOnly: readOnly['expiryDate'] || noneEditable['license.expiry_date'], isVerified: isExpiryDateVerified }) })), _jsxs(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: [_jsx(LicenseCertificate, { defaultFiles: defaultCertificateFiles, show: isSACountry ? false : !isKWCountry || isCR, readOnly: readOnly['certificateId'] || noneEditable['documents'] }), _jsx(Article, { defaultFile: defaultArticleFile, show: !isSACountry, readOnly: readOnly['articleId'] || noneEditable['AOA_file_id'], isVerified: isArticleIdVerified })] })), _jsx(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: _jsx(Button, __assign({ disableBack: disableBack, onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
161
162
|
};
|
|
162
163
|
export default EntityName;
|
|
@@ -14,7 +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 { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
17
|
-
import {
|
|
17
|
+
import { removeAllCharsFromNumber } from '../../../../utils';
|
|
18
18
|
import Collapse from '../../../../components/Collapse';
|
|
19
19
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
20
20
|
import Input from '../../../shared/Input';
|
|
@@ -31,7 +31,7 @@ var UnifiedNumber = function (_a) {
|
|
|
31
31
|
var target = _a.target;
|
|
32
32
|
if (bckError)
|
|
33
33
|
dispatch(clearError());
|
|
34
|
-
var value =
|
|
34
|
+
var value = removeAllCharsFromNumber(target.value);
|
|
35
35
|
unifiedNumberControl.field.onChange(value);
|
|
36
36
|
};
|
|
37
37
|
var unifiedNumberControl = useController({ control: control, name: 'unifiedNumber' });
|
|
@@ -1,88 +1,90 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
declare type NonEditableMap = Record<string, boolean>;
|
|
3
|
+
export declare const EntityNameValidationSchema: (noneEditable: NonEditableMap) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
4
|
+
legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
4
5
|
licenseType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
5
|
-
entityType:
|
|
6
|
-
licenseNumber:
|
|
6
|
+
entityType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
7
|
+
licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
7
8
|
unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
8
|
-
issuingDate:
|
|
9
|
-
expiryDate:
|
|
9
|
+
issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
10
|
+
expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
10
11
|
certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
11
12
|
articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
12
13
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
13
|
-
legalName:
|
|
14
|
+
legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
14
15
|
licenseType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
15
|
-
entityType:
|
|
16
|
-
licenseNumber:
|
|
16
|
+
entityType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
17
|
+
licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
17
18
|
unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
18
|
-
issuingDate:
|
|
19
|
-
expiryDate:
|
|
19
|
+
issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
20
|
+
expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
20
21
|
certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
21
22
|
articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
22
23
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
23
|
-
legalName:
|
|
24
|
+
legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
24
25
|
licenseType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
25
|
-
entityType:
|
|
26
|
-
licenseNumber:
|
|
26
|
+
entityType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
27
|
+
licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
27
28
|
unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
28
|
-
issuingDate:
|
|
29
|
-
expiryDate:
|
|
29
|
+
issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
30
|
+
expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
30
31
|
certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
31
32
|
articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
32
33
|
}>>>;
|
|
33
|
-
export declare const EntityNameKWValidationSchema: () => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
34
|
-
legalName:
|
|
34
|
+
export declare const EntityNameKWValidationSchema: (noneEditable: NonEditableMap) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
35
|
+
legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
35
36
|
licenseType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
36
|
-
entityType:
|
|
37
|
-
licenseNumber:
|
|
38
|
-
issuingDate:
|
|
39
|
-
expiryDate:
|
|
37
|
+
entityType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
38
|
+
licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
39
|
+
issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
40
|
+
expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
40
41
|
certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
41
42
|
articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
42
43
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
43
|
-
legalName:
|
|
44
|
+
legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
44
45
|
licenseType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
45
|
-
entityType:
|
|
46
|
-
licenseNumber:
|
|
47
|
-
issuingDate:
|
|
48
|
-
expiryDate:
|
|
46
|
+
entityType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
47
|
+
licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
48
|
+
issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
49
|
+
expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
49
50
|
certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
50
51
|
articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
51
52
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
52
|
-
legalName:
|
|
53
|
+
legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
53
54
|
licenseType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
54
|
-
entityType:
|
|
55
|
-
licenseNumber:
|
|
56
|
-
issuingDate:
|
|
57
|
-
expiryDate:
|
|
55
|
+
entityType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
56
|
+
licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
57
|
+
issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
58
|
+
expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
58
59
|
certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
59
60
|
articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
60
61
|
}>>>;
|
|
61
|
-
export declare const EntityNameOtherCountryValidationSchema: () => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
62
|
-
legalName:
|
|
62
|
+
export declare const EntityNameOtherCountryValidationSchema: (noneEditable: NonEditableMap) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
63
|
+
legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
63
64
|
licenseType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
64
|
-
entityType:
|
|
65
|
-
licenseNumber:
|
|
66
|
-
issuingDate:
|
|
67
|
-
expiryDate:
|
|
65
|
+
entityType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
66
|
+
licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
67
|
+
issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
68
|
+
expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
68
69
|
certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
69
70
|
articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
70
71
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
71
|
-
legalName:
|
|
72
|
+
legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
72
73
|
licenseType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
73
|
-
entityType:
|
|
74
|
-
licenseNumber:
|
|
75
|
-
issuingDate:
|
|
76
|
-
expiryDate:
|
|
74
|
+
entityType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
75
|
+
licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
76
|
+
issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
77
|
+
expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
77
78
|
certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
78
79
|
articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
79
80
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
80
|
-
legalName:
|
|
81
|
+
legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
81
82
|
licenseType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
82
|
-
entityType:
|
|
83
|
-
licenseNumber:
|
|
84
|
-
issuingDate:
|
|
85
|
-
expiryDate:
|
|
83
|
+
entityType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
84
|
+
licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
85
|
+
issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
86
|
+
expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
86
87
|
certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
87
88
|
articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
88
89
|
}>>>;
|
|
90
|
+
export {};
|
|
@@ -1,67 +1,56 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
2
|
import { BusinessType } from '../../../../@types';
|
|
3
|
-
import { KW_MIN_LICENSE_LENGTH,
|
|
4
|
-
export var EntityNameValidationSchema = function () {
|
|
3
|
+
import { KW_MIN_LICENSE_LENGTH, UNIFIED_NUMBER_MIN_LENGTH } from '../../../../constants';
|
|
4
|
+
export var EntityNameValidationSchema = function (noneEditable) {
|
|
5
5
|
return yup.object().shape({
|
|
6
|
-
legalName:
|
|
7
|
-
.string()
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
legalName: noneEditable['legal_name.en'] && noneEditable['legal_name.ar']
|
|
7
|
+
? yup.string().optional()
|
|
8
|
+
: yup
|
|
9
|
+
.string()
|
|
10
|
+
.required('')
|
|
11
|
+
.test({
|
|
12
|
+
test: function (value) {
|
|
13
|
+
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
14
|
+
if (length === 0)
|
|
15
|
+
return true;
|
|
16
|
+
return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
|
|
17
|
+
}
|
|
18
|
+
}),
|
|
17
19
|
licenseType: yup.string().optional(),
|
|
18
|
-
entityType: yup.string().required('entity_type_required'),
|
|
19
|
-
licenseNumber: yup
|
|
20
|
-
|
|
21
|
-
.
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (length === 0)
|
|
27
|
-
return true;
|
|
28
|
-
if (isCR) {
|
|
29
|
-
return length >= CR_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'cr_max_length' });
|
|
20
|
+
entityType: noneEditable['type'] ? yup.string().optional() : yup.string().required('entity_type_required'),
|
|
21
|
+
licenseNumber: yup.string().optional(),
|
|
22
|
+
unifiedNumber: noneEditable['license.additional_info']
|
|
23
|
+
? yup.string().optional()
|
|
24
|
+
: yup.string().when('licenseType', function (licenseType) {
|
|
25
|
+
var isCR = licenseType === BusinessType.CR;
|
|
26
|
+
if (!isCR) {
|
|
27
|
+
return yup.string().optional();
|
|
30
28
|
}
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
return yup
|
|
30
|
+
.string()
|
|
31
|
+
.required('')
|
|
32
|
+
.test({
|
|
33
|
+
test: function (value) {
|
|
34
|
+
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
35
|
+
if (length >= UNIFIED_NUMBER_MIN_LENGTH)
|
|
36
|
+
return true;
|
|
37
|
+
if (length === 0)
|
|
38
|
+
return this.createError({ message: '' });
|
|
39
|
+
return this.createError({ message: 'unified_number_required' });
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}),
|
|
43
|
+
issuingDate: noneEditable['license.issuing_date'] ? yup.string().optional() : yup.string().required('choose_any_issuing_date'),
|
|
44
|
+
expiryDate: yup.string().optional(),
|
|
38
45
|
certificateId: yup.array().optional(),
|
|
39
46
|
articleId: yup.string().optional()
|
|
40
47
|
});
|
|
41
48
|
};
|
|
42
|
-
export var EntityNameKWValidationSchema = function () {
|
|
49
|
+
export var EntityNameKWValidationSchema = function (noneEditable) {
|
|
43
50
|
return yup.object().shape({
|
|
44
|
-
legalName:
|
|
45
|
-
.string()
|
|
46
|
-
|
|
47
|
-
.test({
|
|
48
|
-
test: function (value) {
|
|
49
|
-
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
50
|
-
if (length === 0)
|
|
51
|
-
return true;
|
|
52
|
-
return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
|
|
53
|
-
}
|
|
54
|
-
}),
|
|
55
|
-
licenseType: yup.string().optional(),
|
|
56
|
-
entityType: yup.string().required('entity_type_required'),
|
|
57
|
-
licenseNumber: yup
|
|
58
|
-
.string()
|
|
59
|
-
.when('licenseType', function (licenseType) {
|
|
60
|
-
var isCR = licenseType === BusinessType.CR;
|
|
61
|
-
if (!isCR) {
|
|
62
|
-
return yup.string().optional();
|
|
63
|
-
}
|
|
64
|
-
return yup
|
|
51
|
+
legalName: noneEditable['legal_name.en'] && noneEditable['legal_name.ar']
|
|
52
|
+
? yup.string().optional()
|
|
53
|
+
: yup
|
|
65
54
|
.string()
|
|
66
55
|
.required('')
|
|
67
56
|
.test({
|
|
@@ -69,37 +58,44 @@ export var EntityNameKWValidationSchema = function () {
|
|
|
69
58
|
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
70
59
|
if (length === 0)
|
|
71
60
|
return true;
|
|
72
|
-
return length >=
|
|
61
|
+
return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
|
|
62
|
+
}
|
|
63
|
+
}),
|
|
64
|
+
licenseType: yup.string().optional(),
|
|
65
|
+
entityType: noneEditable['type'] ? yup.string().optional() : yup.string().required('entity_type_required'),
|
|
66
|
+
licenseNumber: noneEditable['license.number']
|
|
67
|
+
? yup.string().optional()
|
|
68
|
+
: yup
|
|
69
|
+
.string()
|
|
70
|
+
.when('licenseType', function (licenseType) {
|
|
71
|
+
var isCR = licenseType === BusinessType.CR;
|
|
72
|
+
if (!isCR) {
|
|
73
|
+
return yup.string().optional();
|
|
73
74
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
return yup
|
|
76
|
+
.string()
|
|
77
|
+
.required('')
|
|
78
|
+
.test({
|
|
79
|
+
test: function (value) {
|
|
80
|
+
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
81
|
+
if (length === 0)
|
|
82
|
+
return true;
|
|
83
|
+
return length >= KW_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'cr_kw_max_length' });
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
})
|
|
87
|
+
.required(''),
|
|
88
|
+
issuingDate: noneEditable['license.issuing_date'] ? yup.string().optional() : yup.string().required('choose_any_issuing_date'),
|
|
89
|
+
expiryDate: noneEditable['license.expiry_date'] ? yup.string().optional() : yup.string().required('choose_any_expiry_date'),
|
|
79
90
|
certificateId: yup.array().optional(),
|
|
80
91
|
articleId: yup.string().optional()
|
|
81
92
|
});
|
|
82
93
|
};
|
|
83
|
-
export var EntityNameOtherCountryValidationSchema = function () {
|
|
94
|
+
export var EntityNameOtherCountryValidationSchema = function (noneEditable) {
|
|
84
95
|
return yup.object().shape({
|
|
85
|
-
legalName:
|
|
86
|
-
.string()
|
|
87
|
-
|
|
88
|
-
.test({
|
|
89
|
-
test: function (value) {
|
|
90
|
-
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
91
|
-
if (length === 0)
|
|
92
|
-
return true;
|
|
93
|
-
return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
|
|
94
|
-
}
|
|
95
|
-
}),
|
|
96
|
-
licenseType: yup.string().optional(),
|
|
97
|
-
entityType: yup.string().required('entity_type_required'),
|
|
98
|
-
licenseNumber: yup
|
|
99
|
-
.string()
|
|
100
|
-
.when('licenseType', function (licenseType) {
|
|
101
|
-
var isCR = licenseType === BusinessType.CR;
|
|
102
|
-
return yup
|
|
96
|
+
legalName: noneEditable['legal_name.en'] && noneEditable['legal_name.ar']
|
|
97
|
+
? yup.string().optional()
|
|
98
|
+
: yup
|
|
103
99
|
.string()
|
|
104
100
|
.required('')
|
|
105
101
|
.test({
|
|
@@ -107,13 +103,32 @@ export var EntityNameOtherCountryValidationSchema = function () {
|
|
|
107
103
|
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
108
104
|
if (length === 0)
|
|
109
105
|
return true;
|
|
110
|
-
return length >=
|
|
106
|
+
return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
|
|
111
107
|
}
|
|
112
|
-
})
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
108
|
+
}),
|
|
109
|
+
licenseType: yup.string().optional(),
|
|
110
|
+
entityType: noneEditable['type'] ? yup.string().optional() : yup.string().required('entity_type_required'),
|
|
111
|
+
licenseNumber: noneEditable['license.number']
|
|
112
|
+
? yup.string().optional()
|
|
113
|
+
: yup
|
|
114
|
+
.string()
|
|
115
|
+
.when('licenseType', function (licenseType) {
|
|
116
|
+
var isCR = licenseType === BusinessType.CR;
|
|
117
|
+
return yup
|
|
118
|
+
.string()
|
|
119
|
+
.required('')
|
|
120
|
+
.test({
|
|
121
|
+
test: function (value) {
|
|
122
|
+
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
123
|
+
if (length === 0)
|
|
124
|
+
return true;
|
|
125
|
+
return length >= KW_MIN_LICENSE_LENGTH ? true : this.createError({ message: isCR ? 'cr_kw_max_length' : 'fl_max_length' });
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
})
|
|
129
|
+
.required(''),
|
|
130
|
+
issuingDate: noneEditable['license.issuing_date'] ? yup.string().optional() : yup.string().required('choose_any_issuing_date'),
|
|
131
|
+
expiryDate: noneEditable['license.expiry_date'] ? yup.string().optional() : yup.string().required('choose_any_expiry_date'),
|
|
117
132
|
certificateId: yup.array().optional(),
|
|
118
133
|
articleId: yup.string().optional()
|
|
119
134
|
});
|