Fixed unnecessary package declarations and safe calls
This commit is contained in:
parent
f8dd296b47
commit
5d8079cfd4
|
@ -412,7 +412,7 @@ open class FinTs4kMapper {
|
||||||
open fun mapToMoney(amount: Amount, currency: String): Money = Money(amount.toString(), currency)
|
open fun mapToMoney(amount: Amount, currency: String): Money = Money(amount.toString(), currency)
|
||||||
|
|
||||||
|
|
||||||
open fun mapMessageLog(response: net.dankito.banking.client.model.response.FinTsClientResponse, bank: BankAccess? = null, account: BankAccount? = null) =
|
open fun mapMessageLog(response: FinTsClientResponse, bank: BankAccess? = null, account: BankAccount? = null) =
|
||||||
mapMessageLog(response.messageLog, bank, account)
|
mapMessageLog(response.messageLog, bank, account)
|
||||||
|
|
||||||
open fun mapMessageLog(messageLog: List<net.codinux.banking.fints.model.MessageLogEntry>, bank: BankAccess? = null, account: BankAccount? = null) =
|
open fun mapMessageLog(messageLog: List<net.codinux.banking.fints.model.MessageLogEntry>, bank: BankAccess? = null, account: BankAccount? = null) =
|
||||||
|
@ -422,7 +422,7 @@ open class FinTs4kMapper {
|
||||||
// TODO: may map messageLogEntry.context.BankData to BankAccess
|
// TODO: may map messageLogEntry.context.BankData to BankAccess
|
||||||
val context = messageLogEntry.context
|
val context = messageLogEntry.context
|
||||||
val fintsAccount = context.account
|
val fintsAccount = context.account
|
||||||
val effectiveAccount = account ?: bank?.accounts?.firstOrNull { it.identifier == fintsAccount?.accountIdentifier && it.subAccountNumber == fintsAccount?.subAccountAttribute }
|
val effectiveAccount = account ?: bank?.accounts?.firstOrNull { it.identifier == fintsAccount?.accountIdentifier && it.subAccountNumber == fintsAccount.subAccountAttribute }
|
||||||
|
|
||||||
val messageNumberString = "${context.jobNumber.toString().padStart(2, '0')}_${context.dialogNumber.toString().padStart(2, '0')}_${context.messageNumber.toString().padStart(2, '0')}"
|
val messageNumberString = "${context.jobNumber.toString().padStart(2, '0')}_${context.dialogNumber.toString().padStart(2, '0')}_${context.messageNumber.toString().padStart(2, '0')}"
|
||||||
|
|
||||||
|
@ -443,7 +443,7 @@ open class FinTs4kMapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected open fun <T> mapError(response: net.dankito.banking.client.model.response.FinTsClientResponse, messageLog: List<MessageLogEntry>): Response<T> =
|
protected open fun <T> mapError(response: FinTsClientResponse, messageLog: List<MessageLogEntry>): Response<T> =
|
||||||
if (response.error != null) {
|
if (response.error != null) {
|
||||||
Response.error(ErrorType.valueOf(response.error!!.name), if (response.error == ErrorCode.BankReturnedError) null else response.errorMessage,
|
Response.error(ErrorType.valueOf(response.error!!.name), if (response.error == ErrorCode.BankReturnedError) null else response.errorMessage,
|
||||||
if (response.error == ErrorCode.BankReturnedError && response.errorMessage !== null) listOf(response.errorMessage!!) else emptyList(), messageLog)
|
if (response.error == ErrorCode.BankReturnedError && response.errorMessage !== null) listOf(response.errorMessage!!) else emptyList(), messageLog)
|
||||||
|
|
Loading…
Reference in New Issue