From 9a2bc6b430a098b4d0d02482135f4a07f1b80a19 Mon Sep 17 00:00:00 2001 From: dankito Date: Tue, 3 Sep 2024 02:13:02 +0200 Subject: [PATCH] Also added displayName for UserAccount and both respect now userSetDisplayName --- .../kotlin/net/codinux/banking/client/model/BankAccount.kt | 2 +- .../kotlin/net/codinux/banking/client/model/UserAccount.kt | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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 07100d70..e585c0be 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 @@ -38,7 +38,7 @@ open class BankAccount( ) { @get:JsonIgnore open val displayName: String - get() = productName ?: identifier + get() = userSetDisplayName ?: productName ?: identifier override fun toString() = "$type $identifier $productName (IBAN: $iban)" } \ No newline at end of file diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/UserAccount.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/UserAccount.kt index a174144a..08b1dd28 100644 --- a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/UserAccount.kt +++ b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/UserAccount.kt @@ -51,6 +51,11 @@ open class UserAccount( var displayIndex: Int = 0 + @get:JsonIgnore + open val displayName: String + get() = userSetDisplayName ?: bankName + + @get:JsonIgnore val selectedTanMethod: TanMethod get() = tanMethods.first { it.identifier == selectedTanMethodId }