From c3c0b2830e5bfbe453d09e2743036f40d267ab37 Mon Sep 17 00:00:00 2001 From: dankito Date: Tue, 3 Sep 2024 01:30:01 +0200 Subject: [PATCH] Added displayName to be able to replace shortcut `productName ?: identifier` in application --- .../kotlin/net/codinux/banking/client/model/BankAccount.kt | 5 +++++ 1 file changed, 5 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 375a6282..07100d70 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 @@ -2,6 +2,7 @@ package net.codinux.banking.client.model import kotlinx.datetime.LocalDate import kotlinx.datetime.LocalDateTime +import net.codinux.banking.client.model.config.JsonIgnore import net.codinux.banking.client.model.config.NoArgConstructor @NoArgConstructor @@ -35,5 +36,9 @@ open class BankAccount( var hideAccount: Boolean = false, var includeInAutomaticAccountsUpdate: Boolean = true ) { + @get:JsonIgnore + open val displayName: String + get() = productName ?: identifier + override fun toString() = "$type $identifier $productName (IBAN: $iban)" } \ No newline at end of file