@swan-io/shared-business 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swan-io/shared-business",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=14.0.0",
|
|
6
6
|
"yarn": "^1.20.0"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@swan-io/lake": "^1.3.2"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@formatjs/intl": "^2.
|
|
32
|
+
"@formatjs/intl": "^2.7.0",
|
|
33
33
|
"@googlemaps/js-api-loader": "^1.15.1",
|
|
34
34
|
"@swan-io/boxed": "^0.13.0",
|
|
35
35
|
"dayjs": "^1.11.7",
|
|
@@ -37,22 +37,22 @@
|
|
|
37
37
|
"react-atomic-state": "^1.2.7",
|
|
38
38
|
"react-dom": "^18.2.0",
|
|
39
39
|
"react-dropzone": "^14.2.3",
|
|
40
|
-
"react-native-web": "^0.19.
|
|
40
|
+
"react-native-web": "^0.19.4",
|
|
41
41
|
"react-ux-form": "^1.3.0",
|
|
42
42
|
"rifm": "^0.12.1",
|
|
43
|
-
"ts-pattern": "^4.2.
|
|
43
|
+
"ts-pattern": "^4.2.2",
|
|
44
44
|
"uuid": "^9.0.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@swan-io/lake": "^1.
|
|
47
|
+
"@swan-io/lake": "^1.7.0",
|
|
48
48
|
"@testing-library/react": "^14.0.0",
|
|
49
49
|
"@testing-library/user-event": "^14.4.3",
|
|
50
|
-
"@types/google.maps": "^3.52.
|
|
51
|
-
"@types/react": "^18.0.
|
|
50
|
+
"@types/google.maps": "^3.52.5",
|
|
51
|
+
"@types/react": "^18.0.35",
|
|
52
52
|
"@types/react-dom": "^18.0.11",
|
|
53
53
|
"@types/react-native": "^0.71.5",
|
|
54
54
|
"@types/uuid": "^9.0.1",
|
|
55
55
|
"jsdom": "^21.1.1",
|
|
56
|
-
"vitest": "^0.
|
|
56
|
+
"vitest": "^0.30.1"
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -38,6 +38,16 @@ const beneficiaryTypes = [
|
|
|
38
38
|
{ value: "HasCapital", name: t("beneficiaryForm.beneficiary.ownershipOfCapital") },
|
|
39
39
|
{ value: "Other", name: t("beneficiaryForm.beneficiary.other") },
|
|
40
40
|
];
|
|
41
|
+
const validateCca3CountryCode = value => {
|
|
42
|
+
if (value == null) {
|
|
43
|
+
return t("error.requiredField");
|
|
44
|
+
}
|
|
45
|
+
if (!isCountryCCA3(value)) {
|
|
46
|
+
// no need to set an error message because country picker contains only valid values
|
|
47
|
+
// this is used only for validateUbo function to display an error indicator without opening UBO modal
|
|
48
|
+
return " ";
|
|
49
|
+
}
|
|
50
|
+
};
|
|
41
51
|
export const validateUbo = (editorState, accountCountry) => {
|
|
42
52
|
const isAddressRequired = accountCountry === "DEU";
|
|
43
53
|
const isBirthInfoRequired = accountCountry !== "DEU";
|
|
@@ -51,7 +61,7 @@ export const validateUbo = (editorState, accountCountry) => {
|
|
|
51
61
|
birthDate: isBirthInfoRequired
|
|
52
62
|
? validateNullableRequired(editorState.birthDate)
|
|
53
63
|
: undefined,
|
|
54
|
-
birthCountryCode:
|
|
64
|
+
birthCountryCode: validateCca3CountryCode(editorState.birthCountryCode),
|
|
55
65
|
birthCity: isBirthInfoRequired
|
|
56
66
|
? validateNullableRequired(editorState.birthCity)
|
|
57
67
|
: undefined,
|