@swan-io/shared-business 13.1.2 → 13.1.4

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": "13.1.2",
3
+ "version": "13.1.4",
4
4
  "engines": {
5
5
  "node": "^22.12.0"
6
6
  },
@@ -25,7 +25,7 @@
25
25
  ],
26
26
  "license": "MIT",
27
27
  "peerDependencies": {
28
- "@swan-io/lake": "13.1.2"
28
+ "@swan-io/lake": "13.1.4"
29
29
  },
30
30
  "dependencies": {
31
31
  "@formatjs/intl": "^3.1.6",
@@ -50,6 +50,6 @@
50
50
  "@types/react-dom": "^19.1.7",
51
51
  "@types/react-native": "^0.72.8",
52
52
  "type-fest": "^4.41.0",
53
- "@swan-io/lake": "13.1.2"
53
+ "@swan-io/lake": "13.1.4"
54
54
  }
55
55
  }
@@ -1,6 +1,6 @@
1
1
  import { StyleProp, ViewStyle } from "react-native";
2
2
  import { CountryCCA3 } from "../constants/countries";
3
- export type TransactionType = "SepaCreditTransfer" | "Fees" | "SepaDirectDebit" | "Card";
3
+ export type TransactionType = "SepaCreditTransfer" | "SepaDirectDebit" | "Card";
4
4
  type AddressInfo = {
5
5
  addressLine1: string;
6
6
  addressLine2?: string;
@@ -37,10 +37,9 @@ type CreditStatementV1Props = {
37
37
  totalsCredit: Amount;
38
38
  totalsDebit: Amount;
39
39
  closingBalance: Amount;
40
- feesDebit: Amount;
41
- feesCredit: Amount;
40
+ generationDate: string;
42
41
  };
43
- export declare const CreditStatementV1: ({ partnerLogoUrl, accountHolderType, accountHolderName, accountHolderAddress, iban, bic, openingDate, closingDate, openingBalance, transactions, feesDebit, feesCredit, totalsCredit, totalsDebit, closingBalance, }: CreditStatementV1Props) => import("react/jsx-runtime").JSX.Element;
42
+ export declare const CreditStatementV1: ({ partnerLogoUrl, accountHolderType, accountHolderName, accountHolderAddress, iban, bic, openingDate, closingDate, openingBalance, transactions, totalsCredit, totalsDebit, closingBalance, generationDate }: CreditStatementV1Props) => import("react/jsx-runtime").JSX.Element;
44
43
  export type CreditStatementProps = CreditStatementV1Props;
45
44
  export declare const CreditStatement: (props: CreditStatementProps) => import("react/jsx-runtime").JSX.Element;
46
45
  export {};
@@ -36,7 +36,7 @@ const styles = StyleSheet.create({
36
36
  sectionTitle: {
37
37
  ...getTextStyle("sans", 14),
38
38
  color: colors.swan[500],
39
- fontWeight: "500",
39
+ fontWeight: "600",
40
40
  lineHeight: 24,
41
41
  },
42
42
  totalAmount: {
@@ -103,7 +103,6 @@ const Title = ({ text, align = "left", style, }) => (_jsx(Text, { style: [
103
103
  const translateTransaction = (transaction) => {
104
104
  return match(transaction)
105
105
  .with("Card", () => t("accountStatement.card"))
106
- .with("Fees", () => t("accountStatement.fees"))
107
106
  .with("SepaCreditTransfer", () => t("accountStatement.creditTransfer"))
108
107
  .with("SepaDirectDebit", () => t("accountStatement.directDebit"))
109
108
  .exhaustive();
@@ -114,8 +113,8 @@ const logoStyle = {
114
113
  objectFit: "contain",
115
114
  objectPosition: "left",
116
115
  };
117
- export const CreditStatementV1 = ({ partnerLogoUrl, accountHolderType, accountHolderName, accountHolderAddress, iban, bic, openingDate, closingDate, openingBalance, transactions, feesDebit, feesCredit, totalsCredit, totalsDebit, closingBalance, }) => {
118
- return (_jsxs(Box, { style: styles.container, direction: "column", justifyContent: "spaceBetween", children: [_jsxs(Box, { children: [_jsx(Box, { direction: "row", justifyContent: "spaceBetween", children: _jsxs(Box, { direction: "row", alignItems: "center", children: [isNotNullishOrEmpty(partnerLogoUrl) ? (_jsx("img", { src: partnerLogoUrl, style: logoStyle })) : (_jsx(SwanLogo, { style: styles.defaultLogo })), _jsx(Separator, { horizontal: true, space: 8 }), _jsx(Text, { style: styles.partnershipText, children: t("accountStatement.partnership") }), _jsx(Space, { width: 4 }), _jsx(SwanLogo, { color: colors.gray[900], style: styles.swanLogo })] }) }), _jsx(Space, { height: 24 }), _jsx(Text, { style: styles.pageTitle, children: t("creditStatement.titleDocument") }), _jsx(Text, { style: styles.text, children: accountHolderType === "Company"
116
+ export const CreditStatementV1 = ({ partnerLogoUrl, accountHolderType, accountHolderName, accountHolderAddress, iban, bic, openingDate, closingDate, openingBalance, transactions, totalsCredit, totalsDebit, closingBalance, generationDate }) => {
117
+ return (_jsxs(Box, { style: styles.container, direction: "column", justifyContent: "spaceBetween", children: [_jsxs(Box, { children: [_jsx(Box, { direction: "row", justifyContent: "spaceBetween", children: _jsxs(Box, { direction: "row", alignItems: "center", children: [isNotNullishOrEmpty(partnerLogoUrl) ? (_jsx("img", { src: partnerLogoUrl, style: logoStyle })) : (_jsx(SwanLogo, { style: styles.defaultLogo })), _jsx(Separator, { horizontal: true, space: 8 }), _jsx(Text, { style: styles.partnershipText, children: t("accountStatement.partnership") }), _jsx(Space, { width: 4 }), _jsx(SwanLogo, { color: colors.gray[900], style: styles.swanLogo })] }) }), _jsx(Space, { height: 24 }), _jsx(Text, { style: styles.pageTitle, children: t("creditStatement.titleDocument") }), _jsx(Text, { style: styles.text, children: t("transactionStatement.generationDate", { date: generationDate }) }), _jsx(Text, { style: styles.text, children: accountHolderType === "Company"
119
118
  ? t("accountStatement.titleDocument.companyDescription")
120
119
  : t("accountStatement.titleDocument.individualDescription") }), _jsx(Space, { height: 12 }), _jsxs(Box, { direction: "column", children: [_jsx(Text, { style: styles.sectionTitle, children: accountHolderName }), _jsx(Text, { style: styles.text, children: accountHolderAddress.addressLine1 }), isNotNullish(accountHolderAddress.addressLine2) && (_jsx(Text, { children: accountHolderAddress.addressLine2 })), _jsx(Text, { style: styles.text, children: `${accountHolderAddress.postalCode} ${accountHolderAddress.city}, ${getCountryName(accountHolderAddress.country)}` })] }), _jsx(Space, { height: 12 }), _jsx(Text, { style: styles.sectionTitle, children: t("accountStatement.iban") }), _jsx(Text, { style: styles.text, children: iban }), _jsx(Space, { height: 4 }), _jsx(Text, { style: styles.sectionTitle, children: t("accountStatement.bic") }), _jsx(Text, { style: styles.text, children: bic }), _jsx(Space, { height: 24 }), _jsxs(Box, { direction: "row", justifyContent: "spaceBetween", children: [_jsx(Box, { direction: "column", justifyContent: "end", children: _jsx(Text, { style: styles.sectionTitle, children: t("accountStatement.date", { openingDate, closingDate }) }) }), _jsxs(Box, { direction: "column", children: [_jsx(Text, { style: styles.openingBalanceText, children: t("accountStatement.openingBalance") }), _jsx(Text, { style: styles.totalAmount, children: formatCurrencySymbol(Number(openingBalance.value), openingBalance.currency) })] })] }), _jsx(Space, { height: 24 }), _jsxs(_Fragment, { children: [_jsxs(Box, { direction: "row", children: [_jsx(Text, { style: [styles.titleColumn, { width: "15%" }], children: t("accountStatement.column.date") }), _jsx(Text, { style: [styles.titleColumn, { width: "22%" }], children: t("accountStatement.column.type") }), _jsx(Text, { style: [styles.titleColumn, { width: "33%" }], children: t("accountStatement.column.description") }), _jsx(Text, { style: [styles.titleColumn, { width: "15%", textAlign: "right" }], children: t("creditStatement.column.credit") }), _jsx(Text, { style: [styles.titleColumn, { width: "15%", textAlign: "right" }], children: t("creditStatement.column.debit") })] }), _jsx(Box, { direction: "column", children: transactions.map(({ transactionAmount, transactionDate, transactionLabel, transactionSide, transactionType, transactionId, }) => (_jsxs(Box, { direction: "row", children: [_jsx(Text, { style: [styles.textColumn, { width: "15%" }], children: transactionDate }), _jsx(Text, { style: [styles.textColumn, { width: "22%" }], children: translateTransaction(transactionType) }), _jsx(Text, { style: [styles.textColumn, { width: "33%" }], children: transactionLabel }), _jsx(Text, { style: [
121
120
  styles.textColumn,
@@ -123,7 +122,7 @@ export const CreditStatementV1 = ({ partnerLogoUrl, accountHolderType, accountHo
123
122
  ], children: transactionSide === "Credit" ? transactionAmount.value : "" }), _jsx(Text, { style: [
124
123
  styles.textColumn,
125
124
  { width: "15%", textAlign: "right", fontWeight: "600" },
126
- ], children: transactionSide === "Debit" ? transactionAmount.value : "" })] }, transactionId))) })] }), _jsx(Space, { height: 24 }), _jsxs(Box, { direction: "column", children: [_jsxs(Box, { direction: "row", justifyContent: "end", children: [_jsx(Text, { style: [styles.row], children: t("accountStatement.column.fees") }), _jsx(Text, { style: [styles.row, { width: "15%" }], children: feesCredit.value }), _jsx(Text, { style: [styles.row, { width: "15%" }], children: feesDebit.value })] }), _jsx(Space, { height: 12 }), _jsxs(Box, { direction: "row", justifyContent: "end", children: [_jsx(Text, { style: styles.row, children: t("accountStatement.column.totals") }), _jsx(Text, { style: [styles.row, { width: "15%" }], children: totalsCredit.value }), _jsx(Text, { style: [styles.row, { width: "15%" }], children: totalsDebit.value })] })] }), _jsx(Space, { height: 12 }), _jsx(Box, { direction: "row", justifyContent: "end", children: _jsxs(Box, { direction: "row", justifyContent: "spaceBetween", alignItems: "center", style: { width: "50%" }, children: [_jsx(Title, { align: "right", text: t("accountStatement.closingBalance"), style: { width: "40%" } }), _jsx(Title, { text: formatCurrencySymbol(Number(closingBalance.value), closingBalance.currency), style: {
125
+ ], children: transactionSide === "Debit" ? transactionAmount.value : "" })] }, transactionId))) })] }), _jsx(Space, { height: 24 }), _jsx(Box, { direction: "column", children: _jsxs(Box, { direction: "row", justifyContent: "end", children: [_jsx(Text, { style: styles.row, children: t("accountStatement.column.totals") }), _jsx(Text, { style: [styles.row, { width: "15%" }], children: totalsCredit.value }), _jsx(Text, { style: [styles.row, { width: "15%" }], children: totalsDebit.value })] }) }), _jsx(Space, { height: 12 }), _jsx(Box, { direction: "row", justifyContent: "end", children: _jsxs(Box, { direction: "row", justifyContent: "spaceBetween", alignItems: "center", style: { width: "50%" }, children: [_jsx(Title, { align: "right", text: t("accountStatement.closingBalance"), style: { width: "40%" } }), _jsx(Title, { text: formatCurrencySymbol(Number(closingBalance.value), closingBalance.currency), style: {
127
126
  width: "60%",
128
127
  ...getTextStyle("sans", 20),
129
128
  fontWeight: "600",
@@ -15,6 +15,7 @@ import { match } from "ts-pattern";
15
15
  import { extractDate, formatExtractedDate } from "../utils/date";
16
16
  import { t } from "../utils/i18n";
17
17
  import { getMostLikelyUserCountry } from "../utils/localization";
18
+ import { validateDate } from "../utils/validation";
18
19
  const months = [
19
20
  { value: "01", name: t("datePicker.month.january") },
20
21
  { value: "02", name: t("datePicker.month.february") },
@@ -57,7 +58,7 @@ const order = match(getMostLikelyUserCountry().cca2)
57
58
  .with("US", () => "MDY")
58
59
  .with("CN", "JP", "KR", "KP", "TW", "HU", "MN", "LT", "BT", () => "YMD")
59
60
  .otherwise(() => "DMY");
60
- export const InlineDatePicker = ({ value, label, readOnly = false, onValueChange, validate = () => undefined, error: externalError, style, }) => {
61
+ export const InlineDatePicker = ({ value, label, readOnly = false, onValueChange, validate = validateDate, error: externalError, style, }) => {
61
62
  const { desktop } = useResponsive(breakpoints.small);
62
63
  // We can't rely on blurred, since 3 inputs / select are mapped on
63
64
  // 1 field. The first onBlur update the field internal state from
@@ -65,6 +66,7 @@ export const InlineDatePicker = ({ value, label, readOnly = false, onValueChange
65
66
  // validate will not be triggered again since the field has already
66
67
  // blurred = true
67
68
  const touched = useRef(new Set());
69
+ const mountWithInitialValue = useRef(value != null);
68
70
  const { Field, validateField } = useForm({
69
71
  date: {
70
72
  initialValue: isNotNullish(value) ? extractDate(value) : undefined,
@@ -89,7 +91,8 @@ export const InlineDatePicker = ({ value, label, readOnly = false, onValueChange
89
91
  },
90
92
  });
91
93
  const validateDate = () => {
92
- if (touched.current.has("day") && touched.current.has("month") && touched.current.has("year")) {
94
+ if (mountWithInitialValue.current ||
95
+ (touched.current.has("day") && touched.current.has("month") && touched.current.has("year"))) {
93
96
  validateField("date");
94
97
  }
95
98
  };
@@ -111,10 +111,10 @@
111
111
  "fileTile.status.Refused": "Abgelehnt",
112
112
  "fileTile.status.Validated": "Validiert",
113
113
  "fileTile.uploading": "Hochladen…",
114
- "monthlyPaymentVolume.between10000And50000": "Zwischen 10.000 und 50.000 €",
115
- "monthlyPaymentVolume.between50000And100000": "Zwischen 50.000 und 100.000 €",
116
- "monthlyPaymentVolume.lessThan10000": "Weniger als 10.000 €",
117
- "monthlyPaymentVolume.moreThan100000": "Mehr als 100.000 €",
114
+ "monthlyPaymentVolume.between10000And50000": "Zwischen 10.000 und 50.000 € pro Monat",
115
+ "monthlyPaymentVolume.between50000And100000": "Zwischen 50.000 und 100.000 € pro Monat",
116
+ "monthlyPaymentVolume.lessThan10000": "Weniger als 10.000 € pro Monat",
117
+ "monthlyPaymentVolume.moreThan100000": "Mehr als 100.000 € pro Monat",
118
118
  "registrationPage.defaultNumberLabel": "Registrierungsnummer",
119
119
  "registrationPage.withOrganismLabel": "Ist Ihre Firma bereits im {organismName} eingetragen?",
120
120
  "registrationPage.withoutOrganismNameLabel": "Sind Sie registriert?",
@@ -407,5 +407,6 @@
407
407
  "transactionStatement.type.SepaInstantCreditTransferIn": "SEPA Sofortüberweisung erhalten",
408
408
  "transactionStatement.type.SepaInstantCreditTransferOut": "SEPA Sofortüberweisung gesendet",
409
409
  "validation.birthdateCannotBeFuture": "Geburtsdatum darf nicht in der Zukunft liegen",
410
- "validation.invalidBirthDate": "Bitte geben Sie ein gültiges Geburtsdatum ein."
410
+ "validation.invalidBirthDate": "Bitte geben Sie ein gültiges Geburtsdatum ein.",
411
+ "validation.invalidDate": "Bitte geben Sie ein gültiges Datum ein."
411
412
  }
@@ -111,10 +111,10 @@
111
111
  "fileTile.status.Refused": "Refused",
112
112
  "fileTile.status.Validated": "Validated",
113
113
  "fileTile.uploading": "Uploading…",
114
- "monthlyPaymentVolume.between10000And50000": "Between €10,000 and €50,000",
115
- "monthlyPaymentVolume.between50000And100000": "Between €50,000 and €100,000",
116
- "monthlyPaymentVolume.lessThan10000": "Less than €10,000",
117
- "monthlyPaymentVolume.moreThan100000": "More than €100,000",
114
+ "monthlyPaymentVolume.between10000And50000": "Between €10,000 and €50,000 by month",
115
+ "monthlyPaymentVolume.between50000And100000": "Between €50,000 and €100,000 by month",
116
+ "monthlyPaymentVolume.lessThan10000": "Less than €10,000 by month",
117
+ "monthlyPaymentVolume.moreThan100000": "More than €100,000 by month",
118
118
  "registrationPage.defaultNumberLabel": "Registration number",
119
119
  "registrationPage.withOrganismLabel": "Are you registered to {organismName}?",
120
120
  "registrationPage.withoutOrganismNameLabel": "Are you registered?",
@@ -407,5 +407,6 @@
407
407
  "transactionStatement.type.SepaInstantCreditTransferIn": "SEPA Instant Credit Transfer received",
408
408
  "transactionStatement.type.SepaInstantCreditTransferOut": "SEPA Instant Credit Transfer sent",
409
409
  "validation.birthdateCannotBeFuture": "Birthdate cannot be in the future",
410
- "validation.invalidBirthDate": "Please enter a valid birth date."
410
+ "validation.invalidBirthDate": "Please enter a valid birth date.",
411
+ "validation.invalidDate": "Please enter a valid date."
411
412
  }
@@ -111,10 +111,10 @@
111
111
  "fileTile.status.Refused": "Rechazado",
112
112
  "fileTile.status.Validated": "Validado",
113
113
  "fileTile.uploading": "Subiendo…",
114
- "monthlyPaymentVolume.between10000And50000": "Entre 10 000 y 50 000 euros",
115
- "monthlyPaymentVolume.between50000And100000": "Entre 50 000 y 100 000 euros",
116
- "monthlyPaymentVolume.lessThan10000": "Menos de 10 000 euros",
117
- "monthlyPaymentVolume.moreThan100000": "Más de 100 000 euros",
114
+ "monthlyPaymentVolume.between10000And50000": "Entre 10 000 y 50 000 euros por mes",
115
+ "monthlyPaymentVolume.between50000And100000": "Entre 50 000 y 100 000 euros por mes",
116
+ "monthlyPaymentVolume.lessThan10000": "Menos de 10 000 euros por mes",
117
+ "monthlyPaymentVolume.moreThan100000": "Más de 100 000 euros por mes",
118
118
  "registrationPage.defaultNumberLabel": "Número de registro",
119
119
  "registrationPage.withOrganismLabel": "¿Estás registrado en {organismName}?",
120
120
  "registrationPage.withoutOrganismNameLabel": "¿Estás registrado?",
@@ -407,5 +407,6 @@
407
407
  "transactionStatement.type.SepaInstantCreditTransferIn": "Transferencia SEPA instantánea recibida",
408
408
  "transactionStatement.type.SepaInstantCreditTransferOut": "Transferencia SEPA instantánea enviada",
409
409
  "validation.birthdateCannotBeFuture": "La fecha de nacimiento no puede estar en el futuro",
410
- "validation.invalidBirthDate": "Por favor, introduce una fecha de nacimiento válida."
410
+ "validation.invalidBirthDate": "Por favor, introduce una fecha de nacimiento válida.",
411
+ "validation.invalidDate": "Por favor, introduce una fecha válida."
411
412
  }
@@ -111,10 +111,10 @@
111
111
  "fileTile.status.Refused": "Hylätty",
112
112
  "fileTile.status.Validated": "Vahvistettu",
113
113
  "fileTile.uploading": "Ladataan...",
114
- "monthlyPaymentVolume.between10000And50000": "10 000 euron ja 50 000 euron välillä",
115
- "monthlyPaymentVolume.between50000And100000": "50 000 euron ja 100 000 euron välillä",
116
- "monthlyPaymentVolume.lessThan10000": "Vähemmän kuin 10 000 euroa",
117
- "monthlyPaymentVolume.moreThan100000": "Enemmän kuin 100 000 euroa",
114
+ "monthlyPaymentVolume.between10000And50000": "10 000 euron ja 50 000 euron välillä per kuukausi",
115
+ "monthlyPaymentVolume.between50000And100000": "50 000 euron ja 100 000 euron välillä per kuukausi",
116
+ "monthlyPaymentVolume.lessThan10000": "Vähemmän kuin 10 000 euroa per kuukausi",
117
+ "monthlyPaymentVolume.moreThan100000": "Enemmän kuin 100 000 euroa per kuukausi",
118
118
  "registrationPage.defaultNumberLabel": "Rekisteröintinumero",
119
119
  "registrationPage.withOrganismLabel": "Oletko yrityksesi rekisteröity kohteeseen {organismName}?",
120
120
  "registrationPage.withoutOrganismNameLabel": "Onko yrityksesi rekisteröity?",
@@ -407,5 +407,6 @@
407
407
  "transactionStatement.type.SepaInstantCreditTransferIn": "SEPA Instant -tilisiirto vastaanotettu",
408
408
  "transactionStatement.type.SepaInstantCreditTransferOut": "SEPA Instant -tilisiirto lähetetty",
409
409
  "validation.birthdateCannotBeFuture": "Syntymäaika ei voi olla tulevaisuudessa",
410
- "validation.invalidBirthDate": "Syötä syntymäaika oikeassa muodossa."
410
+ "validation.invalidBirthDate": "Syötä syntymäaika oikeassa muodossa.",
411
+ "validation.invalidDate": "Syötä kelvollinen päivämäärä."
411
412
  }
@@ -111,10 +111,10 @@
111
111
  "fileTile.status.Refused": "Refusé",
112
112
  "fileTile.status.Validated": "Validé",
113
113
  "fileTile.uploading": "Téléchargement…",
114
- "monthlyPaymentVolume.between10000And50000": "Entre 10 000 € et 50 000 €",
115
- "monthlyPaymentVolume.between50000And100000": "Entre 50 000 € et 100 000 €",
116
- "monthlyPaymentVolume.lessThan10000": "Moins de 10 000 €",
117
- "monthlyPaymentVolume.moreThan100000": "Plus de 100 000 €",
114
+ "monthlyPaymentVolume.between10000And50000": "Entre 10 000 € et 50 000 € par mois",
115
+ "monthlyPaymentVolume.between50000And100000": "Entre 50 000 € et 100 000 € par mois",
116
+ "monthlyPaymentVolume.lessThan10000": "Moins de 10 000 € par mois",
117
+ "monthlyPaymentVolume.moreThan100000": "Plus de 100 000 € par mois",
118
118
  "registrationPage.defaultNumberLabel": "Numéro d'immatriculation",
119
119
  "registrationPage.withOrganismLabel": "Êtes-vous immatriculé au {organismName}?",
120
120
  "registrationPage.withoutOrganismNameLabel": "Êtes-vous immatriculé?",
@@ -407,5 +407,6 @@
407
407
  "transactionStatement.type.SepaInstantCreditTransferIn": "Virement SEPA instantané reçu",
408
408
  "transactionStatement.type.SepaInstantCreditTransferOut": "Virement SEPA instantané envoyé",
409
409
  "validation.birthdateCannotBeFuture": "La date de naissance ne peut pas être dans le futur",
410
- "validation.invalidBirthDate": "Veuillez saisir une date de naissance valide."
410
+ "validation.invalidBirthDate": "Veuillez saisir une date de naissance valide.",
411
+ "validation.invalidDate": "Veuillez saisir une date valide."
411
412
  }
@@ -111,10 +111,10 @@
111
111
  "fileTile.status.Refused": "Rifiutato",
112
112
  "fileTile.status.Validated": "Convalidato",
113
113
  "fileTile.uploading": "Caricamento…",
114
- "monthlyPaymentVolume.between10000And50000": "Tra €10.000 e €50.000",
115
- "monthlyPaymentVolume.between50000And100000": "Tra €50.000 e €100.000",
116
- "monthlyPaymentVolume.lessThan10000": "Meno di €10.000",
117
- "monthlyPaymentVolume.moreThan100000": "Più di €100.000",
114
+ "monthlyPaymentVolume.between10000And50000": "Tra €10.000 e €50.000 al mese",
115
+ "monthlyPaymentVolume.between50000And100000": "Tra €50.000 e €100.000 al mese",
116
+ "monthlyPaymentVolume.lessThan10000": "Meno di €10.000 al mese",
117
+ "monthlyPaymentVolume.moreThan100000": "Più di €100.000 al mese",
118
118
  "registrationPage.defaultNumberLabel": "Numero di registrazione",
119
119
  "registrationPage.withOrganismLabel": "È registrato a {organismName}?",
120
120
  "registrationPage.withoutOrganismNameLabel": "È registrato?",
@@ -407,5 +407,6 @@
407
407
  "transactionStatement.type.SepaInstantCreditTransferIn": "Bonifico istantaneo SEPA ricevuto",
408
408
  "transactionStatement.type.SepaInstantCreditTransferOut": "Bonifico istantaneo SEPA inviato",
409
409
  "validation.birthdateCannotBeFuture": "La data di nascita non può essere nel futuro",
410
- "validation.invalidBirthDate": "Inserisci una data di nascita valida."
410
+ "validation.invalidBirthDate": "Inserisci una data di nascita valida.",
411
+ "validation.invalidDate": "Inserisci una data valida."
411
412
  }
@@ -111,10 +111,10 @@
111
111
  "fileTile.status.Refused": "Geweigerd",
112
112
  "fileTile.status.Validated": "Gevalideerd",
113
113
  "fileTile.uploading": "Bezig met uploaden…",
114
- "monthlyPaymentVolume.between10000And50000": "€ 10.000,- tot € 50.000,-",
115
- "monthlyPaymentVolume.between50000And100000": "€ 50.000,- tot € 100.000,-",
116
- "monthlyPaymentVolume.lessThan10000": "Minder dan € 10.000,-",
117
- "monthlyPaymentVolume.moreThan100000": "Meer dan € 100.000,-",
114
+ "monthlyPaymentVolume.between10000And50000": "€ 10.000,- tot € 50.000,- per maand",
115
+ "monthlyPaymentVolume.between50000And100000": "€ 50.000,- tot € 100.000,- per maand",
116
+ "monthlyPaymentVolume.lessThan10000": "Minder dan € 10.000,- per maand",
117
+ "monthlyPaymentVolume.moreThan100000": "Meer dan € 100.000,- per maand",
118
118
  "registrationPage.defaultNumberLabel": "Registratienummer",
119
119
  "registrationPage.withOrganismLabel": "Bent u geregistreerd bij {organismName}?",
120
120
  "registrationPage.withoutOrganismNameLabel": "Bent u geregistreerd?",
@@ -407,5 +407,6 @@
407
407
  "transactionStatement.type.SepaInstantCreditTransferIn": "SEPA Instant-overschrijving ontvangen",
408
408
  "transactionStatement.type.SepaInstantCreditTransferOut": "SEPA Instant-overschrijving verzonden",
409
409
  "validation.birthdateCannotBeFuture": "Geboortedatum kan niet in de toekomst liggen",
410
- "validation.invalidBirthDate": "Voer een geldige geboortedatum in."
410
+ "validation.invalidBirthDate": "Voer een geldige geboortedatum in.",
411
+ "validation.invalidDate": "Voer alstublieft een geldige datum in."
411
412
  }
@@ -111,10 +111,10 @@
111
111
  "fileTile.status.Refused": "Recusado",
112
112
  "fileTile.status.Validated": "Validado",
113
113
  "fileTile.uploading": "Carregando…",
114
- "monthlyPaymentVolume.between10000And50000": "Entre €10.000 e €50.000",
115
- "monthlyPaymentVolume.between50000And100000": "Entre €50.000 e €100.000",
116
- "monthlyPaymentVolume.lessThan10000": "Menos de €10.000",
117
- "monthlyPaymentVolume.moreThan100000": "Mais de €100.000",
114
+ "monthlyPaymentVolume.between10000And50000": "Entre €10.000 e €50.000 por mês",
115
+ "monthlyPaymentVolume.between50000And100000": "Entre €50.000 e €100.000 por mês",
116
+ "monthlyPaymentVolume.lessThan10000": "Menos de €10.000 por mês",
117
+ "monthlyPaymentVolume.moreThan100000": "Mais de €100.000 por mês",
118
118
  "registrationPage.defaultNumberLabel": "Número de registo",
119
119
  "registrationPage.withOrganismLabel": "Está registado no {organismName}?",
120
120
  "registrationPage.withoutOrganismNameLabel": "Está registado?",
@@ -407,5 +407,6 @@
407
407
  "transactionStatement.type.SepaInstantCreditTransferIn": "Transferência de crédito instantânea SEPA recebida",
408
408
  "transactionStatement.type.SepaInstantCreditTransferOut": "Transferência de crédito instantânea SEPA enviada",
409
409
  "validation.birthdateCannotBeFuture": "A data de nascimento não pode estar no futuro",
410
- "validation.invalidBirthDate": "Por favor, introduza uma data de nascimento válida."
410
+ "validation.invalidBirthDate": "Por favor, introduza uma data de nascimento válida.",
411
+ "validation.invalidDate": "Por favor, insira uma data válida."
411
412
  }
@@ -1,4 +1,4 @@
1
- export type AccountCountry = "DEU" | "ESP" | "FRA" | "NLD" | "ITA";
1
+ export type AccountCountry = "DEU" | "ESP" | "FRA" | "NLD" | "ITA" | "BEL";
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;
@@ -10,4 +10,5 @@ export declare const validateIndividualTaxNumber: (accountCountry: AccountCountr
10
10
  export declare const validateCompanyTaxNumber: (accountCountry: AccountCountry) => Validator<string | undefined>;
11
11
  export { printFormat as printIbanFormat } from "iban";
12
12
  export declare const validateIban: (iban: string) => string | undefined;
13
+ export declare const validateDate: (value: ExtractedDate | undefined) => string | undefined;
13
14
  export declare const validateBirthdate: (value: ExtractedDate | undefined) => string | undefined;
@@ -111,6 +111,15 @@ export const validateIban = (iban) => {
111
111
  return t("error.iban.invalid");
112
112
  }
113
113
  };
114
+ export const validateDate = (value) => {
115
+ if (isNullish(value)) {
116
+ return t("validation.invalidDate");
117
+ }
118
+ const date = dayjs.utc(formatExtractedDate(value), "YYYY-MM-DD", true);
119
+ if (!date.isValid()) {
120
+ return t("validation.invalidDate");
121
+ }
122
+ };
114
123
  export const validateBirthdate = (value) => {
115
124
  if (isNullish(value)) {
116
125
  return t("validation.invalidBirthDate");