@swan-io/shared-business 13.0.1 → 13.1.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": "13.0.1",
3
+ "version": "13.1.0",
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.0.1"
28
+ "@swan-io/lake": "13.1.0"
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.0.1"
53
+ "@swan-io/lake": "13.1.0"
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 = "SepaCreditTransferIn" | "SepaCreditTransferOut" | "SepaInstantCreditTransferIn" | "SepaInstantCreditTransferOut" | "InternalCreditTransferIn" | "InternalCreditTransferOut" | "InternationalCreditTransferIn" | "InternationalCreditTransferOut" | "InternalCreditTransferOutReturn" | "InternalCreditTransferOutRecall" | "InternalCreditTransferInReturn" | "InternalCreditTransferInRecall" | "SepaCreditTransferOutReturn" | "SepaInstantCreditTransferOutRecall" | "SepaInstantCreditTransferInRecall" | "SepaCreditTransferOutRecall" | "SepaCreditTransferInReturn" | "SepaCreditTransferInRecall" | "FeesOut" | "FeesIn" | "SepaDirectDebitIn" | "SepaDirectDebitInReturn" | "SepaDirectDebitInReversal" | "SepaDirectDebitOut" | "SepaDirectDebitOutReturn" | "SepaDirectDebitOutReversal" | "CardOutAuthorization" | "CardOutDebit" | "CardOutDebitReversal" | "CardOutCredit" | "CardOutCreditReversal" | "InternalDirectDebitIn" | "InternalDirectDebitInReturn" | "InternalDirectDebitOut" | "InternalDirectDebitOutReturn" | "CheckIn" | "CheckInReturn" | "InternationalCreditTransferInReturn" | "InternationalCreditTransferOutReturn" | "CardInCredit" | "CardInChargeback" | "CardInChargebackReversal";
3
+ export type TransactionType = "SepaCreditTransfer" | "Fees" | "SepaDirectDebit" | "Card";
4
4
  type AddressInfo = {
5
5
  addressLine1: string;
6
6
  addressLine2?: string;
@@ -102,11 +102,10 @@ const Title = ({ text, align = "left", style, }) => (_jsx(Text, { style: [
102
102
  ], children: text }));
103
103
  const translateTransaction = (transaction) => {
104
104
  return match(transaction)
105
- .with("CardInChargeback", "CardInChargebackReversal", "CardInCredit", "CardOutAuthorization", "CardOutCredit", "CardOutCreditReversal", "CardOutDebit", "CardOutDebitReversal", () => t("accountStatement.card"))
106
- .with("CheckIn", "CheckInReturn", () => t("accountStatement.check"))
107
- .with("FeesIn", "FeesOut", () => t("accountStatement.fees"))
108
- .with("SepaCreditTransferIn", "SepaCreditTransferOut", "SepaInstantCreditTransferIn", "SepaInstantCreditTransferOut", "InternalCreditTransferIn", "InternalCreditTransferOut", "InternationalCreditTransferIn", "InternationalCreditTransferOut", "InternalCreditTransferOutReturn", "InternalCreditTransferOutRecall", "InternalCreditTransferInReturn", "InternalCreditTransferInRecall", "SepaCreditTransferOutReturn", "SepaInstantCreditTransferOutRecall", "SepaInstantCreditTransferInRecall", "SepaCreditTransferOutRecall", "SepaCreditTransferInReturn", "SepaCreditTransferInRecall", "InternationalCreditTransferInReturn", "InternationalCreditTransferOutReturn", () => t("accountStatement.creditTransfer"))
109
- .with("SepaDirectDebitIn", "SepaDirectDebitInReturn", "SepaDirectDebitInReversal", "SepaDirectDebitOut", "SepaDirectDebitOutReturn", "SepaDirectDebitOutReversal", "InternalDirectDebitIn", "InternalDirectDebitInReturn", "InternalDirectDebitOut", "InternalDirectDebitOutReturn", () => t("accountStatement.directDebit"))
105
+ .with("Card", () => t("accountStatement.card"))
106
+ .with("Fees", () => t("accountStatement.fees"))
107
+ .with("SepaCreditTransfer", () => t("accountStatement.creditTransfer"))
108
+ .with("SepaDirectDebit", () => t("accountStatement.directDebit"))
110
109
  .exhaustive();
111
110
  };
112
111
  const logoStyle = {
@@ -160,5 +160,11 @@ export const SupportingDocumentCollection = ({ ref, documents, generateUpload, u
160
160
  .with("de", () => "de")
161
161
  .with("es", () => "es")
162
162
  .with("it", () => "it")
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
+ .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: () => {
164
+ window.open(`/sworn-statement-template/${match(templateLanguage)
165
+ .with("nl", () => "nl")
166
+ .with("es", () => "es")
167
+ .with("it", () => "it")
168
+ .otherwise(() => "en")}.pdf`);
169
+ }, 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}`))) }) })] }));
164
170
  };