From d209bc46fcb541d3b053e298a95ebcccbaf2a0fd Mon Sep 17 00:00:00 2001 From: dankito Date: Thu, 24 Sep 2020 03:52:03 +0200 Subject: [PATCH] Renamed haveAllTransactionsBeenFetched to haveAllTransactionsBeenRetrieved and isAccountTypeSupported to isAccountTypeSupportedByApplication --- .../net/dankito/banking/fints/model/AccountData.kt | 2 +- .../dankito/banking/persistence/model/BankAccount.kt | 4 ++-- .../banking/persistence/model/BankAccountEntity.kt | 4 ++-- .../dankito/banking/ui/android/home/HomeFragment.kt | 2 +- .../kotlin/net/dankito/banking/ui/model/BankAccount.kt | 4 ++-- .../net/dankito/banking/ui/model/IBankAccount.kt | 4 ++-- .../dankito/banking/ui/presenter/BankingPresenter.kt | 10 +++++----- .../BankingiOSApp/persistence/Mapper.swift | 8 ++++---- .../ui/dialogs/AccountTransactionsDialog.swift | 2 +- .../ui/views/listitems/BankAccountListItem.swift | 2 +- .../net/dankito/banking/mapper/fints4kModelMapper.kt | 2 +- .../net/dankito/banking/util/hbci4jModelMapper.kt | 2 +- 12 files changed, 23 insertions(+), 23 deletions(-) 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 11917277..f48bffd9 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 @@ -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) diff --git a/persistence/database/RoomBankingPersistence/src/main/java/net/dankito/banking/persistence/model/BankAccount.kt b/persistence/database/RoomBankingPersistence/src/main/java/net/dankito/banking/persistence/model/BankAccount.kt index a65e71a8..1da2eb78 100644 --- a/persistence/database/RoomBankingPersistence/src/main/java/net/dankito/banking/persistence/model/BankAccount.kt +++ b/persistence/database/RoomBankingPersistence/src/main/java/net/dankito/banking/persistence/model/BankAccount.kt @@ -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 diff --git a/persistence/json/BankingPersistenceJson/src/main/kotlin/net/dankito/banking/persistence/model/BankAccountEntity.kt b/persistence/json/BankingPersistenceJson/src/main/kotlin/net/dankito/banking/persistence/model/BankAccountEntity.kt index d275d6a5..ad0fd0c8 100644 --- a/persistence/json/BankingPersistenceJson/src/main/kotlin/net/dankito/banking/persistence/model/BankAccountEntity.kt +++ b/persistence/json/BankingPersistenceJson/src/main/kotlin/net/dankito/banking/persistence/model/BankAccountEntity.kt @@ -32,8 +32,8 @@ open class BankAccountEntity( override var unbookedTransactions: List = 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 { diff --git a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/home/HomeFragment.kt b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/home/HomeFragment.kt index 08210712..76d83f52 100644 --- a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/home/HomeFragment.kt +++ b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/home/HomeFragment.kt @@ -301,7 +301,7 @@ class HomeFragment : Fragment() { private fun fetchTransactions() { presenter.selectedAccounts.forEach { account -> - if (account.haveAllTransactionsBeenFetched) { + if (account.haveAllTransactionsBeenRetrieved) { presenter.updateAccountTransactionsAsync(account) } else { diff --git a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/BankAccount.kt b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/BankAccount.kt index 2696bb7f..8b6f4291 100644 --- a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/BankAccount.kt +++ b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/BankAccount.kt @@ -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 diff --git a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/IBankAccount.kt b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/IBankAccount.kt index df6b6cf3..0d824b0c 100644 --- a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/IBankAccount.kt +++ b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/IBankAccount.kt @@ -28,8 +28,8 @@ interface IBankAccount : OrderedDisplayable { var bookedTransactions: List var unbookedTransactions: List var technicalId: String - var haveAllTransactionsBeenFetched: Boolean - var isAccountTypeSupported: Boolean + var haveAllTransactionsBeenRetrieved: Boolean + var isAccountTypeSupportedByApplication: Boolean var userSetDisplayName: String? diff --git a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt index b73cf8ca..5d3325ff 100644 --- a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt +++ b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt @@ -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 - 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 } diff --git a/ui/BankingiOSApp/BankingiOSApp/persistence/Mapper.swift b/ui/BankingiOSApp/BankingiOSApp/persistence/Mapper.swift index ad2b22e8..77ac3b92 100644 --- a/ui/BankingiOSApp/BankingiOSApp/persistence/Mapper.swift +++ b/ui/BankingiOSApp/BankingiOSApp/persistence/Mapper.swift @@ -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 diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/AccountTransactionsDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/AccountTransactionsDialog.swift index 7c6b8024..b8623567 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/AccountTransactionsDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/AccountTransactionsDialog.swift @@ -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 { diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/listitems/BankAccountListItem.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/listitems/BankAccountListItem.swift index 6eec4756..e141d766 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/listitems/BankAccountListItem.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/listitems/BankAccountListItem.swift @@ -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 { 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 574311e5..0a0bff25 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 @@ -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 diff --git a/ui/hbci4jBankingClient/src/main/kotlin/net/dankito/banking/util/hbci4jModelMapper.kt b/ui/hbci4jBankingClient/src/main/kotlin/net/dankito/banking/util/hbci4jModelMapper.kt index 6f2a1c0a..2f22ad55 100644 --- a/ui/hbci4jBankingClient/src/main/kotlin/net/dankito/banking/util/hbci4jModelMapper.kt +++ b/ui/hbci4jBankingClient/src/main/kotlin/net/dankito/banking/util/hbci4jModelMapper.kt @@ -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")