diff --git a/obp-api/src/main/scala/code/api/v1_4_0/APIMethods140.scala b/obp-api/src/main/scala/code/api/v1_4_0/APIMethods140.scala index c473b3571..ee4c3e4b4 100644 --- a/obp-api/src/main/scala/code/api/v1_4_0/APIMethods140.scala +++ b/obp-api/src/main/scala/code/api/v1_4_0/APIMethods140.scala @@ -463,7 +463,7 @@ trait APIMethods140 extends MdcLoggable with APIMethods130 with APIMethods121{ } // TODO: Consider storing allowed_transaction_request_types (List of String) in View Definition. // TODO: This would allow us to restrict transaction request types available to the User for an Account - transactionRequestTypes <- Future(Connector.connector.vend.getTransactionRequestTypes(u, fromAccount, callContext)) map { + (transactionRequestTypes, callContext) <- Future(Connector.connector.vend.getTransactionRequestTypes(u, fromAccount, callContext)) map { connectorEmptyResponse(_, callContext) } (transactionRequestTypeCharges, callContext) <- NewStyle.function.getTransactionRequestTypeCharges(bankId, accountId, viewId, transactionRequestTypes, callContext) diff --git a/obp-api/src/main/scala/code/bankconnectors/Connector.scala b/obp-api/src/main/scala/code/bankconnectors/Connector.scala index 34b1b8c2a..d59809f31 100644 --- a/obp-api/src/main/scala/code/bankconnectors/Connector.scala +++ b/obp-api/src/main/scala/code/bankconnectors/Connector.scala @@ -787,7 +787,7 @@ trait Connector extends MdcLoggable { Failure(setUnimplementedError(nameOf(getTransactionRequestImpl _))) - def getTransactionRequestTypes(initiator : User, fromAccount : BankAccount, callContext: Option[CallContext]) : Box[List[TransactionRequestType]] =Failure(setUnimplementedError(nameOf(createChallengesC3 _))) + def getTransactionRequestTypes(initiator : User, fromAccount : BankAccount, callContext: Option[CallContext]) : Box[(List[TransactionRequestType], Option[CallContext])] =Failure(setUnimplementedError(nameOf(createChallengesC3 _))) def createTransactionAfterChallengeV210(fromAccount: BankAccount, transactionRequest: TransactionRequest, callContext: Option[CallContext]) : OBPReturnType[Box[TransactionRequest]] = Future{(Failure(setUnimplementedError(nameOf(createTransactionAfterChallengeV210 _))), callContext)} diff --git a/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala b/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala index bbf8f809b..79f6dee61 100644 --- a/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala +++ b/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala @@ -360,9 +360,6 @@ object ConnectorBuilderUtil { "deleteCustomerAttribute", "getPhysicalCardsForUser", "getChallengesByBasketId", - - // The follow methods's parameter or return type are special - "getCurrentFxRate", "createChallengesC2", "createChallengesC3", "getChallenge", @@ -375,29 +372,29 @@ object ConnectorBuilderUtil { "validateChallengeAnswerC5", "validateChallengeAnswerV2", "getCounterpartyByIbanAndBankAccountId", - "getStatus", "getChargeValue", "saveTransactionRequestTransaction", "saveTransactionRequestChallenge", "getTransactionRequestTypes", "updateAccountLabel", "getProduct", - "createOrUpdateBranch", - "createOrUpdateAtm", - "createOrUpdateProduct", - "createOrUpdateFXRate", - "getTransactionRequestTypeCharges", - "getCounterpartyFromTransaction", - "getCounterpartiesFromTransaction", - "saveTransactionRequestStatusImpl" + "saveTransactionRequestStatusImpl", + "getTransactionRequestTypeCharges" ).distinct /** * these connector methods have special parameter or return type */ val specialMethods = List( + "getStatus", + "createOrUpdateBranch", "createOrUpdateBank", - "getCurrentFxRate" + "createOrUpdateAtm", + "createOrUpdateProduct", + "createOrUpdateFXRate", + "getCurrentFxRate", + "getCounterpartyFromTransaction", + "getCounterpartiesFromTransaction", ).distinct val omitMethods = List( diff --git a/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnector.scala b/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnector.scala index e0741fc27..0123b4a09 100644 --- a/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnector.scala +++ b/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnector.scala @@ -4578,7 +4578,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { override def notifyTransactionRequest(fromAccount: BankAccount, toAccount: BankAccount, transactionRequest: TransactionRequest, callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequestStatusValue]] = Future((Full(TransactionRequestStatusValue(transactionRequest.status)), callContext)) - override def saveTransactionRequestTransaction(transactionRequestId: TransactionRequestId, transactionId: TransactionId, callContext: Option[CallContext]) = { + override def saveTransactionRequestTransaction(transactionRequestId: TransactionRequestId, transactionId: TransactionId, callContext: Option[CallContext]) : OBPReturnType[Box[Boolean]]= { Future{(TransactionRequests.transactionRequestProvider.vend.saveTransactionRequestTransactionImpl(transactionRequestId, transactionId), callContext)} } @@ -4609,8 +4609,8 @@ object LocalMappedConnector extends Connector with MdcLoggable { override def getTransactionRequestImpl(transactionRequestId: TransactionRequestId, callContext: Option[CallContext]): Box[(TransactionRequest, Option[CallContext])] = TransactionRequests.transactionRequestProvider.vend.getTransactionRequest(transactionRequestId).map(transactionRequest => (transactionRequest, callContext)) - override def getTransactionRequestTypes(initiator: User, fromAccount: BankAccount, callContext: Option[CallContext]): Box[List[TransactionRequestType]] = { - Full(APIUtil.getPropsValue("transactionRequests_supported_types", "").split(",").map(x => TransactionRequestType(x)).toList) + override def getTransactionRequestTypes(initiator: User, fromAccount: BankAccount, callContext: Option[CallContext]):Box[(List[TransactionRequestType], Option[CallContext])] = { + Full((APIUtil.getPropsValue("transactionRequests_supported_types", "").split(",").map(x => TransactionRequestType(x)).toList, callContext)) } override def createTransactionAfterChallengeV210(fromAccount: BankAccount, transactionRequest: TransactionRequest, callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = { diff --git a/obp-api/src/main/scala/code/bankconnectors/akka/AkkaConnector_vDec2018.scala b/obp-api/src/main/scala/code/bankconnectors/akka/AkkaConnector_vDec2018.scala index abc29a4c0..61baf2bc3 100644 --- a/obp-api/src/main/scala/code/bankconnectors/akka/AkkaConnector_vDec2018.scala +++ b/obp-api/src/main/scala/code/bankconnectors/akka/AkkaConnector_vDec2018.scala @@ -1418,7 +1418,7 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { lastMarketingAgreementSignedDate=Some(toDate(dateExample)))) ), exampleInboundMessage = ( - InBoundGetPhysicalCardsForUser(status=MessageDocsSwaggerDefinitions.inboundStatus, + InBoundGetPhysicalCardsForUser(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( PhysicalCard(cardId=cardIdExample.value, bankId=bankIdExample.value, bankCardNumber=bankCardNumberExample.value, @@ -2739,12 +2739,13 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetProducts(bankId=BankId(bankIdExample.value), + OutBoundGetProducts(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), params=List( GetProductsParam(name=nameExample.value, value=valueExample.value.split("[,;]").toList))) ), exampleInboundMessage = ( - InBoundGetProducts(status=MessageDocsSwaggerDefinitions.inboundStatus, + InBoundGetProducts(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( ProductCommons(bankId=BankId(bankIdExample.value), code=ProductCode(productCodeExample.value), parentProductCode=ProductCode(parentProductCodeExample.value), @@ -2764,8 +2765,7 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { override def getProducts(bankId: BankId, params: List[GetProductsParam], callContext: Option[CallContext]): OBPReturnType[Box[List[Product]]] = { import com.openbankproject.commons.dto.{InBoundGetProducts => InBound, OutBoundGetProducts => OutBound} - val callContext: Option[CallContext] = None - val req = OutBound(bankId, params) + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull,bankId, params) val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) response.map(convertToTuple[List[ProductCommons]](callContext)) } @@ -2778,11 +2778,11 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetProduct(bankId=BankId(bankIdExample.value), + OutBoundGetProduct(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), productCode=ProductCode(productCodeExample.value)) ), exampleInboundMessage = ( - InBoundGetProduct(status=MessageDocsSwaggerDefinitions.inboundStatus, + InBoundGetProduct(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, status=MessageDocsSwaggerDefinitions.inboundStatus, data= ProductCommons(bankId=BankId(bankIdExample.value), code=ProductCode(productCodeExample.value), parentProductCode=ProductCode(parentProductCodeExample.value), @@ -2802,8 +2802,7 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { override def getProduct(bankId: BankId, productCode: ProductCode, callContext: Option[CallContext]): OBPReturnType[Box[Product]] = { import com.openbankproject.commons.dto.{InBoundGetProduct => InBound, OutBoundGetProduct => OutBound} - val callContext: Option[CallContext] = None - val req = OutBound(bankId, productCode) + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull,bankId, productCode) val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) response.map(convertToTuple[ProductCommons](callContext)) } @@ -3144,12 +3143,12 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetCurrentFxRate(bankId=BankId(bankIdExample.value), + OutBoundGetCurrentFxRate(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext,bankId=BankId(bankIdExample.value), fromCurrencyCode=fromCurrencyCodeExample.value, toCurrencyCode=toCurrencyCodeExample.value) ), exampleInboundMessage = ( - InBoundGetCurrentFxRate(status=MessageDocsSwaggerDefinitions.inboundStatus, + InBoundGetCurrentFxRate(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext,status=MessageDocsSwaggerDefinitions.inboundStatus, data= FXRateCommons(bankId=BankId(bankIdExample.value), fromCurrencyCode=fromCurrencyCodeExample.value, toCurrencyCode=toCurrencyCodeExample.value, @@ -3162,8 +3161,7 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { override def getCurrentFxRate(bankId: BankId, fromCurrencyCode: String, toCurrencyCode: String, callContext: Option[CallContext]): Box[FXRate] = { import com.openbankproject.commons.dto.{InBoundGetCurrentFxRate => InBound, OutBoundGetCurrentFxRate => OutBound} - val callContext: Option[CallContext] = None - val req = OutBound(bankId, fromCurrencyCode, toCurrencyCode) + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull,bankId, fromCurrencyCode, toCurrencyCode) val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) response.map(convertToTuple[FXRateCommons](callContext)) } diff --git a/obp-api/src/main/scala/code/bankconnectors/rabbitmq/Adapter/AdapterStubBuilder.scala b/obp-api/src/main/scala/code/bankconnectors/rabbitmq/Adapter/AdapterStubBuilder.scala index 98a57b8c1..48c228a20 100644 --- a/obp-api/src/main/scala/code/bankconnectors/rabbitmq/Adapter/AdapterStubBuilder.scala +++ b/obp-api/src/main/scala/code/bankconnectors/rabbitmq/Adapter/AdapterStubBuilder.scala @@ -43,7 +43,7 @@ object AdapterStubBuilder { val codeList = messageDocs //these are only for debugging. // .filterNot(_.process.equals("obp.getCustomers"))//getBanks is the template code, already in the code. -// .filter(_.process.equals("obp.getCustomers"))//getBanks is the template code, already in the code. +// .filter(_.process.equals("obp.validateAndCheckIbanNumber"))//getBanks is the template code, already in the code. // .take(80) // .slice(91,1000) .map( @@ -137,9 +137,7 @@ object AdapterStubBuilder { else null - val inboundAdapterCallContext = if(ConnectorBuilderUtil.specialMethods.contains(connectorMethodName) || - connectorMethodName == "getPhysicalCardsForUser" // this need to be check, InBoundGetPhysicalCardsForUser is missing inboundAdapterCallContext field. - ) + val inboundAdapterCallContext = if(ConnectorBuilderUtil.specialMethods.contains(connectorMethodName)) "" else """ diff --git a/obp-api/src/main/scala/code/bankconnectors/rabbitmq/Adapter/RPCServer.scala b/obp-api/src/main/scala/code/bankconnectors/rabbitmq/Adapter/RPCServer.scala index b59f63954..3d2aa85b6 100644 --- a/obp-api/src/main/scala/code/bankconnectors/rabbitmq/Adapter/RPCServer.scala +++ b/obp-api/src/main/scala/code/bankconnectors/rabbitmq/Adapter/RPCServer.scala @@ -1,7 +1,8 @@ package code.bankconnectors.rabbitmq.Adapter import bootstrap.liftweb.ToSchemify -import code.api.util.{APIUtil} +import code.api.util.APIUtil +import com.openbankproject.commons.ExecutionContext.Implicits.global import com.openbankproject.commons.dto._ import com.openbankproject.commons.model._ import com.rabbitmq.client.AMQP.BasicProperties @@ -9,10 +10,13 @@ import com.rabbitmq.client._ import net.liftweb.db.DB import net.liftweb.json import net.liftweb.json.Serialization.write -import net.liftweb.mapper.{Schemifier} +import net.liftweb.mapper.Schemifier + import scala.concurrent.Future import com.openbankproject.commons.ExecutionContext.Implicits.global +import java.util.Date + class ServerCallback(val ch: Channel) extends DeliverCallback { private implicit val formats = code.api.util.CustomJsonFormats.nullTolerateFormats @@ -69,1524 +73,8 @@ class ServerCallback(val ch: Channel) extends DeliverCallback { data = null )) } -// ---------- created on 2024-10-15T22:43:44Z - - } else if (obpMessageId.contains("get_adapter_info")) { - val outBound = json.parse(message).extract[OutBoundGetAdapterInfo] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getAdapterInfo(None).map(_.map(_._1).head) - - obpMappedResponse.map(response => InBoundGetAdapterInfo( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetAdapterInfo( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("validate_and_check_iban_number")) { - val outBound = json.parse(message).extract[OutBoundValidateAndCheckIbanNumber] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.validateAndCheckIbanNumber(outBound.iban,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundValidateAndCheckIbanNumber( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundValidateAndCheckIbanNumber( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_challenge_threshold")) { - val outBound = json.parse(message).extract[OutBoundGetChallengeThreshold] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getChallengeThreshold(outBound.bankId,outBound.accountId,outBound.viewId,outBound.transactionRequestType,outBound.currency,outBound.userId,outBound.username,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetChallengeThreshold( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetChallengeThreshold( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_charge_level")) { - val outBound = json.parse(message).extract[OutBoundGetChargeLevel] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getChargeLevel(outBound.bankId,outBound.accountId,outBound.viewId,outBound.userId,outBound.username,outBound.transactionRequestType,outBound.currency,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetChargeLevel( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetChargeLevel( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_charge_level_c2")) { - val outBound = json.parse(message).extract[OutBoundGetChargeLevelC2] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getChargeLevelC2(outBound.bankId,outBound.accountId,outBound.viewId,outBound.userId,outBound.username,outBound.transactionRequestType,outBound.currency,outBound.amount,outBound.toAccountRoutings,outBound.customAttributes,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetChargeLevelC2( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetChargeLevelC2( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("create_challenge")) { - val outBound = json.parse(message).extract[OutBoundCreateChallenge] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.createChallenge(outBound.bankId,outBound.accountId,outBound.userId,outBound.transactionRequestType,outBound.transactionRequestId,outBound.scaMethod,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundCreateChallenge( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundCreateChallenge( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("create_challenges")) { - val outBound = json.parse(message).extract[OutBoundCreateChallenges] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.createChallenges(outBound.bankId,outBound.accountId,outBound.userIds,outBound.transactionRequestType,outBound.transactionRequestId,outBound.scaMethod,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundCreateChallenges( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundCreateChallenges( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("create_challenges_c2")) { - val outBound = json.parse(message).extract[OutBoundCreateChallengesC2] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.createChallengesC2(outBound.userIds,outBound.challengeType,outBound.transactionRequestId,outBound.scaMethod,outBound.scaStatus,outBound.consentId,outBound.authenticationMethodId,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundCreateChallengesC2( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundCreateChallengesC2( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("create_challenges_c3")) { - val outBound = json.parse(message).extract[OutBoundCreateChallengesC3] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.createChallengesC3(outBound.userIds,outBound.challengeType,outBound.transactionRequestId,outBound.scaMethod,outBound.scaStatus,outBound.consentId,outBound.basketId,outBound.authenticationMethodId,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundCreateChallengesC3( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundCreateChallengesC3( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("validate_challenge_answer")) { - val outBound = json.parse(message).extract[OutBoundValidateChallengeAnswer] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.validateChallengeAnswer(outBound.challengeId,outBound.hashOfSuppliedAnswer,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundValidateChallengeAnswer( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundValidateChallengeAnswer( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = false - )) - } - } else if (obpMessageId.contains("validate_challenge_answer_v2")) { - val outBound = json.parse(message).extract[OutBoundValidateChallengeAnswerV2] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.validateChallengeAnswerV2(outBound.challengeId,outBound.suppliedAnswer,outBound.suppliedAnswerType,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundValidateChallengeAnswerV2( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundValidateChallengeAnswerV2( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = false - )) - } - } else if (obpMessageId.contains("validate_challenge_answer_c2")) { - val outBound = json.parse(message).extract[OutBoundValidateChallengeAnswerC2] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.validateChallengeAnswerC2(outBound.transactionRequestId,outBound.consentId,outBound.challengeId,outBound.hashOfSuppliedAnswer,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundValidateChallengeAnswerC2( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundValidateChallengeAnswerC2( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("validate_challenge_answer_c3")) { - val outBound = json.parse(message).extract[OutBoundValidateChallengeAnswerC3] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.validateChallengeAnswerC3(outBound.transactionRequestId,outBound.consentId,outBound.basketId,outBound.challengeId,outBound.hashOfSuppliedAnswer,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundValidateChallengeAnswerC3( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundValidateChallengeAnswerC3( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("validate_challenge_answer_c4")) { - val outBound = json.parse(message).extract[OutBoundValidateChallengeAnswerC4] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.validateChallengeAnswerC4(outBound.transactionRequestId,outBound.consentId,outBound.challengeId,outBound.suppliedAnswer,outBound.suppliedAnswerType,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundValidateChallengeAnswerC4( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundValidateChallengeAnswerC4( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("validate_challenge_answer_c5")) { - val outBound = json.parse(message).extract[OutBoundValidateChallengeAnswerC5] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.validateChallengeAnswerC5(outBound.transactionRequestId,outBound.consentId,outBound.basketId,outBound.challengeId,outBound.suppliedAnswer,outBound.suppliedAnswerType,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundValidateChallengeAnswerC5( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundValidateChallengeAnswerC5( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_challenges_by_transaction_request_id")) { - val outBound = json.parse(message).extract[OutBoundGetChallengesByTransactionRequestId] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getChallengesByTransactionRequestId(outBound.transactionRequestId,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetChallengesByTransactionRequestId( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetChallengesByTransactionRequestId( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_challenges_by_consent_id")) { - val outBound = json.parse(message).extract[OutBoundGetChallengesByConsentId] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getChallengesByConsentId(outBound.consentId,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetChallengesByConsentId( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetChallengesByConsentId( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_challenges_by_basket_id")) { - val outBound = json.parse(message).extract[OutBoundGetChallengesByBasketId] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getChallengesByBasketId(outBound.basketId,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetChallengesByBasketId( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetChallengesByBasketId( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_challenge")) { - val outBound = json.parse(message).extract[OutBoundGetChallenge] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getChallenge(outBound.challengeId,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetChallenge( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetChallenge( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_bank")) { - val outBound = json.parse(message).extract[OutBoundGetBank] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getBank(outBound.bankId,None).map(_.map(_._1).head) - - obpMappedResponse.map(response => InBoundGetBank( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetBank( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_banks")) { - val outBound = json.parse(message).extract[OutBoundGetBanks] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getBanks(None).map(_.map(_._1).head) - - obpMappedResponse.map(response => InBoundGetBanks( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetBanks( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_bank_accounts_for_user")) { - val outBound = json.parse(message).extract[OutBoundGetBankAccountsForUser] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getBankAccountsForUser(outBound.provider,outBound.username,None).map(_.map(_._1).head) - - obpMappedResponse.map(response => InBoundGetBankAccountsForUser( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetBankAccountsForUser( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_bank_account_by_iban")) { - val outBound = json.parse(message).extract[OutBoundGetBankAccountByIban] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getBankAccountByIban(outBound.iban,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetBankAccountByIban( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetBankAccountByIban( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_bank_account_by_routing")) { - val outBound = json.parse(message).extract[OutBoundGetBankAccountByRouting] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getBankAccountByRouting(outBound.bankId,outBound.scheme,outBound.address,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetBankAccountByRouting( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetBankAccountByRouting( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_bank_accounts")) { - val outBound = json.parse(message).extract[OutBoundGetBankAccounts] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getBankAccounts(outBound.bankIdAccountIds,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetBankAccounts( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetBankAccounts( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_bank_accounts_balances")) { - val outBound = json.parse(message).extract[OutBoundGetBankAccountsBalances] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getBankAccountsBalances(outBound.bankIdAccountIds,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetBankAccountsBalances( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetBankAccountsBalances( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_bank_account_balances")) { - val outBound = json.parse(message).extract[OutBoundGetBankAccountBalances] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getBankAccountBalances(outBound.bankIdAccountId,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetBankAccountBalances( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetBankAccountBalances( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_core_bank_accounts")) { - val outBound = json.parse(message).extract[OutBoundGetCoreBankAccounts] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getCoreBankAccounts(outBound.bankIdAccountIds,None).map(_.map(_._1).head) - - obpMappedResponse.map(response => InBoundGetCoreBankAccounts( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetCoreBankAccounts( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_bank_accounts_held")) { - val outBound = json.parse(message).extract[OutBoundGetBankAccountsHeld] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getBankAccountsHeld(outBound.bankIdAccountIds,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetBankAccountsHeld( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetBankAccountsHeld( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("check_bank_account_exists")) { - val outBound = json.parse(message).extract[OutBoundCheckBankAccountExists] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.checkBankAccountExists(outBound.bankId,outBound.accountId,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundCheckBankAccountExists( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundCheckBankAccountExists( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_counterparty_trait")) { - val outBound = json.parse(message).extract[OutBoundGetCounterpartyTrait] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getCounterpartyTrait(outBound.bankId,outBound.accountId,outBound.couterpartyId,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetCounterpartyTrait( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetCounterpartyTrait( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_counterparty_by_counterparty_id")) { - val outBound = json.parse(message).extract[OutBoundGetCounterpartyByCounterpartyId] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getCounterpartyByCounterpartyId(outBound.counterpartyId,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetCounterpartyByCounterpartyId( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetCounterpartyByCounterpartyId( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_counterparty_by_iban")) { - val outBound = json.parse(message).extract[OutBoundGetCounterpartyByIban] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getCounterpartyByIban(outBound.iban,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetCounterpartyByIban( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetCounterpartyByIban( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_counterparty_by_iban_and_bank_account_id")) { - val outBound = json.parse(message).extract[OutBoundGetCounterpartyByIbanAndBankAccountId] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getCounterpartyByIbanAndBankAccountId(outBound.iban,outBound.bankId,outBound.accountId,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetCounterpartyByIbanAndBankAccountId( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetCounterpartyByIbanAndBankAccountId( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_counterparties")) { - val outBound = json.parse(message).extract[OutBoundGetCounterparties] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getCounterparties(outBound.thisBankId,outBound.thisAccountId,outBound.viewId,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetCounterparties( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetCounterparties( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_transactions")) { - val outBound = json.parse(message).extract[OutBoundGetTransactions] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getTransactions(outBound.bankId,outBound.accountId,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetTransactions( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetTransactions( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_transactions_core")) { - val outBound = json.parse(message).extract[OutBoundGetTransactionsCore] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getTransactionsCore(outBound.bankId,outBound.accountId,Nil,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetTransactionsCore( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetTransactionsCore( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_transaction")) { - val outBound = json.parse(message).extract[OutBoundGetTransaction] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getTransaction(outBound.bankId,outBound.accountId,outBound.transactionId,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetTransaction( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetTransaction( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_physical_cards_for_user")) { - val outBound = json.parse(message).extract[OutBoundGetPhysicalCardsForUser] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getPhysicalCardsForUser(outBound.user,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetPhysicalCardsForUser( - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetPhysicalCardsForUser( - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_physical_card_for_bank")) { - val outBound = json.parse(message).extract[OutBoundGetPhysicalCardForBank] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getPhysicalCardForBank(outBound.bankId,outBound.cardId,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetPhysicalCardForBank( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetPhysicalCardForBank( - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } -// ---------- created on 2024-10-15T22:43:44Z -// ---------- created on 2024-10-16T07:56:58Z - - } else if (obpMessageId.contains("get_physical_cards_for_bank")) { - val outBound = json.parse(message).extract[OutBoundGetPhysicalCardsForBank] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getPhysicalCardsForBank(outBound.bank,outBound.user,Nil,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetPhysicalCardsForBank( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response.asInstanceOf[List[PhysicalCard]] - )).recoverWith { - case e: Exception => Future(InBoundGetPhysicalCardsForBank( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("create_physical_card")) { - val outBound = json.parse(message).extract[OutBoundCreatePhysicalCard] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.createPhysicalCard(outBound.bankCardNumber,outBound.nameOnCard,outBound.cardType,outBound.issueNumber,outBound.serialNumber,outBound.validFrom,outBound.expires,outBound.enabled,outBound.cancelled,outBound.onHotList,outBound.technology,outBound.networks,outBound.allows,outBound.accountId,outBound.bankId,outBound.replacement,outBound.pinResets,outBound.collected,outBound.posted,outBound.customerId,outBound.cvv,outBound.brand,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundCreatePhysicalCard( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response.asInstanceOf[PhysicalCard] - )).recoverWith { - case e: Exception => Future(InBoundCreatePhysicalCard( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("update_physical_card")) { - val outBound = json.parse(message).extract[OutBoundUpdatePhysicalCard] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.updatePhysicalCard(outBound.cardId,outBound.bankCardNumber,outBound.nameOnCard,outBound.cardType,outBound.issueNumber,outBound.serialNumber,outBound.validFrom,outBound.expires,outBound.enabled,outBound.cancelled,outBound.onHotList,outBound.technology,outBound.networks,outBound.allows,outBound.accountId,outBound.bankId,outBound.replacement,outBound.pinResets,outBound.collected,outBound.posted,outBound.customerId,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundUpdatePhysicalCard( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response.asInstanceOf[PhysicalCard] - )).recoverWith { - case e: Exception => Future(InBoundUpdatePhysicalCard( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("make_paymentv210")) { - val outBound = json.parse(message).extract[OutBoundMakePaymentv210] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.makePaymentv210(outBound.fromAccount,outBound.toAccount,outBound.transactionRequestId,outBound.transactionRequestCommonBody,outBound.amount,outBound.description,outBound.transactionRequestType,outBound.chargePolicy,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundMakePaymentv210( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundMakePaymentv210( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("create_transaction_requestv210")) { - val outBound = json.parse(message).extract[OutBoundCreateTransactionRequestv210] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.createTransactionRequestv210(outBound.initiator,outBound.viewId,outBound.fromAccount,outBound.toAccount,outBound.transactionRequestType,outBound.transactionRequestCommonBody,outBound.detailsPlain,outBound.chargePolicy,outBound.challengeType,outBound.scaMethod,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundCreateTransactionRequestv210( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundCreateTransactionRequestv210( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("create_transaction_requestv400")) { - val outBound = json.parse(message).extract[OutBoundCreateTransactionRequestv400] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.createTransactionRequestv400(outBound.initiator,outBound.viewId,outBound.fromAccount,outBound.toAccount,outBound.transactionRequestType,outBound.transactionRequestCommonBody,outBound.detailsPlain,outBound.chargePolicy,outBound.challengeType,outBound.scaMethod,outBound.reasons,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundCreateTransactionRequestv400( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundCreateTransactionRequestv400( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("create_transaction_request_sepa_credit_transfers_bgv1")) { - val outBound = json.parse(message).extract[OutBoundCreateTransactionRequestSepaCreditTransfersBGV1] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.createTransactionRequestSepaCreditTransfersBGV1(outBound.initiator,outBound.paymentServiceType,outBound.transactionRequestType,outBound.transactionRequestBody,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundCreateTransactionRequestSepaCreditTransfersBGV1( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundCreateTransactionRequestSepaCreditTransfersBGV1( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("create_transaction_request_periodic_sepa_credit_transfers_bgv1")) { - val outBound = json.parse(message).extract[OutBoundCreateTransactionRequestPeriodicSepaCreditTransfersBGV1] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.createTransactionRequestPeriodicSepaCreditTransfersBGV1(outBound.initiator,outBound.paymentServiceType,outBound.transactionRequestType,outBound.transactionRequestBody,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundCreateTransactionRequestPeriodicSepaCreditTransfersBGV1( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundCreateTransactionRequestPeriodicSepaCreditTransfersBGV1( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_transaction_requests210")) { - val outBound = json.parse(message).extract[OutBoundGetTransactionRequests210] - val obpMappedResponse = Future{code.bankconnectors.LocalMappedConnector.getTransactionRequests210(outBound.initiator,outBound.fromAccount,None).map(_._1).head} - - obpMappedResponse.map(response => InBoundGetTransactionRequests210( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetTransactionRequests210( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } -// ---------- created on 2024-10-16T07:56:58Z -// ---------- created on 2024-10-16T08:22:03Z - - } else if (obpMessageId.contains("create_transaction_after_challenge_v210")) { - val outBound = json.parse(message).extract[OutBoundCreateTransactionAfterChallengeV210] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.createTransactionAfterChallengeV210(outBound.fromAccount,outBound.transactionRequest,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundCreateTransactionAfterChallengeV210( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundCreateTransactionAfterChallengeV210( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("update_bank_account")) { - val outBound = json.parse(message).extract[OutBoundUpdateBankAccount] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.updateBankAccount(outBound.bankId,outBound.accountId,outBound.accountType,outBound.accountLabel,outBound.branchId,outBound.accountRoutings,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundUpdateBankAccount( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundUpdateBankAccount( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("create_bank_account")) { - val outBound = json.parse(message).extract[OutBoundCreateBankAccount] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.createBankAccount(outBound.bankId,outBound.accountId,outBound.accountType,outBound.accountLabel,outBound.currency,outBound.initialBalance,outBound.accountHolderName,outBound.branchId,outBound.accountRoutings,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundCreateBankAccount( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundCreateBankAccount( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_products")) { - val outBound = json.parse(message).extract[OutBoundGetProducts] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getProducts(outBound.bankId,outBound.params, None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetProducts( - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetProducts( - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_product")) { - val outBound = json.parse(message).extract[OutBoundGetProduct] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getProduct(outBound.bankId,outBound.productCode, None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetProduct( - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetProduct( - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_branch")) { - val outBound = json.parse(message).extract[OutBoundGetBranch] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getBranch(outBound.bankId,outBound.branchId,None).map(_.map(_._1).head) - - obpMappedResponse.map(response => InBoundGetBranch( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetBranch( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_branches")) { - val outBound = json.parse(message).extract[OutBoundGetBranches] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getBranches(outBound.bankId,None).map(_.map(_._1).head) - - obpMappedResponse.map(response => InBoundGetBranches( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetBranches( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_atm")) { - val outBound = json.parse(message).extract[OutBoundGetAtm] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getAtm(outBound.bankId,outBound.atmId,None).map(_.map(_._1).head) - - obpMappedResponse.map(response => InBoundGetAtm( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetAtm( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_atms")) { - val outBound = json.parse(message).extract[OutBoundGetAtms] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getAtms(outBound.bankId,None).map(_.map(_._1).head) - - obpMappedResponse.map(response => InBoundGetAtms( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetAtms( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_current_fx_rate")) { - val outBound = json.parse(message).extract[OutBoundGetCurrentFxRate] - val obpMappedResponse = Future{code.bankconnectors.LocalMappedConnector.getCurrentFxRate(outBound.bankId,outBound.fromCurrencyCode,outBound.toCurrencyCode, None).head} - - obpMappedResponse.map(response => InBoundGetCurrentFxRate( - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetCurrentFxRate( - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("create_transaction_after_challengev300")) { - val outBound = json.parse(message).extract[OutBoundCreateTransactionAfterChallengev300] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.createTransactionAfterChallengev300(outBound.initiator,outBound.fromAccount,outBound.transReqId,outBound.transactionRequestType,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundCreateTransactionAfterChallengev300( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundCreateTransactionAfterChallengev300( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("make_paymentv300")) { - val outBound = json.parse(message).extract[OutBoundMakePaymentv300] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.makePaymentv300(outBound.initiator,outBound.fromAccount,outBound.toAccount,outBound.toCounterparty,outBound.transactionRequestCommonBody,outBound.transactionRequestType,outBound.chargePolicy,None).map(_.map(_._1).head) - - obpMappedResponse.map(response => InBoundMakePaymentv300( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundMakePaymentv300( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("create_transaction_requestv300")) { - val outBound = json.parse(message).extract[OutBoundCreateTransactionRequestv300] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.createTransactionRequestv300(outBound.initiator,outBound.viewId,outBound.fromAccount,outBound.toAccount,outBound.toCounterparty,outBound.transactionRequestType,outBound.transactionRequestCommonBody,outBound.detailsPlain,outBound.chargePolicy,None).map(_.map(_._1).head) - - obpMappedResponse.map(response => InBoundCreateTransactionRequestv300( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundCreateTransactionRequestv300( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("make_payment_v400")) { - val outBound = json.parse(message).extract[OutBoundMakePaymentV400] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.makePaymentV400(outBound.transactionRequest,outBound.reasons,None).map(_.map(_._1).head) - - obpMappedResponse.map(response => InBoundMakePaymentV400( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundMakePaymentV400( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("cancel_payment_v400")) { - val outBound = json.parse(message).extract[OutBoundCancelPaymentV400] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.cancelPaymentV400(outBound.transactionId,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundCancelPaymentV400( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundCancelPaymentV400( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("create_counterparty")) { - val outBound = json.parse(message).extract[OutBoundCreateCounterparty] - val obpMappedResponse = Future{code.bankconnectors.LocalMappedConnector.createCounterparty(outBound.name,outBound.description,outBound.currency,outBound.createdByUserId,outBound.thisBankId,outBound.thisAccountId,outBound.thisViewId,outBound.otherAccountRoutingScheme,outBound.otherAccountRoutingAddress,outBound.otherAccountSecondaryRoutingScheme,outBound.otherAccountSecondaryRoutingAddress,outBound.otherBankRoutingScheme,outBound.otherBankRoutingAddress,outBound.otherBranchRoutingScheme,outBound.otherBranchRoutingAddress,outBound.isBeneficiary,outBound.bespoke,None).map(_._1).head} - - obpMappedResponse.map(response => InBoundCreateCounterparty( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundCreateCounterparty( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("check_customer_number_available")) { - val outBound = json.parse(message).extract[OutBoundCheckCustomerNumberAvailable] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.checkCustomerNumberAvailable(outBound.bankId,outBound.customerNumber,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundCheckCustomerNumberAvailable( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundCheckCustomerNumberAvailable( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = false - )) - } - } else if (obpMessageId.contains("create_customer")) { - val outBound = json.parse(message).extract[OutBoundCreateCustomer] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.createCustomer(outBound.bankId,outBound.legalName,outBound.mobileNumber,outBound.email,outBound.faceImage,outBound.dateOfBirth,outBound.relationshipStatus,outBound.dependents,outBound.dobOfDependents,outBound.highestEducationAttained,outBound.employmentStatus,outBound.kycStatus,outBound.lastOkDate,outBound.creditRating,outBound.creditLimit,outBound.title,outBound.branchId,outBound.nameSuffix,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundCreateCustomer( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundCreateCustomer( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("update_customer_sca_data")) { - val outBound = json.parse(message).extract[OutBoundUpdateCustomerScaData] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.updateCustomerScaData(outBound.customerId,outBound.mobileNumber,outBound.email,outBound.customerNumber,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundUpdateCustomerScaData( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundUpdateCustomerScaData( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("update_customer_credit_data")) { - val outBound = json.parse(message).extract[OutBoundUpdateCustomerCreditData] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.updateCustomerCreditData(outBound.customerId,outBound.creditRating,outBound.creditSource,outBound.creditLimit,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundUpdateCustomerCreditData( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundUpdateCustomerCreditData( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("update_customer_general_data")) { - val outBound = json.parse(message).extract[OutBoundUpdateCustomerGeneralData] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.updateCustomerGeneralData(outBound.customerId,outBound.legalName,outBound.faceImage,outBound.dateOfBirth,outBound.relationshipStatus,outBound.dependents,outBound.highestEducationAttained,outBound.employmentStatus,outBound.title,outBound.branchId,outBound.nameSuffix,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundUpdateCustomerGeneralData( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundUpdateCustomerGeneralData( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_customers_by_user_id")) { - val outBound = json.parse(message).extract[OutBoundGetCustomersByUserId] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getCustomersByUserId(outBound.userId,None).map(_.map(_._1).head) - - obpMappedResponse.map(response => InBoundGetCustomersByUserId( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetCustomersByUserId( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_customer_by_customer_id")) { - val outBound = json.parse(message).extract[OutBoundGetCustomerByCustomerId] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getCustomerByCustomerId(outBound.customerId,None).map(_.map(_._1).head) - - obpMappedResponse.map(response => InBoundGetCustomerByCustomerId( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetCustomerByCustomerId( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_customer_by_customer_number")) { - val outBound = json.parse(message).extract[OutBoundGetCustomerByCustomerNumber] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getCustomerByCustomerNumber(outBound.customerNumber,outBound.bankId,None).map(_.map(_._1).head) - - obpMappedResponse.map(response => InBoundGetCustomerByCustomerNumber( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetCustomerByCustomerNumber( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("get_customer_address")) { - val outBound = json.parse(message).extract[OutBoundGetCustomerAddress] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getCustomerAddress(outBound.customerId,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundGetCustomerAddress( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetCustomerAddress( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("create_customer_address")) { - val outBound = json.parse(message).extract[OutBoundCreateCustomerAddress] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.createCustomerAddress(outBound.customerId,outBound.line1,outBound.line2,outBound.line3,outBound.city,outBound.county,outBound.state,outBound.postcode,outBound.countryCode,outBound.tags,outBound.status,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundCreateCustomerAddress( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundCreateCustomerAddress( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("update_customer_address")) { - val outBound = json.parse(message).extract[OutBoundUpdateCustomerAddress] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.updateCustomerAddress(outBound.customerAddressId,outBound.line1,outBound.line2,outBound.line3,outBound.city,outBound.county,outBound.state,outBound.postcode,outBound.countryCode,outBound.tags,outBound.status,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundUpdateCustomerAddress( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundUpdateCustomerAddress( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("delete_customer_address")) { - val outBound = json.parse(message).extract[OutBoundDeleteCustomerAddress] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.deleteCustomerAddress(outBound.customerAddressId,None).map(_._1.head) - - obpMappedResponse.map(response => InBoundDeleteCustomerAddress( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundDeleteCustomerAddress( - - inboundAdapterCallContext = InboundAdapterCallContext( - correlationId = outBound.outboundAdapterCallContext.correlationId - ), - status = Status(e.getMessage, Nil), - data = false - )) - } -// ---------- created on 2024-10-16T08:22:03Z //---------------- dynamic start -------------------please don't modify this line -// ---------- created on 2024-10-16T11:04:23Z +// ---------- created on 2024-10-28T12:26:57Z } else if (obpMessageId.contains("get_adapter_info")) { val outBound = json.parse(message).extract[OutBoundGetAdapterInfo] @@ -1598,8 +86,14 @@ class ServerCallback(val ch: Channel) extends DeliverCallback { correlationId = outBound.outboundAdapterCallContext.correlationId ), status = Status("", Nil), - data = response - )).recoverWith { + data = InboundAdapterInfoInternal( + errorCode = "", + backendMessages = Nil, + name ="RABBITMQ", + version ="rabbitmq_vOct2024", + git_commit ="", + date = (new Date()).toString + ))).recoverWith { case e: Exception => Future(InBoundGetAdapterInfo( inboundAdapterCallContext = InboundAdapterCallContext( @@ -2390,11 +884,19 @@ class ServerCallback(val ch: Channel) extends DeliverCallback { val outBound = json.parse(message).extract[OutBoundGetPhysicalCardsForUser] val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getPhysicalCardsForUser(outBound.user,None).map(_._1.head) - obpMappedResponse.map(response => InBoundGetPhysicalCardsForUser( + obpMappedResponse.map(response => InBoundGetPhysicalCardsForUser( + + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), status = Status("", Nil), data = response )).recoverWith { - case e: Exception => Future(InBoundGetPhysicalCardsForUser( + case e: Exception => Future(InBoundGetPhysicalCardsForUser( + + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), status = Status(e.getMessage, Nil), data = null )) @@ -2518,6 +1020,27 @@ class ServerCallback(val ch: Channel) extends DeliverCallback { )).recoverWith { case e: Exception => Future(InBoundMakePaymentv210( + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), + status = Status(e.getMessage, Nil), + data = null + )) + } + } else if (obpMessageId.contains("get_charge_value")) { + val outBound = json.parse(message).extract[OutBoundGetChargeValue] + val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getChargeValue(outBound.chargeLevelAmount,outBound.transactionRequestCommonBodyAmount,None).map(_._1.head) + + obpMappedResponse.map(response => InBoundGetChargeValue( + + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), + status = Status("", Nil), + data = response + )).recoverWith { + case e: Exception => Future(InBoundGetChargeValue( + inboundAdapterCallContext = InboundAdapterCallContext( correlationId = outBound.outboundAdapterCallContext.correlationId ), @@ -2609,6 +1132,69 @@ class ServerCallback(val ch: Channel) extends DeliverCallback { data = null )) } + } else if (obpMessageId.contains("save_transaction_request_transaction")) { + val outBound = json.parse(message).extract[OutBoundSaveTransactionRequestTransaction] + val obpMappedResponse = code.bankconnectors.LocalMappedConnector.saveTransactionRequestTransaction(outBound.transactionRequestId,outBound.transactionId,None).map(_._1.head) + + obpMappedResponse.map(response => InBoundSaveTransactionRequestTransaction( + + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), + status = Status("", Nil), + data = response + )).recoverWith { + case e: Exception => Future(InBoundSaveTransactionRequestTransaction( + + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), + status = Status(e.getMessage, Nil), + data = false + )) + } + } else if (obpMessageId.contains("save_transaction_request_challenge")) { + val outBound = json.parse(message).extract[OutBoundSaveTransactionRequestChallenge] + val obpMappedResponse = code.bankconnectors.LocalMappedConnector.saveTransactionRequestChallenge(outBound.transactionRequestId,outBound.challenge,None).map(_._1.head) + + obpMappedResponse.map(response => InBoundSaveTransactionRequestChallenge( + + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), + status = Status("", Nil), + data = response + )).recoverWith { + case e: Exception => Future(InBoundSaveTransactionRequestChallenge( + + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), + status = Status(e.getMessage, Nil), + data = false + )) + } + } else if (obpMessageId.contains("save_transaction_request_status_impl")) { + val outBound = json.parse(message).extract[OutBoundSaveTransactionRequestStatusImpl] + val obpMappedResponse = code.bankconnectors.LocalMappedConnector.saveTransactionRequestStatusImpl(outBound.transactionRequestId,outBound.status,None).map(_._1.head) + + obpMappedResponse.map(response => InBoundSaveTransactionRequestStatusImpl( + + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), + status = Status("", Nil), + data = response + )).recoverWith { + case e: Exception => Future(InBoundSaveTransactionRequestStatusImpl( + + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), + status = Status(e.getMessage, Nil), + data = false + )) + } } else if (obpMessageId.contains("get_transaction_requests210")) { val outBound = json.parse(message).extract[OutBoundGetTransactionRequests210] val obpMappedResponse = Future{code.bankconnectors.LocalMappedConnector.getTransactionRequests210(outBound.initiator,outBound.fromAccount,None).map(_._1).head} @@ -2714,28 +1300,65 @@ class ServerCallback(val ch: Channel) extends DeliverCallback { data = null )) } - } else if (obpMessageId.contains("get_products")) { - val outBound = json.parse(message).extract[OutBoundGetProducts] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getProducts(outBound.bankId,outBound.params, None).map(_._1.head) + } else if (obpMessageId.contains("update_account_label")) { + val outBound = json.parse(message).extract[OutBoundUpdateAccountLabel] + val obpMappedResponse = code.bankconnectors.LocalMappedConnector.updateAccountLabel(outBound.bankId,outBound.accountId,outBound.label,None).map(_._1.head) - obpMappedResponse.map(response => InBoundGetProducts( + obpMappedResponse.map(response => InBoundUpdateAccountLabel( + + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), status = Status("", Nil), data = response )).recoverWith { - case e: Exception => Future(InBoundGetProducts( + case e: Exception => Future(InBoundUpdateAccountLabel( + + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), + status = Status(e.getMessage, Nil), + data = false + )) + } + } else if (obpMessageId.contains("get_products")) { + val outBound = json.parse(message).extract[OutBoundGetProducts] + val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getProducts(outBound.bankId,outBound.params,None).map(_._1.head) + + obpMappedResponse.map(response => InBoundGetProducts( + + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), + status = Status("", Nil), + data = response + )).recoverWith { + case e: Exception => Future(InBoundGetProducts( + + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), status = Status(e.getMessage, Nil), data = null )) } } else if (obpMessageId.contains("get_product")) { val outBound = json.parse(message).extract[OutBoundGetProduct] - val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getProduct(outBound.bankId,outBound.productCode, None).map(_._1.head) + val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getProduct(outBound.bankId,outBound.productCode,None).map(_._1.head) - obpMappedResponse.map(response => InBoundGetProduct( + obpMappedResponse.map(response => InBoundGetProduct( + + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), status = Status("", Nil), data = response )).recoverWith { - case e: Exception => Future(InBoundGetProduct( + case e: Exception => Future(InBoundGetProduct( + + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), status = Status(e.getMessage, Nil), data = null )) @@ -2824,20 +1447,7 @@ class ServerCallback(val ch: Channel) extends DeliverCallback { data = null )) } - } else if (obpMessageId.contains("get_current_fx_rate")) { - val outBound = json.parse(message).extract[OutBoundGetCurrentFxRate] - val obpMappedResponse = Future{code.bankconnectors.LocalMappedConnector.getCurrentFxRate(outBound.bankId,outBound.fromCurrencyCode,outBound.toCurrencyCode, None).head} - - obpMappedResponse.map(response => InBoundGetCurrentFxRate( - status = Status("", Nil), - data = response - )).recoverWith { - case e: Exception => Future(InBoundGetCurrentFxRate( - status = Status(e.getMessage, Nil), - data = null - )) - } - } else if (obpMessageId.contains("create_transaction_after_challengev300")) { + } else if (obpMessageId.contains("create_transaction_after_challengev300")) { val outBound = json.parse(message).extract[OutBoundCreateTransactionAfterChallengev300] val obpMappedResponse = code.bankconnectors.LocalMappedConnector.createTransactionAfterChallengev300(outBound.initiator,outBound.fromAccount,outBound.transReqId,outBound.transactionRequestType,None).map(_._1.head) @@ -2935,6 +1545,27 @@ class ServerCallback(val ch: Channel) extends DeliverCallback { )).recoverWith { case e: Exception => Future(InBoundCancelPaymentV400( + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), + status = Status(e.getMessage, Nil), + data = null + )) + } + } else if (obpMessageId.contains("get_transaction_request_type_charges")) { + val outBound = json.parse(message).extract[OutBoundGetTransactionRequestTypeCharges] + val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getTransactionRequestTypeCharges(outBound.bankId,outBound.accountId,outBound.viewId,outBound.transactionRequestTypes,None).map(_._1.head) + + obpMappedResponse.map(response => InBoundGetTransactionRequestTypeCharges( + + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), + status = Status("", Nil), + data = response + )).recoverWith { + case e: Exception => Future(InBoundGetTransactionRequestTypeCharges( + inboundAdapterCallContext = InboundAdapterCallContext( correlationId = outBound.outboundAdapterCallContext.correlationId ), @@ -4412,8 +3043,8 @@ class ServerCallback(val ch: Channel) extends DeliverCallback { data = null )) } -// ---------- created on 2024-10-16T11:04:23Z -//---------------- dynamic end ---------------------please don't modify this line +// ---------- created on 2024-10-28T12:26:57Z +//---------------- dynamic end ---------------------please don't modify this line } else { Future { 1 diff --git a/obp-api/src/main/scala/code/bankconnectors/rabbitmq/RabbitMQConnector_vOct2024.scala b/obp-api/src/main/scala/code/bankconnectors/rabbitmq/RabbitMQConnector_vOct2024.scala index 1a84ca035..2f39c0148 100644 --- a/obp-api/src/main/scala/code/bankconnectors/rabbitmq/RabbitMQConnector_vOct2024.scala +++ b/obp-api/src/main/scala/code/bankconnectors/rabbitmq/RabbitMQConnector_vOct2024.scala @@ -73,7 +73,7 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable { val connectorName = "rabbitmq_vOct2024" //---------------- dynamic start -------------------please don't modify this line -// ---------- created on 2024-10-16T00:14:34Z +// ---------- created on 2024-10-28T12:32:40Z messageDocs += getAdapterInfoDoc def getAdapterInfoDoc = MessageDoc( @@ -1650,7 +1650,8 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable { lastMarketingAgreementSignedDate=Some(toDate(dateExample)))) ), exampleInboundMessage = ( - InBoundGetPhysicalCardsForUser(status=MessageDocsSwaggerDefinitions.inboundStatus, + InBoundGetPhysicalCardsForUser(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( PhysicalCard(cardId=cardIdExample.value, bankId=bankIdExample.value, bankCardNumber=bankCardNumberExample.value, @@ -2136,6 +2137,33 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable { response.map(convertToTuple[TransactionId](callContext)) } + messageDocs += getChargeValueDoc + def getChargeValueDoc = MessageDoc( + process = "obp.getChargeValue", + messageFormat = messageFormat, + description = "Get Charge Value", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetChargeValue(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + chargeLevelAmount=BigDecimal("123.321"), + transactionRequestCommonBodyAmount=BigDecimal("123.321")) + ), + exampleInboundMessage = ( + InBoundGetChargeValue(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data="string") + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getChargeValue(chargeLevelAmount: BigDecimal, transactionRequestCommonBodyAmount: BigDecimal, callContext: Option[CallContext]): OBPReturnType[Box[String]] = { + import com.openbankproject.commons.dto.{InBoundGetChargeValue => InBound, OutBoundGetChargeValue => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, chargeLevelAmount, transactionRequestCommonBodyAmount) + val response: Future[Box[InBound]] = sendRequest[InBound]("obp_get_charge_value", req, callContext) + response.map(convertToTuple[String](callContext)) + } + messageDocs += createTransactionRequestv210Doc def createTransactionRequestv210Doc = MessageDoc( process = "obp.createTransactionRequestv210", @@ -2592,6 +2620,89 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable { response.map(convertToTuple[TransactionRequestBGV1](callContext)) } + messageDocs += saveTransactionRequestTransactionDoc + def saveTransactionRequestTransactionDoc = MessageDoc( + process = "obp.saveTransactionRequestTransaction", + messageFormat = messageFormat, + description = "Save Transaction Request Transaction", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundSaveTransactionRequestTransaction(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + transactionRequestId=TransactionRequestId(transactionRequestIdExample.value), + transactionId=TransactionId(transactionIdExample.value)) + ), + exampleInboundMessage = ( + InBoundSaveTransactionRequestTransaction(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=true) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def saveTransactionRequestTransaction(transactionRequestId: TransactionRequestId, transactionId: TransactionId, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { + import com.openbankproject.commons.dto.{InBoundSaveTransactionRequestTransaction => InBound, OutBoundSaveTransactionRequestTransaction => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, transactionRequestId, transactionId) + val response: Future[Box[InBound]] = sendRequest[InBound]("obp_save_transaction_request_transaction", req, callContext) + response.map(convertToTuple[Boolean](callContext)) + } + + messageDocs += saveTransactionRequestChallengeDoc + def saveTransactionRequestChallengeDoc = MessageDoc( + process = "obp.saveTransactionRequestChallenge", + messageFormat = messageFormat, + description = "Save Transaction Request Challenge", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundSaveTransactionRequestChallenge(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + transactionRequestId=TransactionRequestId(transactionRequestIdExample.value), + challenge= TransactionRequestChallenge(id=challengeIdExample.value, + allowed_attempts=123, + challenge_type="string")) + ), + exampleInboundMessage = ( + InBoundSaveTransactionRequestChallenge(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=true) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def saveTransactionRequestChallenge(transactionRequestId: TransactionRequestId, challenge: TransactionRequestChallenge, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { + import com.openbankproject.commons.dto.{InBoundSaveTransactionRequestChallenge => InBound, OutBoundSaveTransactionRequestChallenge => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, transactionRequestId, challenge) + val response: Future[Box[InBound]] = sendRequest[InBound]("obp_save_transaction_request_challenge", req, callContext) + response.map(convertToTuple[Boolean](callContext)) + } + + messageDocs += saveTransactionRequestStatusImplDoc + def saveTransactionRequestStatusImplDoc = MessageDoc( + process = "obp.saveTransactionRequestStatusImpl", + messageFormat = messageFormat, + description = "Save Transaction Request Status Impl", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundSaveTransactionRequestStatusImpl(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + transactionRequestId=TransactionRequestId(transactionRequestIdExample.value), + status=statusExample.value) + ), + exampleInboundMessage = ( + InBoundSaveTransactionRequestStatusImpl(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=true) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def saveTransactionRequestStatusImpl(transactionRequestId: TransactionRequestId, status: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { + import com.openbankproject.commons.dto.{InBoundSaveTransactionRequestStatusImpl => InBound, OutBoundSaveTransactionRequestStatusImpl => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, transactionRequestId, status) + val response: Future[Box[InBound]] = sendRequest[InBound]("obp_save_transaction_request_status_impl", req, callContext) + response.map(convertToTuple[Boolean](callContext)) + } + messageDocs += getTransactionRequests210Doc def getTransactionRequests210Doc = MessageDoc( process = "obp.getTransactionRequests210", @@ -2827,6 +2938,58 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable { response.map(convertToTuple[TransactionRequest](callContext)) } + messageDocs += getTransactionRequestTypesDoc + def getTransactionRequestTypesDoc = MessageDoc( + process = "obp.getTransactionRequestTypes", + messageFormat = messageFormat, + description = "Get Transaction Request Types", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetTransactionRequestTypes(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + initiator= UserCommons(userPrimaryKey=UserPrimaryKey(123), + userId=userIdExample.value, + idGivenByProvider="string", + provider=providerExample.value, + emailAddress=emailAddressExample.value, + name=userNameExample.value, + createdByConsentId=Some("string"), + createdByUserInvitationId=Some("string"), + isDeleted=Some(true), + lastMarketingAgreementSignedDate=Some(toDate(dateExample))), + fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=toDate(bankAccountLastUpdateExample), + branchId=branchIdExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value, + attributes=Some(List( Attribute(name=attributeNameExample.value, + `type`=attributeTypeExample.value, + value=attributeValueExample.value))))) + ), + exampleInboundMessage = ( + InBoundGetTransactionRequestTypes(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List(TransactionRequestType(transactionRequestTypeExample.value))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getTransactionRequestTypes(initiator: User, fromAccount: BankAccount, callContext: Option[CallContext]): Box[(List[TransactionRequestType], Option[CallContext])] = { + import com.openbankproject.commons.dto.{InBoundGetTransactionRequestTypes => InBound, OutBoundGetTransactionRequestTypes => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, fromAccount) + val response: Future[Box[InBound]] = sendRequest[InBound]("obp_get_transaction_request_types", req, callContext) + response.map(convertToTuple[List[TransactionRequestType]](callContext)) + } + messageDocs += createTransactionAfterChallengeV210Doc def createTransactionAfterChallengeV210Doc = MessageDoc( process = "obp.createTransactionAfterChallengeV210", @@ -3128,6 +3291,34 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable { response.map(convertToTuple[BankAccountCommons](callContext)) } + messageDocs += updateAccountLabelDoc + def updateAccountLabelDoc = MessageDoc( + process = "obp.updateAccountLabel", + messageFormat = messageFormat, + description = "Update Account Label", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundUpdateAccountLabel(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + accountId=AccountId(accountIdExample.value), + label=labelExample.value) + ), + exampleInboundMessage = ( + InBoundUpdateAccountLabel(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=true) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def updateAccountLabel(bankId: BankId, accountId: AccountId, label: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { + import com.openbankproject.commons.dto.{InBoundUpdateAccountLabel => InBound, OutBoundUpdateAccountLabel => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, label) + val response: Future[Box[InBound]] = sendRequest[InBound]("obp_update_account_label", req, callContext) + response.map(convertToTuple[Boolean](callContext)) + } + messageDocs += getProductsDoc def getProductsDoc = MessageDoc( process = "obp.getProducts", @@ -3136,12 +3327,14 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetProducts(bankId=BankId(bankIdExample.value), + OutBoundGetProducts(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), params=List( GetProductsParam(name=nameExample.value, value=valueExample.value.replace("[","").replace("]","").split(",").toList))) ), exampleInboundMessage = ( - InBoundGetProducts(status=MessageDocsSwaggerDefinitions.inboundStatus, + InBoundGetProducts(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( ProductCommons(bankId=BankId(bankIdExample.value), code=ProductCode(productCodeExample.value), parentProductCode=ProductCode(parentProductCodeExample.value), @@ -3161,8 +3354,7 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable { override def getProducts(bankId: BankId, params: List[GetProductsParam], callContext: Option[CallContext]): OBPReturnType[Box[List[Product]]] = { import com.openbankproject.commons.dto.{InBoundGetProducts => InBound, OutBoundGetProducts => OutBound} - val callContext: Option[CallContext] = None - val req = OutBound(bankId, params) + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, params) val response: Future[Box[InBound]] = sendRequest[InBound]("obp_get_products", req, callContext) response.map(convertToTuple[List[ProductCommons]](callContext)) } @@ -3175,11 +3367,13 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetProduct(bankId=BankId(bankIdExample.value), + OutBoundGetProduct(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), productCode=ProductCode(productCodeExample.value)) ), exampleInboundMessage = ( - InBoundGetProduct(status=MessageDocsSwaggerDefinitions.inboundStatus, + InBoundGetProduct(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= ProductCommons(bankId=BankId(bankIdExample.value), code=ProductCode(productCodeExample.value), parentProductCode=ProductCode(parentProductCodeExample.value), @@ -3199,8 +3393,7 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable { override def getProduct(bankId: BankId, productCode: ProductCode, callContext: Option[CallContext]): OBPReturnType[Box[Product]] = { import com.openbankproject.commons.dto.{InBoundGetProduct => InBound, OutBoundGetProduct => OutBound} - val callContext: Option[CallContext] = None - val req = OutBound(bankId, productCode) + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, productCode) val response: Future[Box[InBound]] = sendRequest[InBound]("obp_get_product", req, callContext) response.map(convertToTuple[ProductCommons](callContext)) } @@ -3533,38 +3726,6 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable { response.map(convertToTuple[List[AtmTCommons]](callContext)) } - messageDocs += getCurrentFxRateDoc - def getCurrentFxRateDoc = MessageDoc( - process = "obp.getCurrentFxRate", - messageFormat = messageFormat, - description = "Get Current Fx Rate", - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundGetCurrentFxRate(bankId=BankId(bankIdExample.value), - fromCurrencyCode=fromCurrencyCodeExample.value, - toCurrencyCode=toCurrencyCodeExample.value) - ), - exampleInboundMessage = ( - InBoundGetCurrentFxRate(status=MessageDocsSwaggerDefinitions.inboundStatus, - data= FXRateCommons(bankId=BankId(bankIdExample.value), - fromCurrencyCode=fromCurrencyCodeExample.value, - toCurrencyCode=toCurrencyCodeExample.value, - conversionValue=conversionValueExample.value.toDouble, - inverseConversionValue=inverseConversionValueExample.value.toDouble, - effectiveDate=toDate(effectiveDateExample))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - - override def getCurrentFxRate(bankId: BankId, fromCurrencyCode: String, toCurrencyCode: String, callContext: Option[CallContext]): Box[FXRate] = { - import com.openbankproject.commons.dto.{InBoundGetCurrentFxRate => InBound, OutBoundGetCurrentFxRate => OutBound} - val callContext: Option[CallContext] = None - val req = OutBound(bankId, fromCurrencyCode, toCurrencyCode) - val response: Future[Box[InBound]] = sendRequest[InBound]("obp_get_current_fx_rate", req, callContext) - response.map(convertToTuple[FXRateCommons](callContext)) - } - messageDocs += createTransactionAfterChallengev300Doc def createTransactionAfterChallengev300Doc = MessageDoc( process = "obp.createTransactionAfterChallengev300", @@ -4104,6 +4265,39 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable { response.map(convertToTuple[CancelPayment](callContext)) } + messageDocs += getTransactionRequestTypeChargesDoc + def getTransactionRequestTypeChargesDoc = MessageDoc( + process = "obp.getTransactionRequestTypeCharges", + messageFormat = messageFormat, + description = "Get Transaction Request Type Charges", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetTransactionRequestTypeCharges(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + accountId=AccountId(accountIdExample.value), + viewId=ViewId(viewIdExample.value), + transactionRequestTypes=List(TransactionRequestType(transactionRequestTypesExample.value))) + ), + exampleInboundMessage = ( + InBoundGetTransactionRequestTypeCharges(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( TransactionRequestTypeChargeCommons(transactionRequestTypeId="string", + bankId=bankIdExample.value, + chargeCurrency="string", + chargeAmount="string", + chargeSummary="string"))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getTransactionRequestTypeCharges(bankId: BankId, accountId: AccountId, viewId: ViewId, transactionRequestTypes: List[TransactionRequestType], callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionRequestTypeCharge]]] = { + import com.openbankproject.commons.dto.{InBoundGetTransactionRequestTypeCharges => InBound, OutBoundGetTransactionRequestTypeCharges => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, viewId, transactionRequestTypes) + val response: Future[Box[InBound]] = sendRequest[InBound]("obp_get_transaction_request_type_charges", req, callContext) + response.map(convertToTuple[List[TransactionRequestTypeChargeCommons]](callContext)) + } + messageDocs += createCounterpartyDoc def createCounterpartyDoc = MessageDoc( process = "obp.createCounterparty", @@ -6756,8 +6950,8 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable { response.map(convertToTuple[Boolean](callContext)) } -// ---------- created on 2024-10-16T00:14:34Z -//---------------- dynamic end ---------------------please don't modify this line +// ---------- created on 2024-10-28T12:32:40Z +//---------------- dynamic end ---------------------please don't modify this line private val availableOperation = DynamicEntityOperation.values.map(it => s""""$it"""").mkString("[", ", ", "]") diff --git a/obp-api/src/main/scala/code/bankconnectors/rest/RestConnector_vMar2019.scala b/obp-api/src/main/scala/code/bankconnectors/rest/RestConnector_vMar2019.scala index 1c0be9d4b..9cc10e4e1 100644 --- a/obp-api/src/main/scala/code/bankconnectors/rest/RestConnector_vMar2019.scala +++ b/obp-api/src/main/scala/code/bankconnectors/rest/RestConnector_vMar2019.scala @@ -1559,7 +1559,7 @@ trait RestConnector_vMar2019 extends Connector with KafkaHelper with MdcLoggable lastMarketingAgreementSignedDate=Some(toDate(dateExample)))) ), exampleInboundMessage = ( - InBoundGetPhysicalCardsForUser(status=MessageDocsSwaggerDefinitions.inboundStatus, + InBoundGetPhysicalCardsForUser(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( PhysicalCard(cardId=cardIdExample.value, bankId=bankIdExample.value, bankCardNumber=bankCardNumberExample.value, @@ -2910,12 +2910,12 @@ trait RestConnector_vMar2019 extends Connector with KafkaHelper with MdcLoggable outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetProducts(bankId=BankId(bankIdExample.value), + OutBoundGetProducts(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext,bankId=BankId(bankIdExample.value), params=List( GetProductsParam(name=nameExample.value, value=valueExample.value.replaceAll("\\[","").replaceAll("\\]","").split(",").toList))) ), exampleInboundMessage = ( - InBoundGetProducts(status=MessageDocsSwaggerDefinitions.inboundStatus, + InBoundGetProducts(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( ProductCommons(bankId=BankId(bankIdExample.value), code=ProductCode(productCodeExample.value), parentProductCode=ProductCode(parentProductCodeExample.value), @@ -2935,8 +2935,7 @@ trait RestConnector_vMar2019 extends Connector with KafkaHelper with MdcLoggable override def getProducts(bankId: BankId, params: List[GetProductsParam], callContext: Option[CallContext]): OBPReturnType[Box[List[Product]]] = { import com.openbankproject.commons.dto.{InBoundGetProducts => InBound, OutBoundGetProducts => OutBound} - val callContext: Option[CallContext] = None - val req = OutBound(bankId, params) + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull,bankId, params) val response: Future[Box[InBound]] = sendRequest[InBound](getUrl(callContext, "getProducts"), HttpMethods.POST, req, callContext) response.map(convertToTuple[List[ProductCommons]](callContext)) } @@ -2949,11 +2948,11 @@ trait RestConnector_vMar2019 extends Connector with KafkaHelper with MdcLoggable outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetProduct(bankId=BankId(bankIdExample.value), + OutBoundGetProduct(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), productCode=ProductCode(productCodeExample.value)) ), exampleInboundMessage = ( - InBoundGetProduct(status=MessageDocsSwaggerDefinitions.inboundStatus, + InBoundGetProduct(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, status=MessageDocsSwaggerDefinitions.inboundStatus, data= ProductCommons(bankId=BankId(bankIdExample.value), code=ProductCode(productCodeExample.value), parentProductCode=ProductCode(parentProductCodeExample.value), @@ -2973,8 +2972,7 @@ trait RestConnector_vMar2019 extends Connector with KafkaHelper with MdcLoggable override def getProduct(bankId: BankId, productCode: ProductCode, callContext: Option[CallContext]): OBPReturnType[Box[Product]] = { import com.openbankproject.commons.dto.{InBoundGetProduct => InBound, OutBoundGetProduct => OutBound} - val callContext: Option[CallContext] = None - val req = OutBound(bankId, productCode) + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull,bankId, productCode) val response: Future[Box[InBound]] = sendRequest[InBound](getUrl(callContext, "getProduct"), HttpMethods.POST, req, callContext) response.map(convertToTuple[ProductCommons](callContext)) } @@ -3315,12 +3313,12 @@ trait RestConnector_vMar2019 extends Connector with KafkaHelper with MdcLoggable outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetCurrentFxRate(bankId=BankId(bankIdExample.value), + OutBoundGetCurrentFxRate(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext,bankId=BankId(bankIdExample.value), fromCurrencyCode=fromCurrencyCodeExample.value, toCurrencyCode=toCurrencyCodeExample.value) ), exampleInboundMessage = ( - InBoundGetCurrentFxRate(status=MessageDocsSwaggerDefinitions.inboundStatus, + InBoundGetCurrentFxRate(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext,status=MessageDocsSwaggerDefinitions.inboundStatus, data= FXRateCommons(bankId=BankId(bankIdExample.value), fromCurrencyCode=fromCurrencyCodeExample.value, toCurrencyCode=toCurrencyCodeExample.value, @@ -3333,8 +3331,7 @@ trait RestConnector_vMar2019 extends Connector with KafkaHelper with MdcLoggable override def getCurrentFxRate(bankId: BankId, fromCurrencyCode: String, toCurrencyCode: String, callContext: Option[CallContext]): Box[FXRate] = { import com.openbankproject.commons.dto.{InBoundGetCurrentFxRate => InBound, OutBoundGetCurrentFxRate => OutBound} - val callContext: Option[CallContext] = None - val req = OutBound(bankId, fromCurrencyCode, toCurrencyCode) + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull,bankId, fromCurrencyCode, toCurrencyCode) val response: Future[Box[InBound]] = sendRequest[InBound](getUrl(callContext, "getCurrentFxRate"), HttpMethods.POST, req, callContext) response.map(convertToTuple[FXRateCommons](callContext)) } diff --git a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnector_vDec2019.scala b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnector_vDec2019.scala index a8bf2212e..413f14585 100644 --- a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnector_vDec2019.scala +++ b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnector_vDec2019.scala @@ -1726,7 +1726,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { lastMarketingAgreementSignedDate=Some(toDate(dateExample)))) ), exampleInboundMessage = ( - InBoundGetPhysicalCardsForUser(status=MessageDocsSwaggerDefinitions.inboundStatus, + InBoundGetPhysicalCardsForUser(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( PhysicalCard(cardId=cardIdExample.value, bankId=bankIdExample.value, bankCardNumber=bankCardNumberExample.value, @@ -3213,12 +3213,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetProducts(bankId=BankId(bankIdExample.value), + OutBoundGetProducts(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext,bankId=BankId(bankIdExample.value), params=List( GetProductsParam(name=nameExample.value, value=valueExample.value.split("[,;]").toList))) ), exampleInboundMessage = ( - InBoundGetProducts(status=MessageDocsSwaggerDefinitions.inboundStatus, + InBoundGetProducts(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( ProductCommons(bankId=BankId(bankIdExample.value), code=ProductCode(productCodeExample.value), parentProductCode=ProductCode(parentProductCodeExample.value), @@ -3238,8 +3238,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { override def getProducts(bankId: BankId, params: List[GetProductsParam], callContext: Option[CallContext]): OBPReturnType[Box[List[Product]]] = { import com.openbankproject.commons.dto.{InBoundGetProducts => InBound, OutBoundGetProducts => OutBound} - val callContext: Option[CallContext] = None - val req = OutBound(bankId, params) + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull,bankId, params) val response: Future[Box[InBound]] = sendRequest[InBound]("obp_get_products", req, callContext) response.map(convertToTuple[List[ProductCommons]](callContext)) } @@ -3252,11 +3251,11 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetProduct(bankId=BankId(bankIdExample.value), + OutBoundGetProduct(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), productCode=ProductCode(productCodeExample.value)) ), exampleInboundMessage = ( - InBoundGetProduct(status=MessageDocsSwaggerDefinitions.inboundStatus, + InBoundGetProduct(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, status=MessageDocsSwaggerDefinitions.inboundStatus, data= ProductCommons(bankId=BankId(bankIdExample.value), code=ProductCode(productCodeExample.value), parentProductCode=ProductCode(parentProductCodeExample.value), @@ -3276,8 +3275,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { override def getProduct(bankId: BankId, productCode: ProductCode, callContext: Option[CallContext]): OBPReturnType[Box[Product]] = { import com.openbankproject.commons.dto.{InBoundGetProduct => InBound, OutBoundGetProduct => OutBound} - val callContext: Option[CallContext] = None - val req = OutBound(bankId, productCode) + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull,bankId, productCode) val response: Future[Box[InBound]] = sendRequest[InBound]("obp_get_product", req, callContext) response.map(convertToTuple[ProductCommons](callContext)) } @@ -3618,12 +3616,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetCurrentFxRate(bankId=BankId(bankIdExample.value), + OutBoundGetCurrentFxRate(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext,bankId=BankId(bankIdExample.value), fromCurrencyCode=fromCurrencyCodeExample.value, toCurrencyCode=toCurrencyCodeExample.value) ), exampleInboundMessage = ( - InBoundGetCurrentFxRate(status=MessageDocsSwaggerDefinitions.inboundStatus, + InBoundGetCurrentFxRate(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext,status=MessageDocsSwaggerDefinitions.inboundStatus, data= FXRateCommons(bankId=BankId(bankIdExample.value), fromCurrencyCode=fromCurrencyCodeExample.value, toCurrencyCode=toCurrencyCodeExample.value, @@ -3636,8 +3634,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { override def getCurrentFxRate(bankId: BankId, fromCurrencyCode: String, toCurrencyCode: String, callContext: Option[CallContext]): Box[FXRate] = { import com.openbankproject.commons.dto.{InBoundGetCurrentFxRate => InBound, OutBoundGetCurrentFxRate => OutBound} - val callContext: Option[CallContext] = None - val req = OutBound(bankId, fromCurrencyCode, toCurrencyCode) + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull,bankId, fromCurrencyCode, toCurrencyCode) val response: Future[Box[InBound]] = sendRequest[InBound]("obp_get_current_fx_rate", req, callContext) response.map(convertToTuple[FXRateCommons](callContext)) } diff --git a/obp-commons/src/main/scala/com/openbankproject/commons/dto/JsonsTransfer.scala b/obp-commons/src/main/scala/com/openbankproject/commons/dto/JsonsTransfer.scala index 2fafc5ffe..424b16f3a 100644 --- a/obp-commons/src/main/scala/com/openbankproject/commons/dto/JsonsTransfer.scala +++ b/obp-commons/src/main/scala/com/openbankproject/commons/dto/JsonsTransfer.scala @@ -91,13 +91,6 @@ case class OutBoundGetBankAccountsForUser(outboundAdapterCallContext: OutboundAd case class InBoundGetBankAccountsForUser(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[InboundAccountCommons]) extends InBoundTrait[List[InboundAccountCommons]] -case class OutBoundGetBankAccountOld( - bankId: BankId, - accountId: AccountId) extends TopicTrait -case class InBoundGetBankAccountOld(status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} - case class OutBoundGetBankAccount(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, accountId: AccountId) extends TopicTrait @@ -492,18 +485,6 @@ case class OutBoundGetMeeting(outboundAdapterCallContext: OutboundAdapterCallCon meetingId: String) extends TopicTrait case class InBoundGetMeeting(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: MeetingCommons) extends InBoundTrait[MeetingCommons] -case class OutBoundGetUser(name: String, password: String) extends TopicTrait - -case class InBoundGetUser(status: Status, data: InboundUser) extends InBoundTrait[InboundUser] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} -case class OutBoundGetExternalUser(name: String, password: String) extends TopicTrait - -case class InBoundGetExternalUser(status: Status, data: InboundExternalUser) extends InBoundTrait[InboundExternalUser] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} - - //create bound case classes case class OutBoundCreateChallenge(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, @@ -1025,53 +1006,29 @@ case class OutBoundCreateChallenges(outboundAdapterCallContext: OutboundAdapterC case class InBoundCreateChallenges(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[String]) extends InBoundTrait[List[String]] -case class OutBoundGetCounterpartyFromTransaction(bankId: BankId, accountId: AccountId, counterpartyId: String) extends TopicTrait -case class InBoundGetCounterpartyFromTransaction(status: Status, data: Counterparty) extends InBoundTrait[Counterparty] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} +case class OutBoundGetCounterpartyFromTransaction(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, accountId: AccountId, counterpartyId: String) extends TopicTrait +case class InBoundGetCounterpartyFromTransaction(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Counterparty) extends InBoundTrait[Counterparty] -case class OutBoundGetCounterpartiesFromTransaction(bankId: BankId, accountId: AccountId) extends TopicTrait -case class InBoundGetCounterpartiesFromTransaction(status: Status, data: List[Counterparty]) extends InBoundTrait[List[Counterparty]] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} +case class OutBoundGetCounterpartiesFromTransaction(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, accountId: AccountId) extends TopicTrait +case class InBoundGetCounterpartiesFromTransaction(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[Counterparty]) extends InBoundTrait[List[Counterparty]] -case class OutBoundGetCounterparty(thisBankId: BankId, thisAccountId: AccountId, couterpartyId: String) extends TopicTrait -case class InBoundGetCounterparty(status: Status, data: Counterparty) extends InBoundTrait[Counterparty] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} +case class OutBoundGetCounterparty(outboundAdapterCallContext: OutboundAdapterCallContext, thisBankId: BankId, thisAccountId: AccountId, couterpartyId: String) extends TopicTrait +case class InBoundGetCounterparty(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Counterparty) extends InBoundTrait[Counterparty] case class OutBoundGetPhysicalCardsForUser(outboundAdapterCallContext: OutboundAdapterCallContext, user: User) extends TopicTrait -case class InBoundGetPhysicalCardsForUser(status: Status, data: List[PhysicalCard]) extends InBoundTrait[List[PhysicalCard]] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} - -case class OutBoundGetPhysicalCardsForBankLegacy(bank: Bank, user: User, - limit: Int, - offset: Int, - fromDate: String, - toDate: String) extends TopicTrait -case class InBoundGetPhysicalCardsForBankLegacy(status: Status, data: List[PhysicalCard]) extends InBoundTrait[List[PhysicalCard]] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} +case class InBoundGetPhysicalCardsForUser(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[PhysicalCard]) extends InBoundTrait[List[PhysicalCard]] case class OutBoundCreateTransactionRequest(outboundAdapterCallContext: OutboundAdapterCallContext,initiator: User, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, body: TransactionRequestBody) extends TopicTrait -case class InBoundCreateTransactionRequest(status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} +case class InBoundCreateTransactionRequest(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] -case class OutBoundGetStatus(challengeThresholdAmount: BigDecimal, transactionRequestCommonBodyAmount: BigDecimal, transactionRequestType: TransactionRequestType) extends TopicTrait -case class InBoundGetStatus(status: Status, statusValue: String) extends InBoundTrait[TransactionRequestStatus.Value] { +case class OutBoundGetStatus(outboundAdapterCallContext: OutboundAdapterCallContext, challengeThresholdAmount: BigDecimal, transactionRequestCommonBodyAmount: BigDecimal, transactionRequestType: TransactionRequestType) extends TopicTrait +case class InBoundGetStatus(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, statusValue: String, data: TransactionRequestStatus.Value) extends InBoundTrait[TransactionRequestStatus.Value] - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() - override val data: TransactionRequestStatus.Value = TransactionRequestStatus.withName(statusValue) -} -case class OutBoundGetChargeValue(chargeLevelAmount: BigDecimal, transactionRequestCommonBodyAmount: BigDecimal) extends TopicTrait -case class InBoundGetChargeValue(status: Status, data: String) extends InBoundTrait[String] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} +case class OutBoundGetChargeValue(outboundAdapterCallContext: OutboundAdapterCallContext, chargeLevelAmount: BigDecimal, transactionRequestCommonBodyAmount: BigDecimal) extends TopicTrait +case class InBoundGetChargeValue(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: String) extends InBoundTrait[String] case class OutBoundCreateTransactionRequestv400(outboundAdapterCallContext: OutboundAdapterCallContext, initiator: User, viewId: ViewId, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, @@ -1101,150 +1058,64 @@ case class OutBoundCreateTransactionRequestPeriodicSepaCreditTransfersBGV1( case class InBoundCreateTransactionRequestPeriodicSepaCreditTransfersBGV1(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequestBGV1) extends InBoundTrait[TransactionRequestBGV1] -case class OutBoundCreateTransactionRequestImpl(transactionRequestId: TransactionRequestId, transactionRequestType: TransactionRequestType, fromAccount: BankAccount, counterparty: BankAccount, body: TransactionRequestBody, status: String, charge: TransactionRequestCharge) extends TopicTrait -case class InBoundCreateTransactionRequestImpl(status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} +case class OutBoundCreateTransactionRequestImpl(outboundAdapterCallContext: OutboundAdapterCallContext, transactionRequestId: TransactionRequestId, transactionRequestType: TransactionRequestType, fromAccount: BankAccount, counterparty: BankAccount, body: TransactionRequestBody, status: String, charge: TransactionRequestCharge) extends TopicTrait +case class InBoundCreateTransactionRequestImpl(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] -case class OutBoundSaveTransactionRequestTransaction(transactionRequestId: TransactionRequestId, transactionId: TransactionId) extends TopicTrait -case class InBoundSaveTransactionRequestTransaction(status: Status, data: Boolean) extends InBoundTrait[Boolean] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} +case class OutBoundSaveTransactionRequestTransaction(outboundAdapterCallContext: OutboundAdapterCallContext, transactionRequestId: TransactionRequestId, transactionId: TransactionId) extends TopicTrait +case class InBoundSaveTransactionRequestTransaction(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] -case class OutBoundSaveTransactionRequestTransactionImpl(transactionRequestId: TransactionRequestId, transactionId: TransactionId) extends TopicTrait -case class InBoundSaveTransactionRequestTransactionImpl(status: Status, data: Boolean) extends InBoundTrait[Boolean] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} +case class OutBoundSaveTransactionRequestTransactionImpl(outboundAdapterCallContext: OutboundAdapterCallContext, transactionRequestId: TransactionRequestId, transactionId: TransactionId) extends TopicTrait +case class InBoundSaveTransactionRequestTransactionImpl(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] -case class OutBoundSaveTransactionRequestChallenge(transactionRequestId: TransactionRequestId, challenge: TransactionRequestChallenge) extends TopicTrait -case class InBoundSaveTransactionRequestChallenge(status: Status, data: Boolean) extends InBoundTrait[Boolean] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} +case class OutBoundSaveTransactionRequestChallenge(outboundAdapterCallContext: OutboundAdapterCallContext, transactionRequestId: TransactionRequestId, challenge: TransactionRequestChallenge) extends TopicTrait +case class InBoundSaveTransactionRequestChallenge(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] -case class OutBoundSaveTransactionRequestChallengeImpl(transactionRequestId: TransactionRequestId, challenge: TransactionRequestChallenge) extends TopicTrait -case class InBoundSaveTransactionRequestChallengeImpl(status: Status, data: Boolean) extends InBoundTrait[Boolean] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} +case class OutBoundSaveTransactionRequestChallengeImpl(outboundAdapterCallContext: OutboundAdapterCallContext, transactionRequestId: TransactionRequestId, challenge: TransactionRequestChallenge) extends TopicTrait +case class InBoundSaveTransactionRequestChallengeImpl(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] -case class OutBoundSaveTransactionRequestStatusImpl(transactionRequestId: TransactionRequestId, status: String) extends TopicTrait -case class InBoundSaveTransactionRequestStatusImpl(status: Status, data: Boolean) extends InBoundTrait[Boolean] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} +case class OutBoundSaveTransactionRequestStatusImpl(outboundAdapterCallContext: OutboundAdapterCallContext, transactionRequestId: TransactionRequestId, status: String) extends TopicTrait +case class InBoundSaveTransactionRequestStatusImpl(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] case class OutBoundGetTransactionRequests(outboundAdapterCallContext: OutboundAdapterCallContext,initiator: User, fromAccount: BankAccount) extends TopicTrait -case class InBoundGetTransactionRequests(status: Status, data: List[TransactionRequest]) extends InBoundTrait[List[TransactionRequest]] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} +case class InBoundGetTransactionRequests(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionRequest]) extends InBoundTrait[List[TransactionRequest]] case class OutBoundGetTransactionRequestTypes(outboundAdapterCallContext: OutboundAdapterCallContext, initiator: User, fromAccount: BankAccount) extends TopicTrait -case class InBoundGetTransactionRequestTypes(status: Status, data: List[TransactionRequestType]) extends InBoundTrait[List[TransactionRequestType]] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} +case class InBoundGetTransactionRequestTypes(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionRequestType]) extends InBoundTrait[List[TransactionRequestType]] case class OutBoundCreateTransactionAfterChallenge(outboundAdapterCallContext: OutboundAdapterCallContext, initiator: User, transReqId: TransactionRequestId) extends TopicTrait -case class InBoundCreateTransactionAfterChallenge(status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} +case class InBoundCreateTransactionAfterChallenge(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] -case class BankAndBankAccount(bank: BankCommons, account: BankAccountCommons) -case class OutBoundCreateBankAndAccount(bankName: String, bankNationalIdentifier: String, accountNumber: String, accountType: String, accountLabel: String, currency: String, accountHolderName: String, branchId: String, accountRoutingScheme: String, accountRoutingAddress: String) extends TopicTrait -case class InBoundCreateBankAndAccount(status: Status, value: BankAndBankAccount) extends InBoundTrait[(Bank, BankAccount)] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() - override val data: (Bank, BankAccount) = (value.bank, value.account) -} -case class OutBoundCreateSandboxBankAccount(bankId: BankId, accountId: AccountId, accountNumber: String, accountType: String, accountLabel: String, currency: String, initialBalance: BigDecimal, accountHolderName: String, branchId: String, accountRoutings: List[AccountRouting]) extends TopicTrait -case class InBoundCreateSandboxBankAccount(status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} +case class OutBoundCreateSandboxBankAccount(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, accountId: AccountId, accountNumber: String, accountType: String, accountLabel: String, currency: String, initialBalance: BigDecimal, accountHolderName: String, branchId: String, accountRoutings: List[AccountRouting]) extends TopicTrait +case class InBoundCreateSandboxBankAccount(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] -case class OutBoundAccountExists(bankId: BankId, accountNumber: String) extends TopicTrait -case class InBoundAccountExists(status: Status, data: Boolean) extends InBoundTrait[Boolean] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} -case class OutBoundRemoveAccount(bankId: BankId, accountId: AccountId) extends TopicTrait -case class InBoundRemoveAccount(status: Status, data: Boolean) extends InBoundTrait[Boolean] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} - -case class OutBoundGetMatchingTransactionCount(bankNationalIdentifier: String, accountNumber: String, amount: String, completed: Date, otherAccountHolder: String) extends TopicTrait -case class InBoundGetMatchingTransactionCount(status: Status, data: Int) extends InBoundTrait[Int] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} - -case class OutBoundUpdateAccountBalance(bankId: BankId, accountId: AccountId, newBalance: BigDecimal) extends TopicTrait -case class InBoundUpdateAccountBalance(status: Status, data: Boolean) extends InBoundTrait[Boolean] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} - -case class OutBoundSetBankAccountLastUpdated(bankNationalIdentifier: String, accountNumber: String, updateDate: Date) extends TopicTrait -case class InBoundSetBankAccountLastUpdated(status: Status, data: Boolean) extends InBoundTrait[Boolean] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} - -case class OutBoundUpdateAccountLabel(bankId: BankId, accountId: AccountId, label: String) extends TopicTrait -case class InBoundUpdateAccountLabel(status: Status, data: Boolean) extends InBoundTrait[Boolean] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} - -case class OutBoundUpdateAccount(bankId: BankId, accountId: AccountId, label: String) extends TopicTrait -case class InBoundUpdateAccount(status: Status, data: Boolean) extends InBoundTrait[Boolean] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} +case class OutBoundUpdateAccountLabel(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, accountId: AccountId, label: String) extends TopicTrait +case class InBoundUpdateAccountLabel(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] case class GetProductsParam(name: String, value: List[String]) -case class OutBoundGetProducts(bankId: BankId, params: List[GetProductsParam]) extends TopicTrait +case class OutBoundGetProducts(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, params: List[GetProductsParam]) extends TopicTrait -case class InBoundGetProducts(status: Status, data: List[ProductCommons]) extends InBoundTrait[List[ProductCommons]] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} +case class InBoundGetProducts(inboundAdapterCallContext: InboundAdapterCallContext ,status: Status, data: List[ProductCommons]) extends InBoundTrait[List[ProductCommons]] -case class OutBoundGetProduct(bankId: BankId, productCode: ProductCode) extends TopicTrait -case class InBoundGetProduct(status: Status, data: ProductCommons) extends InBoundTrait[ProductCommons] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} +case class OutBoundGetProduct(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, productCode: ProductCode) extends TopicTrait +case class InBoundGetProduct(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: ProductCommons) extends InBoundTrait[ProductCommons] + +case class OutBoundGetCurrentFxRate(outboundAdapterCallContext: OutboundAdapterCallContext,bankId: BankId, fromCurrencyCode: String, toCurrencyCode: String) extends TopicTrait +case class InBoundGetCurrentFxRate(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: FXRateCommons) extends InBoundTrait[FXRateCommons] + +case class OutBoundCreateOrUpdateFXRate(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: String, fromCurrencyCode: String, toCurrencyCode: String, conversionValue: Double, inverseConversionValue: Double, effectiveDate: Date) extends TopicTrait +case class InBoundCreateOrUpdateFXRate(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: FXRateCommons) extends InBoundTrait[FXRateCommons] -case class OutBoundCreateOrUpdateBranch(branch: BranchT) extends TopicTrait -case class InBoundCreateOrUpdateBranch(status: Status, data: BranchTCommons) extends InBoundTrait[BranchTCommons] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} +case class OutBoundGetBranchLegacy(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, branchId: BranchId) extends TopicTrait +case class InBoundGetBranchLegacy(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BranchTCommons) extends InBoundTrait[BranchTCommons] -case class OutBoundCreateOrUpdateBank(bankId: String, fullBankName: String, shortBankName: String, logoURL: String, websiteURL: String, swiftBIC: String, national_identifier: String, bankRoutingScheme: String, bankRoutingAddress: String) extends TopicTrait -case class InBoundCreateOrUpdateBank(status: Status, data: BankCommons) extends InBoundTrait[BankCommons] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} +case class OutBoundGetAtmLegacy(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, atmId: AtmId) extends TopicTrait +case class InBoundGetAtmLegacy(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AtmTCommons) extends InBoundTrait[AtmTCommons] -case class OutBoundCreateOrUpdateProduct(bankId: String, code: String, parentProductCode: Option[String], name: String, category: String, family: String, superFamily: String, moreInfoUrl: String, termsAndConditionsUrl: String, details: String, description: String, metaLicenceId: String, metaLicenceName: String) extends TopicTrait -case class InBoundCreateOrUpdateProduct(status: Status, data: ProductCommons) extends InBoundTrait[ProductCommons] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} - -case class OutBoundCreateOrUpdateFXRate(bankId: String, fromCurrencyCode: String, toCurrencyCode: String, conversionValue: Double, inverseConversionValue: Double, effectiveDate: Date) extends TopicTrait -case class InBoundCreateOrUpdateFXRate(status: Status, data: FXRateCommons) extends InBoundTrait[FXRateCommons] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} - -case class OutBoundGetBranchLegacy(bankId: BankId, branchId: BranchId) extends TopicTrait -case class InBoundGetBranchLegacy(status: Status, data: BranchTCommons) extends InBoundTrait[BranchTCommons] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} - -case class OutBoundGetAtmLegacy(bankId: BankId, atmId: AtmId) extends TopicTrait -case class InBoundGetAtmLegacy(status: Status, data: AtmTCommons) extends InBoundTrait[AtmTCommons] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} - -case class OutBoundGetCurrentFxRate(bankId: BankId, fromCurrencyCode: String, toCurrencyCode: String) extends TopicTrait -case class InBoundGetCurrentFxRate(status: Status, data: FXRateCommons) extends InBoundTrait[FXRateCommons] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} - -case class OutBoundGetTransactionRequestTypeCharges(bankId: BankId, accountId: AccountId, viewId: ViewId, transactionRequestTypes: List[TransactionRequestType]) extends TopicTrait -case class InBoundGetTransactionRequestTypeCharges(status: Status, data: List[TransactionRequestTypeChargeCommons]) extends InBoundTrait[List[TransactionRequestTypeChargeCommons]] { - override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() -} +case class OutBoundGetTransactionRequestTypeCharges(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, accountId: AccountId, viewId: ViewId, transactionRequestTypes: List[TransactionRequestType]) extends TopicTrait +case class InBoundGetTransactionRequestTypeCharges(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionRequestTypeChargeCommons]) extends InBoundTrait[List[TransactionRequestTypeChargeCommons]] case class OutBoundGetCustomersByCustomerPhoneNumber(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, phoneNumber: String) extends TopicTrait case class InBoundGetCustomersByCustomerPhoneNumber(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CustomerCommons]) extends InBoundTrait[List[CustomerCommons]]