@swan-io/shared-business 13.5.1 → 13.5.2

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.5.1",
3
+ "version": "13.5.2",
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.5.1"
28
+ "@swan-io/lake": "13.5.2"
29
29
  },
30
30
  "dependencies": {
31
31
  "@formatjs/intl": "^4.1.2",
@@ -50,6 +50,6 @@
50
50
  "@types/react-dom": "^19.2.3",
51
51
  "@types/react-native": "^0.72.8",
52
52
  "type-fest": "^5.4.3",
53
- "@swan-io/lake": "13.5.1"
53
+ "@swan-io/lake": "13.5.2"
54
54
  }
55
55
  }
@@ -1,5 +1,6 @@
1
1
  import { StyleProp, ViewStyle } from "react-native";
2
2
  import { CountryCCA3 } from "../constants/countries";
3
+ import { SupportedLanguage } from "../utils/i18n";
3
4
  export type TransactionType = "Card" | "Check" | "Fees" | "InternationalDirectDebit" | "InternationalCreditTransfer" | "SepaCreditTransfer" | "SepaDirectDebit" | "Seizure" | (string & {});
4
5
  type AddressInfo = {
5
6
  street: string;
@@ -37,8 +38,9 @@ type AccountStatementV1Props = {
37
38
  feesCredit: Amount;
38
39
  hideHeader?: boolean;
39
40
  hideFooter?: boolean;
41
+ language?: SupportedLanguage;
40
42
  };
41
- export declare const AccountStatementV1: ({ style, accountHolderName, accountHolderAddress, accountHolderType, iban, bic, openingDate, closingDate, openingBalance, transactions, feesDebit, feesCredit, totalsCredit, totalsDebit, closingBalance, }: AccountStatementV1Props) => import("react/jsx-runtime").JSX.Element;
43
+ export declare const AccountStatementV1: ({ style, accountHolderName, accountHolderAddress, accountHolderType, iban, bic, openingDate, closingDate, openingBalance, transactions, feesDebit, feesCredit, totalsCredit, totalsDebit, closingBalance, language, }: AccountStatementV1Props) => import("react/jsx-runtime").JSX.Element;
42
44
  export type AccountStatementProps = AccountStatementV1Props;
43
45
  export declare const AccountStatement: (props: AccountStatementProps) => import("react/jsx-runtime").JSX.Element;
44
46
  export {};
@@ -5,12 +5,13 @@ import { colors, spacings } from "@swan-io/lake/src/constants/design";
5
5
  import { isNotEmpty, isNotNullish } from "@swan-io/lake/src/utils/nullish";
6
6
  import { StyleSheet, Text } from "react-native";
7
7
  import { match } from "ts-pattern";
8
- import { t } from "../utils/i18n";
8
+ import { useTranslation } from "../utils/i18n";
9
9
  import { getTextStyle } from "../utils/style";
10
10
  const styles = StyleSheet.create({
11
11
  container: {
12
12
  width: 793,
13
13
  padding: 10,
14
+ fontFamily: "Inter, -apple-system, system-ui, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",
14
15
  },
15
16
  firstSectionTitle: {
16
17
  ...getTextStyle("sans", 20),
@@ -92,7 +93,7 @@ const Title = ({ text, align = "left", style, }) => (_jsx(Text, { style: [
92
93
  textAlign: align,
93
94
  },
94
95
  ], children: text }));
95
- const translateTransaction = (transaction) => {
96
+ const translateTransaction = (transaction, t) => {
96
97
  return match(transaction)
97
98
  .with("Card", () => t("accountStatement.card"))
98
99
  .with("Check", () => t("accountStatement.check"))
@@ -102,10 +103,11 @@ const translateTransaction = (transaction) => {
102
103
  .with("InternationalCreditTransfer", () => t("accountStatement.internationalCreditTransfer"))
103
104
  .otherwise(() => transaction);
104
105
  };
105
- export const AccountStatementV1 = ({ style, accountHolderName, accountHolderAddress, accountHolderType, iban, bic, openingDate, closingDate, openingBalance, transactions, feesDebit, feesCredit, totalsCredit, totalsDebit, closingBalance, }) => {
106
+ export const AccountStatementV1 = ({ style, accountHolderName, accountHolderAddress, accountHolderType, iban, bic, openingDate, closingDate, openingBalance, transactions, feesDebit, feesCredit, totalsCredit, totalsDebit, closingBalance, language, }) => {
107
+ const t = useTranslation(language);
106
108
  return (_jsx(Box, { style: style, children: _jsx(Box, { style: styles.container, direction: "column", justifyContent: "spaceBetween", children: _jsxs(Box, { children: [_jsxs(Box, { direction: "row", justifyContent: "spaceBetween", children: [_jsxs(Box, { direction: "column", children: [_jsx(Text, { style: styles.sectionTitle, children: accountHolderName.toUpperCase() }), _jsx(Text, { style: styles.text, children: accountHolderAddress.street }), _jsxs(Text, { style: styles.text, children: [accountHolderAddress.city, ",", " ", isNotNullish(accountHolderAddress.country) && accountHolderAddress.country] }), _jsx(Space, { height: 24 }), isNotEmpty(iban) && (_jsxs(Text, { style: styles.textBold, children: [t("accountStatement.iban"), " ", _jsx(Text, { style: styles.text, children: iban })] })), _jsx(Space, { height: 4 }), isNotEmpty(bic) && (_jsxs(Text, { style: styles.textBold, children: [t("accountStatement.bic"), _jsx(Text, { style: styles.text, children: bic })] }))] }), _jsxs(Box, { direction: "column", alignItems: "end", children: [_jsx(Text, { style: styles.pageTitle, children: t("accountStatement.titleDocument") }), _jsx(Text, { style: styles.pageSubTitle, children: accountHolderType === "Company"
107
109
  ? t("accountStatement.titleDocument.companyDescription")
108
- : t("accountStatement.titleDocument.individualDescription") }), _jsx(Space, { height: 24 }), _jsx(Text, { style: styles.textBold, children: t("accountStatement.contactSupport") }), _jsx(Text, { style: styles.text, children: "support.swan.io" })] })] }), _jsx(Space, { height: 48 }), _jsxs(Box, { direction: "row", justifyContent: "spaceBetween", alignItems: "center", children: [_jsx(Box, { direction: "column", children: _jsx(Text, { style: styles.dateTitle, 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: openingBalance.value })] })] }), _jsx(Space, { height: 24 }), _jsxs(_Fragment, { children: [_jsxs(Box, { direction: "row", style: styles.thead, children: [_jsx(Text, { style: [styles.titleColumn, { width: "13%" }], children: t("accountStatement.column.date") }), _jsx(Text, { style: [styles.titleColumn, { width: "17%" }], children: t("accountStatement.column.type") }), _jsx(Text, { style: [styles.titleColumn, { width: "40%" }], children: t("accountStatement.column.description") }), _jsx(Text, { style: [styles.titleColumn, { width: "15%", textAlign: "right" }], children: t("accountStatement.column.credit") }), _jsx(Text, { style: [styles.titleColumn, { width: "15%", textAlign: "right" }], children: t("accountStatement.column.debit") })] }), _jsx(Box, { direction: "column", children: transactions.map(transaction => (_jsxs(Box, { direction: "row", children: [_jsx(Text, { style: [styles.textColumn, { width: "13%" }], children: transaction.date }), _jsx(Text, { style: [styles.textColumn, { width: "17%" }], children: translateTransaction(transaction.type) }), _jsx(Text, { style: [styles.textColumn, { width: "40%" }], children: transaction.label }), _jsx(Text, { style: [styles.textColumn, { width: "15%", textAlign: "right" }], children: transaction.credit ? transaction.credit.value : "" }), _jsx(Text, { style: [styles.textColumn, { width: "15%", textAlign: "right" }], children: transaction.debit ? transaction.debit.value : "" })] }, transaction.id))) })] }), _jsx(Space, { height: 12 }), _jsxs(Box, { direction: "column", children: [_jsxs(Box, { direction: "row", justifyContent: "end", children: [_jsx(Text, { style: [styles.row, styles.textBold], children: t("accountStatement.column.fees") }), _jsx(Text, { style: [styles.row, styles.textBold], children: feesCredit.value }), _jsx(Text, { style: [styles.row, styles.textBold], children: feesDebit.value })] }), _jsxs(Box, { direction: "row", justifyContent: "end", children: [_jsx(Text, { style: [styles.row, styles.textBold], children: t("accountStatement.column.totals") }), _jsx(Text, { style: [styles.row, styles.textBold], children: totalsCredit.value }), _jsx(Text, { style: [styles.row, styles.textBold], children: totalsDebit.value })] })] }), _jsx(Space, { height: 12 }), _jsx(Box, { direction: "row", justifyContent: "end", children: _jsxs(Box, { direction: "row", alignItems: "center", style: styles.closingBalanceRow, justifyContent: "spaceBetween", children: [_jsx(Title, { style: styles.closingBalanceRowText, text: t("accountStatement.closingBalance") }), _jsx(Title, { text: closingBalance.value, style: styles.totalAmount, align: "right" })] }) })] }) }) }));
110
+ : t("accountStatement.titleDocument.individualDescription") }), _jsx(Space, { height: 24 }), _jsx(Text, { style: styles.textBold, children: t("accountStatement.contactSupport") }), _jsx(Text, { style: styles.text, children: "support.swan.io" })] })] }), _jsx(Space, { height: 48 }), _jsxs(Box, { direction: "row", justifyContent: "spaceBetween", alignItems: "center", children: [_jsx(Box, { direction: "column", children: _jsx(Text, { style: styles.dateTitle, 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: openingBalance.value })] })] }), _jsx(Space, { height: 24 }), _jsxs(_Fragment, { children: [_jsxs(Box, { direction: "row", style: styles.thead, children: [_jsx(Text, { style: [styles.titleColumn, { width: "13%" }], children: t("accountStatement.column.date") }), _jsx(Text, { style: [styles.titleColumn, { width: "17%" }], children: t("accountStatement.column.type") }), _jsx(Text, { style: [styles.titleColumn, { width: "40%" }], children: t("accountStatement.column.description") }), _jsx(Text, { style: [styles.titleColumn, { width: "15%", textAlign: "right" }], children: t("accountStatement.column.credit") }), _jsx(Text, { style: [styles.titleColumn, { width: "15%", textAlign: "right" }], children: t("accountStatement.column.debit") })] }), _jsx(Box, { direction: "column", children: transactions.map(transaction => (_jsxs(Box, { direction: "row", children: [_jsx(Text, { style: [styles.textColumn, { width: "13%" }], children: transaction.date }), _jsx(Text, { style: [styles.textColumn, { width: "17%" }], children: translateTransaction(transaction.type, t) }), _jsx(Text, { style: [styles.textColumn, { width: "40%" }], children: transaction.label }), _jsx(Text, { style: [styles.textColumn, { width: "15%", textAlign: "right" }], children: transaction.credit ? transaction.credit.value : "" }), _jsx(Text, { style: [styles.textColumn, { width: "15%", textAlign: "right" }], children: transaction.debit ? transaction.debit.value : "" })] }, transaction.id))) })] }), _jsx(Space, { height: 12 }), _jsxs(Box, { direction: "column", children: [_jsxs(Box, { direction: "row", justifyContent: "end", children: [_jsx(Text, { style: [styles.row, styles.textBold], children: t("accountStatement.column.fees") }), _jsx(Text, { style: [styles.row, styles.textBold], children: feesCredit.value }), _jsx(Text, { style: [styles.row, styles.textBold], children: feesDebit.value })] }), _jsxs(Box, { direction: "row", justifyContent: "end", children: [_jsx(Text, { style: [styles.row, styles.textBold], children: t("accountStatement.column.totals") }), _jsx(Text, { style: [styles.row, styles.textBold], children: totalsCredit.value }), _jsx(Text, { style: [styles.row, styles.textBold], children: totalsDebit.value })] })] }), _jsx(Space, { height: 12 }), _jsx(Box, { direction: "row", justifyContent: "end", children: _jsxs(Box, { direction: "row", alignItems: "center", style: styles.closingBalanceRow, justifyContent: "spaceBetween", children: [_jsx(Title, { style: styles.closingBalanceRowText, text: t("accountStatement.closingBalance") }), _jsx(Title, { text: closingBalance.value, style: styles.totalAmount, align: "right" })] }) })] }) }) }));
109
111
  };
110
112
  export const AccountStatement = (props) => match(props)
111
113
  .with({ version: "v1" }, props => _jsx(AccountStatementV1, { ...props }))
@@ -67,7 +67,7 @@
67
67
  "common.showLess": "Toon minder",
68
68
  "common.showMore": "Toon meer",
69
69
  "common.skipToContent": "Doorgaan naar artikel",
70
- "common.statement.footer": "SWAN is een vereenvoudigde naamloze vennootschap (SAS) geregistreerd bij de Kamer van Koophandel van Bobigny onder nummer 853 827 103, met een kapitaal van 16.999,66 euro, btw-nummer FR90853827103 en met maatschappelijke zetel gevestigd aan 91 rue du Faubourg Saint-Honoré, 75008 Paris, FRANKRIJK.\n\nIn zijn hoedanigheid van een elektronisch geldinstelling die betalingsdiensten aanbiedt onder Frans recht goedgekeurd door de ACPR, is SWAN geregistreerd bij laatstgenoemde onder nummer 17328.",
70
+ "common.statement.footer": "SWAN is een vereenvoudigde naamloze vennootschap (SAS) die is geregistreerd bij het handels- en bedrijvenregister van Bobigny onder nummer 853 827 103, met een kapitaal van 16.999,66 euro, btw-nummer FR90853827103 en met maatschappelijke zetel te 91 rue du Faubourg Saint-Honoré, 75008 Parijs, FRANKRIJK.\n\nAls elektronischgeldinstelling die betalingsdiensten aanbiedt volgens de Franse wetgeving en goedgekeurd door de ACPR, staat SWAN bij deze laatste geregistreerd onder nummer 17328.",
71
71
  "copyButton.copiedTooltip": "Gekopieerd naar klembord",
72
72
  "copyButton.copyTooltip": "Klik om te kopiëren",
73
73
  "creditStatement.additionalDetails": "De afrekening van bold>{openingDate}</bold> tot <bold>{closingDate}</bold> bevat alle kosten en betalingen die we tot {closingDate} hebben ontvangen. De volgende automatische afschrijving gebeurt vanaf {repaymentDate}.\n\n\nAls een automatische incasso wordt geweigerd omdat er niet genoeg geld op je rekening staat, kunnen we deze incasso minstens <bold>3 tot 4 dagen</bold> na de weigering door je bank opnieuw proberen.",
@@ -204,7 +204,7 @@
204
204
  "rejection.InvalidSirenNumberRejection": "Ongeldig SIREN-nummer",
205
205
  "rejection.LegalRepresentativeAccountMembershipCannotBeDisabledRejection": "Kan het accountlidmaatschap van een wettelijke vertegenwoordiger niet deactiveren",
206
206
  "rejection.LegalRepresentativeAccountMembershipCannotBeSuspendedRejection": "Kan het accountlidmaatschap van een wettelijke vertegenwoordiger niet opschorten",
207
- "rejection.MaximumDailvInvitationsReachedRelection": "Je hebt het maximale aantal dagelijkse uitnodigingen voor het accountlidmaatschap bereikt.",
207
+ "rejection.MaximumDailvInvitationsReachedRelection": "Je hebt het maximale aantal dagelijkse uitnodigingen voor het lidmaatschap van de rekening bereikt.",
208
208
  "rejection.MaximumDailyExportsReachedRejection": "Het maximumaantal dagelijkse exports is bereikt",
209
209
  "rejection.MaximumSimultaneousExportsRejection": "Het maximumaantal gelijktijdige exports is bereikt",
210
210
  "rejection.MerchantCardPaymentDeclinedRejection": "De kaartbetaling van de handelaar is geweigerd",
@@ -364,7 +364,7 @@
364
364
  "supportingDocuments.rejectionReason.BadDocumentQuality": "De kwaliteit van het document is erg slecht",
365
365
  "supportingDocuments.rejectionReason.CompanyNameMismatch": "De bedrijfsnaam in het ingediende document komt niet overeen met onze gegevens.",
366
366
  "supportingDocuments.rejectionReason.DeclaredAmountMismatch": "Het opgegeven bedrag in het ingediende document komt niet overeen met onze gegevens.",
367
- "supportingDocuments.rejectionReason.ExpiredDocument": "Het document is te oud, kun je de nieuwste versie geven?",
367
+ "supportingDocuments.rejectionReason.ExpiredDocument": "Het document is te oud, kun je de meest recente versie geven?",
368
368
  "supportingDocuments.rejectionReason.FullDocumentRequired": "Volledig document vereist",
369
369
  "supportingDocuments.rejectionReason.HandwrittenOrCertifiedElectronicSignatureRequired": "De handtekening is niet handgeschreven of elektronisch gecertificeerd.",
370
370
  "supportingDocuments.rejectionReason.IbanMismatch": "Het IBAN van de begunstigde op het ingediende document komt niet overeen met het transactieverzoek.",