Fixed getCustomersForUser v3.0.0 in akka mode

This commit is contained in:
constantine2nd 2018-02-27 08:48:55 +01:00
parent 2941e7133e
commit 1171abaa00
5 changed files with 11 additions and 10 deletions

View File

@ -1628,8 +1628,7 @@ object LocalMappedConnector extends Connector with MdcLoggable {
)
override def getCustomersByUserIdFuture(userId: String)(session: Option[CallContext]): Future[Box[List[Customer]]] = Future {
Customer.customerProvider.vend.getCustomersByUserIdBox(userId)
}
override def getCustomersByUserIdFuture(userId: String)(session: Option[CallContext]): Future[Box[List[Customer]]] =
Customer.customerProvider.vend.getCustomersByUserIdFuture(userId)
}

View File

@ -28,7 +28,7 @@ trait CustomerProvider {
def getCustomersByUserId(userId: String): List[Customer]
def getCustomersByUserIdBox(userId: String): Box[List[Customer]]
def getCustomersByUserIdFuture(userId: String): Future[Box[List[Customer]]]
def getCustomerByCustomerId(customerId: String): Box[Customer]

View File

@ -52,12 +52,14 @@ object MappedCustomerProvider extends CustomerProvider {
MappedCustomer.findAll(ByList(MappedCustomer.mCustomerId, customerIds))
}
def getCustomersByUserIdF(userId: String): Box[List[Customer]] = {
def getCustomersByUserIdBoxed(userId: String): Box[List[Customer]] = {
Full(getCustomersByUserId(userId))
}
override def getCustomersByUserIdBox(userId: String): Box[List[Customer]]= {
Full(getCustomersByUserId(userId))
override def getCustomersByUserIdFuture(userId: String): Future[Box[List[Customer]]]= {
Future {
Full(getCustomersByUserId(userId))
}
}
override def getBankIdByCustomerId(customerId: String): Box[String] = {

View File

@ -20,8 +20,8 @@ object RemotedataCustomers extends ObpActorInit with CustomerProvider {
def getCustomersByUserId(userId: String): List[Customer] =
extractFuture(actor ? cc.getCustomersByUserId(userId))
def getCustomersByUserIdBox(userId: String): Box[List[Customer]] =
extractFutureToBox(actor ? cc.getCustomersByUserIdFuture(userId))
def getCustomersByUserIdFuture(userId: String): Future[Box[List[Customer]]] =
(actor ? cc.getCustomersByUserIdFuture(userId)).mapTo[Box[List[Customer]]]
def getCustomerByCustomerId(customerId: String) : Box[Customer] =
extractFutureToBox(actor ? cc.getCustomerByCustomerId(customerId))

View File

@ -25,7 +25,7 @@ class RemotedataCustomersActor extends Actor with ObpActorHelper with MdcLoggabl
case cc.getCustomersByUserIdFuture(userId: String) =>
logger.debug("getCustomersByUserIdFuture(" + userId + ")")
sender ! (mapper.getCustomersByUserIdF(userId))
sender ! (mapper.getCustomersByUserIdBoxed(userId))
case cc.getCustomerByCustomerId(customerId: String) =>
logger.debug("getCustomerByCustomerId(" + customerId + ")")