@swan-io/shared-business 9.0.1 → 9.1.1
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 +1 -1
- package/src/components/TransactionStatement.js +16 -9
- package/src/locales/de.json +1 -1
- package/src/locales/en.json +1 -1
- package/src/locales/es.json +1 -1
- package/src/locales/fi.json +1 -1
- package/src/locales/fr.json +1 -1
- package/src/locales/it.json +1 -1
- package/src/locales/nl.json +1 -1
- package/src/locales/pt.json +1 -1
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ import { Stack } from "@swan-io/lake/src/components/Stack";
|
|
|
7
7
|
import { SwanLogo } from "@swan-io/lake/src/components/SwanLogo";
|
|
8
8
|
import { colors, fonts, interFontStyle } from "@swan-io/lake/src/constants/design";
|
|
9
9
|
import { isNotNullish, isNotNullishOrEmpty } from "@swan-io/lake/src/utils/nullish";
|
|
10
|
+
import IBAN from "iban";
|
|
10
11
|
import { StyleSheet, Text, View } from "react-native";
|
|
11
12
|
import { match } from "ts-pattern";
|
|
12
13
|
import { formatCurrencyIso, t } from "../utils/i18n";
|
|
@@ -26,34 +27,34 @@ const styles = StyleSheet.create({
|
|
|
26
27
|
padding: 56,
|
|
27
28
|
},
|
|
28
29
|
partnershipText: {
|
|
29
|
-
...getTextStyle("sans",
|
|
30
|
+
...getTextStyle("sans", 14),
|
|
30
31
|
color: colors.gray[500],
|
|
31
32
|
},
|
|
32
33
|
pageTitle: {
|
|
33
|
-
...getTextStyle("sans",
|
|
34
|
+
...getTextStyle("sans", 20),
|
|
34
35
|
color: colors.swan[500],
|
|
35
36
|
fontWeight: "500",
|
|
36
37
|
},
|
|
37
38
|
sectionTitle: {
|
|
38
|
-
...getTextStyle("sans",
|
|
39
|
+
...getTextStyle("sans", 14),
|
|
39
40
|
color: colors.swan[500],
|
|
40
41
|
fontWeight: "600",
|
|
41
42
|
},
|
|
42
43
|
lineName: {
|
|
43
|
-
...getTextStyle("sans",
|
|
44
|
+
...getTextStyle("sans", 11),
|
|
44
45
|
color: colors.gray[700],
|
|
45
46
|
},
|
|
46
47
|
lineValue: {
|
|
47
|
-
...getTextStyle("sans",
|
|
48
|
+
...getTextStyle("sans", 11),
|
|
48
49
|
color: colors.swan[500],
|
|
49
50
|
fontWeight: "600",
|
|
50
51
|
},
|
|
51
52
|
generationInfos: {
|
|
52
|
-
...getTextStyle("sans",
|
|
53
|
+
...getTextStyle("sans", 10),
|
|
53
54
|
color: colors.gray[700],
|
|
54
55
|
},
|
|
55
56
|
footer: {
|
|
56
|
-
...getTextStyle("sans",
|
|
57
|
+
...getTextStyle("sans", 10),
|
|
57
58
|
color: colors.gray[500],
|
|
58
59
|
fontWeight: "300",
|
|
59
60
|
},
|
|
@@ -76,7 +77,7 @@ const logoStyle = {
|
|
|
76
77
|
objectPosition: "left",
|
|
77
78
|
};
|
|
78
79
|
export const TransactionStatementV1 = ({ partnerLogoUrl, generationDate, executionDate, type, amount, instructedAmount, amountCredited, targetTransferAmount, exchangeRate, fees, label, reference, debtorName, debtorAccountNumber, debtorBankName, debtorBankIdentifier, creditorName, creditorAccountNumber, creditorBankName, creditorBankIdentifier, style, }) => {
|
|
79
|
-
return (_jsxs(View, { style: [styles.container, style], 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("transactionStatement.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("transactionStatement.title.document") }), _jsx(Space, { height: 24 }), _jsx(Text, { style: styles.sectionTitle, children: t("transactionStatement.title.
|
|
80
|
+
return (_jsxs(View, { style: [styles.container, style], 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("transactionStatement.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("transactionStatement.title.document") }), _jsx(Space, { height: 24 }), _jsx(Text, { style: styles.sectionTitle, children: t("transactionStatement.title.transactionInformation") }), _jsx(Space, { height: 8 }), _jsxs(Stack, { space: 8, children: [_jsx(Line, { name: t("transactionStatement.information.executionDate"), value: executionDate }), _jsx(Line, { name: t("transactionStatement.information.type"), value: match(type)
|
|
80
81
|
.with("SepaCreditTransferIn", () => t("transactionStatement.type.SepaCreditTransferIn"))
|
|
81
82
|
.with("SepaCreditTransferOut", () => t("transactionStatement.type.SepaCreditTransferOut"))
|
|
82
83
|
.with("SepaInstantCreditTransferIn", () => t("transactionStatement.type.SepaInstantCreditTransferIn"))
|
|
@@ -85,7 +86,13 @@ export const TransactionStatementV1 = ({ partnerLogoUrl, generationDate, executi
|
|
|
85
86
|
.with("InternalCreditTransferOut", () => t("transactionStatement.type.InternalCreditTransferOut"))
|
|
86
87
|
.with("InternationalCreditTransferIn", () => t("transactionStatement.type.InternationalCreditTransferIn"))
|
|
87
88
|
.with("InternationalCreditTransferOut", () => t("transactionStatement.type.InternationalCreditTransferOut"))
|
|
88
|
-
.exhaustive() }), isNotNullish(instructedAmount) && (_jsx(Line, { name: t("transactionStatement.information.instructedAmount"), value: formatCurrencyIso(Number(instructedAmount.value), instructedAmount.currency) })), isNotNullish(amountCredited) && (_jsx(Line, { name: t("transactionStatement.information.amountCredited"), value: formatCurrencyIso(Number(amountCredited.value), amountCredited.currency) })), isNotNullish(amount) && (_jsx(Line, { name: t("transactionStatement.information.amount"), value: formatCurrencyIso(Number(amount.value), amount.currency) })), isNotNullish(targetTransferAmount) && (_jsx(Line, { name: t("transactionStatement.information.targetTransferAmount"), value: formatCurrencyIso(Number(targetTransferAmount.value), targetTransferAmount.currency) })), isNotNullish(exchangeRate) && (_jsx(Line, { name: t("transactionStatement.information.exchangeRate"), value: `${formatCurrencyIso(Number(exchangeRate[0].value), exchangeRate[0].currency)} = ${formatCurrencyIso(Number(exchangeRate[1].value), exchangeRate[1].currency)}` })), isNotNullish(fees) && (_jsx(Line, { name: t("transactionStatement.information.fees"), value: formatCurrencyIso(Number(fees.value), fees.currency) })), _jsx(Line, { name: t("transactionStatement.information.label"), value: label }), isNotNullish(reference) && (_jsx(Line, { name: t("transactionStatement.information.reference"), value: reference }))] }), _jsx(Space, { height: 24 }), _jsx(Text, { style: styles.sectionTitle, children: t("transactionStatement.title.debtor") }), _jsx(Space, { height: 8 }), _jsxs(Stack, { space: 8, children: [_jsx(Line, { name: t("transactionStatement.debtor.name"), value: debtorName }), _jsx(Line, { name: t("transactionStatement.debtor.accountNumber"), value:
|
|
89
|
+
.exhaustive() }), isNotNullish(instructedAmount) && (_jsx(Line, { name: t("transactionStatement.information.instructedAmount"), value: formatCurrencyIso(Number(instructedAmount.value), instructedAmount.currency) })), isNotNullish(amountCredited) && (_jsx(Line, { name: t("transactionStatement.information.amountCredited"), value: formatCurrencyIso(Number(amountCredited.value), amountCredited.currency) })), isNotNullish(amount) && (_jsx(Line, { name: t("transactionStatement.information.amount"), value: formatCurrencyIso(Number(amount.value), amount.currency) })), isNotNullish(targetTransferAmount) && (_jsx(Line, { name: t("transactionStatement.information.targetTransferAmount"), value: formatCurrencyIso(Number(targetTransferAmount.value), targetTransferAmount.currency) })), isNotNullish(exchangeRate) && (_jsx(Line, { name: t("transactionStatement.information.exchangeRate"), value: `${formatCurrencyIso(Number(exchangeRate[0].value), exchangeRate[0].currency)} = ${formatCurrencyIso(Number(exchangeRate[1].value), exchangeRate[1].currency)}` })), isNotNullish(fees) && (_jsx(Line, { name: t("transactionStatement.information.fees"), value: formatCurrencyIso(Number(fees.value), fees.currency) })), _jsx(Line, { name: t("transactionStatement.information.label"), value: label }), isNotNullish(reference) && (_jsx(Line, { name: t("transactionStatement.information.reference"), value: reference }))] }), _jsx(Space, { height: 24 }), _jsx(Text, { style: styles.sectionTitle, children: t("transactionStatement.title.debtor") }), _jsx(Space, { height: 8 }), _jsxs(Stack, { space: 8, children: [_jsx(Line, { name: t("transactionStatement.debtor.name"), value: debtorName }), _jsx(Line, { name: t("transactionStatement.debtor.accountNumber"), value: IBAN.isValid(debtorAccountNumber)
|
|
90
|
+
? IBAN.printFormat(debtorAccountNumber)
|
|
91
|
+
: debtorAccountNumber }), isNotNullishOrEmpty(debtorBankName) && (_jsx(Line, { name: t("transactionStatement.debtor.bankName"), value: debtorBankName })), isNotNullishOrEmpty(debtorBankIdentifier) && (_jsx(Line, { name: t("transactionStatement.debtor.bankIdentifier"), value: debtorBankIdentifier }))] }), _jsx(Space, { height: 24 }), _jsx(Text, { style: styles.sectionTitle, children: t("transactionStatement.title.creditor") }), _jsx(Space, { height: 8 }), _jsxs(Stack, { space: 8, children: [_jsx(Line, { name: t("transactionStatement.creditor.name"), value: creditorName }), _jsx(Line, { name: t("transactionStatement.creditor.accountNumber"), value: IBAN.isValid(creditorAccountNumber)
|
|
92
|
+
? IBAN.printFormat(creditorAccountNumber)
|
|
93
|
+
: creditorAccountNumber }), isNotNullishOrEmpty(creditorBankName) && (_jsx(Line, { name: t("transactionStatement.creditor.bankName"), value: creditorBankName })), isNotNullishOrEmpty(creditorBankIdentifier) && (_jsx(Line, { name: t("transactionStatement.creditor.bankIdentifier"), value: creditorBankIdentifier }))] }), _jsx(Fill, { minHeight: 8 }), _jsx(Text, { style: styles.generationInfos, children: t("transactionStatement.generationDate", { date: generationDate }) }), _jsx(Space, { height: 8 }), match(type)
|
|
94
|
+
.with("SepaCreditTransferOut", "SepaInstantCreditTransferOut", "InternationalCreditTransferOut", () => (_jsx(Text, { style: styles.generationInfos, children: t("transactionStatement.generationInfos") })))
|
|
95
|
+
.otherwise(() => null), _jsx(Separator, { space: 24 }), _jsx(Text, { style: styles.footer, children: t("transactionStatement.footer") })] }));
|
|
89
96
|
};
|
|
90
97
|
export const TransactionStatement = (props) => match(props)
|
|
91
98
|
.with({ version: "v1" }, props => _jsx(TransactionStatementV1, { ...props }))
|
package/src/locales/de.json
CHANGED
|
@@ -305,7 +305,7 @@
|
|
|
305
305
|
"transactionStatement.title.creditor": "Gläubigerinformationen",
|
|
306
306
|
"transactionStatement.title.debtor": "Informationen des Schuldners",
|
|
307
307
|
"transactionStatement.title.document": "Transaktionsbestätigung",
|
|
308
|
-
"transactionStatement.title.
|
|
308
|
+
"transactionStatement.title.transactionInformation": "Transaktionsinformationen",
|
|
309
309
|
"transactionStatement.type.InternalCreditTransferIn": "Interne Überweisung erhalten",
|
|
310
310
|
"transactionStatement.type.InternalCreditTransferOut": "Interne Überweisung gesendet",
|
|
311
311
|
"transactionStatement.type.InternationalCreditTransferIn": "Internationale Überweisung erhalten",
|
package/src/locales/en.json
CHANGED
|
@@ -305,7 +305,7 @@
|
|
|
305
305
|
"transactionStatement.title.creditor": "Creditor information",
|
|
306
306
|
"transactionStatement.title.debtor": "Debtor information",
|
|
307
307
|
"transactionStatement.title.document": "Transaction confirmation",
|
|
308
|
-
"transactionStatement.title.
|
|
308
|
+
"transactionStatement.title.transactionInformation": "Transaction information",
|
|
309
309
|
"transactionStatement.type.InternalCreditTransferIn": "Internal Credit Transfer received",
|
|
310
310
|
"transactionStatement.type.InternalCreditTransferOut": "Internal Credit Transfer sent",
|
|
311
311
|
"transactionStatement.type.InternationalCreditTransferIn": "International Credit Transfer received",
|
package/src/locales/es.json
CHANGED
|
@@ -305,7 +305,7 @@
|
|
|
305
305
|
"transactionStatement.title.creditor": "Información del acreedor",
|
|
306
306
|
"transactionStatement.title.debtor": "Información del deudor",
|
|
307
307
|
"transactionStatement.title.document": "Confirmación de la transacción",
|
|
308
|
-
"transactionStatement.title.
|
|
308
|
+
"transactionStatement.title.transactionInformation": "Información de la transacción",
|
|
309
309
|
"transactionStatement.type.InternalCreditTransferIn": "Transferencia interna recibida",
|
|
310
310
|
"transactionStatement.type.InternalCreditTransferOut": "Transferencia interna enviada",
|
|
311
311
|
"transactionStatement.type.InternationalCreditTransferIn": "Transferencia internacional recibida",
|
package/src/locales/fi.json
CHANGED
|
@@ -305,7 +305,7 @@
|
|
|
305
305
|
"transactionStatement.title.creditor": "Luotonantajan tiedot",
|
|
306
306
|
"transactionStatement.title.debtor": "Velallisen tiedot",
|
|
307
307
|
"transactionStatement.title.document": "Tapahtuman vahvistus",
|
|
308
|
-
"transactionStatement.title.
|
|
308
|
+
"transactionStatement.title.transactionInformation": "Tapahtumatiedot",
|
|
309
309
|
"transactionStatement.type.InternalCreditTransferIn": "Sisäinen tilisiirto vastaanotettu",
|
|
310
310
|
"transactionStatement.type.InternalCreditTransferOut": "Lähetetty sisäinen opintopisteen siirto",
|
|
311
311
|
"transactionStatement.type.InternationalCreditTransferIn": "Vastaanotettu kansainvälinen tilisiirto",
|
package/src/locales/fr.json
CHANGED
|
@@ -305,7 +305,7 @@
|
|
|
305
305
|
"transactionStatement.title.creditor": "Informations sur le créancier",
|
|
306
306
|
"transactionStatement.title.debtor": "Informations du débiteur",
|
|
307
307
|
"transactionStatement.title.document": "Confirmation de la transaction",
|
|
308
|
-
"transactionStatement.title.
|
|
308
|
+
"transactionStatement.title.transactionInformation": "Informations sur la transaction",
|
|
309
309
|
"transactionStatement.type.InternalCreditTransferIn": "Virement interne reçu",
|
|
310
310
|
"transactionStatement.type.InternalCreditTransferOut": "Virement interne envoyé",
|
|
311
311
|
"transactionStatement.type.InternationalCreditTransferIn": "Réception d'un virement international",
|
package/src/locales/it.json
CHANGED
|
@@ -305,7 +305,7 @@
|
|
|
305
305
|
"transactionStatement.title.creditor": "Informazioni creditore",
|
|
306
306
|
"transactionStatement.title.debtor": "Informazioni debitore",
|
|
307
307
|
"transactionStatement.title.document": "Conferma della transazione",
|
|
308
|
-
"transactionStatement.title.
|
|
308
|
+
"transactionStatement.title.transactionInformation": "Informazioni sulla transazione",
|
|
309
309
|
"transactionStatement.type.InternalCreditTransferIn": "Bonifico interno ricevuto",
|
|
310
310
|
"transactionStatement.type.InternalCreditTransferOut": "Bonifico interno inviato",
|
|
311
311
|
"transactionStatement.type.InternationalCreditTransferIn": "Bonifico internazionale ricevuto",
|
package/src/locales/nl.json
CHANGED
|
@@ -305,7 +305,7 @@
|
|
|
305
305
|
"transactionStatement.title.creditor": "Crediteur informatie",
|
|
306
306
|
"transactionStatement.title.debtor": "Debiteur informatie",
|
|
307
307
|
"transactionStatement.title.document": "Transactiebevestiging",
|
|
308
|
-
"transactionStatement.title.
|
|
308
|
+
"transactionStatement.title.transactionInformation": "Transactie-informatie",
|
|
309
309
|
"transactionStatement.type.InternalCreditTransferIn": "Interne Overschrijving ontvangen",
|
|
310
310
|
"transactionStatement.type.InternalCreditTransferOut": "Interne Overschrijving verzonden",
|
|
311
311
|
"transactionStatement.type.InternationalCreditTransferIn": "Internationale Overschrijving ontvangen",
|
package/src/locales/pt.json
CHANGED
|
@@ -305,7 +305,7 @@
|
|
|
305
305
|
"transactionStatement.title.creditor": "Informações do credor",
|
|
306
306
|
"transactionStatement.title.debtor": "Informações do devedor",
|
|
307
307
|
"transactionStatement.title.document": "Confirmação da transação",
|
|
308
|
-
"transactionStatement.title.
|
|
308
|
+
"transactionStatement.title.transactionInformation": "Informações da transação",
|
|
309
309
|
"transactionStatement.type.InternalCreditTransferIn": "Transferência de crédito interna recebida",
|
|
310
310
|
"transactionStatement.type.InternalCreditTransferOut": "Transferência de crédito interna enviada",
|
|
311
311
|
"transactionStatement.type.InternationalCreditTransferIn": "Transferência de crédito internacional recebida",
|