Renamed getAccountTransactions() to fetchAccountTransactions() to make it clear that it contacts bank's server as opposed to getAccountTransactionsForBankAccounts()
This commit is contained in:
parent
5fa3bf18ff
commit
5ce48322a1
|
@ -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)
|
val userSelection = dialogService.showDialog(Alert.AlertType.CONFIRMATION, message, null, currentStage, ButtonType.YES, ButtonType.NO)
|
||||||
|
|
||||||
when (userSelection) {
|
when (userSelection) {
|
||||||
ButtonType.YES -> presenter.getAccountTransactionsAsync(response.account) { }
|
ButtonType.YES -> presenter.fetchAccountTransactionsAsync(response.account) { }
|
||||||
else -> { } // nothing to do then, simply close dialog
|
else -> { } // nothing to do then, simply close dialog
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -174,23 +174,23 @@ open class BankingPresenter(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
open fun getAccountTransactionsAsync(account: Account,
|
open fun fetchAccountTransactionsAsync(account: Account,
|
||||||
callback: (GetTransactionsResponse) -> Unit) {
|
callback: (GetTransactionsResponse) -> Unit) {
|
||||||
|
|
||||||
account.bankAccounts.forEach { bankAccount ->
|
account.bankAccounts.forEach { bankAccount ->
|
||||||
if (bankAccount.supportsRetrievingAccountTransactions) {
|
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) {
|
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) {
|
callback: (GetTransactionsResponse) -> Unit) {
|
||||||
|
|
||||||
getClientForAccount(bankAccount.account)?.let { client ->
|
getClientForAccount(bankAccount.account)?.let { client ->
|
||||||
|
@ -211,7 +211,7 @@ open class BankingPresenter(
|
||||||
val lastRetrievedTransactionDate = bankAccount.bookedTransactions.firstOrNull { it.bookingDate <= today }?.bookingDate
|
val lastRetrievedTransactionDate = bankAccount.bookedTransactions.firstOrNull { it.bookingDate <= today }?.bookingDate
|
||||||
val fromDate = lastRetrievedTransactionDate?.let { Date(it.time - OneDayMillis) } // one day before last received transaction
|
val fromDate = lastRetrievedTransactionDate?.let { Date(it.time - OneDayMillis) } // one day before last received transaction
|
||||||
|
|
||||||
getAccountTransactionsAsync(bankAccount, fromDate, callback)
|
fetchAccountTransactionsAsync(bankAccount, fromDate, callback)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,7 +131,7 @@ open class AddAccountDialog : DialogFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun retrieveAccountTransactionsAndDismiss(response: AddAccountResponse, messageDialog: DialogInterface) {
|
protected open fun retrieveAccountTransactionsAndDismiss(response: AddAccountResponse, messageDialog: DialogInterface) {
|
||||||
presenter.getAccountTransactionsAsync(response.account) { }
|
presenter.fetchAccountTransactionsAsync(response.account) { }
|
||||||
|
|
||||||
messageDialog.dismiss()
|
messageDialog.dismiss()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue