Filtering out potential remittees without IBAN

This commit is contained in:
dankito 2020-09-01 17:50:48 +02:00
parent 044ff141a5
commit 0f081006ed
1 changed files with 3 additions and 1 deletions

View File

@ -140,7 +140,9 @@ class CoreDataBankingPersistence: IBankingPersistence, IRemitteeSearcher {
NSLog("Could not request Customers: \(error)") NSLog("Could not request Customers: \(error)")
} }
let remittees = transactions.map( { Remittee(name: $0.otherPartyName ?? "", iban: $0.otherPartyAccountId, bic: $0.otherPartyBankCode, bankName: nil) } ) let remittees = transactions
.filter { $0.otherPartyAccountId != nil } // if IBAN is not set we cannot make use of it
.map( { Remittee(name: $0.otherPartyName ?? "", iban: $0.otherPartyAccountId, bic: $0.otherPartyBankCode, bankName: nil) } )
let uniqueRemittees = Set<Remittee>(remittees) let uniqueRemittees = Set<Remittee>(remittees)