@tap-payments/auth-jsconnect 2.3.26-test → 2.3.28-test

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/build/@types/app.d.ts +12 -1
  2. package/build/@types/app.js +1 -0
  3. package/build/@types/form.d.ts +2 -1
  4. package/build/api/entity.d.ts +5 -5
  5. package/build/app/settings.d.ts +3 -1
  6. package/build/app/settings.js +5 -1
  7. package/build/assets/locales/ar.json +3 -1
  8. package/build/assets/locales/en.json +3 -1
  9. package/build/constants/app.d.ts +2 -1
  10. package/build/constants/app.js +1 -0
  11. package/build/constants/validation.d.ts +1 -0
  12. package/build/constants/validation.js +1 -0
  13. package/build/features/app/bank/bankStore.js +26 -30
  14. package/build/features/app/brand/brandStore.d.ts +5 -2
  15. package/build/features/app/brand/brandStore.js +49 -39
  16. package/build/features/app/entity/entityStore.js +58 -68
  17. package/build/features/app/individual/individualStore.js +59 -65
  18. package/build/features/app/tax/taxStore.js +23 -22
  19. package/build/features/bank/screens/BankDetails/BankDetails.js +20 -5
  20. package/build/features/bank/screens/BankDetails/BankName.d.ts +4 -1
  21. package/build/features/bank/screens/BankDetails/BankName.js +8 -7
  22. package/build/features/bank/screens/BankDetails/BankStatement.d.ts +4 -1
  23. package/build/features/bank/screens/BankDetails/BankStatement.js +3 -8
  24. package/build/features/bank/screens/BankDetails/Beneficiary.d.ts +2 -1
  25. package/build/features/bank/screens/BankDetails/Beneficiary.js +8 -7
  26. package/build/features/bank/screens/BankDetails/ConfirmPolicy.d.ts +4 -1
  27. package/build/features/bank/screens/BankDetails/ConfirmPolicy.js +6 -3
  28. package/build/features/bank/screens/BankDetails/IBAN.d.ts +2 -1
  29. package/build/features/bank/screens/BankDetails/IBAN.js +2 -2
  30. package/build/features/bank/screens/BankDetails/validation.d.ts +14 -14
  31. package/build/features/bank/screens/BankDetails/validation.js +16 -21
  32. package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +3 -1
  33. package/build/features/brand/screens/BrandActivities/ActivitiesList.js +11 -6
  34. package/build/features/brand/screens/BrandActivities/BrandActivities.js +4 -3
  35. package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +2 -1
  36. package/build/features/brand/screens/BrandActivities/CustomerBase.js +12 -9
  37. package/build/features/brand/screens/BrandActivities/ExpectedCustomers.d.ts +2 -1
  38. package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +10 -7
  39. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.d.ts +2 -1
  40. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +9 -6
  41. package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +4 -1
  42. package/build/features/brand/screens/BrandActivities/RefundPolicy.js +7 -4
  43. package/build/features/brand/screens/BrandActivities/TAC.d.ts +2 -1
  44. package/build/features/brand/screens/BrandActivities/TAC.js +3 -1
  45. package/build/features/brand/screens/BrandActivities/TransactionPolicy.d.ts +4 -1
  46. package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +7 -4
  47. package/build/features/brand/screens/BrandActivities/validation.d.ts +7 -7
  48. package/build/features/brand/screens/BrandActivities/validation.js +10 -19
  49. package/build/features/brand/screens/BrandInfo/BrandInfo.js +14 -9
  50. package/build/features/brand/screens/BrandInfo/BrandLogo.d.ts +9 -0
  51. package/build/features/brand/screens/BrandInfo/BrandLogo.js +52 -0
  52. package/build/features/brand/screens/BrandInfo/BrandName.d.ts +2 -1
  53. package/build/features/brand/screens/BrandInfo/BrandName.js +2 -2
  54. package/build/features/brand/screens/BrandInfo/SalesChannels.d.ts +2 -1
  55. package/build/features/brand/screens/BrandInfo/SalesChannels.js +2 -1
  56. package/build/features/brand/screens/BrandInfo/Segments.d.ts +2 -1
  57. package/build/features/brand/screens/BrandInfo/Segments.js +3 -1
  58. package/build/features/brand/screens/BrandInfo/TeamSize.d.ts +2 -1
  59. package/build/features/brand/screens/BrandInfo/TeamSize.js +3 -1
  60. package/build/features/brand/screens/BrandInfo/validation.d.ts +6 -6
  61. package/build/features/brand/screens/BrandInfo/validation.js +31 -37
  62. package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +2 -1
  63. package/build/features/entity/screens/EntityCapital/ActivityList.js +12 -22
  64. package/build/features/entity/screens/EntityCapital/CapitalPaid.d.ts +2 -1
  65. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +2 -1
  66. package/build/features/entity/screens/EntityCapital/CapitalShareCount.d.ts +2 -1
  67. package/build/features/entity/screens/EntityCapital/CapitalShareCount.js +2 -1
  68. package/build/features/entity/screens/EntityCapital/CapitalShareValue.d.ts +2 -1
  69. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +2 -1
  70. package/build/features/entity/screens/EntityCapital/EntityCapital.js +4 -2
  71. package/build/features/entity/screens/EntityCapital/validation.d.ts +10 -10
  72. package/build/features/entity/screens/EntityCapital/validation.js +4 -10
  73. package/build/features/entity/screens/EntityName/Article.d.ts +4 -1
  74. package/build/features/entity/screens/EntityName/Article.js +3 -4
  75. package/build/features/entity/screens/EntityName/EntityName.js +7 -4
  76. package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +2 -1
  77. package/build/features/entity/screens/EntityName/EntityTypeList.js +9 -19
  78. package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +2 -1
  79. package/build/features/entity/screens/EntityName/ExpiryDate.js +2 -2
  80. package/build/features/entity/screens/EntityName/IssuingDate.d.ts +2 -1
  81. package/build/features/entity/screens/EntityName/IssuingDate.js +2 -2
  82. package/build/features/entity/screens/EntityName/LegalName.d.ts +2 -1
  83. package/build/features/entity/screens/EntityName/LegalName.js +2 -1
  84. package/build/features/entity/screens/EntityName/LicenseCertificate.d.ts +4 -1
  85. package/build/features/entity/screens/EntityName/LicenseCertificate.js +3 -8
  86. package/build/features/entity/screens/EntityName/LicenseNumber.d.ts +2 -1
  87. package/build/features/entity/screens/EntityName/LicenseNumber.js +2 -2
  88. package/build/features/entity/screens/EntityName/UnifiedNumber.d.ts +2 -1
  89. package/build/features/entity/screens/EntityName/UnifiedNumber.js +2 -2
  90. package/build/features/entity/screens/EntityName/validation.d.ts +35 -35
  91. package/build/features/entity/screens/EntityName/validation.js +68 -93
  92. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +6 -3
  93. package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.d.ts +6 -3
  94. package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.js +3 -8
  95. package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.d.ts +2 -1
  96. package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +3 -4
  97. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.d.ts +2 -1
  98. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +11 -22
  99. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.d.ts +2 -1
  100. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +12 -23
  101. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +2 -1
  102. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +3 -4
  103. package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.d.ts +2 -1
  104. package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.js +2 -2
  105. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.d.ts +2 -1
  106. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +2 -2
  107. package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.d.ts +4 -1
  108. package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.js +3 -8
  109. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.d.ts +2 -1
  110. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +12 -23
  111. package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +2 -2
  112. package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +6 -11
  113. package/build/features/individual/screens/IndividualList/MobileNumber.js +0 -1
  114. package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.d.ts +1 -0
  115. package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.js +3 -1
  116. package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.d.ts +1 -0
  117. package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.js +3 -1
  118. package/build/features/individual/screens/IndividualPersonalInfo/DOB.d.ts +2 -1
  119. package/build/features/individual/screens/IndividualPersonalInfo/DOB.js +2 -2
  120. package/build/features/individual/screens/IndividualPersonalInfo/Email.d.ts +2 -1
  121. package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
  122. package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.d.ts +2 -1
  123. package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.js +3 -4
  124. package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +2 -1
  125. package/build/features/individual/screens/IndividualPersonalInfo/Gender.js +3 -1
  126. package/build/features/individual/screens/IndividualPersonalInfo/ID.d.ts +2 -1
  127. package/build/features/individual/screens/IndividualPersonalInfo/ID.js +2 -7
  128. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +3 -3
  129. package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.d.ts +1 -0
  130. package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.js +4 -6
  131. package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.d.ts +1 -0
  132. package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +2 -4
  133. package/build/features/individual/screens/IndividualPersonalInfo/Name.d.ts +2 -1
  134. package/build/features/individual/screens/IndividualPersonalInfo/Name.js +2 -2
  135. package/build/features/individual/screens/IndividualPersonalInfo/Nationality.d.ts +1 -0
  136. package/build/features/individual/screens/IndividualPersonalInfo/Nationality.js +4 -6
  137. package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.d.ts +1 -0
  138. package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.js +6 -3
  139. package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +1 -1
  140. package/build/features/shared/SalesChannels/SaleChannelIconsInput.d.ts +2 -1
  141. package/build/features/shared/SalesChannels/SaleChannelIconsInput.js +3 -3
  142. package/build/features/shared/SalesChannels/SalesChannel.d.ts +2 -1
  143. package/build/features/shared/SalesChannels/SalesChannel.js +3 -3
  144. package/build/features/shared/UploadFile/FileUpload.d.ts +3 -1
  145. package/build/features/shared/UploadFile/FileUpload.js +14 -10
  146. package/build/features/shared/UploadFile/UploadWrapper.d.ts +3 -1
  147. package/build/features/shared/UploadFile/UploadWrapper.js +3 -2
  148. package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +2 -1
  149. package/build/features/shared/UploadMultipleFile/UploadFile.js +9 -5
  150. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +2 -1
  151. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +3 -3
  152. package/build/features/tax/screens/TaxDetails/ConfirmPolicy.d.ts +4 -1
  153. package/build/features/tax/screens/TaxDetails/ConfirmPolicy.js +6 -3
  154. package/build/features/tax/screens/TaxDetails/TaxDetails.js +5 -3
  155. package/build/features/tax/screens/TaxDetails/TaxDocument.d.ts +4 -1
  156. package/build/features/tax/screens/TaxDetails/TaxDocument.js +3 -8
  157. package/build/features/tax/screens/TaxDetails/VATId.d.ts +4 -1
  158. package/build/features/tax/screens/TaxDetails/VATId.js +5 -7
  159. package/build/features/tax/screens/TaxDetails/validation.d.ts +4 -4
  160. package/build/features/tax/screens/TaxDetails/validation.js +2 -5
  161. package/build/hooks/index.d.ts +3 -0
  162. package/build/hooks/index.js +3 -0
  163. package/build/hooks/useAppConfig.d.ts +1 -1
  164. package/build/hooks/useAppConfig.js +4 -2
  165. package/build/hooks/useDataNoneEditable.d.ts +2 -0
  166. package/build/hooks/useDataNoneEditable.js +19 -0
  167. package/build/hooks/useFormErrorAndUpdateReadOnly.d.ts +6 -0
  168. package/build/hooks/useFormErrorAndUpdateReadOnly.js +48 -0
  169. package/build/hooks/useFormReadOnly.d.ts +6 -0
  170. package/build/hooks/useFormReadOnly.js +40 -0
  171. package/build/utils/string.js +7 -8
  172. package/package.json +1 -1
  173. package/build/features/brand/screens/BrandActivities/OperationStartDate.d.ts +0 -20
  174. package/build/features/brand/screens/BrandActivities/OperationStartDate.js +0 -45
@@ -24,7 +24,7 @@ import { clearError, entitySelector } from '../../../app/entity/entityStore';
24
24
  import Collapse from '../../../../components/Collapse';
25
25
  var LicenseNumber = function (_a) {
26
26
  var _b, _c;
27
- var show = _a.show;
27
+ var show = _a.show, readOnly = _a.readOnly;
28
28
  var t = useTranslation().t;
29
29
  var _d = useAppSelector(entitySelector), data = _d.data, bckError = _d.error;
30
30
  var dispatch = useAppDispatch();
@@ -49,6 +49,6 @@ var LicenseNumber = function (_a) {
49
49
  var isCR = type === BusinessType.CR;
50
50
  var length = !isSACountry ? KW_MAX_LICENSE_LENGTH : isCR ? CR_NUMBER_LENGTH : FL_NUMBER_ENTITY_LENGTH;
51
51
  var minLength = !isSACountry ? KW_MIN_LICENSE_LENGTH : length;
52
- return (_jsx(Collapse, __assign({ in: show && !hide }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { label: t('license_number_label'), onChange: handleChange, disabled: disabled, inputProps: { maxLength: length }, value: licenseNumberValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: isCR ? t('cr_number_hint') : t('fl_number_hint'), warningType: 'alert', warningMessage: error && t(error, { length: minLength }) }) })) })));
52
+ return (_jsx(Collapse, __assign({ in: show && !hide }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('license_number_label'), onChange: handleChange, disabled: disabled, inputProps: { maxLength: length }, value: licenseNumberValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: isCR ? t('cr_number_hint') : t('fl_number_hint'), warningType: 'alert', warningMessage: error && t(error, { length: minLength }) }) })) })));
53
53
  };
54
54
  export default React.memo(LicenseNumber);
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  interface UnifiedNumberProps {
3
3
  show: boolean;
4
+ readOnly?: boolean;
4
5
  }
5
- declare const _default: React.MemoExoticComponent<({ show }: UnifiedNumberProps) => JSX.Element>;
6
+ declare const _default: React.MemoExoticComponent<({ show, readOnly }: UnifiedNumberProps) => JSX.Element>;
6
7
  export default _default;
@@ -21,7 +21,7 @@ import Input from '../../../shared/Input';
21
21
  import { clearError, entitySelector } from '../../../app/entity/entityStore';
22
22
  var UnifiedNumber = function (_a) {
23
23
  var _b, _c, _d;
24
- var show = _a.show;
24
+ var show = _a.show, readOnly = _a.readOnly;
25
25
  var t = useTranslation().t;
26
26
  var _e = useAppSelector(entitySelector), data = _e.data, bckError = _e.error;
27
27
  var control = useFormContext().control;
@@ -40,6 +40,6 @@ var UnifiedNumber = function (_a) {
40
40
  var unifiedNumberControl = useController({ control: control, name: 'unifiedNumber' });
41
41
  var unifiedNumberValue = unifiedNumberControl.field.value;
42
42
  var error = (_d = unifiedNumberControl.fieldState.error) === null || _d === void 0 ? void 0 : _d.message;
43
- return (_jsx(Collapse, __assign({ in: show && !hide }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { label: t('unified_number_label'), onChange: handleChange, disabled: disabled, value: unifiedNumberValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('unified_number_hint'), warningType: 'alert', warningMessage: error && t(error) }) })) })));
43
+ return (_jsx(Collapse, __assign({ in: show && !hide }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('unified_number_label'), onChange: handleChange, disabled: disabled, value: unifiedNumberValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('unified_number_hint'), warningType: 'alert', warningMessage: error && t(error) }) })) })));
44
44
  };
45
45
  export default React.memo(UnifiedNumber);
@@ -1,60 +1,60 @@
1
1
  import * as yup from 'yup';
2
- export declare const EntityNameValidationSchema: (entity: any) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
- legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
2
+ export declare const EntityNameValidationSchema: () => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
+ legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
4
4
  licenseType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
5
- entityType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
6
- licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
7
- unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
8
- issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
9
- expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
5
+ entityType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
6
+ licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
7
+ unifiedNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
8
+ issuingDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
9
+ expiryDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
10
10
  certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
11
11
  articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
12
12
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
13
- legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
13
+ legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
14
14
  licenseType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
15
- entityType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
16
- licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
17
- unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
18
- issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
19
- expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
15
+ entityType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
16
+ licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
17
+ unifiedNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
18
+ issuingDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
19
+ expiryDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
20
20
  certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
21
21
  articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
22
22
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
23
- legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
23
+ legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
24
24
  licenseType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
25
- entityType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
26
- licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
27
- unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
28
- issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
29
- expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
25
+ entityType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
26
+ licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
27
+ unifiedNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
28
+ issuingDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
29
+ expiryDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
30
30
  certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
31
31
  articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
32
32
  }>>>;
33
- export declare const EntityNameKWValidationSchema: (entity: any) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
34
- legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
33
+ export declare const EntityNameKWValidationSchema: () => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
34
+ legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
35
35
  licenseType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
36
- entityType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
37
- licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
38
- issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
39
- expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
36
+ entityType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
37
+ licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
38
+ issuingDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
39
+ expiryDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
40
40
  certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
41
41
  articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
42
42
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
43
- legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
43
+ legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
44
44
  licenseType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
45
- entityType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
46
- licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
47
- issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
48
- expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
45
+ entityType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
46
+ licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
47
+ issuingDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
48
+ expiryDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
49
49
  certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
50
50
  articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
51
51
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
52
- legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
52
+ legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
53
53
  licenseType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
54
- entityType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
55
- licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
56
- issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
57
- expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
54
+ entityType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
55
+ licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
56
+ issuingDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
57
+ expiryDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
58
58
  certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
59
59
  articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
60
60
  }>>>;
@@ -1,79 +1,76 @@
1
1
  import * as yup from 'yup';
2
- import { BusinessType, FieldType } from '../../../../@types';
2
+ import { BusinessType } from '../../../../@types';
3
3
  import { KW_MIN_LICENSE_LENGTH, CR_MIN_LICENSE_LENGTH, FL_MIN_LICENSE_LENGTH } from '../../../../constants';
4
- export var EntityNameValidationSchema = function (entity) {
5
- var _a, _b, _c, _d, _e;
6
- var _f = entity || {}, legal_name = _f.legal_name, data_status = _f.data_status, license = _f.license;
7
- var isLegalNameOptional = !((legal_name === null || legal_name === void 0 ? void 0 : legal_name.ar) || (legal_name === null || legal_name === void 0 ? void 0 : legal_name.en)) && (data_status === null || data_status === void 0 ? void 0 : data_status.legal_name) === FieldType.NON_EDITABLE;
8
- var isEntityTypeOptional = !(license === null || license === void 0 ? void 0 : license.type) && (data_status === null || data_status === void 0 ? void 0 : data_status.type) === FieldType.NON_EDITABLE;
9
- var isLicenseNumberOptional = !(license === null || license === void 0 ? void 0 : license.number) && ((_a = data_status === null || data_status === void 0 ? void 0 : data_status.license) === null || _a === void 0 ? void 0 : _a.number) === FieldType.NON_EDITABLE;
10
- var isUnifiedNumberOptional = !((_b = license === null || license === void 0 ? void 0 : license.additional_info) === null || _b === void 0 ? void 0 : _b.unified_number) && ((_c = data_status === null || data_status === void 0 ? void 0 : data_status.license) === null || _c === void 0 ? void 0 : _c.additional_info) === FieldType.NON_EDITABLE;
11
- var isIssuingDateOptional = !(license === null || license === void 0 ? void 0 : license.issuing_date) && ((_d = data_status === null || data_status === void 0 ? void 0 : data_status.license) === null || _d === void 0 ? void 0 : _d.issuing_date) === FieldType.NON_EDITABLE;
12
- var isExpiryDateOptional = !(license === null || license === void 0 ? void 0 : license.expiry_date) && ((_e = data_status === null || data_status === void 0 ? void 0 : data_status.license) === null || _e === void 0 ? void 0 : _e.expiry_date) === FieldType.NON_EDITABLE;
4
+ export var EntityNameValidationSchema = function () {
13
5
  return yup.object().shape({
14
- legalName: isLegalNameOptional
15
- ? yup.string().optional()
16
- : yup
17
- .string()
18
- .required('')
19
- .test({
20
- test: function (value) {
21
- var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
22
- if (length === 0)
23
- return true;
24
- return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
25
- }
26
- }),
6
+ legalName: yup
7
+ .string()
8
+ .required('')
9
+ .test({
10
+ test: function (value) {
11
+ var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
12
+ if (length === 0)
13
+ return true;
14
+ return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
15
+ }
16
+ }),
27
17
  licenseType: yup.string().optional(),
28
- entityType: isEntityTypeOptional ? yup.string().optional() : yup.string().required('entity_type_required'),
29
- licenseNumber: isLicenseNumberOptional
30
- ? yup.string().optional()
31
- : yup
32
- .string()
33
- .test({
34
- test: function (value) {
35
- var type = this.parent.licenseType;
36
- var isCR = type === BusinessType.CR;
37
- var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
38
- if (length === 0)
39
- return true;
40
- if (isCR) {
41
- return length > CR_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'cr_max_length' });
42
- }
43
- return length > FL_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'fl_max_length' });
44
- }
45
- })
46
- .required(''),
47
- unifiedNumber: isUnifiedNumberOptional
48
- ? yup.string().optional()
49
- : yup
50
- .string()
51
- .when('licenseType', function (licenseType) {
52
- var isCR = licenseType === BusinessType.CR;
18
+ entityType: yup.string().required('entity_type_required'),
19
+ licenseNumber: yup
20
+ .string()
21
+ .test({
22
+ test: function (value) {
23
+ var type = this.parent.licenseType;
24
+ var isCR = type === BusinessType.CR;
25
+ var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
26
+ if (length === 0)
27
+ return true;
53
28
  if (isCR) {
54
- return yup.string().required('unified_number_required');
29
+ return length > CR_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'cr_max_length' });
55
30
  }
56
- return yup.string().optional();
57
- })
58
- .required(''),
59
- issuingDate: isIssuingDateOptional ? yup.string().optional() : yup.string().required('choose_any_issuing_date'),
60
- expiryDate: isExpiryDateOptional ? yup.string().optional() : yup.string().required('choose_any_expiry_date'),
31
+ return length > FL_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'fl_max_length' });
32
+ }
33
+ })
34
+ .required(''),
35
+ unifiedNumber: yup
36
+ .string()
37
+ .when('licenseType', function (licenseType) {
38
+ var isCR = licenseType === BusinessType.CR;
39
+ if (isCR) {
40
+ return yup.string().required('unified_number_required');
41
+ }
42
+ return yup.string().optional();
43
+ })
44
+ .required(''),
45
+ issuingDate: yup.string().required('choose_any_issuing_date'),
46
+ expiryDate: yup.string().required('choose_any_expiry_date'),
61
47
  certificateId: yup.array().optional(),
62
48
  articleId: yup.string().optional()
63
49
  });
64
50
  };
65
- export var EntityNameKWValidationSchema = function (entity) {
66
- var _a, _b, _c;
67
- var _d = entity || {}, legal_name = _d.legal_name, data_status = _d.data_status, license = _d.license;
68
- var isLegalNameOptional = !((legal_name === null || legal_name === void 0 ? void 0 : legal_name.ar) || (legal_name === null || legal_name === void 0 ? void 0 : legal_name.en)) && (data_status === null || data_status === void 0 ? void 0 : data_status.legal_name) === FieldType.NON_EDITABLE;
69
- var isEntityTypeOptional = !(license === null || license === void 0 ? void 0 : license.type) && (data_status === null || data_status === void 0 ? void 0 : data_status.type) === FieldType.NON_EDITABLE;
70
- var isLicenseNumberOptional = !(license === null || license === void 0 ? void 0 : license.number) && ((_a = data_status === null || data_status === void 0 ? void 0 : data_status.license) === null || _a === void 0 ? void 0 : _a.number) === FieldType.NON_EDITABLE;
71
- var isIssuingDateOptional = !(license === null || license === void 0 ? void 0 : license.issuing_date) && ((_b = data_status === null || data_status === void 0 ? void 0 : data_status.license) === null || _b === void 0 ? void 0 : _b.issuing_date) === FieldType.NON_EDITABLE;
72
- var isExpiryDateOptional = !(license === null || license === void 0 ? void 0 : license.expiry_date) && ((_c = data_status === null || data_status === void 0 ? void 0 : data_status.license) === null || _c === void 0 ? void 0 : _c.expiry_date) === FieldType.NON_EDITABLE;
51
+ export var EntityNameKWValidationSchema = function () {
73
52
  return yup.object().shape({
74
- legalName: isLegalNameOptional
75
- ? yup.string().optional()
76
- : yup
53
+ legalName: yup
54
+ .string()
55
+ .required('')
56
+ .test({
57
+ test: function (value) {
58
+ var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
59
+ if (length === 0)
60
+ return true;
61
+ return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
62
+ }
63
+ }),
64
+ licenseType: yup.string().optional(),
65
+ entityType: yup.string().required('entity_type_required'),
66
+ licenseNumber: yup
67
+ .string()
68
+ .when('licenseType', function (licenseType) {
69
+ var isCR = licenseType === BusinessType.CR;
70
+ if (!isCR) {
71
+ return yup.string().optional();
72
+ }
73
+ return yup
77
74
  .string()
78
75
  .required('')
79
76
  .test({
@@ -81,35 +78,13 @@ export var EntityNameKWValidationSchema = function (entity) {
81
78
  var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
82
79
  if (length === 0)
83
80
  return true;
84
- return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
85
- }
86
- }),
87
- licenseType: yup.string().optional(),
88
- entityType: isEntityTypeOptional ? yup.string().optional() : yup.string().required('entity_type_required'),
89
- licenseNumber: isLicenseNumberOptional
90
- ? yup.string().optional()
91
- : yup
92
- .string()
93
- .when('licenseType', function (licenseType) {
94
- var isCR = licenseType === BusinessType.CR;
95
- if (!isCR) {
96
- return yup.string().optional();
81
+ return length >= KW_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'cr_kw_max_length' });
97
82
  }
98
- return yup
99
- .string()
100
- .required('')
101
- .test({
102
- test: function (value) {
103
- var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
104
- if (length === 0)
105
- return true;
106
- return length >= KW_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'cr_kw_max_length' });
107
- }
108
- });
109
- })
110
- .required(''),
111
- issuingDate: isIssuingDateOptional ? yup.string().optional() : yup.string().required('choose_any_issuing_date'),
112
- expiryDate: isExpiryDateOptional ? yup.string().optional() : yup.string().required('choose_any_expiry_date'),
83
+ });
84
+ })
85
+ .required(''),
86
+ issuingDate: yup.string().required('choose_any_issuing_date'),
87
+ expiryDate: yup.string().required('choose_any_expiry_date'),
113
88
  certificateId: yup.array().optional(),
114
89
  articleId: yup.string().optional()
115
90
  });
@@ -18,7 +18,7 @@ import { handleCurrentActiveScreen, settingsSelector } from '../../../../app/set
18
18
  import Box from '@mui/material/Box';
19
19
  import { alpha, styled } from '@mui/material/styles';
20
20
  import { useAppDispatch, useAppSelector, useSetFromDefaultValues, useLanguage } from '../../../../hooks';
21
- import { IndividualType } from '../../../../@types';
21
+ import { DocumentPurpose, IndividualType } from '../../../../@types';
22
22
  import { isSA } from '../../../../utils';
23
23
  import Form from '../../../../components/Form';
24
24
  import Collapse from '../../../../components/Collapse';
@@ -36,6 +36,7 @@ import CivilIDFile from './CivilIDFile';
36
36
  import SignatureFile from './SignatureFile';
37
37
  import ShareCount from './ShareCount';
38
38
  import ShareValue from './ShareValue';
39
+ import { getFileDetailsFromDocument } from '../../../../utils';
39
40
  var TextBoxStyled = styled(Box)(function (_a) {
40
41
  var theme = _a.theme;
41
42
  return (__assign(__assign({ display: 'flex', justifyContent: 'center', flexDirection: 'row', padding: theme.spacing(1.8, 2.5, 1.8, 2.5) }, theme.typography.body1), { lineHeight: theme.spacing(2.5), color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightMedium }));
@@ -54,6 +55,7 @@ var AdditionalIndividualInfo = function (_a) {
54
55
  var t = useTranslation().t;
55
56
  var isAr = useLanguage().isAr;
56
57
  var dispatch = useAppDispatch();
58
+ var settingData = useAppSelector(settingsSelector).data;
57
59
  var _b = useAppSelector(individualSelector), data = _b.data, loading = _b.loading, error = _b.error;
58
60
  var settingsData = useAppSelector(settingsSelector).data;
59
61
  var verify = data.verify;
@@ -61,7 +63,7 @@ var AdditionalIndividualInfo = function (_a) {
61
63
  var isAuthorizedUser = user === null || user === void 0 ? void 0 : user.is_authorized;
62
64
  var _c = data.individualData, occupation = _c.occupation, sourceIncome = _c.sourceIncome, monthlyIncome = _c.monthlyIncome, employerName = _c.employerName, employerLocation = _c.employerLocation, isPEP = _c.isPEP, isInfluencer = _c.isInfluencer, civilID = _c.civilID, signatureFileId = _c.signatureFileId, civilIDUploading = _c.civilIDUploading, signatureFileUploading = _c.signatureFileUploading, shareCount = _c.shareCount, shareValue = _c.shareValue;
63
65
  var methods = useForm({
64
- resolver: yupResolver(IndividualInfoValidationSchema(isAuthorizedUser, user)),
66
+ resolver: yupResolver(IndividualInfoValidationSchema(user === null || user === void 0 ? void 0 : user.type)),
65
67
  defaultValues: {
66
68
  occupation: occupation,
67
69
  sourceIncome: sourceIncome,
@@ -106,6 +108,7 @@ var AdditionalIndividualInfo = function (_a) {
106
108
  return t('type_board_member');
107
109
  return t('type_user');
108
110
  };
111
+ var defaultUserFiles = React.useMemo(function () { return getFileDetailsFromDocument(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.IDENTITY_DOCUMENT); }, [user === null || user === void 0 ? void 0 : user.documents]);
109
112
  var showSignatureFile = (user === null || user === void 0 ? void 0 : user.type) === IndividualType.USER || (user === null || user === void 0 ? void 0 : user.type) === IndividualType.BUYER;
110
113
  var showOccupationFile = (user === null || user === void 0 ? void 0 : user.type) === IndividualType.USER || (user === null || user === void 0 ? void 0 : user.type) === IndividualType.BUYER;
111
114
  var showSourceOfIncome = (user === null || user === void 0 ? void 0 : user.type) === IndividualType.USER || (user === null || user === void 0 ? void 0 : user.type) === IndividualType.BUYER;
@@ -116,7 +119,7 @@ var AdditionalIndividualInfo = function (_a) {
116
119
  var isMonthlyIncomeListActive = listActive === ListType.MonthlyIncomeList;
117
120
  var isOccupationListActive = listActive === ListType.OccupationList;
118
121
  var disabled = !methods.formState.isValid || civilIDUploading || signatureFileUploading;
119
- return (_jsxs(ScreenContainer, { children: [_jsx(Collapse, __assign({ in: !listActive && !!(user === null || user === void 0 ? void 0 : user.is_authorized), timeout: 500 }, { children: _jsxs(TextBoxStyled, { children: [getUserName() || '', _jsx(RoleTextStyled, { children: getUserRole() || '' })] }) })), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Box, { children: [_jsx(Occupation, { onListOpen: function () { return handleMenuClick(ListType.OccupationList); }, onListClose: function () { return handleMenuClick(); }, show: showOccupationFile && !isMonthlyIncomeListActive && !isSourceOfIncomeListActive }), _jsx(SourceOfIncome, { onListOpen: function () { return handleMenuClick(ListType.SourceOfIncomeList); }, onListClose: function () { return handleMenuClick(); }, show: showSourceOfIncome && !isMonthlyIncomeListActive && !isOccupationListActive }), _jsx(MonthlyIncome, { show: showSourceOfIncome && !isSourceOfIncomeListActive && !isOccupationListActive, onListOpen: function () { return handleMenuClick(ListType.MonthlyIncomeList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(ShareCount, { show: !listActive && showShares }), _jsx(ShareValue, { show: !listActive && showShares }), _jsxs(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: [_jsx(CivilIDFile, { show: !isSACountry }), _jsx(SignatureFile, { show: (user === null || user === void 0 ? void 0 : user.is_authorized) && showSignatureFile })] })), _jsx(PEPSwitch, { show: showIsPEP && !listActive }), _jsx(InfluencerSwitch, { show: showIsInfluencer && !listActive })] }), _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') })) }))] })) }))] }));
122
+ return (_jsxs(ScreenContainer, { children: [_jsx(Collapse, __assign({ in: !listActive && !!(user === null || user === void 0 ? void 0 : user.is_authorized), timeout: 500 }, { children: _jsxs(TextBoxStyled, { children: [getUserName() || '', _jsx(RoleTextStyled, { children: getUserRole() || '' })] }) })), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Box, { children: [_jsx(Occupation, { readOnly: !settingData.boardMaturity && !!(occupation === null || occupation === void 0 ? void 0 : occupation.id), onListOpen: function () { return handleMenuClick(ListType.OccupationList); }, onListClose: function () { return handleMenuClick(); }, show: showOccupationFile && !isMonthlyIncomeListActive && !isSourceOfIncomeListActive }), _jsx(SourceOfIncome, { readOnly: !settingData.boardMaturity && !!(sourceIncome === null || sourceIncome === void 0 ? void 0 : sourceIncome.id), onListOpen: function () { return handleMenuClick(ListType.SourceOfIncomeList); }, onListClose: function () { return handleMenuClick(); }, show: showSourceOfIncome && !isMonthlyIncomeListActive && !isOccupationListActive }), _jsx(MonthlyIncome, { readOnly: !settingData.boardMaturity && !!(monthlyIncome === null || monthlyIncome === void 0 ? void 0 : monthlyIncome.id), show: showSourceOfIncome && !isSourceOfIncomeListActive && !isOccupationListActive, onListOpen: function () { return handleMenuClick(ListType.MonthlyIncomeList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(ShareCount, { show: !listActive && showShares, readOnly: !settingData.boardMaturity && !!shareCount }), _jsx(ShareValue, { show: !listActive && showShares, readOnly: !settingData.boardMaturity && !!shareValue }), _jsxs(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: [_jsx(CivilIDFile, { show: !isSACountry, readOnly: !settingData.boardMaturity && !!defaultUserFiles.length, defaultFiles: defaultUserFiles }), _jsx(SignatureFile, { show: (user === null || user === void 0 ? void 0 : user.is_authorized) && showSignatureFile, readOnly: !settingData.boardMaturity && !!defaultUserFiles.length, defaultFiles: defaultUserFiles })] })), _jsx(PEPSwitch, { show: showIsPEP && !listActive, readOnly: !settingData.boardMaturity && typeof isPEP === 'boolean' }), _jsx(InfluencerSwitch, { show: showIsInfluencer && !listActive, readOnly: !settingData.boardMaturity && typeof isInfluencer === 'boolean' })] }), _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') })) }))] })) }))] }));
120
123
  };
121
124
  export default React.memo(AdditionalIndividualInfo);
122
125
  AdditionalIndividualInfo.defaultProps = {};
@@ -1,6 +1,9 @@
1
1
  /// <reference types="react" />
2
- interface CivilIDFileProps {
2
+ import { FileDetails } from '../../../../@types';
3
+ declare type CivilIDFileProps = {
4
+ defaultFiles?: Array<FileDetails>;
5
+ readOnly?: boolean;
3
6
  show: boolean;
4
- }
5
- declare const CivilIDFile: ({ show }: CivilIDFileProps) => JSX.Element;
7
+ };
8
+ declare const CivilIDFile: ({ defaultFiles, readOnly, show }: CivilIDFileProps) => JSX.Element;
6
9
  export default CivilIDFile;
@@ -10,7 +10,6 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
- import React from 'react';
14
13
  import { ScreenContainer } from '../../../../features/shared/Containers';
15
14
  import { styled } from '@mui/material/styles';
16
15
  import { useTranslation } from 'react-i18next';
@@ -19,7 +18,6 @@ import { useAppDispatch, useAppSelector } from '../../../../hooks';
19
18
  import { DocumentPurpose } from '../../../../@types';
20
19
  import { FileType } from '../../../../constants';
21
20
  import Collapse from '../../../../components/Collapse';
22
- import { getFileDetailsFromDocument } from '../../../../utils';
23
21
  import { civilIDUploadingStatus, clearError, individualSelector } from '../../../app/individual/individualStore';
24
22
  import UploadMultipleFile from '../../../shared/UploadMultipleFile';
25
23
  var FeatureStyled = styled(ScreenContainer)(function (_a) {
@@ -29,14 +27,12 @@ var FeatureStyled = styled(ScreenContainer)(function (_a) {
29
27
  });
30
28
  });
31
29
  var CivilIDFile = function (_a) {
32
- var _b;
33
- var show = _a.show;
30
+ var defaultFiles = _a.defaultFiles, readOnly = _a.readOnly, show = _a.show;
34
31
  var t = useTranslation().t;
35
32
  var dispatch = useAppDispatch();
36
33
  var control = useFormContext().control;
37
34
  var civilIDFileIdControl = useController({ name: 'civilID', control: control });
38
- var _c = useAppSelector(individualSelector), loading = _c.loading, data = _c.data, error = _c.error;
39
- var documents = (((_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.user) || {}).documents;
35
+ var _b = useAppSelector(individualSelector), loading = _b.loading, error = _b.error;
40
36
  var handleCivilIDChange = function (ids) {
41
37
  if (error)
42
38
  dispatch(clearError());
@@ -47,7 +43,6 @@ var CivilIDFile = function (_a) {
47
43
  dispatch(clearError());
48
44
  civilIDFileIdControl.field.onChange(ids);
49
45
  };
50
- var defaultFiles = React.useMemo(function () { return getFileDetailsFromDocument(documents, DocumentPurpose.IDENTITY_DOCUMENT); }, [documents]);
51
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadMultipleFile, { id: 'civilID', control: control, label: t('title_civil_id'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('desc_drag_and_drop_civilID'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_civil_id'), onFileUploaded: handleCivilIDChange, isSubmitting: loading, onDeleteFile: handleReset, maxLimit: 4, defaultFiles: defaultFiles, purpose: DocumentPurpose.IDENTITY_DOCUMENT, fileUploadingStatus: function (uploading) { return dispatch(civilIDUploadingStatus(uploading)); }, fileType: FileType.IMAGES }) }) })));
46
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadMultipleFile, { readOnly: readOnly, id: 'civilID', control: control, label: t('title_civil_id'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('desc_drag_and_drop_civilID'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_civil_id'), onFileUploaded: handleCivilIDChange, isSubmitting: loading, onDeleteFile: handleReset, maxLimit: 4, defaultFiles: defaultFiles, purpose: DocumentPurpose.IDENTITY_DOCUMENT, fileUploadingStatus: function (uploading) { return dispatch(civilIDUploadingStatus(uploading)); }, fileType: FileType.IMAGES }) }) })));
52
47
  };
53
48
  export default CivilIDFile;
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  export interface InfluencerSwitchProps {
3
3
  show: boolean;
4
+ readOnly?: boolean;
4
5
  }
5
- declare const _default: React.MemoExoticComponent<({ show }: InfluencerSwitchProps) => JSX.Element>;
6
+ declare const _default: React.MemoExoticComponent<({ show, readOnly }: InfluencerSwitchProps) => JSX.Element>;
6
7
  export default _default;
@@ -36,14 +36,13 @@ var RadioGroupStyled = styled(RadioGroup)(function (_a) {
36
36
  });
37
37
  });
38
38
  var InfluencerSwitch = function (_a) {
39
- var show = _a.show;
39
+ var show = _a.show, readOnly = _a.readOnly;
40
40
  var _b = React.useState(false), isHovered = _b[0], setIsHovered = _b[1];
41
41
  var control = useFormContext().control;
42
42
  var t = useTranslation().t;
43
43
  var dispatch = useAppDispatch();
44
44
  var influencerControl = useController({ name: 'isInfluencer', control: control });
45
- var _c = useAppSelector(individualSelector), data = _c.data, error = _c.error;
46
- var user = (data.verify.responseBody || {}).user;
45
+ var error = useAppSelector(individualSelector).error;
47
46
  var disabled = false;
48
47
  var handleOnChange = function (_a) {
49
48
  var target = _a.target;
@@ -52,6 +51,6 @@ var InfluencerSwitch = function (_a) {
52
51
  influencerControl.field.onChange(target.value === 'yes');
53
52
  };
54
53
  var influencerValue = influencerControl.field.value;
55
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pt: 2.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(Box, __assign({ style: { display: 'flex', justifyContent: 'space-between' } }, { children: [_jsxs(LabelTextStyled, { children: [t('tap_js_are_you_an_influencer'), _jsx(Mandatory, {})] }), _jsx(Tooltip, __assign({ title: t('influencer_name_hint'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onTouchStartCapture: function () { return setIsHovered(true); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] })), _jsxs(RadioGroupStyled, __assign({ value: influencerValue != null ? (influencerValue ? 'yes' : 'no') : false, onChange: disabled ? undefined : handleOnChange }, { children: [_jsx(RadioLabel, { value: 'yes', label: t('yes') }), _jsx(RadioLabel, { value: 'no', label: t('no') })] }))] })) })));
54
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pt: 2.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(Box, __assign({ style: { display: 'flex', justifyContent: 'space-between' } }, { children: [_jsxs(LabelTextStyled, { children: [t('tap_js_are_you_an_influencer'), _jsx(Mandatory, {})] }), _jsx(Tooltip, __assign({ title: t('influencer_name_hint'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onTouchStartCapture: function () { return setIsHovered(true); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] })), _jsxs(RadioGroupStyled, __assign({ value: influencerValue != null ? (influencerValue ? 'yes' : 'no') : false, onChange: disabled || readOnly ? undefined : handleOnChange }, { children: [_jsx(RadioLabel, { value: 'yes', label: t('yes') }), _jsx(RadioLabel, { value: 'no', label: t('no') })] }))] })) })));
56
55
  };
57
56
  export default React.memo(InfluencerSwitch);
@@ -5,6 +5,7 @@ interface MonthlyIncomeProps {
5
5
  onSelectSource?: (country: MonthlyIncomeType) => void;
6
6
  onListOpen?: () => void;
7
7
  onListClose?: () => void;
8
+ readOnly?: boolean;
8
9
  }
9
- declare const _default: React.MemoExoticComponent<({ ...rest }: MonthlyIncomeProps) => JSX.Element>;
10
+ declare const _default: React.MemoExoticComponent<(props: MonthlyIncomeProps) => JSX.Element>;
10
11
  export default _default;
@@ -9,17 +9,6 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
12
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
13
  import * as React from 'react';
25
14
  import { useTranslation } from 'react-i18next';
@@ -52,21 +41,19 @@ var CheckIconStyled = styled(CheckIcon)(function (_a) {
52
41
  alignItems: 'flex-end'
53
42
  });
54
43
  });
55
- var MonthlyIncome = function (_a) {
56
- var _b;
57
- var rest = __rest(_a, []);
58
- var _c = React.useState([]), incomeList = _c[0], setIncomeList = _c[1];
59
- var _d = React.useState(null), anchorEl = _d[0], setAnchorEl = _d[1];
44
+ var MonthlyIncome = function (props) {
45
+ var _a;
46
+ var _b = React.useState([]), incomeList = _b[0], setIncomeList = _b[1];
47
+ var _c = React.useState(null), anchorEl = _c[0], setAnchorEl = _c[1];
60
48
  var t = useTranslation().t;
61
49
  var isAr = useLanguage().isAr;
62
50
  var dispatch = useAppDispatch();
63
- var _e = useAppSelector(individualSelector), data = _e.data, bckError = _e.error;
51
+ var _d = useAppSelector(individualSelector), data = _d.data, bckError = _d.error;
64
52
  var control = useFormContext().control;
65
53
  var settingsData = useAppSelector(settingsSelector).data;
66
54
  var monthlyIncomeList = (data.individualData.responseBody || {}).monthlyIncomeList;
67
55
  var monthlyIncomeControl = useController({ control: control, name: 'monthlyIncome' });
68
56
  var countryCode = settingsData.businessCountry;
69
- var user = (data.verify.responseBody || {}).user;
70
57
  var disabled = false;
71
58
  React.useEffect(function () {
72
59
  if ((monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList.length) > 0) {
@@ -75,13 +62,15 @@ var MonthlyIncome = function (_a) {
75
62
  }, [monthlyIncomeList]);
76
63
  var onOpenList = function (event) {
77
64
  var _a;
65
+ if (props.readOnly)
66
+ return;
78
67
  setAnchorEl(event.currentTarget);
79
- (_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
68
+ (_a = props.onListOpen) === null || _a === void 0 ? void 0 : _a.call(props);
80
69
  };
81
70
  var onCloseList = function () {
82
71
  var _a;
83
72
  setAnchorEl(null);
84
- (_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
73
+ (_a = props.onListClose) === null || _a === void 0 ? void 0 : _a.call(props);
85
74
  if ((monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList.length) > 0) {
86
75
  setIncomeList(monthlyIncomeList);
87
76
  }
@@ -93,8 +82,8 @@ var MonthlyIncome = function (_a) {
93
82
  monthlyIncomeControl.field.onChange(source);
94
83
  };
95
84
  var income = monthlyIncomeControl.field.value;
96
- var error = (_b = monthlyIncomeControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
97
- return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 0 } }, { children: [_jsx(Input, { label: t('please_enter_actual_income', {
85
+ var error = (_a = monthlyIncomeControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
86
+ return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 0 } }, { children: [_jsx(Input, { label: t('please_enter_actual_income', {
98
87
  currency: t(findCurrencyByIso2(countryCode.iso2))
99
88
  }), disabled: disabled, readOnly: true, onClick: disabled ? undefined : !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: disabled ? _jsx(_Fragment, {}) : _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_any_source_of_income'), value: (isAr ? income === null || income === void 0 ? void 0 : income.range.ar : income === null || income === void 0 ? void 0 : income.range.en) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'range.en', searchValuePath: ['range.en', 'range.ar'], list: incomeList, onSelectItem: onSelectItem, renderItem: function (item) {
100
89
  return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (income === null || income === void 0 ? void 0 : income.id) }, { children: isAr ? item.range.ar : item === null || item === void 0 ? void 0 : item.range.en })) }), item.id === (income === null || income === void 0 ? void 0 : income.id) && _jsx(CheckIconStyled, {})] }));
@@ -5,6 +5,7 @@ interface OccupationProps {
5
5
  onSelectOccupation?: (occupation: OccupationType) => void;
6
6
  onListOpen?: () => void;
7
7
  onListClose?: () => void;
8
+ readOnly?: boolean;
8
9
  }
9
- declare const Occupation: ({ ...rest }: OccupationProps) => JSX.Element;
10
+ declare const Occupation: (props: OccupationProps) => JSX.Element;
10
11
  export default Occupation;