From 9c269ceb0910f01e6c7c28662912dfae17a36c39 Mon Sep 17 00:00:00 2001 From: dankito Date: Sat, 8 Aug 2020 18:10:11 +0200 Subject: [PATCH] Made displayName settable --- .../kotlin/net/dankito/banking/ui/model/BankAccount.kt | 4 +++- .../kotlin/net/dankito/banking/ui/model/Customer.kt | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/BankAccount.kt b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/BankAccount.kt index 881a8f5f..54bb34c5 100644 --- a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/BankAccount.kt +++ b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/BankAccount.kt @@ -40,9 +40,11 @@ open class BankAccount @JvmOverloads constructor( open var technicalId: String = UUID.random() + open var userSetDisplayName: String? = null + open val displayName: String get() { - return productName ?: subAccountNumber ?: identifier + return userSetDisplayName ?: productName ?: subAccountNumber ?: identifier } diff --git a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/Customer.kt b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/Customer.kt index 00f1df96..4bcfb667 100644 --- a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/Customer.kt +++ b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/Customer.kt @@ -43,8 +43,11 @@ open class Customer( get() = tanMedia.sortedByDescending { it.status == TanMediumStatus.Used } + open var userSetDisplayName: String? = null + open val displayName: String - get() = bankName + get() = userSetDisplayName ?: bankName + open val balance: BigDecimal get() = accounts.map { it.balance }.sum()