From dee6f4aebed6e386daa4c1b7eb7ef7c54b2601dd Mon Sep 17 00:00:00 2001 From: dankito Date: Wed, 23 Sep 2020 03:45:33 +0200 Subject: [PATCH] Making use of supportXyz convenience properties --- .../kotlin/net/dankito/banking/fints/FinTsClient.kt | 6 +++--- .../net/dankito/banking/mapper/fints4kModelMapper.kt | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt index 9cba6017..61a3eefb 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt @@ -301,7 +301,7 @@ open class FinTsClient( val retrievedAccountData = bank.accounts.associateBy( { it }, { RetrievedAccountData.unsuccessful(it) } ).toMutableMap() - val accountsSupportingRetrievingTransactions = bank.accounts.filter { it.supportsFeature(AccountFeature.RetrieveBalance) || it.supportsFeature(AccountFeature.RetrieveAccountTransactions) } + val accountsSupportingRetrievingTransactions = bank.accounts.filter { it.supportsRetrievingBalance || it.supportsRetrievingAccountTransactions } val countAccountsSupportingRetrievingTransactions = accountsSupportingRetrievingTransactions.size var countRetrievedAccounts = 0 @@ -347,7 +347,7 @@ open class FinTsClient( val ninetyDaysAgo = Date(Date.today.millisSinceEpoch - NinetyDaysMillis) - getTransactionsAsync(GetTransactionsParameter(account, account.supportsFeature(AccountFeature.RetrieveBalance), ninetyDaysAgo, abortIfTanIsRequired = true), bank) { response -> + getTransactionsAsync(GetTransactionsParameter(account, account.supportsRetrievingBalance, ninetyDaysAgo, abortIfTanIsRequired = true), bank) { response -> callback(response) } } @@ -416,7 +416,7 @@ open class FinTsClient( } protected open fun mayGetBalance(parameter: GetTransactionsParameter, dialogContext: DialogContext, callback: (BankResponse) -> Unit) { - if (parameter.alsoRetrieveBalance && parameter.account.supportsFeature(AccountFeature.RetrieveBalance)) { + if (parameter.alsoRetrieveBalance && parameter.account.supportsRetrievingBalance) { val message = messageBuilder.createGetBalanceMessage(parameter.account, dialogContext) getAndHandleResponseForMessage(message, dialogContext) { response -> diff --git a/ui/fints4kBankingClient/src/commonMain/kotlin/net/dankito/banking/mapper/fints4kModelMapper.kt b/ui/fints4kBankingClient/src/commonMain/kotlin/net/dankito/banking/mapper/fints4kModelMapper.kt index fe32f20d..951266e5 100644 --- a/ui/fints4kBankingClient/src/commonMain/kotlin/net/dankito/banking/mapper/fints4kModelMapper.kt +++ b/ui/fints4kBankingClient/src/commonMain/kotlin/net/dankito/banking/mapper/fints4kModelMapper.kt @@ -124,10 +124,10 @@ open class fints4kModelMapper(protected val modelCreator: IModelCreator) { account.productName = accountData.productName account.accountLimit = accountData.accountLimit - account.supportsRetrievingBalance = accountData.supportsFeature(AccountFeature.RetrieveBalance) - account.supportsRetrievingAccountTransactions = accountData.supportsFeature(AccountFeature.RetrieveAccountTransactions) - account.supportsTransferringMoney = accountData.supportsFeature(AccountFeature.TransferMoney) - account.supportsInstantPaymentMoneyTransfer = accountData.supportsFeature(AccountFeature.InstantPayment) + account.supportsRetrievingBalance = accountData.supportsRetrievingBalance + account.supportsRetrievingAccountTransactions = accountData.supportsRetrievingAccountTransactions + account.supportsTransferringMoney = accountData.supportsTransferringMoney + account.supportsInstantPaymentMoneyTransfer = accountData.supportsInstantPaymentMoneyTransfer } open fun mapBankAccountType(type: AccountType?): BankAccountType {