Implemented adding message log of accounts that could not be added to message log
This commit is contained in:
parent
bc49b4ee20
commit
83e8b7b882
|
@ -87,6 +87,8 @@ open class BankingPresenter(
|
||||||
|
|
||||||
protected val bankingClientsForBanks = mutableMapOf<TypedBankData, IBankingClient>()
|
protected val bankingClientsForBanks = mutableMapOf<TypedBankData, IBankingClient>()
|
||||||
|
|
||||||
|
protected val messageLogsOfFailedAccountAdditions = mutableListOf<MessageLogEntry>()
|
||||||
|
|
||||||
protected var _selectedAccounts = mutableListOf<TypedBankAccount>()
|
protected var _selectedAccounts = mutableListOf<TypedBankAccount>()
|
||||||
|
|
||||||
protected var selectedAccountType = SelectedAccountType.AllAccounts
|
protected var selectedAccountType = SelectedAccountType.AllAccounts
|
||||||
|
@ -189,6 +191,9 @@ open class BankingPresenter(
|
||||||
log.error(e) { "Could not save successfully added bank" }
|
log.error(e) { "Could not save successfully added bank" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
messageLogsOfFailedAccountAdditions.addAll(newClient.messageLogWithoutSensitiveData)
|
||||||
|
}
|
||||||
|
|
||||||
callback(response)
|
callback(response)
|
||||||
}
|
}
|
||||||
|
@ -777,11 +782,17 @@ open class BankingPresenter(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
open fun getMessageLogForAccounts(banks: List<TypedBankData>): List<String> {
|
open fun getMessageLogForAccounts(banks: List<TypedBankData>, includeFailedAccountAdditions: Boolean = true): List<String> {
|
||||||
val logEntries = banks.flatMap {
|
val logEntries = mutableListOf<MessageLogEntry>()
|
||||||
getBankingClientForBank(it)?.messageLogWithoutSensitiveData ?: listOf()
|
|
||||||
|
if (includeFailedAccountAdditions) {
|
||||||
|
logEntries.addAll(messageLogsOfFailedAccountAdditions)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logEntries.addAll(banks.flatMap {
|
||||||
|
getBankingClientForBank(it)?.messageLogWithoutSensitiveData ?: listOf()
|
||||||
|
})
|
||||||
|
|
||||||
return logEntries.map { entry ->
|
return logEntries.map { entry ->
|
||||||
MessageLogEntryDateFormatter.format(entry.time) + " " + entry.bank.bankCode + " " + entry.message
|
MessageLogEntryDateFormatter.format(entry.time) + " " + entry.bank.bankCode + " " + entry.message
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue