mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 19:16:53 +00:00
Tweaked function getPhoneNumbersForAccount
This commit is contained in:
parent
727aa323b6
commit
c1f07086d6
@ -2621,15 +2621,13 @@ Returns a string showed to the developer
|
||||
* @param accountId The ACCOUNT_ID
|
||||
* @return The phone number of a Customer
|
||||
*/
|
||||
def getPhoneNumbersForAccount(bankId: BankId, accountId: AccountId): String = {
|
||||
AccountHolders.accountHolders.vend.getAccountHolders(bankId, accountId).toList match {
|
||||
case x :: _ =>
|
||||
UserCustomerLink.userCustomerLink.vend.getUserCustomerLinksByUserId(x.userId) match {
|
||||
case x :: _ =>
|
||||
CustomerX.customerProvider.vend.getCustomerByCustomerId(x.customerId).map(_.mobileNumber).getOrElse("")
|
||||
case _ => ""
|
||||
def getPhoneNumbersForAccount(bankId: BankId, accountId: AccountId): List[(String, String)] = {
|
||||
AccountHolders.accountHolders.vend.getAccountHolders(bankId, accountId).toList flatMap {
|
||||
holder =>
|
||||
UserCustomerLink.userCustomerLink.vend.getUserCustomerLinksByUserId(holder.userId) flatMap {
|
||||
userCustomerLink =>
|
||||
CustomerX.customerProvider.vend.getCustomerByCustomerId(userCustomerLink.customerId).map(c => (c.legalName, c.mobileNumber))
|
||||
}
|
||||
case _ => ""
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user