Renamed getAccountTransactions() to fetchAccountTransactions() to make it clear that it contacts bank's server as opposed to getAccountTransactionsForBankAccounts()

This commit is contained in:
dankito 2020-04-23 15:10:12 +02:00
parent 5fa3bf18ff
commit 5ce48322a1
3 changed files with 11 additions and 11 deletions

View File

@ -236,7 +236,7 @@ open class AddAccountDialog(protected val presenter: BankingPresenter) : Window(
val userSelection = dialogService.showDialog(Alert.AlertType.CONFIRMATION, message, null, currentStage, ButtonType.YES, ButtonType.NO)
when (userSelection) {
ButtonType.YES -> presenter.getAccountTransactionsAsync(response.account) { }
ButtonType.YES -> presenter.fetchAccountTransactionsAsync(response.account) { }
else -> { } // nothing to do then, simply close dialog
}

View File

@ -174,23 +174,23 @@ open class BankingPresenter(
}
open fun getAccountTransactionsAsync(account: Account,
open fun fetchAccountTransactionsAsync(account: Account,
callback: (GetTransactionsResponse) -> Unit) {
account.bankAccounts.forEach { bankAccount ->
if (bankAccount.supportsRetrievingAccountTransactions) {
getAccountTransactionsAsync(bankAccount, callback) // TODO: use a synchronous version of getAccountTransactions() so that all bank accounts get handled serially
fetchAccountTransactionsAsync(bankAccount, callback) // TODO: use a synchronous version of fetchAccountTransactions() so that all bank accounts get handled serially
}
}
}
open fun getAccountTransactionsAsync(bankAccount: BankAccount,
open fun fetchAccountTransactionsAsync(bankAccount: BankAccount,
callback: (GetTransactionsResponse) -> Unit) {
getAccountTransactionsAsync(bankAccount, null, callback)
fetchAccountTransactionsAsync(bankAccount, null, callback)
}
open fun getAccountTransactionsAsync(bankAccount: BankAccount, fromDate: Date?,
open fun fetchAccountTransactionsAsync(bankAccount: BankAccount, fromDate: Date?,
callback: (GetTransactionsResponse) -> Unit) {
getClientForAccount(bankAccount.account)?.let { client ->
@ -211,7 +211,7 @@ open class BankingPresenter(
val lastRetrievedTransactionDate = bankAccount.bookedTransactions.firstOrNull { it.bookingDate <= today }?.bookingDate
val fromDate = lastRetrievedTransactionDate?.let { Date(it.time - OneDayMillis) } // one day before last received transaction
getAccountTransactionsAsync(bankAccount, fromDate, callback)
fetchAccountTransactionsAsync(bankAccount, fromDate, callback)
}
}
}

View File

@ -131,7 +131,7 @@ open class AddAccountDialog : DialogFragment() {
}
protected open fun retrieveAccountTransactionsAndDismiss(response: AddAccountResponse, messageDialog: DialogInterface) {
presenter.getAccountTransactionsAsync(response.account) { }
presenter.fetchAccountTransactionsAsync(response.account) { }
messageDialog.dismiss()
}