From 68317f3b1c0c4c0d5fca5a78aba7d9e7aef149cc Mon Sep 17 00:00:00 2001 From: dankito Date: Mon, 16 Sep 2024 17:16:41 +0200 Subject: [PATCH] Made changeable properties var and using List instead of MutableList for transactions --- .../net/codinux/banking/client/model/BankAccess.kt | 10 +++++----- .../net/codinux/banking/client/model/BankAccount.kt | 9 ++++----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/BankAccess.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/BankAccess.kt index 325d2beb..828a192a 100644 --- a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/BankAccess.kt +++ b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/BankAccess.kt @@ -29,7 +29,7 @@ open class BankAccess( * So in most cases the userId is identical with the customerId = loginName in our speech, but there are rare cases * where the userId differs from customerId. */ - val userId: String? = null, + var userId: String? = null, open val accounts: List = emptyList(), @@ -39,8 +39,8 @@ open class BankAccess( * As [tanMethods] also contains selected TanMethod, we didn't want to duplicate this object. Use * [selectedTanMethod] to get selected TanMethod or iterate over [tanMethods] and filter selected one by this id. */ - val selectedTanMethodIdentifier: String? = null, - open val tanMethods: List = listOf(), + var selectedTanMethodIdentifier: String? = null, + open var tanMethods: List = listOf(), /** * Identifier of selected TanMedium. @@ -48,8 +48,8 @@ open class BankAccess( * As [tanMedia] also contains selected TanMedium, we didn't want to duplicate this object. Use [selectedTanMedium] * to get selected TanMedium or iterate over [tanMedia] and filter selected one by this medium name. */ - val selectedTanMediumIdentifier: String? = null, - open val tanMedia: List = listOf(), + var selectedTanMediumIdentifier: String? = null, + open var tanMedia: List = listOf(), var bankingGroup: BankingGroup? = null, open var serverAddress: String? = null 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 f3ec1019..36ccd0a4 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 @@ -20,16 +20,15 @@ open class BankAccount( val isAccountTypeSupportedByApplication: Boolean = false, val features: Set = emptySet(), -// var balance: BigDecimal = BigDecimal.ZERO, - var balance: Amount = Amount.Zero, // TODO: add a BigDecimal library + var balance: Amount = Amount.Zero, val serverTransactionsRetentionDays: Int? = null, open var lastAccountUpdateTime: Instant? = null, var retrievedTransactionsFrom: LocalDate? = null, - open val bookedTransactions: MutableList = mutableListOf(), - open val prebookedTransactions: MutableList = mutableListOf(), - open val holdings: List = emptyList(), + open var bookedTransactions: List = emptyList(), + open var prebookedTransactions: List = emptyList(), + open var holdings: List = emptyList(), var userSetDisplayName: String? = null, var displayIndex: Int = 0,