From b2fb04372f322f3749ed2813cb1189ba43cd9995 Mon Sep 17 00:00:00 2001 From: dankito Date: Tue, 3 Sep 2024 21:19:24 +0200 Subject: [PATCH] Updating BankAccount.bookedTransactions only if we retrieved transactions and adding it to existing list instead of replacing existing bookedTransactions list --- .../net/codinux/banking/fints/mapper/FinTsModelMapper.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/mapper/FinTsModelMapper.kt b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/mapper/FinTsModelMapper.kt index f5faf6a3..0f50a58c 100644 --- a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/mapper/FinTsModelMapper.kt +++ b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/mapper/FinTsModelMapper.kt @@ -91,7 +91,11 @@ open class FinTsModelMapper { bankAccount.lastTransactionsRetrievalTime = retrievalTime } - bankAccount.bookedTransactions = map(accountTransactionsResponse) + if (accountTransactionsResponse.bookedTransactions.isNotEmpty()) { + bankAccount.bookedTransactions = bankAccount.bookedTransactions.toMutableList().apply { + addAll(map(accountTransactionsResponse)) + } + } } }