From 21ef49ee380dfbba4a2940d2d6aa0fde2e2ff3dc Mon Sep 17 00:00:00 2001 From: Jacob Kiers Date: Thu, 27 Nov 2025 21:04:41 +0100 Subject: [PATCH] fix: Correctly map transactions without counterparty Before this change, transactions that did not have a counterparty were not correctly mapped and could not be insterted into Firefly III. That is not correct: _all_ transactions must be added to Firefly III. Furthermore, Firefly III already has logic to deal with this, and rules that can solve it manually as well. --- banks2ff/src/adapters/firefly/client.rs | 8 ++------ banks2ff/src/adapters/gocardless/mapper.rs | 1 + 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/banks2ff/src/adapters/firefly/client.rs b/banks2ff/src/adapters/firefly/client.rs index 139ae62..00fd159 100644 --- a/banks2ff/src/adapters/firefly/client.rs +++ b/banks2ff/src/adapters/firefly/client.rs @@ -146,9 +146,7 @@ impl TransactionDestination for FireflyAdapter { None }, source_name: if is_credit { - tx.counterparty_name - .clone() - .or(Some("Unknown Sender".to_string())) + tx.counterparty_name.clone() } else { None }, @@ -158,9 +156,7 @@ impl TransactionDestination for FireflyAdapter { None }, destination_name: if !is_credit { - tx.counterparty_name - .clone() - .or(Some("Unknown Recipient".to_string())) + tx.counterparty_name.clone() } else { None }, diff --git a/banks2ff/src/adapters/gocardless/mapper.rs b/banks2ff/src/adapters/gocardless/mapper.rs index ea2bdda..d270d7c 100644 --- a/banks2ff/src/adapters/gocardless/mapper.rs +++ b/banks2ff/src/adapters/gocardless/mapper.rs @@ -8,6 +8,7 @@ use std::str::FromStr; pub fn map_transaction(tx: Transaction) -> Result { let internal_id = tx .transaction_id + .or(tx.internal_transaction_id) .ok_or_else(|| anyhow::anyhow!("Transaction ID missing"))?; let date_str = tx