Added add() methods for list properties

This commit is contained in:
dankito 2024-09-17 15:29:33 +02:00
parent 9af8d0eb1d
commit 4fbb0425e6
1 changed files with 12 additions and 0 deletions

View File

@ -40,6 +40,18 @@ open class BankAccount(
open val displayName: String
get() = userSetDisplayName ?: productName ?: identifier
open fun addTransactions(transactions: List<out AccountTransaction>) {
(this.bookedTransactions as MutableList<AccountTransaction>).addAll(transactions)
}
open fun addPrebookedTransactions(transactions: List<out PrebookedAccountTransaction>) {
(this.prebookedTransactions as MutableList<PrebookedAccountTransaction>).addAll(transactions)
}
open fun addHoldings(holdings: List<out Holding>) {
(this.holdings as MutableList<Holding>).addAll(holdings)
}
@get:JsonIgnore
open val supportsTransactionRetrieval: Boolean
get() = supportsAnyFeature(BankAccountFeatures.RetrieveBalance)