@tap-payments/auth-jsconnect 2.12.9-development → 2.12.9-sandbox

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 (60) hide show
  1. package/build/@types/app.d.ts +2 -0
  2. package/build/@types/app.js +1 -0
  3. package/build/@types/form.d.ts +1 -0
  4. package/build/api/document.d.ts +1 -1
  5. package/build/api/file.d.ts +1 -0
  6. package/build/api/file.js +9 -1
  7. package/build/api/index.d.ts +1 -0
  8. package/build/assets/locales/ar.json +13 -10
  9. package/build/assets/locales/en.json +8 -6
  10. package/build/components/Tooltip/Tooltip.js +1 -1
  11. package/build/constants/app.d.ts +3 -0
  12. package/build/constants/app.js +15 -6
  13. package/build/features/app/connectExpress/connectExpressStore.d.ts +11 -1
  14. package/build/features/app/connectExpress/connectExpressStore.js +199 -18
  15. package/build/features/app/entity/entityStore.js +56 -35
  16. package/build/features/app/individual/individualStore.js +1 -0
  17. package/build/features/app/terminal/terminalStore.d.ts +3 -0
  18. package/build/features/app/terminal/terminalStore.js +34 -1
  19. package/build/features/bank/screens/BankDetails/BankDetails.js +1 -1
  20. package/build/features/connectExpress/ConnectExpress.js +6 -3
  21. package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +5 -2
  22. package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +10 -5
  23. package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +3 -2
  24. package/build/features/connectExpress/screens/Email/Email.d.ts +5 -0
  25. package/build/features/connectExpress/screens/Email/Email.js +57 -0
  26. package/build/features/connectExpress/screens/Email/EmailField.d.ts +8 -0
  27. package/build/features/connectExpress/screens/Email/EmailField.js +52 -0
  28. package/build/features/connectExpress/screens/Email/index.d.ts +3 -0
  29. package/build/features/connectExpress/screens/Email/index.js +2 -0
  30. package/build/features/connectExpress/screens/Email/validation.d.ts +8 -0
  31. package/build/features/connectExpress/screens/Email/validation.js +4 -0
  32. package/build/features/connectExpress/screens/NIDMissed/NID.js +4 -2
  33. package/build/features/connectExpress/screens/OTP/OTP.js +15 -9
  34. package/build/features/connectExpress/screens/OTP/OTPInput.js +10 -4
  35. package/build/features/entity/screens/EntityName/EntityDocumentUpload.d.ts +12 -0
  36. package/build/features/entity/screens/EntityName/{LicenseCertificate.js → EntityDocumentUpload.js} +10 -15
  37. package/build/features/entity/screens/EntityName/EntityName.js +10 -4
  38. package/build/features/entity/screens/EntityName/validation.d.ts +9 -0
  39. package/build/features/entity/screens/EntityName/validation.js +3 -0
  40. package/build/features/featuresScreens.js +5 -0
  41. package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.js +2 -1
  42. package/build/features/terminal/screens/shared/POSDeviceList.js +5 -5
  43. package/build/hooks/index.d.ts +1 -0
  44. package/build/hooks/index.js +1 -0
  45. package/build/hooks/useAppConfig.js +1 -1
  46. package/build/hooks/useCountry.d.ts +1 -0
  47. package/build/hooks/useCountry.js +3 -2
  48. package/build/hooks/useIsEmailAuth.d.ts +1 -0
  49. package/build/hooks/useIsEmailAuth.js +11 -0
  50. package/build/utils/array.d.ts +1 -1
  51. package/build/utils/array.js +3 -2
  52. package/build/utils/common.js +3 -3
  53. package/build/utils/file.d.ts +1 -0
  54. package/build/utils/file.js +6 -0
  55. package/build/utils/index.d.ts +1 -0
  56. package/build/utils/index.js +1 -0
  57. package/build/utils/string.d.ts +2 -0
  58. package/build/utils/string.js +8 -0
  59. package/package.json +2 -2
  60. package/build/features/entity/screens/EntityName/LicenseCertificate.d.ts +0 -9
@@ -17,7 +17,7 @@ import { yupResolver } from '@hookform/resolvers/yup';
17
17
  import { styled } from '@mui/material/styles';
18
18
  import { useAppDispatch, useAppSelector, useExcludeReadOnlyFelids, useFormErrorAndUpdateReadOnly, useFormReadOnly, useSetFromDefaultValues } from '../../../../hooks';
19
19
  import { AuthForType } from '../../../../@types';
20
- import { useLanguage } from '../../../../hooks';
20
+ import { useLanguage, useIsEmailAuth } from '../../../../hooks';
21
21
  import { deepCopy, isKW, sendCustomEventToGTM } from '../../../../utils';
22
22
  import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
23
23
  import Form from '../../../../components/Form';
@@ -45,6 +45,7 @@ var CollectIndividualInfo = function (_a) {
45
45
  var t = useTranslation().t;
46
46
  var isAr = useLanguage().isAr;
47
47
  var individualData = data.individualData, otpData = data.otpData, responseData = data.responseData;
48
+ var startWithEmail = useIsEmailAuth();
48
49
  var startWithNID = otpData.authFor === AuthForType.NATIONAL_ID;
49
50
  var startWithNIDMissed = otpData.authFor === AuthForType.NATIONAL_ID_MISSED;
50
51
  var contact = ((responseData === null || responseData === void 0 ? void 0 : responseData.leadData) || {}).contact;
@@ -82,7 +83,7 @@ var CollectIndividualInfo = function (_a) {
82
83
  dispatch(resetIndividualScreen());
83
84
  }
84
85
  var code = (_a = settingsData.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2;
85
- var screen = 'CONNECT_EXPRESS_MOBILE_STEP';
86
+ var screen = startWithEmail ? 'CONNECT_EXPRESS_EMAIL_STEP' : 'CONNECT_EXPRESS_MOBILE_STEP';
86
87
  if (startWithNID) {
87
88
  if (isKW(code))
88
89
  screen = 'CONNECT_EXPRESS_CIVIL_ID_STEP';
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface EmailProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: EmailProps) => JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,57 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import * as React from 'react';
14
+ import { useTranslation } from 'react-i18next';
15
+ import { useForm, FormProvider } from 'react-hook-form';
16
+ import { styled } from '@mui/material/styles';
17
+ import { yupResolver } from '@hookform/resolvers/yup';
18
+ import { useAppDispatch, useLanguage, useAppSelector } from '../../../../hooks';
19
+ import { handleCurrentActiveScreen } from '../../../../app/settings';
20
+ import { clearError, connectExpressSelector, createEmailAuthAsync, resetStore } from '../../../app/connectExpress/connectExpressStore';
21
+ import Form from '../../../../components/Form';
22
+ import Button from '../../../shared/Button';
23
+ import { ScreenContainer } from '../../../shared/Containers';
24
+ import { deepCopy } from '../../../../utils';
25
+ import { EmailInfoValidation } from './validation';
26
+ import EmailField from './EmailField';
27
+ var FormStyled = styled(Form)(function () { return ({
28
+ display: 'flex',
29
+ flexDirection: 'column'
30
+ }); });
31
+ var Email = function (_a) {
32
+ var isAr = useLanguage().isAr;
33
+ var dispatch = useAppDispatch();
34
+ var t = useTranslation().t;
35
+ var _b = useAppSelector(connectExpressSelector), data = _b.data, loading = _b.loading, error = _b.error;
36
+ var methods = useForm({
37
+ resolver: yupResolver(EmailInfoValidation),
38
+ defaultValues: data.emailData,
39
+ mode: 'onChange'
40
+ });
41
+ React.useEffect(function () {
42
+ if (error)
43
+ dispatch(clearError());
44
+ }, [methods.formState.isValid]);
45
+ React.useEffect(function () {
46
+ dispatch(resetStore());
47
+ }, []);
48
+ var onSubmit = function (formData) {
49
+ dispatch(createEmailAuthAsync(deepCopy(formData)));
50
+ };
51
+ var onBackToCountryList = function () {
52
+ dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_BUSINESS_COUNTRY_STEP'));
53
+ };
54
+ var disabled = !methods.formState.isValid;
55
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(EmailField, { sx: { mb: 5, transition: 'mb 0.3s' } }), _jsx(Button, __assign({ loading: loading, isAr: isAr, onBackClicked: onBackToCountryList, disableBack: !data.isStartFromBusinessCountry, disabled: disabled, error: t(error || '') }, { children: t('next') }))] })) })) }));
56
+ };
57
+ export default React.memo(Email);
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import { SxProps, Theme } from '@mui/material/styles';
3
+ interface EmailFieldProps {
4
+ sx: SxProps<Theme> | undefined;
5
+ readOnly?: boolean;
6
+ }
7
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<EmailFieldProps & React.RefAttributes<unknown>>>;
8
+ export default _default;
@@ -0,0 +1,52 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import * as React from 'react';
14
+ import { useTranslation } from 'react-i18next';
15
+ import { useController, useFormContext } from 'react-hook-form';
16
+ import Box from '@mui/material/Box';
17
+ import { styled, alpha } from '@mui/material/styles';
18
+ import Text from '../../../../components/Text';
19
+ import { MAX_EMAIL_LENGTH } from '../../../../constants';
20
+ import Input from '../../../shared/Input';
21
+ import ScreenContainer from '../../../shared/Containers/ScreenContainer';
22
+ import { EndAdornment } from '../../../shared/EndAdornment';
23
+ var LabelContainerStyled = styled(Box)(function (_a) {
24
+ var theme = _a.theme;
25
+ return ({
26
+ display: 'flex',
27
+ justifyContent: 'space-between',
28
+ padding: theme.spacing(0, 2.5, 1.25, 2.5)
29
+ });
30
+ });
31
+ var InputLabelStyled = styled(Text)(function (_a) {
32
+ var theme = _a.theme;
33
+ return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightMedium }, theme.typography.caption), { lineHeight: theme.spacing(2.5) }));
34
+ });
35
+ var EmailField = React.forwardRef(function (_a, ref) {
36
+ var _b;
37
+ var sx = _a.sx, readOnly = _a.readOnly;
38
+ var t = useTranslation().t;
39
+ var control = useFormContext().control;
40
+ var emailControl = useController({ control: control, name: 'email' });
41
+ var handleEmailChange = function (_a) {
42
+ var target = _a.target;
43
+ emailControl.field.onChange(target.value);
44
+ };
45
+ var clearEmail = function () {
46
+ emailControl.field.onChange('');
47
+ };
48
+ var emailValue = emailControl.field.value;
49
+ var error = (_b = emailControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
50
+ return (_jsxs(ScreenContainer, __assign({ ref: ref, sx: sx }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('signup_email_lable') }) }), _jsx(Input, { type: 'email', readOnly: readOnly, inputProps: { maxLength: MAX_EMAIL_LENGTH }, onChange: handleEmailChange, value: emailValue, endAdornment: _jsx(EndAdornment, { value: emailValue, error: error, onClear: clearEmail }), placeholder: t('signup_email_placeholder'), warningType: 'alert', warningMessage: error && t(error), required: true })] })));
51
+ });
52
+ export default React.memo(EmailField);
@@ -0,0 +1,3 @@
1
+ import Email, { EmailProps } from './Email';
2
+ export type { EmailProps };
3
+ export default Email;
@@ -0,0 +1,2 @@
1
+ import Email from './Email';
2
+ export default Email;
@@ -0,0 +1,8 @@
1
+ import * as yup from 'yup';
2
+ export declare const EmailInfoValidation: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
+ email: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
4
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
5
+ email: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
6
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
7
+ email: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
8
+ }>>>;
@@ -0,0 +1,4 @@
1
+ import * as yup from 'yup';
2
+ export var EmailInfoValidation = yup.object().shape({
3
+ email: yup.string().email('email_not_valid').required('email_not_valid')
4
+ });
@@ -16,7 +16,7 @@ import { styled } from '@mui/material/styles';
16
16
  import { useForm, FormProvider } from 'react-hook-form';
17
17
  import { yupResolver } from '@hookform/resolvers/yup';
18
18
  import { NIDOtherCountryValidationSchema, NIDValidationSchema } from './validation';
19
- import { useAppDispatch, useLanguage, useAppSelector } from '../../../../hooks';
19
+ import { useAppDispatch, useLanguage, useAppSelector, useIsEmailAuth } from '../../../../hooks';
20
20
  import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
21
21
  import { clearError, connectExpressSelector, createNIDNafathAuthIdentityAsync } from '../../../app/connectExpress/connectExpressStore';
22
22
  import Form from '../../../../components/Form';
@@ -38,6 +38,7 @@ var NID = function (_a) {
38
38
  var settingsData = useAppSelector(settingsSelector).data;
39
39
  var _c = useAppSelector(connectExpressSelector), data = _c.data, loading = _c.loading, error = _c.error;
40
40
  var isOtherCountry = React.useMemo(function () { return isOtherThanKWOrSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
41
+ var startWithEmail = useIsEmailAuth();
41
42
  var methods = useForm({
42
43
  resolver: yupResolver(isOtherCountry ? NIDOtherCountryValidationSchema : NIDValidationSchema),
43
44
  defaultValues: data.nidData,
@@ -54,7 +55,8 @@ var NID = function (_a) {
54
55
  setCollapse(flag);
55
56
  };
56
57
  var onBack = function () {
57
- dispatch(handlePrevScreenStep());
58
+ var screen = startWithEmail ? 'CONNECT_EXPRESS_EMAIL_STEP' : 'CONNECT_EXPRESS_MOBILE_STEP';
59
+ dispatch(handlePrevScreenStep(screen));
58
60
  };
59
61
  var disabled = !methods.formState.isValid;
60
62
  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(Collapse, __assign({ in: isOtherCountry }, { children: _jsx(DOB, { onDateClicked: handleCollapseOpenClose }) })), _jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(Button, __assign({ sx: !isOtherCountry ? { mt: 10 } : {}, loading: loading, isAr: isAr, onBackClicked: onBack, disabled: disabled, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
@@ -13,18 +13,17 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import Box from '@mui/material/Box/Box';
14
14
  import { styled } from '@mui/material/styles';
15
15
  import * as React from 'react';
16
- import { useTranslation } from 'react-i18next';
17
16
  import Text from '../../../../components/Text';
18
- import { clearError, connectExpressSelector, verifyMobileOtpAsync, resetOTPValue } from '../../../app/connectExpress/connectExpressStore';
17
+ import { clearError, connectExpressSelector, verifyMobileOtpAsync, verifyEmailOtpAsync, resetOTPValue } from '../../../app/connectExpress/connectExpressStore';
19
18
  import Button from '../../../shared/Button';
20
19
  import { ScreenContainer } from '../../../shared/Containers';
21
- import { useAppDispatch, useAppSelector, useSanitizedTranslation } from '../../../../hooks';
20
+ import { useAppDispatch, useAppSelector, useSanitizedTranslation, useIsEmailAuth } from '../../../../hooks';
22
21
  import { handlePrevScreenStep } from '../../../../app/settings';
23
22
  import { useLanguage } from '../../../../hooks';
24
23
  import { useForm, FormProvider } from 'react-hook-form';
25
24
  import { yupResolver } from '@hookform/resolvers/yup';
26
25
  import Form from '../../../../components/Form';
27
- import { maskPhone, deepCopy, sendCustomEventToGTM } from '../../../../utils';
26
+ import { maskPhone, deepCopy, sendCustomEventToGTM, maskEmail } from '../../../../utils';
28
27
  import { OTPValidation } from './validation';
29
28
  import OTPInput from './OTPInput';
30
29
  var OTPTitleContainerStyled = styled(Box)(function (_a) {
@@ -50,9 +49,9 @@ var OTP = function () {
50
49
  var _a;
51
50
  var dispatch = useAppDispatch();
52
51
  var _b = useAppSelector(connectExpressSelector), data = _b.data, loading = _b.loading, error = _b.error;
53
- var t = useTranslation().t;
54
52
  var st = useSanitizedTranslation();
55
53
  var isAr = useLanguage().isAr;
54
+ var isEmailFlow = useIsEmailAuth();
56
55
  var methods = useForm({
57
56
  resolver: yupResolver(OTPValidation),
58
57
  defaultValues: data.otpData,
@@ -73,14 +72,21 @@ var OTP = function () {
73
72
  };
74
73
  }, []);
75
74
  var onSubmit = function (formData) {
76
- dispatch(verifyMobileOtpAsync(deepCopy(formData)));
75
+ if (isEmailFlow) {
76
+ dispatch(verifyEmailOtpAsync(deepCopy(formData)));
77
+ }
78
+ else {
79
+ dispatch(verifyMobileOtpAsync(deepCopy(formData)));
80
+ }
77
81
  };
78
82
  var onBack = function () {
79
- dispatch(handlePrevScreenStep());
83
+ var screen = isEmailFlow ? 'CONNECT_EXPRESS_EMAIL_STEP' : 'CONNECT_EXPRESS_MOBILE_STEP';
84
+ dispatch(handlePrevScreenStep(screen));
80
85
  };
81
86
  var disabled = !methods.formState.isValid;
82
87
  var phone = data.mobileData.mobile ? ((_a = data.mobileData.countryCode) === null || _a === void 0 ? void 0 : _a.idd_prefix) + data.mobileData.mobile : '';
83
- var title = t('ide_opt_sent_title');
84
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? st('ide_otp_waiting_title') : title, !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: maskPhone(phone) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: st(error || '') }, { children: t('next') }))] })) })) }));
88
+ var contactInfo = isEmailFlow ? maskEmail(data.emailData.email) : maskPhone(phone);
89
+ var title = isEmailFlow ? st('otp_email_sent_title') : st('ide_opt_sent_title');
90
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? st('ide_otp_waiting_title') : title, !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: contactInfo }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: st(error || '') }, { children: st('next') }))] })) })) }));
85
91
  };
86
92
  export default React.memo(OTP);
@@ -17,8 +17,8 @@ import Box from '@mui/material/Box/Box';
17
17
  import { styled } from '@mui/material/styles';
18
18
  import OTPField from '../../../shared/OTP';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
- import { resendMobileAuthOTP, connectExpressSelector, clearError } from '../../../app/connectExpress/connectExpressStore';
21
- import { useAppDispatch, useAppSelector } from '../../../../hooks';
20
+ import { resendMobileAuthOTP, resendEmailAuthOTP, connectExpressSelector, clearError } from '../../../app/connectExpress/connectExpressStore';
21
+ import { useAppDispatch, useAppSelector, useIsEmailAuth } from '../../../../hooks';
22
22
  import { sendCustomEventToGTM } from '../../../../utils';
23
23
  var BoxStyled = styled(Box)(function (_a) {
24
24
  var theme = _a.theme;
@@ -34,7 +34,8 @@ var OTPInput = function (_a) {
34
34
  var dispatch = useAppDispatch();
35
35
  var otpControl = useController({ name: 'otp', control: control });
36
36
  var _c = useAppSelector(connectExpressSelector), data = _c.data, error = _c.error;
37
- var mobileData = data.mobileData;
37
+ var mobileData = data.mobileData, emailData = data.emailData;
38
+ var isEmailFlow = useIsEmailAuth();
38
39
  var sendEventAskAnotherOTP = function () {
39
40
  sendCustomEventToGTM({
40
41
  event: 'Send Event',
@@ -51,7 +52,12 @@ var OTPInput = function (_a) {
51
52
  if (otpControl.field.value)
52
53
  setValue('otp', '', { shouldValidate: true });
53
54
  sendEventAskAnotherOTP();
54
- dispatch(resendMobileAuthOTP(mobileData));
55
+ if (isEmailFlow) {
56
+ dispatch(resendEmailAuthOTP(emailData));
57
+ }
58
+ else {
59
+ dispatch(resendMobileAuthOTP(mobileData));
60
+ }
55
61
  };
56
62
  var otpValue = otpControl.field.value;
57
63
  return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { DocumentPurpose, FileDetails } from '../../../../@types';
3
+ interface EntityDocumentUploadProps {
4
+ name: string;
5
+ labelKey: string;
6
+ purpose: DocumentPurpose;
7
+ show: boolean;
8
+ readOnly?: boolean;
9
+ defaultFiles?: Array<FileDetails>;
10
+ }
11
+ declare const EntityDocumentUpload: ({ name, labelKey, purpose, show, readOnly, defaultFiles }: EntityDocumentUploadProps) => JSX.Element;
12
+ export default EntityDocumentUpload;
@@ -15,9 +15,8 @@ import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
16
16
  import { styled } from '@mui/material/styles';
17
17
  import Collapse from '../../../../components/Collapse';
18
- import { DocumentPurpose } from '../../../../@types';
19
18
  import { FileType } from '../../../../constants';
20
- import { useAppDispatch, useAppSelector } from '../../../../hooks';
19
+ import { useAppDispatch, useAppSelector, useSanitizedTranslation } from '../../../../hooks';
21
20
  import { hasVerifiedValue } from '../../../../utils';
22
21
  import { ScreenContainer } from '../../../shared/Containers';
23
22
  import { clearError, entitySelector, uploadingStatus } from '../../../app/entity/entityStore';
@@ -28,27 +27,23 @@ var FeatureStyled = styled(ScreenContainer)(function (_a) {
28
27
  marginBlockStart: theme.spacing(3)
29
28
  });
30
29
  });
31
- var LicenseCertificate = function (_a) {
30
+ var EntityDocumentUpload = function (_a) {
32
31
  var _b;
33
- var show = _a.show, readOnly = _a.readOnly, defaultFiles = _a.defaultFiles;
32
+ var name = _a.name, labelKey = _a.labelKey, purpose = _a.purpose, show = _a.show, readOnly = _a.readOnly, defaultFiles = _a.defaultFiles;
34
33
  var t = useTranslation().t;
34
+ var st = useSanitizedTranslation();
35
35
  var control = useFormContext().control;
36
36
  var dispatch = useAppDispatch();
37
- var certificateIdControl = useController({ name: 'certificateId', control: control });
37
+ var fieldControl = useController({ name: name, control: control });
38
38
  var _c = useAppSelector(entitySelector), loading = _c.loading, error = _c.error, data = _c.data;
39
39
  var data_verification = (((_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.entity) || {}).data_verification;
40
- var uploadedIds = certificateIdControl.field.value;
40
+ var uploadedIds = fieldControl.field.value;
41
41
  var isDocumentVerified = React.useMemo(function () { var _a; return !!((_a = defaultFiles === null || defaultFiles === void 0 ? void 0 : defaultFiles[0]) === null || _a === void 0 ? void 0 : _a.docId) && hasVerifiedValue(data_verification, "documents.".concat(defaultFiles[0].docId)); }, [data_verification]);
42
- var handleLicenseCertificateChange = function (ids) {
42
+ var handleChange = function (ids) {
43
43
  if (error)
44
44
  dispatch(clearError());
45
- certificateIdControl.field.onChange(ids);
45
+ fieldControl.field.onChange(ids);
46
46
  };
47
- var handleReset = function (ids) {
48
- if (error)
49
- dispatch(clearError());
50
- certificateIdControl.field.onChange(ids);
51
- };
52
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadMultipleFile, { readOnly: readOnly, id: 'certificateId', control: control, label: t('title_license_certificate'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('desc_drag_and_drop_certificate'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_bank_statement'), onFileUploaded: handleLicenseCertificateChange, isSubmitting: loading, onDeleteFile: handleReset, maxLimit: 4, defaultFiles: defaultFiles, purpose: DocumentPurpose.CR, fileUploadingStatus: function (uploading) { return dispatch(uploadingStatus(uploading)); }, fileType: FileType.IMAGES, isVerified: !(uploadedIds === null || uploadedIds === void 0 ? void 0 : uploadedIds.length) && isDocumentVerified }) }) })));
47
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadMultipleFile, { readOnly: readOnly, id: name, control: control, label: st(labelKey), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('desc_drag_and_drop_certificate'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_bank_statement'), onFileUploaded: handleChange, isSubmitting: loading, onDeleteFile: handleChange, maxLimit: 4, defaultFiles: defaultFiles, purpose: purpose, fileUploadingStatus: function (uploading) { return dispatch(uploadingStatus(uploading)); }, fileType: FileType.IMAGES, isVerified: !(uploadedIds === null || uploadedIds === void 0 ? void 0 : uploadedIds.length) && isDocumentVerified }) }) })));
53
48
  };
54
- export default LicenseCertificate;
49
+ export default EntityDocumentUpload;
@@ -31,8 +31,8 @@ import IssuingDate from './IssuingDate';
31
31
  import ExpiryDate from './ExpiryDate';
32
32
  import EntityTypeList from './EntityTypeList';
33
33
  import UnifiedNumber from './UnifiedNumber';
34
- import LicenseCertificate from './LicenseCertificate';
35
34
  import Article from './Article';
35
+ import EntityDocumentUpload from './EntityDocumentUpload';
36
36
  var FormStyled = styled(Form)(function () { return ({
37
37
  display: 'flex',
38
38
  flexDirection: 'column'
@@ -47,7 +47,7 @@ var EntityName = function (_a) {
47
47
  var isAr = useLanguage().isAr;
48
48
  var t = useTranslation().t;
49
49
  var dispatch = useAppDispatch();
50
- var _j = data.entityNameData, legalName = _j.legalName, licenseNumber = _j.licenseNumber, licenseType = _j.licenseType, entityType = _j.entityType, issuingDate = _j.issuingDate, expiryDate = _j.expiryDate, unifiedNumber = _j.unifiedNumber, certificateId = _j.certificateId, articleId = _j.articleId;
50
+ var _j = data.entityNameData, legalName = _j.legalName, licenseNumber = _j.licenseNumber, licenseType = _j.licenseType, entityType = _j.entityType, issuingDate = _j.issuingDate, expiryDate = _j.expiryDate, unifiedNumber = _j.unifiedNumber, certificateId = _j.certificateId, commercialRegistrationExtractId = _j.commercialRegistrationExtractId, articleId = _j.articleId;
51
51
  var country_code = settingsData.businessCountry.iso2;
52
52
  var isSACountry = React.useMemo(function () { return isSA(country_code); }, [country_code]);
53
53
  var isKWCountry = React.useMemo(function () { return isKW(country_code); }, [country_code]);
@@ -83,6 +83,7 @@ var EntityName = function (_a) {
83
83
  expiryDate: expiryDate,
84
84
  unifiedNumber: unifiedNumber,
85
85
  certificateId: certificateId,
86
+ commercialRegistrationExtractId: commercialRegistrationExtractId,
86
87
  articleId: articleId
87
88
  },
88
89
  mode: 'onChange'
@@ -91,6 +92,7 @@ var EntityName = function (_a) {
91
92
  var isEntityTypeFL = ((_b = watch('entityType')) === null || _b === void 0 ? void 0 : _b.toLocaleLowerCase()) === BusinessType.FL;
92
93
  useSetFromDefaultValues(methods, data.entityNameData, true);
93
94
  var defaultCertificateFiles = React.useMemo(function () { return getFileDetailsFromDocument(documents, DocumentPurpose.CR); }, [documents]);
95
+ var defaultCommercialRegistrationExtractFiles = React.useMemo(function () { return getFileDetailsFromDocument(documents, DocumentPurpose.COMMERCIAL_REGISTRATION_EXTRACT); }, [documents]);
94
96
  var defaultArticleFile = React.useMemo(function () { return AOA_file && __assign(__assign({}, AOA_file), { docId: id }); }, [AOA_file]);
95
97
  var issueDateRes = (license === null || license === void 0 ? void 0 : license.issuing_date) && convertToEnglishDateFormat(new Date(license.issuing_date));
96
98
  var expDateRes = (license === null || license === void 0 ? void 0 : license.expiry_date) && convertToEnglishDateFormat(new Date(license.expiry_date));
@@ -104,7 +106,11 @@ var EntityName = function (_a) {
104
106
  unifiedNumber: (_c = license === null || license === void 0 ? void 0 : license.additional_info) === null || _c === void 0 ? void 0 : _c.unified_number,
105
107
  articleId: defaultArticleFile === null || defaultArticleFile === void 0 ? void 0 : defaultArticleFile.id
106
108
  }).isDirty;
107
- var originalReadOnly = useFormReadOnly(methods, { certificateId: defaultCertificateFiles, articleId: defaultArticleFile });
109
+ var originalReadOnly = useFormReadOnly(methods, {
110
+ certificateId: defaultCertificateFiles,
111
+ commercialRegistrationExtractId: defaultCommercialRegistrationExtractFiles,
112
+ articleId: defaultArticleFile
113
+ });
108
114
  var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
109
115
  var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
110
116
  var dataVerified = useDataVerified(data_verification, [
@@ -159,6 +165,6 @@ var EntityName = function (_a) {
159
165
  var showExpiryDate = isSACountry ? !isCR : true;
160
166
  var showUnifiedNumber = isSACountry ? !isEntityTypeFL : false;
161
167
  var disableBack = settingsData.appConfig.mode === 'content';
162
- 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') })) }))] })) })) }));
168
+ 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(EntityDocumentUpload, { name: 'certificateId', labelKey: 'title_license_certificate', purpose: DocumentPurpose.CR, show: isSACountry ? false : !isKWCountry || isCR, readOnly: readOnly['certificateId'] || noneEditable['documents'], defaultFiles: defaultCertificateFiles }), _jsx(EntityDocumentUpload, { name: 'commercialRegistrationExtractId', labelKey: 'title_commercial_registration_extract', purpose: DocumentPurpose.COMMERCIAL_REGISTRATION_EXTRACT, show: isKWCountry, readOnly: readOnly['commercialRegistrationExtractId'] || noneEditable['documents'], defaultFiles: defaultCommercialRegistrationExtractFiles }), _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') })) }))] })) })) }));
163
169
  };
164
170
  export default EntityName;
@@ -9,6 +9,7 @@ export declare const EntityNameValidationSchema: (noneEditable: NonEditableMap)
9
9
  issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
10
10
  expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
11
11
  certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
12
+ commercialRegistrationExtractId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
12
13
  articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
13
14
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
14
15
  legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
@@ -19,6 +20,7 @@ export declare const EntityNameValidationSchema: (noneEditable: NonEditableMap)
19
20
  issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
20
21
  expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
21
22
  certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
23
+ commercialRegistrationExtractId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
22
24
  articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
23
25
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
24
26
  legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
@@ -29,6 +31,7 @@ export declare const EntityNameValidationSchema: (noneEditable: NonEditableMap)
29
31
  issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
30
32
  expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
31
33
  certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
34
+ commercialRegistrationExtractId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
32
35
  articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
33
36
  }>>>;
34
37
  export declare const EntityNameKWValidationSchema: (noneEditable: NonEditableMap) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
@@ -39,6 +42,7 @@ export declare const EntityNameKWValidationSchema: (noneEditable: NonEditableMap
39
42
  issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
40
43
  expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
41
44
  certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
45
+ commercialRegistrationExtractId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
42
46
  articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
43
47
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
44
48
  legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
@@ -48,6 +52,7 @@ export declare const EntityNameKWValidationSchema: (noneEditable: NonEditableMap
48
52
  issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
49
53
  expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
50
54
  certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
55
+ commercialRegistrationExtractId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
51
56
  articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
52
57
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
53
58
  legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
@@ -57,6 +62,7 @@ export declare const EntityNameKWValidationSchema: (noneEditable: NonEditableMap
57
62
  issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
58
63
  expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
59
64
  certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
65
+ commercialRegistrationExtractId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
60
66
  articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
61
67
  }>>>;
62
68
  export declare const EntityNameOtherCountryValidationSchema: (noneEditable: NonEditableMap) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
@@ -67,6 +73,7 @@ export declare const EntityNameOtherCountryValidationSchema: (noneEditable: NonE
67
73
  issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
68
74
  expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
69
75
  certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
76
+ commercialRegistrationExtractId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
70
77
  articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
71
78
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
72
79
  legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
@@ -76,6 +83,7 @@ export declare const EntityNameOtherCountryValidationSchema: (noneEditable: NonE
76
83
  issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
77
84
  expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
78
85
  certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
86
+ commercialRegistrationExtractId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
79
87
  articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
80
88
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
81
89
  legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
@@ -85,6 +93,7 @@ export declare const EntityNameOtherCountryValidationSchema: (noneEditable: NonE
85
93
  issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
86
94
  expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
87
95
  certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
96
+ commercialRegistrationExtractId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
88
97
  articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
89
98
  }>>>;
90
99
  export {};
@@ -43,6 +43,7 @@ export var EntityNameValidationSchema = function (noneEditable) {
43
43
  issuingDate: noneEditable['license.issuing_date'] ? yup.string().optional() : yup.string().required('choose_any_issuing_date'),
44
44
  expiryDate: yup.string().optional(),
45
45
  certificateId: yup.array().optional(),
46
+ commercialRegistrationExtractId: yup.array().optional(),
46
47
  articleId: yup.string().optional()
47
48
  });
48
49
  };
@@ -88,6 +89,7 @@ export var EntityNameKWValidationSchema = function (noneEditable) {
88
89
  issuingDate: noneEditable['license.issuing_date'] ? yup.string().optional() : yup.string().required('choose_any_issuing_date'),
89
90
  expiryDate: noneEditable['license.expiry_date'] ? yup.string().optional() : yup.string().required('choose_any_expiry_date'),
90
91
  certificateId: yup.array().optional(),
92
+ commercialRegistrationExtractId: yup.array().optional(),
91
93
  articleId: yup.string().optional()
92
94
  });
93
95
  };
@@ -130,6 +132,7 @@ export var EntityNameOtherCountryValidationSchema = function (noneEditable) {
130
132
  issuingDate: noneEditable['license.issuing_date'] ? yup.string().optional() : yup.string().required('choose_any_issuing_date'),
131
133
  expiryDate: noneEditable['license.expiry_date'] ? yup.string().optional() : yup.string().required('choose_any_expiry_date'),
132
134
  certificateId: yup.array().optional(),
135
+ commercialRegistrationExtractId: yup.array().optional(),
133
136
  articleId: yup.string().optional()
134
137
  });
135
138
  };
@@ -17,6 +17,7 @@ import OTPVerifySecurityError from './shared/OTPVerifySecurityError';
17
17
  import OTPSessionExpired from './connect/screens/OTPSessionExpired';
18
18
  import ConnectExpressBusinessCountry from './connectExpress/screens/BusinessCountry/BusinessCountry';
19
19
  import ConnectExpressMobileScreen from './connectExpress/screens/Mobile';
20
+ import ConnectExpressEmailScreen from './connectExpress/screens/Email';
20
21
  import ConnectExpressNIDScreen from './connectExpress/screens/NID';
21
22
  import ConnectExpressVerifyNafathScreen from './connectExpress/screens/VerifyNafath';
22
23
  import ConnectExpressCivilIDScreen from './connectExpress/screens/CivilID';
@@ -261,6 +262,10 @@ export var connectExpressFeatureScreens = [
261
262
  name: 'CONNECT_EXPRESS_MOBILE_STEP',
262
263
  element: ConnectExpressMobileScreen
263
264
  },
265
+ {
266
+ name: 'CONNECT_EXPRESS_EMAIL_STEP',
267
+ element: ConnectExpressEmailScreen
268
+ },
264
269
  {
265
270
  name: 'CONNECT_EXPRESS_OTP_STEP',
266
271
  element: ConnectExpressOTPScreen
@@ -56,7 +56,7 @@ import Button from '../../../../components/Button';
56
56
  import Loader from '../../../../components/Loader';
57
57
  import Warning from '../../../../components/Warning';
58
58
  import Box from '@mui/material/Box';
59
- import { clearError, resetTerminalLinkResponse, retrieveBoardDetails, retrieveBoardStatus, retrievePOSDevices, storeSelectedTerminal, terminalSelector } from '../../../app/terminal/terminalStore';
59
+ import { clearError, resetTerminalLinkResponse, retrieveBoardDetails, retrieveBoardStatus, retrievePOSDevices, retrieveTerminalPlatformBrandLogo, storeSelectedTerminal, terminalSelector } from '../../../app/terminal/terminalStore';
60
60
  import { Header, Container, TextTypography } from '../shared';
61
61
  import DeviceList from './DeviceList';
62
62
  var TerminalDeviceList = function () {
@@ -100,6 +100,7 @@ var TerminalDeviceList = function () {
100
100
  _a.label = 1;
101
101
  case 1:
102
102
  _a.trys.push([1, 3, , 4]);
103
+ dispatch(retrieveTerminalPlatformBrandLogo());
103
104
  return [4, dispatch(retrievePOSDevices()).unwrap()];
104
105
  case 2:
105
106
  _a.sent();
@@ -9,14 +9,14 @@ import { useAppSelector } from '../../../../hooks';
9
9
  import { terminalSelector } from '../../../../features/app/terminal/terminalStore';
10
10
  import { useTheme } from '@mui/material/styles';
11
11
  var POSDeviceList = function (_a) {
12
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
13
- var posDevices = _a.posDevices, onClick = _a.onClick, selectedPOS = _a.selectedPOS, _m = _a.select, select = _m === void 0 ? true : _m, loading = _a.loading;
12
+ var _b, _c, _d, _e, _f, _g;
13
+ var posDevices = _a.posDevices, onClick = _a.onClick, selectedPOS = _a.selectedPOS, _h = _a.select, select = _h === void 0 ? true : _h, loading = _a.loading;
14
14
  var t = useTranslation().t;
15
15
  var typography = useTheme().typography;
16
16
  var responseData = useAppSelector(terminalSelector).data.responseData;
17
- var terminalData = (responseData || {}).terminalData;
18
- var platformImage = ((_e = (_d = (_c = (_b = terminalData === null || terminalData === void 0 ? void 0 : terminalData.list) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.platform) === null || _d === void 0 ? void 0 : _d.brand) === null || _e === void 0 ? void 0 : _e.logo) || ICONS_NAMES.platform_image;
19
- var platformName = (_l = (_k = (_j = (_h = (_g = (_f = terminalData === null || terminalData === void 0 ? void 0 : terminalData.list) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.platform) === null || _h === void 0 ? void 0 : _h.brand) === null || _j === void 0 ? void 0 : _j.name) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.text;
17
+ var _j = responseData || {}, terminalData = _j.terminalData, terminalPlatformBrandLogo = _j.terminalPlatformBrandLogo;
18
+ var platformImage = terminalPlatformBrandLogo || ICONS_NAMES.platform_image;
19
+ var platformName = (_g = (_f = (_e = (_d = (_c = (_b = terminalData === null || terminalData === void 0 ? void 0 : terminalData.list) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.platform) === null || _d === void 0 ? void 0 : _d.brand) === null || _e === void 0 ? void 0 : _e.name) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.text;
20
20
  var getEndComponent = function (pos) {
21
21
  if (loading && (selectedPOS === null || selectedPOS === void 0 ? void 0 : selectedPOS.id) === (pos === null || pos === void 0 ? void 0 : pos.id))
22
22
  return _jsx(Loader, { innerColor: 'black', outerColor: 'black', size: 10, style: { height: 24, width: 24 }, toggleAnimation: !!loading });
@@ -15,6 +15,7 @@ export * from './useSetFromDefaultValues';
15
15
  export * from './useCountUp';
16
16
  export * from './useCountDown';
17
17
  export * from './useCountry';
18
+ export * from './useIsEmailAuth';
18
19
  export * from './useVerifyToken';
19
20
  export * from './useFormReadOnly';
20
21
  export * from './useDataNoneEditable';
@@ -15,6 +15,7 @@ export * from './useSetFromDefaultValues';
15
15
  export * from './useCountUp';
16
16
  export * from './useCountDown';
17
17
  export * from './useCountry';
18
+ export * from './useIsEmailAuth';
18
19
  export * from './useVerifyToken';
19
20
  export * from './useFormReadOnly';
20
21
  export * from './useDataNoneEditable';