Trimming white spaces at end of name as e.g. Baader Bank adds them to account holder name

This commit is contained in:
dankito 2024-08-18 04:04:32 +02:00
parent bfc0e7c563
commit 4588fb4d20
1 changed files with 3 additions and 4 deletions

View File

@ -81,10 +81,9 @@ open class ModelMapper(
}
response.getSegmentsById<AccountInfo>(InstituteSegmentId.AccountInfo).forEach { accountInfo ->
var accountHolderName = accountInfo.accountHolderName1
accountInfo.accountHolderName2?.let {
accountHolderName += it // TODO: add a whitespace in between?
}
val accountHolderName = if (accountInfo.accountHolderName2.isNullOrBlank()) accountInfo.accountHolderName1.trim() // Baader Bank adds a lot of white spaces at end
else accountInfo.accountHolderName1.trim() + " " + accountInfo.accountHolderName2.trim()
bank.customerName = accountHolderName
findExistingAccount(bank, accountInfo)?.let { account ->