From 4fbb0425e634f728edf16fce0b6c9c19696b5446 Mon Sep 17 00:00:00 2001 From: dankito Date: Tue, 17 Sep 2024 15:29:33 +0200 Subject: [PATCH] Added add() methods for list properties --- .../net/codinux/banking/client/model/BankAccount.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/BankAccount.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/BankAccount.kt index babde71a..545ba10e 100644 --- a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/BankAccount.kt +++ b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/BankAccount.kt @@ -40,6 +40,18 @@ open class BankAccount( open val displayName: String get() = userSetDisplayName ?: productName ?: identifier + open fun addTransactions(transactions: List) { + (this.bookedTransactions as MutableList).addAll(transactions) + } + + open fun addPrebookedTransactions(transactions: List) { + (this.prebookedTransactions as MutableList).addAll(transactions) + } + + open fun addHoldings(holdings: List) { + (this.holdings as MutableList).addAll(holdings) + } + @get:JsonIgnore open val supportsTransactionRetrieval: Boolean get() = supportsAnyFeature(BankAccountFeatures.RetrieveBalance)