Updated to new BankingClient model that renamed lastTransactionsRetrievalTime to lastAccountUpdateTime and made fints4k an implementation detail

This commit is contained in:
dankito 2024-09-12 00:17:43 +02:00
parent 28530d63cd
commit 35624c0034
4 changed files with 9 additions and 10 deletions

View File

@ -55,7 +55,7 @@ open class SqliteBankingRepository(
}
fun getAllBankAccounts(): List<BankAccountEntity> = userQueries.selectAllBankAccounts { id, userId, identifier, subAccountNumber, iban, productName, accountHolderName, type, currency, accountLimit, isAccountTypeSupportedByApplication, features, balance, serverTransactionsRetentionDays, lastTransactionsRetrievalTime, retrievedTransactionsFrom, userSetDisplayName, displayIndex, hideAccount, includeInAutomaticAccountsUpdate ->
fun getAllBankAccounts(): List<BankAccountEntity> = userQueries.selectAllBankAccounts { id, userId, identifier, subAccountNumber, iban, productName, accountHolderName, type, currency, accountLimit, isAccountTypeSupportedByApplication, features, balance, serverTransactionsRetentionDays, lastAccountUpdateTime, retrievedTransactionsFrom, userSetDisplayName, displayIndex, hideAccount, includeInAutomaticAccountsUpdate ->
BankAccountEntity(
id, userId,
@ -69,7 +69,7 @@ open class SqliteBankingRepository(
mapToAmount(balance),
mapToInt(serverTransactionsRetentionDays),
mapToInstant(lastTransactionsRetrievalTime), mapToDate(retrievedTransactionsFrom),
mapToInstant(lastAccountUpdateTime), mapToDate(retrievedTransactionsFrom),
mutableListOf(), mutableListOf(), emptyList(),
@ -94,7 +94,7 @@ open class SqliteBankingRepository(
account.isAccountTypeSupportedByApplication, mapEnumCollectionToString(account.features),
mapInt(account.serverTransactionsRetentionDays),
mapInstant(account.lastTransactionsRetrievalTime), mapDate(account.retrievedTransactionsFrom),
mapInstant(account.lastAccountUpdateTime), mapDate(account.retrievedTransactionsFrom),
account.userSetDisplayName, mapInt(account.displayIndex),
account.hideAccount, account.includeInAutomaticAccountsUpdate

View File

@ -25,7 +25,7 @@ class BankAccountEntity(
balance: Amount = Amount.Zero, // TODO: add a BigDecimal library
serverTransactionsRetentionDays: Int? = null,
lastTransactionsRetrievalTime: Instant? = null,
lastAccountUpdateTime: Instant? = null,
retrievedTransactionsFrom: LocalDate? = null,
bookedTransactions: MutableList<AccountTransactionEntity> = mutableListOf(),
@ -46,7 +46,7 @@ class BankAccountEntity(
balance,
serverTransactionsRetentionDays, lastTransactionsRetrievalTime, retrievedTransactionsFrom,
serverTransactionsRetentionDays, lastAccountUpdateTime, retrievedTransactionsFrom,
bookedTransactions as MutableList<AccountTransaction>, prebookedTransactions,
holdings,
@ -66,7 +66,7 @@ class BankAccountEntity(
account.balance,
account.serverTransactionsRetentionDays,
account.lastTransactionsRetrievalTime, account.retrievedTransactionsFrom,
account.lastAccountUpdateTime, account.retrievedTransactionsFrom,
transactions.toMutableList(), mutableListOf(), holdings,

View File

@ -5,6 +5,7 @@ import kotlinx.coroutines.*
import kotlinx.datetime.LocalDate
import net.codinux.banking.client.SimpleBankingClientCallback
import net.codinux.banking.client.fints4k.FinTs4kBankingClient
import net.codinux.banking.client.fints4k.FinTsClientOptions
import net.codinux.banking.client.model.*
import net.codinux.banking.client.model.options.GetAccountDataOptions
import net.codinux.banking.client.model.options.RetrieveTransactions
@ -17,8 +18,6 @@ import net.codinux.banking.dataaccess.BankingRepository
import net.codinux.banking.dataaccess.entities.AccountTransactionEntity
import net.codinux.banking.dataaccess.entities.BankAccountEntity
import net.codinux.banking.dataaccess.entities.UserEntity
import net.codinux.banking.fints.config.FinTsClientConfiguration
import net.codinux.banking.fints.config.FinTsClientOptions
import net.codinux.banking.ui.IOorDefault
import net.codinux.banking.ui.model.AccountTransactionViewModel
import net.codinux.banking.ui.model.BankInfo
@ -37,7 +36,7 @@ class BankingService(
private val bankFinder: BankFinder
) {
private val client = FinTs4kBankingClient(FinTsClientConfiguration(FinTsClientOptions(true)), SimpleBankingClientCallback { tanChallenge, callback ->
private val client = FinTs4kBankingClient(FinTsClientOptions(true, closeDialogs = false), SimpleBankingClientCallback { tanChallenge, callback ->
uiState.receivedTanChallenge(tanChallenge, callback)
})

View File

@ -3,7 +3,7 @@ package net.codinux.banking.ui.service
import kotlinx.datetime.DayOfWeek
import kotlinx.datetime.LocalDate
import kotlinx.datetime.Month
import net.codinux.banking.fints.extensions.minusDays
import net.codinux.banking.client.model.extensions.minusDays
import net.codinux.banking.ui.model.AccountTransactionViewModel
import net.codinux.banking.ui.model.TransactionsGrouping