From 50a593804625d06551c5e8c10f8d8f9bb3d7bcca Mon Sep 17 00:00:00 2001 From: dankito Date: Sat, 19 Sep 2020 01:54:22 +0200 Subject: [PATCH] Made all properties overridable --- .../implementierte/tan/TanMedium.kt | 4 +- .../banking/fints/model/AccountData.kt | 28 +++++------ .../dankito/banking/fints/model/BankData.kt | 50 +++++++++---------- .../fints/model/GetTransactionsParameter.kt | 16 +++--- .../fints/model/RetrievedAccountData.kt | 8 +-- .../banking/fints/model/TanProcedure.kt | 14 +++--- .../response/client/AddAccountResponse.kt | 4 +- .../response/client/FinTsClientResponse.kt | 24 ++++----- .../client/GetTransactionsResponse.kt | 4 +- .../fints/response/segments/JobParameters.kt | 10 ++-- .../response/segments/ReceivedSegment.kt | 10 ++-- .../banking/ui/model/RetrievedAccountData.kt | 8 +-- .../ui/model/responses/AddAccountResponse.kt | 6 +-- .../model/responses/BankingClientResponse.kt | 6 +-- .../responses/GetTransactionsResponse.kt | 6 +-- 15 files changed, 99 insertions(+), 99 deletions(-) diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/messages/datenelemente/implementierte/tan/TanMedium.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/messages/datenelemente/implementierte/tan/TanMedium.kt index 9f91ce2a..3f97a847 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/messages/datenelemente/implementierte/tan/TanMedium.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/messages/datenelemente/implementierte/tan/TanMedium.kt @@ -9,8 +9,8 @@ package net.dankito.banking.fints.messages.datenelemente.implementierte.tan * Wird das Datenelement „TAN-Medium-Klasse“ mit „B“ (bilateral vereinbart) belegt, so muss im Element „Sicherheitsfunktion, kodiert“ die entsprechende Sicherheitsfunktion in der DEG „Verfahrensparameter Zwei-Schritt-Verfahren“ referenziert werden. */ open class TanMedium( - val mediumClass: TanMediumKlasse, - val status: TanMediumStatus, + open val mediumClass: TanMediumKlasse, + open val status: TanMediumStatus, open val mediumName: String? ) { diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/AccountData.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/AccountData.kt index 9f8563de..6c8a3533 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/AccountData.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/AccountData.kt @@ -6,25 +6,25 @@ import net.dankito.banking.fints.response.segments.JobParameters open class AccountData( - val accountIdentifier: String, - val subAccountAttribute: String?, - val bankCountryCode: Int, - val bankCode: String, - val iban: String?, - val customerId: String, - val accountType: AccountType?, - val currency: String?, // TODO: may parse to a value object - val accountHolderName: String, - val productName: String?, - val accountLimit: String?, - val allowedJobNames: List, - var allowedJobs: List = listOf() + open val accountIdentifier: String, + open val subAccountAttribute: String?, + open val bankCountryCode: Int, + open val bankCode: String, + open val iban: String?, + open val customerId: String, + open val accountType: AccountType?, + open val currency: String?, // TODO: may parse to a value object + open val accountHolderName: String, + open val productName: String?, + open val accountLimit: String?, + open val allowedJobNames: List, + open var allowedJobs: List = listOf() ) { internal constructor() : this("", null, Laenderkennzeichen.Germany, "", null, "", null, null, "", null, null, listOf()) // for object deserializers - protected val supportedFeatures = mutableSetOf() + protected open val supportedFeatures = mutableSetOf() open fun supportsFeature(feature: AccountFeature): Boolean { diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/BankData.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/BankData.kt index f2b4b1a6..ecef08dd 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/BankData.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/BankData.kt @@ -10,40 +10,40 @@ import net.dankito.banking.fints.response.segments.PinInfo open class BankData( - var bankCode: String, - var customerId: String, - var pin: String, - var finTs3ServerAddress: String, - var bic: String, + open var bankCode: String, + open var customerId: String, + open var pin: String, + open var finTs3ServerAddress: String, + open var bic: String, - var bankName: String = "", - var countryCode: Int = Laenderkennzeichen.Germany, // TODO: currently there are only German banks. But change this if ever other countries get supported - var bpdVersion: Int = BPDVersion.VersionNotReceivedYet, + open var bankName: String = "", + open var countryCode: Int = Laenderkennzeichen.Germany, // TODO: currently there are only German banks. But change this if ever other countries get supported + open var bpdVersion: Int = BPDVersion.VersionNotReceivedYet, - var userId: String = customerId, - var customerName: String = "", - var updVersion: Int = UPDVersion.VersionNotReceivedYet, + open var userId: String = customerId, + open var customerName: String = "", + open var updVersion: Int = UPDVersion.VersionNotReceivedYet, - var tanProceduresSupportedByBank: List = listOf(), - var tanProceduresAvailableForUser: List = listOf(), - var selectedTanProcedure: TanProcedure = TanProcedureNotSelected, - var tanMedia: List = listOf(), - var changeTanMediumParameters: ChangeTanMediaParameters? = null, - var pinInfo: PinInfo? = null, + open var tanProceduresSupportedByBank: List = listOf(), + open var tanProceduresAvailableForUser: List = listOf(), + open var selectedTanProcedure: TanProcedure = TanProcedureNotSelected, + open var tanMedia: List = listOf(), + open var changeTanMediumParameters: ChangeTanMediaParameters? = null, + open var pinInfo: PinInfo? = null, - var supportedLanguages: List = listOf(), - var selectedLanguage: Dialogsprache = Dialogsprache.Default, - var customerSystemId: String = KundensystemID.Anonymous, - var customerSystemStatus: KundensystemStatusWerte = KundensystemStatus.SynchronizingCustomerSystemId, + open var supportedLanguages: List = listOf(), + open var selectedLanguage: Dialogsprache = Dialogsprache.Default, + open var customerSystemId: String = KundensystemID.Anonymous, + open var customerSystemStatus: KundensystemStatusWerte = KundensystemStatus.SynchronizingCustomerSystemId, /** * Maximale Anzahl an Geschäftsvorfallsarten, die pro Nachricht zulässig ist. * Der Wert ‚0’ gibt an, dass keine Restriktionen bzgl. der Anzahl an Geschäftsvorfallsarten bestehen. */ - var countMaxJobsPerMessage: Int = 0, + open var countMaxJobsPerMessage: Int = 0, - var supportedHbciVersions: List = listOf(), - var supportedJobs: List = listOf() + open var supportedHbciVersions: List = listOf(), + open var supportedJobs: List = listOf() ) { companion object { @@ -62,7 +62,7 @@ open class BankData( - protected val _accounts = mutableListOf() + protected open val _accounts = mutableListOf() open val accounts: List get() = ArrayList(_accounts) diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/GetTransactionsParameter.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/GetTransactionsParameter.kt index 3fad1a77..343f432d 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/GetTransactionsParameter.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/GetTransactionsParameter.kt @@ -4,9 +4,9 @@ import net.dankito.utils.multiplatform.Date open class GetTransactionsParameter( - val alsoRetrieveBalance: Boolean = true, - val fromDate: Date? = null, - val toDate: Date? = null, + open val alsoRetrieveBalance: Boolean = true, + open val fromDate: Date? = null, + open val toDate: Date? = null, /** * Be aware this is by far not supported by all banks. @@ -15,14 +15,14 @@ open class GetTransactionsParameter( * * // TODO: set a parameter in response if maxCountEntries is set but bank doesn't support it. */ - val maxCountEntries: Int? = null, - val abortIfTanIsRequired: Boolean = false, - val retrievedChunkListener: ((Collection) -> Unit)? = null + open val maxCountEntries: Int? = null, + open val abortIfTanIsRequired: Boolean = false, + open val retrievedChunkListener: ((Collection) -> Unit)? = null ) { - internal var isSettingMaxCountEntriesAllowedByBank = false + internal open var isSettingMaxCountEntriesAllowedByBank = false - internal val maxCountEntriesIfSettingItIsAllowed: Int? + internal open val maxCountEntriesIfSettingItIsAllowed: Int? get() = if (isSettingMaxCountEntriesAllowedByBank) maxCountEntries else null } \ No newline at end of file diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/RetrievedAccountData.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/RetrievedAccountData.kt index 81e04ede..2c15a132 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/RetrievedAccountData.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/RetrievedAccountData.kt @@ -2,10 +2,10 @@ package net.dankito.banking.fints.model open class RetrievedAccountData( - val accountData: AccountData, - val balance: Money?, - var bookedTransactions: Collection, - var unbookedTransactions: List + open val accountData: AccountData, + open val balance: Money?, + open var bookedTransactions: Collection, + open var unbookedTransactions: List ) { open fun addBookedTransactions(transactions: List) { diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/TanProcedure.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/TanProcedure.kt index 9e66a932..2670a672 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/TanProcedure.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/TanProcedure.kt @@ -5,13 +5,13 @@ import net.dankito.banking.fints.messages.datenelemente.implementierte.tan.Allow open class TanProcedure( - val displayName: String, - val securityFunction: Sicherheitsfunktion, - val type: TanProcedureType, - val hhdVersion: HHDVersion? = null, - val maxTanInputLength: Int? = null, - val allowedTanFormat: AllowedTanFormat = AllowedTanFormat.Alphanumeric, - val nameOfTanMediaRequired: Boolean = false + open val displayName: String, + open val securityFunction: Sicherheitsfunktion, + open val type: TanProcedureType, + open val hhdVersion: HHDVersion? = null, + open val maxTanInputLength: Int? = null, + open val allowedTanFormat: AllowedTanFormat = AllowedTanFormat.Alphanumeric, + open val nameOfTanMediaRequired: Boolean = false ) { diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/client/AddAccountResponse.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/client/AddAccountResponse.kt index 773b9c50..53be5e93 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/client/AddAccountResponse.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/client/AddAccountResponse.kt @@ -6,7 +6,7 @@ import net.dankito.banking.fints.response.Response open class AddAccountResponse( response: Response, - val bank: BankData, - val supportsRetrievingTransactionsOfLast90DaysWithoutTan: Boolean = false, + open val bank: BankData, + open val supportsRetrievingTransactionsOfLast90DaysWithoutTan: Boolean = false, retrievedData: List = listOf() ) : GetTransactionsResponse(response, retrievedData) \ No newline at end of file diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/client/FinTsClientResponse.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/client/FinTsClientResponse.kt index 45160211..4ab86d1f 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/client/FinTsClientResponse.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/client/FinTsClientResponse.kt @@ -6,28 +6,28 @@ import net.dankito.banking.fints.response.segments.TanResponse open class FinTsClientResponse( - val isSuccessful: Boolean, + open val isSuccessful: Boolean, // TODO: rename to successful - val noTanProcedureSelected: Boolean, + open val noTanProcedureSelected: Boolean, - val isStrongAuthenticationRequired: Boolean, - val tanRequired: TanResponse? = null, + open val isStrongAuthenticationRequired: Boolean, + open val tanRequired: TanResponse? = null, - val errorsToShowToUser: List = listOf(), + open val errorsToShowToUser: List = listOf(), /** * When a serious error occurred during web request or response parsing. */ - val errorMessage: String? = null, + open val errorMessage: String? = null, - val userCancelledAction: Boolean = false, + open val userCancelledAction: Boolean = false, - val tanRequiredButWeWereToldToAbortIfSo: Boolean = false, + open val tanRequiredButWeWereToldToAbortIfSo: Boolean = false, - val isJobAllowed: Boolean = true, - val isJobVersionSupported: Boolean = true, - val allowedVersions: List = listOf(), - val supportedVersions: List = listOf() + open val isJobAllowed: Boolean = true, + open val isJobVersionSupported: Boolean = true, + open val allowedVersions: List = listOf(), + open val supportedVersions: List = listOf() ) { diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/client/GetTransactionsResponse.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/client/GetTransactionsResponse.kt index 67128a9e..9eb22985 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/client/GetTransactionsResponse.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/client/GetTransactionsResponse.kt @@ -6,9 +6,9 @@ import net.dankito.banking.fints.response.Response open class GetTransactionsResponse( response: Response, - val retrievedData: List = listOf(), + open val retrievedData: List = listOf(), /** * This value is only set if [GetTransactionsParameter.maxCountEntries] was set to tell caller if maxCountEntries parameter has been evaluated or not */ - var isSettingMaxCountEntriesAllowedByBank: Boolean? = null + open var isSettingMaxCountEntriesAllowedByBank: Boolean? = null ) : FinTsClientResponse(response) \ No newline at end of file diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/segments/JobParameters.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/segments/JobParameters.kt index b32c9c67..4e33268d 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/segments/JobParameters.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/segments/JobParameters.kt @@ -2,11 +2,11 @@ package net.dankito.banking.fints.response.segments open class JobParameters( - val jobName: String, - val maxCountJobs: Int, - val minimumCountSignatures: Int, - val securityClass: Int?, - segmentString: String // TODO: when serializing / deserializing we don't care for segment string -> remove it + open val jobName: String, + open val maxCountJobs: Int, + open val minimumCountSignatures: Int, + open val securityClass: Int?, + segmentString: String ) : ReceivedSegment(segmentString) { diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/segments/ReceivedSegment.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/segments/ReceivedSegment.kt index 2725e5d8..ed97012d 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/segments/ReceivedSegment.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/segments/ReceivedSegment.kt @@ -5,14 +5,14 @@ import kotlin.jvm.Transient open class ReceivedSegment( - val segmentId: String, + open val segmentId: String, @Transient - val segmentNumber: Int, - val segmentVersion: Int, + open val segmentNumber: Int, + open val segmentVersion: Int, @Transient - val referenceSegmentNumber: Int? = null, + open val referenceSegmentNumber: Int? = null, @Transient - val segmentString: String + open val segmentString: String ) { diff --git a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/RetrievedAccountData.kt b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/RetrievedAccountData.kt index 73b466a0..d840a8d9 100644 --- a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/RetrievedAccountData.kt +++ b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/RetrievedAccountData.kt @@ -4,8 +4,8 @@ import net.dankito.utils.multiplatform.BigDecimal open class RetrievedAccountData( - val account: TypedBankAccount, - val balance: BigDecimal?, - var bookedTransactions: Collection, - var unbookedTransactions: List + open val account: TypedBankAccount, + open val balance: BigDecimal?, + open val bookedTransactions: Collection, + open val unbookedTransactions: List ) \ No newline at end of file diff --git a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/responses/AddAccountResponse.kt b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/responses/AddAccountResponse.kt index f98f99a7..25dd874c 100644 --- a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/responses/AddAccountResponse.kt +++ b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/responses/AddAccountResponse.kt @@ -7,9 +7,9 @@ import net.dankito.utils.multiplatform.BigDecimal open class AddAccountResponse( isSuccessful: Boolean, errorToShowToUser: String?, - val customer: TypedCustomer, - val supportsRetrievingTransactionsOfLast90DaysWithoutTan: Boolean = false, - val retrievedData: List = listOf(), + open val customer: TypedCustomer, + open val supportsRetrievingTransactionsOfLast90DaysWithoutTan: Boolean = false, + open val retrievedData: List = listOf(), userCancelledAction: Boolean = false ) : BankingClientResponse(isSuccessful, errorToShowToUser, userCancelledAction) { diff --git a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/responses/BankingClientResponse.kt b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/responses/BankingClientResponse.kt index ece10e01..51874e28 100644 --- a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/responses/BankingClientResponse.kt +++ b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/responses/BankingClientResponse.kt @@ -2,9 +2,9 @@ package net.dankito.banking.ui.model.responses open class BankingClientResponse( - val isSuccessful: Boolean, - val errorToShowToUser: String?, - val userCancelledAction: Boolean = false // TODO: not implemented in hbci4jBankingClient yet + open val isSuccessful: Boolean, + open val errorToShowToUser: String?, + open val userCancelledAction: Boolean = false // TODO: not implemented in hbci4jBankingClient yet ) { diff --git a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/responses/GetTransactionsResponse.kt b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/responses/GetTransactionsResponse.kt index 472e7145..41546a20 100644 --- a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/responses/GetTransactionsResponse.kt +++ b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/responses/GetTransactionsResponse.kt @@ -5,10 +5,10 @@ import net.dankito.banking.ui.model.TypedBankAccount open class GetTransactionsResponse( - val bankAccount: TypedBankAccount, + open val bankAccount: TypedBankAccount, isSuccessful: Boolean, errorToShowToUser: String?, - val retrievedData: List = listOf(), + open val retrievedData: List = listOf(), userCancelledAction: Boolean = false, - val tanRequiredButWeWereToldToAbortIfSo: Boolean = false + open val tanRequiredButWeWereToldToAbortIfSo: Boolean = false ) : BankingClientResponse(isSuccessful, errorToShowToUser, userCancelledAction)