@swan-io/shared-business 12.4.1 → 12.4.3

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": "12.4.1",
3
+ "version": "12.4.3",
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": "12.4.1"
28
+ "@swan-io/lake": "12.4.3"
29
29
  },
30
30
  "dependencies": {
31
31
  "@formatjs/intl": "^3.1.6",
@@ -51,6 +51,6 @@
51
51
  "@types/react-native": "^0.72.8",
52
52
  "jsdom": "^26.1.0",
53
53
  "vitest": "^3.2.0",
54
- "@swan-io/lake": "12.4.1"
54
+ "@swan-io/lake": "12.4.3"
55
55
  }
56
56
  }
@@ -1,6 +1,6 @@
1
1
  import { StyleProp, ViewStyle } from "react-native";
2
2
  import { CountryCCA3 } from "../constants/countries";
3
- export type TransactionType = "Card" | "Check" | "Fees" | "InternationalDirectDebit" | "InternationalCreditTransfer" | "SepaCreditTransfer" | "SepaDirectDebit";
3
+ export type TransactionType = "Card" | "Check" | "Fees" | "InternationalDirectDebit" | "InternationalCreditTransfer" | "SepaCreditTransfer" | "SepaDirectDebit" | (string & {});
4
4
  type AddressInfo = {
5
5
  street: string;
6
6
  city: string;
@@ -14,7 +14,7 @@ export type Transaction = {
14
14
  id: string;
15
15
  label: string;
16
16
  date: string;
17
- type: "Card" | "Check" | "Fees" | "InternationalDirectDebit" | "InternationalCreditTransfer" | "SepaCreditTransfer" | "SepaDirectDebit";
17
+ type: TransactionType;
18
18
  credit?: Amount;
19
19
  debit?: Amount;
20
20
  };
@@ -99,7 +99,7 @@ const translateTransaction = (transaction) => {
99
99
  .with("Fees", () => t("accountStatement.fees"))
100
100
  .with("InternationalDirectDebit", "SepaDirectDebit", () => t("accountStatement.directDebit"))
101
101
  .with("InternationalCreditTransfer", "SepaCreditTransfer", () => t("accountStatement.creditTransfer"))
102
- .exhaustive();
102
+ .otherwise(() => transaction);
103
103
  };
104
104
  const logoStyle = {
105
105
  height: LOGO_MAX_HEIGHT,
@@ -35,6 +35,10 @@ type RIBv1Props = {
35
35
  accountCountry: "ITA";
36
36
  agency: string;
37
37
  bankNumber: string;
38
+ } | {
39
+ accountCountry: "BEL";
40
+ agency: string;
41
+ bankNumber: string;
38
42
  });
39
43
  export type RIBProps = RIBv1Props;
40
44
  export declare const RIB: (props: RIBProps) => import("react/jsx-runtime").JSX.Element;
@@ -79,6 +79,7 @@ const RIBv1 = ({ accountHolderAddress, bank, bankAddress, bic, iban, partnerColo
79
79
  .with({ accountCountry: "ESP" }, ({ agency, bankNumber, nationalCode }) => (_jsxs(_Fragment, { children: [_jsx(Item, { kind: "small", label: t("rib.bank"), value: bank }), _jsx(Space, { width: 24 }), _jsx(Item, { kind: "small", label: t("rib.agency"), value: agency }), _jsx(Space, { width: 24 }), _jsx(Item, { kind: "small", label: t("rib.nationalCode"), value: nationalCode }), _jsx(Space, { width: 24 }), _jsx(Item, { kind: "small", label: t("rib.number"), value: bankNumber })] })))
80
80
  .with({ accountCountry: "NLD" }, ({ bankKey, bankNumber }) => (_jsxs(_Fragment, { children: [_jsx(Item, { kind: "small", label: t("rib.bank"), value: bank }), _jsx(Space, { width: 24 }), _jsx(Item, { kind: "small", label: t("rib.number"), value: bankNumber }), _jsx(Space, { width: 24 }), _jsx(Item, { kind: "small", label: t("rib.key"), value: bankKey })] })))
81
81
  .with({ accountCountry: "ITA" }, ({ agency, bankNumber }) => (_jsxs(_Fragment, { children: [_jsx(Item, { kind: "small", label: t("rib.bank"), value: bank }), _jsx(Space, { width: 24 }), _jsx(Item, { kind: "small", label: t("rib.agency"), value: agency }), _jsx(Space, { width: 24 }), _jsx(Item, { kind: "small", label: t("rib.number"), value: bankNumber })] })))
82
+ .with({ accountCountry: "BEL" }, ({ agency, bankNumber }) => (_jsxs(_Fragment, { children: [_jsx(Item, { kind: "small", label: t("rib.bank"), value: bank }), _jsx(Space, { width: 24 }), _jsx(Item, { kind: "small", label: t("rib.agency"), value: agency }), _jsx(Space, { width: 24 }), _jsx(Item, { kind: "small", label: t("rib.number"), value: bankNumber })] })))
82
83
  .exhaustive() })] }), _jsx(Separator, {}), _jsxs(View, { style: styles.half, children: [_jsxs(Box, { direction: "row", alignItems: "center", children: [_jsx(Item, { kind: "address", color: "partner", label: t("rib.address"), value: [
83
84
  bankAddress.name,
84
85
  bankAddress.address,
@@ -159,5 +159,6 @@ export const SupportingDocumentCollection = ({ ref, documents, generateUpload, u
159
159
  .with("fr", () => "fr")
160
160
  .with("de", () => "de")
161
161
  .with("es", () => "es")
162
+ .with("it", () => "it")
162
163
  .otherwise(() => "en")}.pdf`), children: t("supportingDocuments.downloadTemplate") }) })] }), _jsxs(LakeModal, { visible: showSwornStatementModal, title: t("supportingDocuments.purpose.SwornStatement"), icon: "document-regular", onPressClose: () => setShowSwornStatementModal(false), children: [_jsx(LakeText, { children: t("supportingDocuments.purpose.SwornStatement.description") }), _jsx(Space, { height: 16 }), _jsx(LakeButtonGroup, { paddingBottom: 0, children: _jsx(LakeButton, { grow: true, color: "current", onPress: () => window.open("/sworn-statement-template/es.pdf"), children: t("supportingDocuments.downloadTemplate") }) })] }), _jsx(LakeModal, { visible: isNotNullish(currentMetadata), title: t("supportingDocuments.informations"), icon: "document-regular", onPressClose: () => setCurrentMetadata(undefined), children: _jsx(ReadOnlyFieldList, { children: currentMetadata === null || currentMetadata === void 0 ? void 0 : currentMetadata.values.map(({ title, value, type }, index) => (_jsx(LakeLabel, { type: "viewSmall", label: title, actions: type === "copy" && (_jsx(LakeCopyButton, { valueToCopy: value, copiedText: t("copyButton.copiedTooltip"), copyText: t("copyButton.copyTooltip") })), render: () => (_jsx(LakeText, { variant: "regular", color: colors.gray[900], children: value })) }, `metadata-${index}`))) }) })] }));
163
164
  };