From 5ce48322a158c565cddbe3ca717a2de0ca703d23 Mon Sep 17 00:00:00 2001 From: dankito Date: Thu, 23 Apr 2020 15:10:12 +0200 Subject: [PATCH] Renamed getAccountTransactions() to fetchAccountTransactions() to make it clear that it contacts bank's server as opposed to getAccountTransactionsForBankAccounts() --- .../ui/javafx/dialogs/AddAccountDialog.kt | 2 +- .../banking/ui/presenter/BankingPresenter.kt | 18 +++++++++--------- .../android/ui/dialogs/AddAccountDialog.kt | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/BankingJavaFxControls/src/main/kotlin/net/dankito/banking/ui/javafx/dialogs/AddAccountDialog.kt b/BankingJavaFxControls/src/main/kotlin/net/dankito/banking/ui/javafx/dialogs/AddAccountDialog.kt index d743498a..d27a0c66 100755 --- a/BankingJavaFxControls/src/main/kotlin/net/dankito/banking/ui/javafx/dialogs/AddAccountDialog.kt +++ b/BankingJavaFxControls/src/main/kotlin/net/dankito/banking/ui/javafx/dialogs/AddAccountDialog.kt @@ -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 } diff --git a/BankingUiCommon/src/main/java/net/dankito/banking/ui/presenter/BankingPresenter.kt b/BankingUiCommon/src/main/java/net/dankito/banking/ui/presenter/BankingPresenter.kt index eb7951ce..676e74f5 100644 --- a/BankingUiCommon/src/main/java/net/dankito/banking/ui/presenter/BankingPresenter.kt +++ b/BankingUiCommon/src/main/java/net/dankito/banking/ui/presenter/BankingPresenter.kt @@ -174,24 +174,24 @@ open class BankingPresenter( } - open fun getAccountTransactionsAsync(account: Account, - callback: (GetTransactionsResponse) -> Unit) { + 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, - callback: (GetTransactionsResponse) -> Unit) { + open fun fetchAccountTransactionsAsync(bankAccount: BankAccount, + callback: (GetTransactionsResponse) -> Unit) { - getAccountTransactionsAsync(bankAccount, null, callback) + fetchAccountTransactionsAsync(bankAccount, null, callback) } - open fun getAccountTransactionsAsync(bankAccount: BankAccount, fromDate: Date?, - callback: (GetTransactionsResponse) -> Unit) { + open fun fetchAccountTransactionsAsync(bankAccount: BankAccount, fromDate: Date?, + callback: (GetTransactionsResponse) -> Unit) { getClientForAccount(bankAccount.account)?.let { client -> client.getTransactionsAsync(bankAccount, net.dankito.banking.ui.model.parameters.GetTransactionsParameter(true, fromDate)) { response -> @@ -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) } } } diff --git a/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/dialogs/AddAccountDialog.kt b/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/dialogs/AddAccountDialog.kt index 58b01944..67bf4de4 100644 --- a/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/dialogs/AddAccountDialog.kt +++ b/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/dialogs/AddAccountDialog.kt @@ -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() }