@swan-io/shared-business 8.2.4 → 8.3.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": "8.2.4",
3
+ "version": "8.3.0",
4
4
  "engines": {
5
5
  "node": ">=18.0.0",
6
6
  "yarn": "^1.22.0"
@@ -1,4 +1,4 @@
1
- export type AccountCountry = "DEU" | "ESP" | "FRA" | "NLD";
1
+ export type AccountCountry = "DEU" | "ESP" | "FRA" | "NLD" | "ITA";
2
2
  export declare const getIndividualTaxNumberPlaceholder: (accountCountry: AccountCountry) => string;
3
3
  export declare const getCompanyTaxNumberPlaceholder: (accountCountry: AccountCountry) => string;
4
4
  export declare const getTaxNumberTooltip: (accountCountry: AccountCountry) => string | undefined;
@@ -68,6 +68,12 @@ export const validateIndividualTaxNumber = (accountCountry) => value => {
68
68
  if (!/^[a-zA-Z0-9]{9}$/.test(value)) {
69
69
  return t("common.form.invalidTaxIdentificationNumber");
70
70
  }
71
+ })
72
+ .with("ITA", () => {
73
+ // accept 16 characters
74
+ if (!/^[a-zA-Z0-9]{16}$/.test(value)) {
75
+ return t("common.form.invalidTaxIdentificationNumber");
76
+ }
71
77
  })
72
78
  .otherwise(noop);
73
79
  };