Added error to BankingClientResponse
This commit is contained in:
parent
9496836b76
commit
7fbd6159ac
|
@ -13,9 +13,10 @@ open class AddAccountResponse(
|
|||
val supportsRetrievingTransactionsOfLast90DaysWithoutTan: Boolean = false,
|
||||
bookedTransactionsOfLast90Days: Map<BankAccount, List<AccountTransaction>> = mapOf(),
|
||||
unbookedTransactionsOfLast90Days: Map<BankAccount, List<Any>> = mapOf(),
|
||||
balances: Map<BankAccount, BigDecimal> = mapOf()
|
||||
balances: Map<BankAccount, BigDecimal> = mapOf(),
|
||||
error: Exception? = null
|
||||
)
|
||||
: GetTransactionsResponse(isSuccessful, errorToShowToUser, bookedTransactionsOfLast90Days, unbookedTransactionsOfLast90Days, balances) {
|
||||
: GetTransactionsResponse(isSuccessful, errorToShowToUser, bookedTransactionsOfLast90Days, unbookedTransactionsOfLast90Days, balances, error) {
|
||||
|
||||
override fun toString(): String {
|
||||
return account.toString() + " " + super.toString()
|
||||
|
|
|
@ -3,7 +3,8 @@ package net.dankito.banking.ui.model.responses
|
|||
|
||||
open class BankingClientResponse(
|
||||
val isSuccessful: Boolean,
|
||||
val errorToShowToUser: String?
|
||||
val errorToShowToUser: String?,
|
||||
val error: Exception? = null
|
||||
) {
|
||||
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ open class GetTransactionsResponse(
|
|||
errorToShowToUser: String?,
|
||||
val bookedTransactions: Map<BankAccount, List<AccountTransaction>> = mapOf(),
|
||||
val unbookedTransactions: Map<BankAccount, List<Any>> = mapOf(),
|
||||
val balances: Map<BankAccount, BigDecimal> = mapOf()
|
||||
val balances: Map<BankAccount, BigDecimal> = mapOf(),
|
||||
error: Exception? = null
|
||||
)
|
||||
: BankingClientResponse(isSuccessful, errorToShowToUser)
|
||||
: BankingClientResponse(isSuccessful, errorToShowToUser, error)
|
||||
|
|
|
@ -18,7 +18,7 @@ open class fints4javaModelMapper {
|
|||
|
||||
|
||||
open fun mapResponse(response: FinTsClientResponse): BankingClientResponse {
|
||||
return BankingClientResponse(response.isSuccessful, mapErrorToShowToUser(response))
|
||||
return BankingClientResponse(response.isSuccessful, mapErrorToShowToUser(response), response.exception)
|
||||
}
|
||||
|
||||
open fun mapResponse(account: Account, response: net.dankito.fints.response.client.AddAccountResponse): AddAccountResponse {
|
||||
|
@ -34,7 +34,8 @@ open class fints4javaModelMapper {
|
|||
account, response.supportsRetrievingTransactionsOfLast90DaysWithoutTan,
|
||||
bookedTransactions,
|
||||
mapOf(), // TODO: map unbooked transactions
|
||||
balances)
|
||||
balances,
|
||||
response.exception)
|
||||
}
|
||||
|
||||
open fun mapResponse(bankAccount: BankAccount, response: net.dankito.fints.response.client.GetTransactionsResponse): GetTransactionsResponse {
|
||||
|
@ -42,7 +43,8 @@ open class fints4javaModelMapper {
|
|||
return GetTransactionsResponse(response.isSuccessful, mapErrorToShowToUser(response),
|
||||
mapOf(bankAccount to mapTransactions(bankAccount, response.bookedTransactions)),
|
||||
mapOf(), // TODO: map unbooked transactions
|
||||
response.balance?.let { mapOf(bankAccount to it) } ?: mapOf())
|
||||
response.balance?.let { mapOf(bankAccount to it) } ?: mapOf(),
|
||||
response.exception)
|
||||
}
|
||||
|
||||
open fun mapErrorToShowToUser(response: FinTsClientResponse): String? {
|
||||
|
|
Loading…
Reference in New Issue