From 5964fc611c0b9c97defb8aaf15eeabc1c18fc2ee Mon Sep 17 00:00:00 2001 From: dankito Date: Wed, 18 Sep 2024 02:13:35 +0200 Subject: [PATCH] Added properties to sort accounts, tanMethods and tanMedia --- .../net/codinux/banking/client/model/BankAccess.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 0e3d7830..d3a87c8b 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 @@ -76,6 +76,19 @@ open class BankAccess( get() = userSetDisplayName ?: bankName + @get:JsonIgnore + open val accountsSorted: List + get() = accounts.sortedBy { it.displayIndex } + + @get:JsonIgnore + open val tanMethodsSorted: List + get() = tanMethods.sortedBy { it.identifier } + + @get:JsonIgnore + open val tanMediaSorted: List + get() = tanMedia.sortedBy { it.status } + + @get:JsonIgnore val selectedTanMethod: TanMethod get() = tanMethods.first { it.identifier == selectedTanMethodIdentifier }