Renamed haveAllTransactionsBeenFetched to haveAllTransactionsBeenRetrieved and isAccountTypeSupported to isAccountTypeSupportedByApplication
This commit is contained in:
parent
24dd07d46f
commit
d209bc46fc
|
@ -25,7 +25,7 @@ open class AccountData(
|
|||
internal constructor() : this("", null, Laenderkennzeichen.Germany, "", null, "", null, null, "", null, null, listOf()) // for object deserializers
|
||||
|
||||
|
||||
open val isAccountTypeSupported: Boolean
|
||||
open val isAccountTypeSupportedByApplication: Boolean
|
||||
get() = FinTsClient.SupportedAccountTypes.contains(accountType)
|
||||
|
||||
|
||||
|
|
|
@ -57,9 +57,9 @@ open class BankAccount(
|
|||
open var bankId: Long = BaseDao.ObjectNotInsertedId
|
||||
|
||||
|
||||
override var haveAllTransactionsBeenFetched: Boolean = false
|
||||
override var haveAllTransactionsBeenRetrieved: Boolean = false
|
||||
|
||||
override var isAccountTypeSupported: Boolean = true
|
||||
override var isAccountTypeSupportedByApplication: Boolean = true
|
||||
|
||||
|
||||
override var userSetDisplayName: String? = null
|
||||
|
|
|
@ -32,8 +32,8 @@ open class BankAccountEntity(
|
|||
override var unbookedTransactions: List<Any> = listOf(),
|
||||
override var technicalId: String = UUID.random(),
|
||||
override var userSetDisplayName: String? = null,
|
||||
override var haveAllTransactionsBeenFetched: Boolean = false,
|
||||
override var isAccountTypeSupported: Boolean = true,
|
||||
override var haveAllTransactionsBeenRetrieved: Boolean = false,
|
||||
override var isAccountTypeSupportedByApplication: Boolean = true,
|
||||
override var displayIndex: Int = 0
|
||||
|
||||
) : IBankAccount<AccountTransactionEntity> {
|
||||
|
|
|
@ -301,7 +301,7 @@ class HomeFragment : Fragment() {
|
|||
|
||||
private fun fetchTransactions() {
|
||||
presenter.selectedAccounts.forEach { account ->
|
||||
if (account.haveAllTransactionsBeenFetched) {
|
||||
if (account.haveAllTransactionsBeenRetrieved) {
|
||||
presenter.updateAccountTransactionsAsync(account)
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -41,9 +41,9 @@ open class BankAccount @JvmOverloads constructor(
|
|||
override var technicalId: String = UUID.random()
|
||||
|
||||
|
||||
override var haveAllTransactionsBeenFetched: Boolean = false
|
||||
override var haveAllTransactionsBeenRetrieved: Boolean = false
|
||||
|
||||
override var isAccountTypeSupported: Boolean = true
|
||||
override var isAccountTypeSupportedByApplication: Boolean = true
|
||||
|
||||
|
||||
override var userSetDisplayName: String? = null
|
||||
|
|
|
@ -28,8 +28,8 @@ interface IBankAccount<TTransaction: IAccountTransaction> : OrderedDisplayable {
|
|||
var bookedTransactions: List<TTransaction>
|
||||
var unbookedTransactions: List<Any>
|
||||
var technicalId: String
|
||||
var haveAllTransactionsBeenFetched: Boolean
|
||||
var isAccountTypeSupported: Boolean
|
||||
var haveAllTransactionsBeenRetrieved: Boolean
|
||||
var isAccountTypeSupportedByApplication: Boolean
|
||||
var userSetDisplayName: String?
|
||||
|
||||
|
||||
|
|
|
@ -126,8 +126,8 @@ open class BankingPresenter(
|
|||
addClientForBank(bank, newClient)
|
||||
|
||||
bank.accounts.forEach { account ->
|
||||
if (account.haveAllTransactionsBeenFetched == false && didFetchAllTransactionsStoredOnBankServer(account, listOf())) {
|
||||
account.haveAllTransactionsBeenFetched = true // no need to save account, just delays app start-up, as even if account doesn't get saved during app run, haveAllTransactionsBeenFetched gets restored on next app run
|
||||
if (account.haveAllTransactionsBeenRetrieved == false && didFetchAllTransactionsStoredOnBankServer(account, listOf())) {
|
||||
account.haveAllTransactionsBeenRetrieved = true // no need to save account, just delays app start-up, as even if account doesn't get saved during app run, haveAllTransactionsBeenRetrieved gets restored on next app run
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -348,7 +348,7 @@ open class BankingPresenter(
|
|||
}
|
||||
|
||||
if (didFetchAllTransactions || didFetchAllTransactionsStoredOnBankServer(account, retrievedData.bookedTransactions)) {
|
||||
account.haveAllTransactionsBeenFetched = true
|
||||
account.haveAllTransactionsBeenRetrieved = true
|
||||
}
|
||||
|
||||
updateAccountTransactionsAndBalances(retrievedData)
|
||||
|
@ -643,7 +643,7 @@ open class BankingPresenter(
|
|||
get() = sumBalance(selectedAccounts.map { it.balance })
|
||||
|
||||
open val selectedAccountsForWhichNotAllTransactionsHaveBeenFetched: List<TypedBankAccount>
|
||||
get() = selectedAccounts.filter { it.haveAllTransactionsBeenFetched == false }
|
||||
get() = selectedAccounts.filter { it.haveAllTransactionsBeenRetrieved == false }
|
||||
|
||||
open val selectedAccountsTransactionRetrievalState: TransactionsRetrievalState
|
||||
get() = getAccountsTransactionRetrievalState(selectedAccounts)
|
||||
|
@ -769,7 +769,7 @@ open class BankingPresenter(
|
|||
}
|
||||
|
||||
protected open fun getAccountTransactionRetrievalState(account: TypedBankAccount): TransactionsRetrievalState {
|
||||
if (account.isAccountTypeSupported == false) {
|
||||
if (account.isAccountTypeSupportedByApplication == false) {
|
||||
return TransactionsRetrievalState.AccountTypeNotSupported
|
||||
}
|
||||
|
||||
|
|
|
@ -60,8 +60,8 @@ class Mapper {
|
|||
func map(_ bank: IBankData, _ account: PersistedBankAccount) -> IBankAccount {
|
||||
let mapped = BankAccount(bank: bank, identifier: map(account.identifier), accountHolderName: map(account.accountHolderName), iban: account.iban, subAccountNumber: account.subAccountNumber, customerId: map(account.customerId), balance: map(account.balance), currency: map(account.currency), type: map(account.type), productName: account.productName, accountLimit: account.accountLimit, retrievedTransactionsFromOn: map(account.retrievedTransactionsFromOn), retrievedTransactionsUpTo: map(account.retrievedTransactionsUpTo), supportsRetrievingAccountTransactions: account.supportsRetrievingAccountTransactions, supportsRetrievingBalance: account.supportsRetrievingBalance, supportsTransferringMoney: account.supportsTransferringMoney, supportsRealTimeTransfer: account.supportsRealTimeTransfer, bookedTransactions: [], unbookedTransactions: [])
|
||||
|
||||
mapped.haveAllTransactionsBeenFetched = account.haveAllTransactionsBeenFetched
|
||||
mapped.isAccountTypeSupported = account.isAccountTypeSupported
|
||||
mapped.haveAllTransactionsBeenRetrieved = account.haveAllTransactionsBeenRetrieved
|
||||
mapped.isAccountTypeSupportedByApplication = account.isAccountTypeSupportedByApplication
|
||||
|
||||
mapped.userSetDisplayName = account.userSetDisplayName
|
||||
mapped.displayIndex = account.displayIndex
|
||||
|
@ -89,7 +89,7 @@ class Mapper {
|
|||
mapped.balance = account.balance.decimal
|
||||
mapped.currency = account.currency
|
||||
mapped.type = map(account.type)
|
||||
mapped.isAccountTypeSupported = account.isAccountTypeSupported
|
||||
mapped.isAccountTypeSupportedByApplication = account.isAccountTypeSupportedByApplication
|
||||
mapped.productName = account.productName
|
||||
mapped.accountLimit = account.accountLimit
|
||||
mapped.retrievedTransactionsFromOn = account.retrievedTransactionsFromOn?.date
|
||||
|
@ -99,7 +99,7 @@ class Mapper {
|
|||
mapped.supportsTransferringMoney = account.supportsTransferringMoney
|
||||
mapped.supportsRealTimeTransfer = account.supportsRealTimeTransfer
|
||||
|
||||
mapped.haveAllTransactionsBeenFetched = account.haveAllTransactionsBeenFetched
|
||||
mapped.haveAllTransactionsBeenRetrieved = account.haveAllTransactionsBeenRetrieved
|
||||
|
||||
mapped.userSetDisplayName = account.userSetDisplayName
|
||||
mapped.displayIndex = account.displayIndex
|
||||
|
|
|
@ -182,7 +182,7 @@ struct AccountTransactionsDialog: View {
|
|||
|
||||
private func fetchTransactions() {
|
||||
for account in presenter.selectedAccounts {
|
||||
if account.haveAllTransactionsBeenFetched {
|
||||
if account.haveAllTransactionsBeenRetrieved {
|
||||
presenter.updateAccountTransactionsAsync(account: account, abortIfTanIsRequired: false, callback: self.handleGetTransactionsResult)
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -19,7 +19,7 @@ struct BankAccountListItem : View {
|
|||
AmountLabel(amount: account.balance)
|
||||
}.frame(height: 35)
|
||||
}
|
||||
.disabled( !account.isAccountTypeSupported)
|
||||
.disabled( !account.isAccountTypeSupportedByApplication)
|
||||
.contextMenu {
|
||||
Button(action: { self.navigateToBankAccountSettingsDialog() }) {
|
||||
HStack {
|
||||
|
|
|
@ -120,7 +120,7 @@ open class fints4kModelMapper(protected val modelCreator: IModelCreator) {
|
|||
|
||||
account.currency = accountData.currency ?: "EUR"
|
||||
account.type = mapBankAccountType(accountData.accountType)
|
||||
account.isAccountTypeSupported = accountData.isAccountTypeSupported
|
||||
account.isAccountTypeSupportedByApplication = accountData.isAccountTypeSupportedByApplication
|
||||
account.productName = accountData.productName
|
||||
account.accountLimit = accountData.accountLimit
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ open class hbci4jModelMapper(
|
|||
|
||||
result.currency = account.curr
|
||||
result.type = mapBankAccountType(account)
|
||||
result.isAccountTypeSupported = result.type == BankAccountType.Girokonto || result.type == BankAccountType.Festgeldkonto
|
||||
result.isAccountTypeSupportedByApplication = result.type == BankAccountType.Girokonto || result.type == BankAccountType.Festgeldkonto
|
||||
result.accountLimit = account.limit?.value?.let { mapValue(it).toString() }
|
||||
|
||||
result.supportsRetrievingBalance = account.allowedGVs.contains("HKSAL")
|
||||
|
|
Loading…
Reference in New Issue