From b210c1e7faa4211d46e3e68a4447ac580d7805ed Mon Sep 17 00:00:00 2001 From: dankito Date: Mon, 2 Sep 2024 19:40:18 +0200 Subject: [PATCH] Made properties open --- .../banking/client/model/tan/TanChallenge.kt | 26 +++++++++---------- .../banking/client/model/tan/TanMethod.kt | 10 +++---- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/tan/TanChallenge.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/tan/TanChallenge.kt index f5dde824..152102b2 100644 --- a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/tan/TanChallenge.kt +++ b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/tan/TanChallenge.kt @@ -9,9 +9,9 @@ import net.codinux.banking.client.model.config.NoArgConstructor @Suppress("RUNTIME_ANNOTATION_NOT_SUPPORTED") @NoArgConstructor open class TanChallenge( - val type: TanChallengeType, - val forAction: ActionRequiringTan, - val messageToShowToUser: String, + open val type: TanChallengeType, + open val forAction: ActionRequiringTan, + open val messageToShowToUser: String, /** * Identifier of selected TanMethod. @@ -19,7 +19,7 @@ open class TanChallenge( * As [availableTanMethods] also contains selected TanMethod, we didn't want to duplicate this object. Use * [selectedTanMethod] to get selected TanMethod or iterate over [availableTanMethods] and filter selected one by this id. */ - val selectedTanMethodId: String, + open val selectedTanMethodId: String, /** * When adding an account, frontend has no UserAccount object in BankingClientCallback to know which TanMethods are * available for User. @@ -28,7 +28,7 @@ open class TanChallenge( * * Therefore i added list with up to date TanMethods here to ensure EnterTanDialog can display user's up to date TanMethods. */ - val availableTanMethods: List, + open val availableTanMethods: List, /** * Identifier of selected TanMedium. @@ -36,21 +36,21 @@ open class TanChallenge( * As [availableTanMedia] also contains selected TanMedium, we didn't want to duplicate this object. Use * [selectedTanMedium] to get selected TanMedium or iterate over [availableTanMedia] and filter selected one by this medium name. */ - val selectedTanMediumName: String? = null, - val availableTanMedia: List = emptyList(), + open val selectedTanMediumName: String? = null, + open val availableTanMedia: List = emptyList(), - val tanImage: TanImage? = null, - val flickerCode: FlickerCode? = null, - val user: UserAccountViewInfo, - val account: BankAccountViewInfo? = null + open val tanImage: TanImage? = null, + open val flickerCode: FlickerCode? = null, + open val user: UserAccountViewInfo, + open val account: BankAccountViewInfo? = null ) { @get:JsonIgnore - val selectedTanMethod: TanMethod + open val selectedTanMethod: TanMethod get() = availableTanMethods.first { it.identifier == selectedTanMethodId } @get:JsonIgnore - val selectedTanMedium: TanMedium? + open val selectedTanMedium: TanMedium? get() = availableTanMedia.firstOrNull { it.mediumName == selectedTanMediumName } diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/tan/TanMethod.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/tan/TanMethod.kt index 6f1a740a..0da8e433 100644 --- a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/tan/TanMethod.kt +++ b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/tan/TanMethod.kt @@ -4,11 +4,11 @@ import net.codinux.banking.client.model.config.NoArgConstructor @NoArgConstructor open class TanMethod( - val displayName: String, - val type: TanMethodType, - val identifier: String, - val maxTanInputLength: Int? = null, - val allowedTanFormat: AllowedTanFormat = AllowedTanFormat.Alphanumeric + open val displayName: String, + open val type: TanMethodType, + open val identifier: String, + open val maxTanInputLength: Int? = null, + open val allowedTanFormat: AllowedTanFormat = AllowedTanFormat.Alphanumeric ) { override fun toString() = "$displayName ($type, ${identifier})" } \ No newline at end of file