Making use of supportXyz convenience properties

This commit is contained in:
dankito 2020-09-23 03:45:33 +02:00
parent 395ef5445c
commit dee6f4aebe
2 changed files with 7 additions and 7 deletions

View File

@ -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 ->

View File

@ -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 {