Updating BankAccount.bookedTransactions only if we retrieved transactions and adding it to existing list instead of replacing existing bookedTransactions list

This commit is contained in:
dankito 2024-09-03 21:19:24 +02:00
parent 3b05a8b9c8
commit b2fb04372f
1 changed files with 5 additions and 1 deletions

View File

@ -91,7 +91,11 @@ open class FinTsModelMapper {
bankAccount.lastTransactionsRetrievalTime = retrievalTime bankAccount.lastTransactionsRetrievalTime = retrievalTime
} }
bankAccount.bookedTransactions = map(accountTransactionsResponse) if (accountTransactionsResponse.bookedTransactions.isNotEmpty()) {
bankAccount.bookedTransactions = bankAccount.bookedTransactions.toMutableList().apply {
addAll(map(accountTransactionsResponse))
}
}
} }
} }