From 0f4155bea7692c00f8b1a3d40bfedf21ef377f32 Mon Sep 17 00:00:00 2001 From: shuang Date: Mon, 15 Jun 2020 15:31:06 +0800 Subject: [PATCH 01/10] feature/create_akka_connector_builder: add AkkaConnectorBuilder and extract duplicated code to ConnectorBuilderUtil. --- .../code/api/util/CodeGenerateUtils.scala | 43 ++- .../scala/code/bankconnectors/Connector.scala | 74 ++++- .../bankconnectors/ConnectorBuilderUtil.scala | 218 ++++++++++++++ .../akka/AkkaConnectorBuilder.scala | 191 ++++++++++++ .../rest/RestConnectorBuilder.scala | 284 +----------------- .../StoredProcedureConnectorBuilder.scala | 188 +----------- .../vMay2019/KafkaConnectorBuilder.scala | 183 +---------- .../vSept2018/KafkaConnectorBuilder.scala | 245 +-------------- 8 files changed, 538 insertions(+), 888 deletions(-) create mode 100644 obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala create mode 100644 obp-api/src/main/scala/code/bankconnectors/akka/AkkaConnectorBuilder.scala diff --git a/obp-api/src/main/scala/code/api/util/CodeGenerateUtils.scala b/obp-api/src/main/scala/code/api/util/CodeGenerateUtils.scala index 60f5a451b..b3fb1690e 100644 --- a/obp-api/src/main/scala/code/api/util/CodeGenerateUtils.scala +++ b/obp-api/src/main/scala/code/api/util/CodeGenerateUtils.scala @@ -3,7 +3,7 @@ package code.api.util import java.util.Date import com.openbankproject.commons.model.enums.StrongCustomerAuthentication -import com.openbankproject.commons.model.{CardAction, CardReplacementReason, PinResetReason} +import com.openbankproject.commons.model.{CardAction, CardReplacementReason, InboundAdapterCallContext, OutboundAdapterCallContext, PinResetReason, Status} import com.openbankproject.commons.util.{EnumValue, ReflectUtils} import org.apache.commons.lang3.StringUtils @@ -14,6 +14,41 @@ import scala.reflect.runtime.{universe => ru} object CodeGenerateUtils { + /** + * when create example, if fieldName and|or fieldType match, the example is fixed value + * @param fieldName fieldName, this value can be null, but should not together with tp are both null + * @param tp fieldType, this value can be null, but should not together with fieldName are both null + * @param example example string + */ + private case class NameTypeExample(fieldName: String, tp: Type, example: String) { + assert(StringUtils.isNotBlank(fieldName) || tp != null, s"fieldName and tp should not both empty") + + def isFieldMatch(fieldName: String, tp: Type): Boolean = + if(tp != null && StringUtils.isNotBlank(this.fieldName)) { + this.tp <:< tp && fieldName == this.fieldName + } else if(tp != null) { + this.tp <:< tp + } else { + fieldName == this.fieldName + } + + def getExample(fieldName: String, tp: Type): Option[String] = + if(isFieldMatch(fieldName, tp)) { + Some(example) + } else { + None + } + } + // fixed example for given field or type + private val fixedExamples: List[NameTypeExample] = List( + NameTypeExample(null, typeOf[OutboundAdapterCallContext], "MessageDocsSwaggerDefinitions.outboundAdapterCallContext"), + NameTypeExample(null, typeOf[InboundAdapterCallContext], "MessageDocsSwaggerDefinitions.inboundAdapterCallContext"), + NameTypeExample("status", typeOf[Status], "MessageDocsSwaggerDefinitions.inboundStatus"), + ) + + private def getFixedExample(fieldName: String, tp: Type): Option[String] = + fixedExamples.find(_.isFieldMatch(fieldName, tp)).map(_.example) + /** * create messageDocs example object string, for example exampleOutboundMessage and exampleInboundMessage, * this is just return a string for code generation @@ -24,7 +59,11 @@ object CodeGenerateUtils { * @return initialize object string */ def createDocExample(tp: ru.Type, fieldName: Option[String] = None, parentFieldName: Option[String] = None, parentType: Option[ru.Type] = None): String = { - if(tp =:= typeOf[CardAction]) { + // if given fieldName and tp have fixed example, just return fixed example + val fixedExample = getFixedExample(fieldName.orNull, tp) + if(fixedExample.isDefined) { + return fixedExample.get + } else if(tp =:= typeOf[CardAction]) { return "com.openbankproject.commons.model.CardAction.DEBIT" } else if(tp =:= typeOf[CardReplacementReason]) { return "com.openbankproject.commons.model.CardReplacementReason.FIRST" diff --git a/obp-api/src/main/scala/code/bankconnectors/Connector.scala b/obp-api/src/main/scala/code/bankconnectors/Connector.scala index 1488de08f..e78fcf4c2 100644 --- a/obp-api/src/main/scala/code/bankconnectors/Connector.scala +++ b/obp-api/src/main/scala/code/bankconnectors/Connector.scala @@ -55,12 +55,13 @@ import com.openbankproject.commons.util.ReflectUtils import com.openbankproject.commons.util.Functions.lazyValue import net.liftweb.json -import scala.concurrent.Future +import scala.concurrent.{Await, Future} import scala.concurrent.duration._ import scala.math.{BigDecimal, BigInt} import scala.util.Random import scala.reflect.runtime.universe.{MethodSymbol, typeOf} import _root_.akka.http.scaladsl.model.HttpMethod +import com.openbankproject.commons.dto.InBoundTrait /* So we can switch between different sources of resources e.g. @@ -212,6 +213,15 @@ trait Connector extends MdcLoggable { connectorMethods ++ result // result put after ++ to make sure methods of Connector's subtype be kept when name conflict. } + protected implicit def boxToTuple[T](box: Box[(T, Option[CallContext])]): (Box[T], Option[CallContext]) = + (box.map(_._1), box.flatMap(_._2)) + + protected implicit def tupleToBoxTuple[T](tuple: (Box[T], Option[CallContext])): Box[(T, Option[CallContext])] = + tuple._1.map(it => (it, tuple._2)) + + protected implicit def tupleToBox[T](tuple: (Box[T], Option[CallContext])): Box[T] = tuple._1 + + /** * convert original return type future to OBPReturnType * @@ -219,9 +229,8 @@ trait Connector extends MdcLoggable { * @tparam T future success value type * @return OBPReturnType type future */ - protected implicit def futureReturnTypeToOBPReturnType[T](future: Future[Box[(T, Option[CallContext])]]): OBPReturnType[Box[T]] = future map { - boxedTuple => (boxedTuple.map(_._1), boxedTuple.map(_._2).getOrElse(None)) - } + protected implicit def futureReturnTypeToOBPReturnType[T](future: Future[Box[(T, Option[CallContext])]]): OBPReturnType[Box[T]] = + future map boxToTuple /** * convert OBPReturnType return type to original future type @@ -230,8 +239,61 @@ trait Connector extends MdcLoggable { * @tparam T future success value type * @return original future type */ - protected implicit def OBPReturnTypeToFutureReturnType[T](value: OBPReturnType[Box[T]]): Future[Box[(T, Option[CallContext])]] = value.map { - tuple => tuple._1.map((_, tuple._2)) + protected implicit def OBPReturnTypeToFutureReturnType[T](value: OBPReturnType[Box[T]]): Future[Box[(T, Option[CallContext])]] = + value map tupleToBoxTuple + + private val futureTimeOut: Duration = 20 seconds + /** + * convert OBPReturnType return type to Tuple type + * + * @param value Tuple return type + * @tparam T future success value type + * @return original future tuple box type + */ + protected implicit def OBPReturnTypeToTupleBox[T](value: OBPReturnType[Box[T]]): (Box[T], Option[CallContext]) = + Await.result(value, futureTimeOut) + + /** + * convert OBPReturnType return type to Box Tuple type + * + * @param value Box Tuple return type + * @tparam T future success value type + * @return original future box tuple type + */ + protected implicit def OBPReturnTypeToBoxTuple[T](value: OBPReturnType[Box[T]]): Box[(T, Option[CallContext])] = + Await.result( + OBPReturnTypeToFutureReturnType(value), 30 seconds + ) + + /** + * convert OBPReturnType return type to Box value + * + * @param value Box Tuple return type + * @tparam T future success value type + * @return original future box value + */ + protected implicit def OBPReturnTypeToBox[T](value: OBPReturnType[Box[T]]): Box[T] = + Await.result( + value.map(_._1), + 30 seconds + ) + + protected def convertToTuple[T](callContext: Option[CallContext])(inbound: Box[InBoundTrait[T]]): (Box[T], Option[CallContext]) = { + val boxedResult = inbound match { + case Full(in) if (in.status.hasNoError) => Full(in.data) + case Full(inbound) if (inbound.status.hasError) => { + val errorMessage = "CoreBank - Status: " + inbound.status.backendMessages + val errorCode: Int = try { + inbound.status.errorCode.toInt + } catch { + case _: Throwable => 400 + } + ParamFailure(errorMessage, Empty, Empty, APIFailure(errorMessage, errorCode)) + } + case failureOrEmpty: Failure => failureOrEmpty + } + + (boxedResult, callContext) } /** diff --git a/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala b/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala new file mode 100644 index 000000000..37a0c70b1 --- /dev/null +++ b/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala @@ -0,0 +1,218 @@ +package code.bankconnectors + +import java.io.File +import java.util.Date + +import code.api.util.CallContext +import code.api.util.CodeGenerateUtils.createDocExample +import code.bankconnectors.vSept2018.KafkaMappedConnector_vSept2018 +import com.openbankproject.commons.util.ReflectUtils +import org.apache.commons.io.FileUtils +import org.apache.commons.lang3.StringUtils.uncapitalize + +import scala.collection.immutable.List +import scala.language.postfixOps +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} + +/** + * this is util for Connector builders, this should never be called by product code. + */ +object ConnectorBuilderUtil { + // rewrite method code.webuiprops.MappedWebUiPropsProvider#getWebUiPropsValue, avoid access DB cause dataSource not found exception + { + import javassist.ClassPool + val pool = ClassPool.getDefault + val ct = pool.getCtClass("code.webuiprops.MappedWebUiPropsProvider$") + val m = ct.getDeclaredMethod("getWebUiPropsValue") + m.insertBefore("""return ""; """) + ct.toClass + } + + private val mirror: ru.Mirror = ru.runtimeMirror(getClass().getClassLoader) + private val clazz: ru.ClassSymbol = ru.typeOf[Connector].typeSymbol.asClass + private val classMirror: ru.ClassMirror = mirror.reflectClass(clazz) + + def generateMethods(connectorMethodNames: List[String], connectorCodePath: String, responseExpression: String, + setTopic: Boolean = false, doCache: Boolean = false) = + buildMethods(connectorMethodNames, connectorCodePath, _ => responseExpression, setTopic, doCache) + + def buildMethods(connectorMethodNames: List[String], connectorCodePath: String, connectorMethodToResponse: String => String, + setTopic: Boolean = false, doCache: Boolean = false): Unit = { + + val nameSignature: Iterable[ConnectorMethodGenerator] = ru.typeOf[Connector].decls + .filter(_.isMethod) + .filter(it => connectorMethodNames.contains(it.name.toString)) + .filter(it => { + it.typeSignature.paramLists(0).exists(_.asTerm.info =:= ru.typeOf[Option[CallContext]]) + }) + .map(it => { + val (methodName, typeSignature) = (it.name.toString, it.typeSignature) + ConnectorMethodGenerator(methodName, typeSignature) + }) + + // check whether some methods names are wrong typo + if(connectorMethodNames.size > nameSignature.size) { + val generatedMethodsNames = nameSignature.map(_.methodName).toSet + val invalidMethodNames = connectorMethodNames.filterNot(generatedMethodsNames.contains(_)) + throw new IllegalArgumentException(s"Some methods not be supported, please check following methods: ${invalidMethodNames.mkString(", \n")}") + } + + val codeList = nameSignature.map(_.toCode(connectorMethodToResponse, setTopic, doCache)) + + // private val types: Iterable[ru.Type] = symbols.map(_.typeSignature) + // println(symbols) + println("-------------------") + codeList.foreach(println(_)) + println("===================") + + val path = new File(getClass.getResource("").toURI.toString.replaceFirst("target/.*", "").replace("file:", ""), connectorCodePath) + val source = FileUtils.readFileToString(path, "utf-8") + val start = "//---------------- dynamic start -------------------please don't modify this line" + val end = "//---------------- dynamic end ---------------------please don't modify this line" + val placeHolderInSource = s"""(?s)$start.+$end""" + val insertCode = + s"""$start + |// ---------- create on ${new Date()} + |${codeList.mkString} + |// ---------- create on ${new Date()} + |$end """.stripMargin + val newSource = source.replaceFirst(placeHolderInSource, insertCode) + FileUtils.writeStringToFile(path, newSource, "utf-8") + } + + + private case class ConnectorMethodGenerator(methodName: String, tp: Type) { + private[this] def paramAnResult = tp.toString + .replaceAll("(\\w+\\.)+", "") + .replaceFirst("\\)", "): ") + .replace("cardAttributeType: Value", "cardAttributeType: CardAttributeType.Value") // scala enum is bad for Reflection + .replace("productAttributeType: Value", "productAttributeType: ProductAttributeType.Value") // scala enum is bad for Reflection + .replace("accountAttributeType: Value", "accountAttributeType: AccountAttributeType.Value") // scala enum is bad for Reflection + .replaceFirst("""\btype\b""", "`type`") + + private[this] val params = tp.paramLists(0).filterNot(_.asTerm.info =:= ru.typeOf[Option[CallContext]]).map(_.name.toString).mkString(", ", ", ", "").replaceFirst("""\btype\b""", "`type`") + private[this] val description = methodName.replaceAll("""(\w)([A-Z])""", "$1 $2").capitalize + + private[this] val entityName = methodName.replaceFirst("^[a-z]+(OrUpdate)?", "") + + private[this] val resultType = tp.resultType.toString.replaceAll("(\\w+\\.)+", "") + + private[this] val isOBPReturnType = resultType.startsWith("OBPReturnType[") + + private[this] val outBoundExample = { + var typeName = s"com.openbankproject.commons.dto.OutBound${methodName.capitalize}" + val outBoundType = ReflectUtils.getTypeByName(typeName) + createDocExample(outBoundType).replaceAll("(?m)^(\\S)", " $1") + } + private[this] val inBoundExample = { + var typeName = s"com.openbankproject.commons.dto.InBound${methodName.capitalize}" + val inBoundType = ReflectUtils.getTypeByName(typeName) + createDocExample(inBoundType).replaceAll("(?m)^(\\S)", " $1") + } + + var signature = s"$methodName$paramAnResult" + + /** + * Get all the parameters name as a String from `typeSignature` object. + * eg: it will return + * , bankId, accountId, accountType, accountLabel, currency, initialBalance, accountHolderName, branchId, accountRoutingScheme, accountRoutingAddress + */ + private[this] val parametersNamesString = tp.paramLists(0)//paramLists will return all the curry parameters set. + .filterNot(_.asTerm.info =:= ru.typeOf[Option[CallContext]]) // remove the `CallContext` field. + .map(_.name.toString)//get all parameters name + .map(it => if(it =="type") "`type`" else it)//This is special case for `type`, it is the keyword in scala. + .map(it => if(it == "queryParams") "OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)" else it) + match { + case Nil => "" + case list:List[String] => list.mkString(", ", ", ", "") + } + + // for cache + private[this] val cacheMethodName = if(resultType.startsWith("Box[")) "memoizeSyncWithProvider" else "memoizeWithProvider" + + private[this] val timeoutFieldName = uncapitalize(methodName.replaceFirst("^[a-z]+", "")) + "TTL" + private[this] val cacheTimeout = ReflectUtils.findMethod(ru.typeOf[KafkaMappedConnector_vSept2018], timeoutFieldName)(_ => true) + .map(_.name.toString) + .getOrElse("accountTTL") + + // end for cache + + private val outBoundName = s"OutBound${methodName.capitalize}" + private val inBoundName = s"InBound${methodName.capitalize}" + + val inboundDataFieldType = ReflectUtils.getTypeByName(s"com.openbankproject.commons.dto.$inBoundName") + .member(TermName("data")).asMethod + .returnType.toString.replaceAll( + """(\w+\.)+(\w+\.Value)|(\w+\.)+(\w+)""", "$2$4" + ) + + def toCode(responseExpression: String => String, setTopic: Boolean = false, doCache: Boolean = false) = { + val (outBoundTopic, inBoundTopic) = setTopic match { + case true => + (s"""Some(Topics.createTopicByClassName("$outBoundName").request)""" , + s"""Some(Topics.createTopicByClassName("$outBoundName").request)""" ) + case false => (None, None) + } + + val missingCallContext = if(tp.paramLists(0) //if parameter have no callContext, add None to Body + .exists(_.asTerm.info =:= ru.typeOf[Option[CallContext]])) { + "" + } else { + "val callContext: Option[CallContext] = None \n" + } + + var body = + s"""| import com.openbankproject.commons.dto.{$outBoundName => OutBound, $inBoundName => InBound} + | ${missingCallContext}val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull $parametersNamesString) + | val response: Future[Box[InBound]] = ${responseExpression(methodName)} + | response.map(convertToTuple[$inboundDataFieldType](callContext)) """.stripMargin + + + if(doCache && methodName.matches("^(get|check|validate).+")) { + signature = signature.replaceFirst("""(\b\S+)\s*:\s*Option\[CallContext\]""", "@CacheKeyOmit callContext: Option[CallContext]") + body = + s"""saveConnectorMetric { + | /** + | * Please note that "var cacheKey = (randomUUID().toString, randomUUID().toString, randomUUID().toString)" + | * is just a temporary value filed with UUID values in order to prevent any ambiguity. + | * The real value will be assigned by Macro during compile time at this line of a code: + | * https://github.com/OpenBankProject/scala-macros/blob/master/macros/src/main/scala/com/tesobe/CacheKeyFromArgumentsMacro.scala#L49 + | */ + | var cacheKey = (randomUUID().toString, randomUUID().toString, randomUUID().toString) + | CacheKeyFromArguments.buildCacheKey { + | Caching.${cacheMethodName}(Some(cacheKey.toString()))($cacheTimeout seconds) { + | + | ${body.replaceAll("(?m)^ ", " ")} + | + | } + | } + | }("$methodName") + |""".stripMargin + } + s""" + | messageDocs += ${methodName}Doc + | def ${methodName}Doc = MessageDoc( + | process = "obp.$methodName", + | messageFormat = messageFormat, + | description = "$description", + | outboundTopic = $outBoundTopic, + | inboundTopic = $inBoundTopic, + | exampleOutboundMessage = ( + | $outBoundExample + | ), + | exampleInboundMessage = ( + | $inBoundExample + | ), + | adapterImplementation = Some(AdapterImplementation("- Core", 1)) + | ) + | + | override def $signature = { + | $body + | } + """.stripMargin + } + } +} + + diff --git a/obp-api/src/main/scala/code/bankconnectors/akka/AkkaConnectorBuilder.scala b/obp-api/src/main/scala/code/bankconnectors/akka/AkkaConnectorBuilder.scala new file mode 100644 index 000000000..6f7663703 --- /dev/null +++ b/obp-api/src/main/scala/code/bankconnectors/akka/AkkaConnectorBuilder.scala @@ -0,0 +1,191 @@ +package code.bankconnectors.akka + +import code.bankconnectors.ConnectorBuilderUtil + +import scala.collection.immutable.List +import scala.language.postfixOps + +object AkkaConnectorBuilder extends App { + + val genMethodNames = List( + // "getEmptyBankAccount", //not useful! + // "getCounterpartyFromTransaction", //not useful! + // "getCounterpartiesFromTransaction",//not useful! + + "getAdapterInfo", + "getChallengeThreshold", + "getChargeLevel", + "createChallenge", + "getBank", + "getBanks", + "getBankAccountsForUser", + "getUser", + "getBankAccount", + "getBankAccount", + "getBankAccountsBalances", + "getCoreBankAccounts", + "getBankAccountsHeld", + "checkBankAccountExists", + "getCounterparty", + "getCounterpartyTrait", + "getCounterpartyByCounterpartyId", + "getCounterpartyByIban", + "getCounterparties", + "getTransactions", + "getTransactionsCore", + "getTransaction", + "getPhysicalCards", + "getPhysicalCardForBank", + "deletePhysicalCardForBank", + "getPhysicalCardsForBank", + "createPhysicalCard", + "updatePhysicalCard", + "makePayment", + "makePaymentv200", + "makePaymentv210", + "makePaymentImpl", + "createTransactionRequest", + "createTransactionRequestv200", + "getStatus", + "getChargeValue", + "createTransactionRequestv210", + "createTransactionRequestImpl", + "createTransactionRequestImpl210", + "saveTransactionRequestTransaction", + "saveTransactionRequestTransactionImpl", + "saveTransactionRequestChallenge", + "saveTransactionRequestChallengeImpl", + "saveTransactionRequestStatusImpl", + "getTransactionRequests", + "getTransactionRequests210", + "getTransactionRequestStatuses", + "getTransactionRequestStatusesImpl", + "getTransactionRequestsImpl", + "getTransactionRequestsImpl210", + "getTransactionRequestImpl", + "getTransactionRequestTypes", + "getTransactionRequestTypesImpl", + "answerTransactionRequestChallenge", + "createTransactionAfterChallenge", + "createTransactionAfterChallengev200", + "createTransactionAfterChallengeV210", + "updateBankAccount", + "createBankAndAccount", + "createBankAccount", + "createSandboxBankAccount", + "setAccountHolder", + "accountExists", + "removeAccount", + "getMatchingTransactionCount", + "createImportedTransaction", + "updateAccountBalance", + "setBankAccountLastUpdated", + "updateAccountLabel", + "updateAccount", + "getProducts", + "getProduct", + "createOrUpdateBranch", + "createOrUpdateBank", + "createOrUpdateAtm", + "createOrUpdateProduct", + "createOrUpdateFXRate", + "getBranch", + "getBranches", + "getAtm", + "getAtms", + "accountOwnerExists", + "createViews", + "getCurrentFxRate", + "getCurrentFxRateCached", + "getTransactionRequestTypeCharge", + "UpdateUserAccoutViewsByUsername", + "createTransactionAfterChallengev300", + "makePaymentv300", + "createTransactionRequestv300", + "getTransactionRequestTypeCharges", + "createCounterparty", + "checkCustomerNumberAvailable", + "createCustomer", + "updateCustomerScaData", + "updateCustomerCreditData", + "updateCustomerGeneralData", + "getCustomersByUserId", + "getCustomerByCustomerId", + "getCustomerByCustomerNumber", + "getCustomerAddress", + "createCustomerAddress", + "updateCustomerAddress", + "deleteCustomerAddress", + "createTaxResidence", + "getTaxResidence", + "deleteTaxResidence", + "getCustomers", + "getCheckbookOrders", + "getStatusOfCreditCardOrder", + "createUserAuthContext", + "createUserAuthContextUpdate", + "deleteUserAuthContexts", + "deleteUserAuthContextById", + "getUserAuthContexts", + "createOrUpdateProductAttribute", + "getProductAttributeById", + "getProductAttributesByBankAndCode", + "deleteProductAttribute", + "getAccountAttributeById", + "createOrUpdateAccountAttribute", + "createAccountAttributes", + "getAccountAttributesByAccount", + "createOrUpdateCardAttribute", + "getCardAttributeById", + "getCardAttributesFromProvider", + "createAccountApplication", + "getAllAccountApplication", + "getAccountApplicationById", + "updateAccountApplicationStatus", + "getOrCreateProductCollection", + "getProductCollection", + "getOrCreateProductCollectionItem", + "getProductCollectionItem", + "getProductCollectionItemsTree", + "createMeeting", + "getMeetings", + "getMeeting", + "createOrUpdateKycCheck", + "createOrUpdateKycDocument", + "createOrUpdateKycMedia", + "createOrUpdateKycStatus", + "getKycChecks", + "getKycDocuments", + "getKycMedias", + "getKycStatuses", + "createMessage", + "makeHistoricalPayment", + // new removed comments + "validateChallengeAnswer", + "getBankLegacy", + "getBanksLegacy", + "getBankAccountsForUserLegacy", + "updateUserAccountViewsOld", + "getBankAccountLegacy", + "getBankAccountByIban", + "getBankAccountByRouting", + "getBankAccounts", + "getCoreBankAccountsLegacy", + "getBankAccountsHeldLegacy", + "checkBankAccountExistsLegacy", + "getCounterpartyByCounterpartyIdLegacy", + "getCounterpartiesLegacy", + "getTransactionsLegacy", + "getTransactionLegacy", + "getPhysicalCardsForBankLegacy", + "createPhysicalCardLegacy", + "createBankAccountLegacy", + "getBranchLegacy", + "getAtmLegacy", + "getCustomerByCustomerIdLegacy", + ) + + ConnectorBuilderUtil.generateMethods(genMethodNames, + "src/main/scala/code/bankconnectors/akka/AkkaConnector_vDec2018.scala", + "(southSideActor ? req).mapTo[InBound].map(Box !!(_))") +} diff --git a/obp-api/src/main/scala/code/bankconnectors/rest/RestConnectorBuilder.scala b/obp-api/src/main/scala/code/bankconnectors/rest/RestConnectorBuilder.scala index 87196d51e..a30c2c956 100644 --- a/obp-api/src/main/scala/code/bankconnectors/rest/RestConnectorBuilder.scala +++ b/obp-api/src/main/scala/code/bankconnectors/rest/RestConnectorBuilder.scala @@ -1,29 +1,12 @@ package code.bankconnectors.rest -import java.io.File -import java.util.Date - -import code.api.util.{APIUtil, CallContext, OBPQueryParam} -import code.bankconnectors.Connector -import com.openbankproject.commons.util.ReflectUtils -import org.apache.commons.io.FileUtils +import code.bankconnectors.ConnectorBuilderUtil import scala.collection.immutable.List import scala.language.postfixOps -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import code.api.util.CodeGenerateUtils.createDocExample object RestConnectorBuilder extends App { - // rewrite method code.webuiprops.MappedWebUiPropsProvider#getWebUiPropsValue, avoid access DB cause dataSource not found exception - { - import javassist.ClassPool - val pool = ClassPool.getDefault - val ct = pool.getCtClass("code.webuiprops.MappedWebUiPropsProvider$") - val m = ct.getDeclaredMethod("getWebUiPropsValue") - m.insertBefore("""return ""; """) - ct.toClass - } + val genMethodNames = List( // "getEmptyBankAccount", //not useful! @@ -203,265 +186,8 @@ object RestConnectorBuilder extends App { "getCustomerByCustomerIdLegacy", ) - private val mirror: ru.Mirror = ru.runtimeMirror(getClass().getClassLoader) - private val clazz: ru.ClassSymbol = ru.typeOf[Connector].typeSymbol.asClass - private val classMirror: ru.ClassMirror = mirror.reflectClass(clazz) - private val nameSignature = ru.typeOf[Connector].decls - .filter(_.isMethod) - .filter(it => genMethodNames.contains(it.name.toString)) - .filter(it => { - it.typeSignature.paramLists(0).find(_.asTerm.info =:= ru.typeOf[Option[CallContext]]).isDefined - }) - .map(it => { - val (methodName, typeSignature) = (it.name.toString, it.typeSignature) - methodName match { - // case name if(name.matches("(get|check).*")) => GetGenerator(methodName, typeSignature) - // case name if(name.matches("(create|make).*")) => PostGenerator(methodName, typeSignature) - case _ => PostGenerator(methodName, typeSignature)//throw new NotImplementedError(s" not support method name: $methodName") - } - - }) - - - // private val types: Iterable[ru.Type] = symbols.map(_.typeSignature) - // println(symbols) - println("-------------------") - nameSignature.map(_.toString).foreach(println(_)) - println("===================") - - val path = new File(getClass.getResource("").toURI.toString.replaceFirst("target/.*", "").replace("file:", ""), "src/main/scala/code/bankconnectors/rest/RestConnector_vMar2019.scala") - val source = FileUtils.readFileToString(path) - val start = "//---------------- dynamic start -------------------please don't modify this line" - val end = "//---------------- dynamic end ---------------------please don't modify this line" - val placeHolderInSource = s"""(?s)$start.+$end""" - val insertCode = - s"""$start - |// ---------- create on ${new Date()} - |${nameSignature.map(_.toString).mkString} - |$end """.stripMargin - val newSource = source.replaceFirst(placeHolderInSource, insertCode) - FileUtils.writeStringToFile(path, newSource) - - // to check whether example is correct. - private val tp: ru.Type = ReflectUtils.getTypeByName("com.openbankproject.commons.dto.InBoundGetProductCollectionItemsTree") - - println(createDocExample(tp)) + ConnectorBuilderUtil.buildMethods(genMethodNames, + "src/main/scala/code/bankconnectors/rest/RestConnector_vMar2019.scala", + methodName => s"""sendRequest[InBound](getUrl(callContext, "$methodName"), HttpMethods.POST, req, callContext)""") } -case class GetGenerator(methodName: String, tp: Type) { - private[this] def paramAnResult = tp.toString - .replaceAll("(\\w+\\.)+", "") - .replaceFirst("\\)", "): ") - .replaceFirst("""\btype\b""", "`type`") - .replace("cardAttributeType: Value", "cardAttributeType: CardAttributeType.Value") // scala enum is bad for Reflection - .replace("productAttributeType: Value", "productAttributeType: ProductAttributeType.Value") // scala enum is bad for Reflection - .replace("accountAttributeType: Value", "accountAttributeType: AccountAttributeType.Value") // scala enum is bad for Reflection - .replaceFirst("""callContext:\s*Option\[CallContext\]""", "@CacheKeyOmit callContext: Option[CallContext]") - - private[this] val params = tp.paramLists(0).filterNot(_.asTerm.info =:= ru.typeOf[Option[CallContext]]).map(_.name.toString) - - private[this] val description = methodName.replace("Future", "").replaceAll("([a-z])([A-Z])", "$1 $2").capitalize - private[this] val resultType = tp.resultType.toString.replaceAll("(\\w+\\.)+", "") - - private[this] val isReturnBox = resultType.startsWith("Box[") - - private[this] val cachMethodName = if(isReturnBox) "memoizeSyncWithProvider" else "memoizeWithProvider" - - private[this] val outBoundExample = { - var typeName = s"com.openbankproject.commons.dto.OutBound${methodName.capitalize}" - if(!ReflectUtils.isTypeExists(typeName)) typeName += "Future" - val outBoundType = ReflectUtils.getTypeByName(typeName) - createDocExample(outBoundType).replaceAll("(?m)^(\\S)", " $1") - } - private[this] val inBoundExample = { - var typeName = s"com.openbankproject.commons.dto.InBound${methodName.capitalize}" - if(!ReflectUtils.isTypeExists(typeName)) typeName += "Future" - val inBoundType = ReflectUtils.getTypeByName(typeName) - createDocExample(inBoundType).replaceAll("(?m)^(\\S)", " $1") - } - - val signature = s"$methodName$paramAnResult" - - val pathVariables = tp.paramLists(0) //For a method or poly type, a list of its value parameter sections. - .filterNot(_.info =:= ru.typeOf[Option[CallContext]]) - .map { it => - // make sure if param signature is: queryParams: List[OBPQueryParam] , the param name must be queryParams - val paramName = if(it.info <:< typeOf[Seq[OBPQueryParam]]) "queryParams" else it.name.toString - val paramValue = it.name.toString - s""", ("$paramName", $paramValue)""" - }.mkString - - val urlDemo = s"/$methodName" + params.map(it => s"/$it/{$it}").mkString - val jsonType = { - val typeName = s"com.openbankproject.commons.dto.InBound${methodName.capitalize}" - if(ReflectUtils.isTypeExists(typeName)) { - s"InBound${methodName.capitalize}" - } - else { - s"InBound${methodName.capitalize}Future" - } - } - - - val dataType = if (resultType.startsWith("Future[Box[")) { - resultType.replaceFirst("""Future\[Box\[\((.+), Option\[CallContext\]\)\]\]""", "$1").replaceFirst("(\\])|$", "Commons$1") - } else if (resultType.startsWith("OBPReturnType[Box[")) { - resultType.replaceFirst("""OBPReturnType\[Box\[(.+)\]\]""", "$1").replaceFirst("(\\])|$", "Commons$1") - } else if (isReturnBox) { - //Box[(InboundAdapterInfoInternal, Option[CallContext])] - resultType.replaceFirst("""Box\[\((.+), Option\[CallContext\]\)\]""", "$1").replaceFirst("(\\])|$", "Commons$1") - } else { - throw new NotImplementedError(s"this return type not implemented: $resultType") - } - val returnEntityType = dataType.replaceFirst("Commons$", "").replaceAll(".*\\[|\\].*", "") - - val lastMapStatement = if (isReturnBox || resultType.startsWith("Future[Box[")) { - """| boxedResult.map { result => - | (result.data, buildCallContext(result.inboundAdapterCallContext, callContext)) - | } - """.stripMargin - } else { - """| boxedResult match { - | case Full(result) => (Full(result.data), buildCallContext(result.inboundAdapterCallContext, callContext)) - | case result: EmptyBox => (result, callContext) // Empty and Failure all match this case - | } - """.stripMargin - } - - override def toString = - s""" - |messageDocs += MessageDoc( - | process = "obp.$methodName", - | messageFormat = messageFormat, - | description = "$description", - | outboundTopic = None, - | inboundTopic = None, - | exampleOutboundMessage = ( - | $outBoundExample - | ), - | exampleInboundMessage = ( - | $inBoundExample - | ), - | adapterImplementation = Some(AdapterImplementation("- Core", 1)) - | ) - | // url example: $urlDemo - | override def $signature = saveConnectorMetric { - | /** - | * Please note that "var cacheKey = (randomUUID().toString, randomUUID().toString, randomUUID().toString)" - | * is just a temporary value filed with UUID values in order to prevent any ambiguity. - | * The real value will be assigned by Macro during compile time at this line of a code: - | * https://github.com/OpenBankProject/scala-macros/blob/master/macros/src/main/scala/com/tesobe/CacheKeyFromArgumentsMacro.scala#L49 - | */ - | var cacheKey = (randomUUID().toString, randomUUID().toString, randomUUID().toString) - | CacheKeyFromArguments.buildCacheKey { - | Caching.${cachMethodName}(Some(cacheKey.toString()))(banksTTL second){ - | val url = ""//getUrl(callContext, "$methodName" $pathVariables) - | sendGetRequest[$jsonType](url, callContext) - | .map { boxedResult => - | $lastMapStatement - | } - | } - | } - | }("$methodName") - """.stripMargin -} - -case class PostGenerator(methodName: String, tp: Type) { - private[this] def paramAnResult = tp.toString - .replaceAll("(\\w+\\.)+", "") - .replaceFirst("\\)", "): ") - .replace("cardAttributeType: Value", "cardAttributeType: CardAttributeType.Value") // scala enum is bad for Reflection - .replace("productAttributeType: Value", "productAttributeType: ProductAttributeType.Value") // scala enum is bad for Reflection - .replace("accountAttributeType: Value", "accountAttributeType: AccountAttributeType.Value") // scala enum is bad for Reflection - .replaceFirst("""\btype\b""", "`type`") - - private[this] val params = tp.paramLists(0).filterNot(_.asTerm.info =:= ru.typeOf[Option[CallContext]]).map(_.name.toString).mkString(", ", ", ", "").replaceFirst("""\btype\b""", "`type`") - private[this] val description = methodName.replaceAll("([a-z])([A-Z])", "$1 $2").capitalize - - private[this] val entityName = methodName.replaceFirst("^[a-z]+(OrUpdate)?", "") - - private[this] val resultType = tp.resultType.toString.replaceAll("(\\w+\\.)+", "") - - private[this] val isOBPReturnType = resultType.startsWith("OBPReturnType[") - - private[this] val outBoundExample = { - var typeName = s"com.openbankproject.commons.dto.OutBound${methodName.capitalize}" - val outBoundType = ReflectUtils.getTypeByName(typeName) - createDocExample(outBoundType).replaceAll("(?m)^(\\S)", " $1") - } - private[this] val inBoundExample = { - var typeName = s"com.openbankproject.commons.dto.InBound${methodName.capitalize}" - val inBoundType = ReflectUtils.getTypeByName(typeName) - createDocExample(inBoundType).replaceAll("(?m)^(\\S)", " $1") - } - - val signature = s"$methodName$paramAnResult" - val urlDemo = s"/$methodName" - - val lastMapStatement = if (isOBPReturnType) { - """|boxedResult match { - | case Full(result) => (Full(result.data), buildCallContext(result.inboundAdapterCallContext, callContext)) - | case result: EmptyBox => (result, callContext) // Empty and Failure all match this case - | } - """.stripMargin - } else { - """|boxedResult.map { result => - | (result.data, buildCallContext(result.inboundAdapterCallContext, callContext)) - | } - """.stripMargin - } - val httpMethod = APIUtil.getRequestTypeByMethodName(methodName) match { - case "get" => "HttpMethods.GET" - case "post" => "HttpMethods.POST" - case "put" => "HttpMethods.PUT" - case "delete" => "HttpMethods.DELETE" - } - - /** - * Get all the parameters name as a String from `typeSignature` object. - * eg: it will return - * , bankId, accountId, accountType, accountLabel, currency, initialBalance, accountHolderName, branchId, accountRoutingScheme, accountRoutingAddress - */ - private[this] val parametersNamesString = tp.paramLists(0)//paramLists will return all the curry parameters set. - .filterNot(_.asTerm.info =:= ru.typeOf[Option[CallContext]]) // remove the `CallContext` field. - .map(_.name.toString)//get all parameters name - .map(it => if(it =="type") "`type`" else it)//This is special case for `type`, it is the keyword in scala. - .map(it => if(it == "queryParams") "OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)" else it) - match { - case Nil => "" - case list:List[String] => list.mkString(", ", ", ", "") - } - - val inboundDataFieldType = ReflectUtils.getTypeByName(s"com.openbankproject.commons.dto.InBound${methodName.capitalize}") - .member(TermName("data")).asMethod - .returnType.toString.replaceAll( - """(\w+\.)+(\w+\.Value)|(\w+\.)+(\w+)""", "$2$4" - ) - - override def toString = - s""" - | messageDocs += ${methodName}Doc - | def ${methodName}Doc = MessageDoc( - | process = "obp.$methodName", - | messageFormat = messageFormat, - | description = "$description", - | outboundTopic = None, - | inboundTopic = None, - | exampleOutboundMessage = ( - | $outBoundExample - | ), - | exampleInboundMessage = ( - | $inBoundExample - | ), - | adapterImplementation = Some(AdapterImplementation("- Core", 1)) - | ) - | // url example: $urlDemo - | override def $signature = { - | import com.openbankproject.commons.dto.{OutBound${methodName.capitalize} => OutBound, InBound${methodName.capitalize} => InBound} - | val url = getUrl(callContext, "$methodName") - | val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull $parametersNamesString) - | val result: OBPReturnType[Box[$inboundDataFieldType]] = sendRequest[InBound](url, $httpMethod, req, callContext).map(convertToTuple(callContext)) - | result - | } - """.stripMargin -} diff --git a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnectorBuilder.scala b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnectorBuilder.scala index 6e26d4fb2..a5738fab4 100644 --- a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnectorBuilder.scala +++ b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnectorBuilder.scala @@ -1,32 +1,12 @@ package code.bankconnectors.storedprocedure -import java.io.File -import java.util.Date - -import code.api.util.APIUtil.AdapterImplementation -import code.api.util.CallContext -import code.api.util.CodeGenerateUtils.createDocExample -import code.bankconnectors.Connector -import com.openbankproject.commons.util.ReflectUtils +import code.bankconnectors.ConnectorBuilderUtil import net.liftweb.util.StringHelpers -import org.apache.commons.io.FileUtils import scala.collection.immutable.List import scala.language.postfixOps -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.util.Random object StoredProcedureConnectorBuilder extends App { - // rewrite method code.webuiprops.MappedWebUiPropsProvider#getWebUiPropsValue, avoid access DB cause dataSource not found exception - { - import javassist.ClassPool - val pool = ClassPool.getDefault - val ct = pool.getCtClass("code.webuiprops.MappedWebUiPropsProvider$") - val m = ct.getDeclaredMethod("getWebUiPropsValue") - m.insertBefore("""return ""; """) - ct.toClass - } val genMethodNames = List( "getAdapterInfo", @@ -207,168 +187,8 @@ object StoredProcedureConnectorBuilder extends App { // "getCounterpartiesFromTransaction",//not useful! ) - private val mirror: ru.Mirror = ru.runtimeMirror(getClass().getClassLoader) - private val clazz: ru.ClassSymbol = ru.typeOf[Connector].typeSymbol.asClass - private val classMirror: ru.ClassMirror = mirror.reflectClass(clazz) - - /* - find missing OutBound types - val a = ru.typeOf[Connector].decls - .filter(_.isMethod) - .filter(it => genMethodNames.contains(it.name.toString)) - .map(_.name.toString) - .map(it => s"com.openbankproject.commons.dto.OutBound${it.capitalize}") - .filter(it => { - try { - ReflectUtils.getTypeByName(it) - false - } catch { - case _: Throwable => true - } - }).foreach(it => println(it.replace("com.openbankproject.commons.dto.OutBound", ""))) -*/ - - private val nameSignature = ru.typeOf[Connector].decls - .filter(_.isMethod) - .filter(it => genMethodNames.contains(it.name.toString)) - .map(it => { - val (methodName, typeSignature) = (it.name.toString, it.typeSignature) - MethodBodyGenerator(methodName, typeSignature) - }) - - - // private val types: Iterable[ru.Type] = symbols.map(_.typeSignature) - // println(symbols) - println("-------------------") - nameSignature.map(_.toString).foreach(println(_)) - println("===================") - - val path = new File(getClass.getResource("").toURI.toString.replaceFirst("target/.*", "").replace("file:", ""), "src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnector_vDec2019.scala") - val source = FileUtils.readFileToString(path, "utf-8") - val start = "//---------------- dynamic start -------------------please don't modify this line" - val end = "//---------------- dynamic end ---------------------please don't modify this line" - val placeHolderInSource = s"""(?s)$start.+$end""" - val insertCode = - s"""$start - |// ---------- create on ${new Date()} - |${nameSignature.map(_.toString).mkString} - |$end """.stripMargin - val newSource = source.replaceFirst(placeHolderInSource, insertCode) - FileUtils.writeStringToFile(path, newSource, "utf-8") - - // to check whether example is correct. - private val tp: ru.Type = ReflectUtils.getTypeByName("com.openbankproject.commons.dto.InBoundGetProductCollectionItemsTree") - - println(createDocExample(tp)) + ConnectorBuilderUtil.buildMethods(genMethodNames, + "src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnector_vDec2019.scala", + methodName => s"sendRequest[InBound](${StringHelpers.snakify(methodName)}, req, callContext)") } - -case class MethodBodyGenerator(methodName: String, tp: Type) { - private[this] def paramAnResult = tp.toString - .replaceAll("(\\w+\\.)+", "") - .replaceFirst("\\)", "): ") - .replace("cardAttributeType: Value", "cardAttributeType: CardAttributeType.Value") // scala enum is bad for Reflection - .replace("productAttributeType: Value", "productAttributeType: ProductAttributeType.Value") // scala enum is bad for Reflection - .replace("accountAttributeType: Value", "accountAttributeType: AccountAttributeType.Value") // scala enum is bad for Reflection - .replaceFirst("""\btype\b""", "`type`") - - private[this] val params = tp.paramLists(0).filterNot(_.asTerm.info =:= ru.typeOf[Option[CallContext]]).map(_.name.toString).mkString(", ", ", ", "").replaceFirst("""\btype\b""", "`type`") - - private val procedureName = StringHelpers.snakify(methodName) - - private[this] val description = s""" - || |${methodName.replaceAll("([a-z])([A-Z])", "$1 $2").capitalize} - || | - || |The connector name is: stored_procedure_vDec2019 - || |The MS SQL Server stored procedure name is: $procedureName - """ - - - private[this] val entityName = methodName.replaceFirst("^[a-z]+(OrUpdate)?", "") - - private[this] val resultType = tp.resultType.toString.replaceAll("(\\w+\\.)+", "") - - private[this] val isOBPReturnType = resultType.startsWith("OBPReturnType[") - - private[this] val outBoundExample = { - var typeName = s"com.openbankproject.commons.dto.OutBound${methodName.capitalize}" - val outBoundType = ReflectUtils.getTypeByName(typeName) - createDocExample(outBoundType).replaceAll("(?m)^(\\S)", " $1") - } - private[this] val inBoundExample = { - var typeName = s"com.openbankproject.commons.dto.InBound${methodName.capitalize}" - val inBoundType = ReflectUtils.getTypeByName(typeName) - createDocExample(inBoundType).replaceAll("(?m)^(\\S)", " $1") - } - - val signature = s"$methodName$paramAnResult" - val urlDemo = s"/$methodName" - - val lastMapStatement = if (isOBPReturnType) { - """|boxedResult match { - | case Full(result) => (Full(result.data), buildCallContext(result.inboundAdapterCallContext, callContext)) - | case result: EmptyBox => (result, callContext) // Empty and Failure all match this case - | } - """.stripMargin - } else { - """|boxedResult.map { result => - | (result.data, buildCallContext(result.inboundAdapterCallContext, callContext)) - | } - """.stripMargin - } - - - /** - * Get all the parameters name as a String from `typeSignature` object. - * eg: it will return - * , bankId, accountId, accountType, accountLabel, currency, initialBalance, accountHolderName, branchId, accountRoutingScheme, accountRoutingAddress - */ - private[this] val parametersNamesString = tp.paramLists(0)//paramLists will return all the curry parameters set. - .filterNot(_.asTerm.info =:= ru.typeOf[Option[CallContext]]) // remove the `CallContext` field. - .map(_.name.toString)//get all parameters name - .map(it => if(it =="type") "`type`" else it)//This is special case for `type`, it is the keyword in scala. - .map(it => if(it == "queryParams") "OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)" else it) - match { - case Nil => "" - case list:List[String] => list.mkString(", ", ", ", "") - } - - val inboundDataFieldType = ReflectUtils.getTypeByName(s"com.openbankproject.commons.dto.InBound${methodName.capitalize}") - .member(TermName("data")).asMethod - .returnType.toString.replaceAll( - """(\w+\.)+(\w+\.Value)|(\w+\.)+(\w+)""", "$2$4" - ) - - val callContextVal: String = if(tp.paramLists(0).find(_.asTerm.info =:= ru.typeOf[Option[CallContext]]).isEmpty) { - "val callContext: Option[CallContext] = None" - } else "" - - val randomNum = Random.nextInt(100) - override def toString = - s""" - | messageDocs += ${methodName}Doc$randomNum - | private def ${methodName}Doc$randomNum = MessageDoc( - | process = "obp.$methodName", - | messageFormat = messageFormat, - | description = \"\"\"${description}\"\"\".stripMargin, - | outboundTopic = None, - | inboundTopic = None, - | exampleOutboundMessage = ( - | $outBoundExample - | ), - | exampleInboundMessage = ( - | $inBoundExample - | ), - | adapterImplementation = Some(AdapterImplementation("- Core", 1)) - | ) - | // stored procedure name: $procedureName - | override def $signature = { - | import com.openbankproject.commons.dto.{OutBound${methodName.capitalize} => OutBound, InBound${methodName.capitalize} => InBound} - | val procedureName = "$procedureName" - | $callContextVal - | val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull $parametersNamesString) - | val result: OBPReturnType[Box[$inboundDataFieldType]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - | result - | } - """.stripMargin -} diff --git a/obp-api/src/main/scala/code/bankconnectors/vMay2019/KafkaConnectorBuilder.scala b/obp-api/src/main/scala/code/bankconnectors/vMay2019/KafkaConnectorBuilder.scala index 9749c6bfe..86e8458d2 100644 --- a/obp-api/src/main/scala/code/bankconnectors/vMay2019/KafkaConnectorBuilder.scala +++ b/obp-api/src/main/scala/code/bankconnectors/vMay2019/KafkaConnectorBuilder.scala @@ -6,7 +6,7 @@ import java.util.regex.Matcher import code.api.util.ApiTag.ResourceDocTag import code.api.util.{ApiTag, CallContext, OBPQueryParam} -import code.bankconnectors.Connector +import code.bankconnectors.{Connector, ConnectorBuilderUtil} import com.openbankproject.commons.util.ReflectUtils import org.apache.commons.io.FileUtils import org.apache.commons.lang3.StringUtils._ @@ -16,17 +16,10 @@ import scala.language.postfixOps import scala.reflect.runtime.universe._ import scala.reflect.runtime.{universe => ru} import code.api.util.CodeGenerateUtils.createDocExample +import code.bankconnectors.vSept2018.KafkaConnectorBuilder.genMethodNames import javassist.ClassPool object KafkaConnectorBuilder extends App { - // rewrite method code.webuiprops.MappedWebUiPropsProvider#getWebUiPropsValue, avoid access DB cause dataSource not found exception - { - val pool = ClassPool.getDefault - val ct = pool.getCtClass("code.webuiprops.MappedWebUiPropsProvider$") - val m = ct.getDeclaredMethod("getWebUiPropsValue") - m.insertBefore("""return ""; """) - ct.toClass - } val genMethodNames = List( "getAdapterInfo", @@ -42,175 +35,9 @@ object KafkaConnectorBuilder extends App { "getCustomerByCustomerNumber" ) - private val mirror: ru.Mirror = ru.runtimeMirror(getClass().getClassLoader) - private val clazz: ru.ClassSymbol = ru.typeOf[Connector].typeSymbol.asClass - private val classMirror: ru.ClassMirror = mirror.reflectClass(clazz) - private val nameSignature = ru.typeOf[Connector].decls - .filter(_.isMethod) - .filter(it => genMethodNames.contains(it.name.toString)) - .filter(it => { - it.typeSignature.paramLists(0).find(_.asTerm.info =:= ru.typeOf[Option[CallContext]]).isDefined - }) - .map(it => (it.name.toString, it.typeSignature)) - .map{ - case (methodName, typeSignature) if(methodName.matches("^(get|check).+")) => GetGenerator(methodName, typeSignature) - case other => new CommonGenerator(other._1, other._2) - } - - if(genMethodNames.size > nameSignature.size) { - val foundMehotdNames = nameSignature.map(_.methodName).toList - val notFoundMethodNames = genMethodNames.diff(foundMehotdNames) - throw new IllegalArgumentException(s"some method not found, please check typo: ${notFoundMethodNames.mkString(", ")}") - } - - // private val types: Iterable[ru.Type] = symbols.map(_.typeSignature) - // println(symbols) - println("-------------------") - nameSignature.map(_.toString).foreach(println(_)) - println("===================") - - val path = new File(getClass.getResource("").toURI.toString.replaceFirst("target/.*", "").replace("file:", ""), "src/main/scala/code/bankconnectors/vMay2019/KafkaMappedConnector_vMay2019.scala") - val source = FileUtils.readFileToString(path) - val start = "//---------------- dynamic start -------------------please don't modify this line" - val end = "//---------------- dynamic end ---------------------please don't modify this line" - val placeHolderInSource = s"""(?s)$start.+$end""" - val insertCode = - s""" - |$start - |// ---------- create on ${new Date()} - |${nameSignature.map(_.toString).mkString} - |$end - """.stripMargin - val newSource = source.replaceFirst(placeHolderInSource, Matcher.quoteReplacement(insertCode)) - FileUtils.writeStringToFile(path, newSource) - - // to check whether example is correct. - private val tp: ru.Type = ReflectUtils.getTypeByName("com.openbankproject.commons.dto.InBoundGetProductCollectionItemsTree") - - println(createDocExample(tp)) -} - -class CommonGenerator(val methodName: String, tp: Type) { - protected[this] def paramAnResult = tp.toString - .replaceAll("""(\w+\.)+(\w+\.Value)""", "$2") - .replaceAll("""(\w+\.){2,}""", "") - .replaceFirst("\\)", "): ") - .replaceFirst("""\btype\b""", "`type`") - - val queryParamsListName = tp.paramLists(0).find(symbol => symbol.info <:< typeOf[List[OBPQueryParam]]).map(_.name.toString) - - private[this] val params: String = tp.paramLists(0) - .filterNot(_.asTerm.info =:= ru.typeOf[Option[CallContext]]) - .map(_.name.toString) - .map(it => if(it =="type") "`type`" else it) - match { - case Nil => "" - case list:List[String] => { - val paramNames = list.mkString(", ", ", ", "") - queryParamsListName match { - // deal with queryParams: List[OBPQueryParam], convert to four parameters - case Some(queryParams) => paramNames.replaceFirst( - s"""\\b(${queryParams})\\b""", - "OBPQueryParam.getLimit($1), OBPQueryParam.getOffset($1), OBPQueryParam.getFromDate($1), OBPQueryParam.getToDate($1)" - ) - case scala.None => paramNames - } - } - } - - private[this] val description = methodName.replace("Future", "").replaceAll("([a-z])([A-Z])", "$1 $2").capitalize - - private[this] val outBoundExample = { - var typeName = s"com.openbankproject.commons.dto.OutBound${methodName.capitalize}" - if(!ReflectUtils.isTypeExists(typeName)) typeName += "Future" - val outBoundType = ReflectUtils.getTypeByName(typeName) - createDocExample(outBoundType).replaceAll("(?m)^(\\S)", " $1") - } - private[this] val inBoundExample = { - var typeName = s"com.openbankproject.commons.dto.InBound${methodName.capitalize}" - if(!ReflectUtils.isTypeExists(typeName)) typeName += "Future" - val inBoundType = ReflectUtils.getTypeByName(typeName) - createDocExample(inBoundType).replaceAll("(?m)^(\\S)", " $1") - } - - val signature = s"$methodName$paramAnResult" - - val outboundName = s"OutBound${methodName.capitalize}" - val inboundName = s"InBound${methodName.capitalize}" - - val tagValues = ReflectUtils.getType(ApiTag).decls - .filter(it => it.isMethod && it.asMethod.returnType <:< typeOf[ResourceDocTag]) - .map(_.asMethod) - .filter(method => method.paramLists.isEmpty) - .map(method => ReflectUtils.invokeMethod(ApiTag, method)) - .map(_.asInstanceOf[ResourceDocTag]) - .map(_.tag) - .map(it => (it.replaceAll("""\W""", "").toLowerCase, it)) - .toMap - - val tag = tagValues.filter(it => methodName.toLowerCase().contains(it._1)).map(_._2).toList.sortBy(_.size).lastOption.getOrElse("- Core") - - val queryParamList = params.replaceFirst("""\b(.+?):\s*List[OBPQueryParam]""", "OBPQueryParam.getLimit($1), OBPQueryParam.getOffset($1), OBPQueryParam.getFromDate($1), OBPQueryParam.getToDate(queryParams)") - - protected[this] def methodBody: String = - s"""{ - | import com.openbankproject.commons.dto.{${outboundName} => OutBound, ${inboundName} => InBound} - | - | val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).get ${params}) - | logger.debug(s"Kafka ${methodName} Req is: $$req") - | processRequest[InBound](req) map (convertToTuple(callContext)) - | } - """.stripMargin - - override def toString = - s""" - | messageDocs += MessageDoc( - | process = s"obp.$${nameOf($methodName _)}", - | messageFormat = messageFormat, - | description = "$description", - | outboundTopic = Some(Topics.createTopicByClassName(${outboundName}.getClass.getSimpleName).request), - | inboundTopic = Some(Topics.createTopicByClassName(${outboundName}.getClass.getSimpleName).response), - | exampleOutboundMessage = ( - | $outBoundExample - | ), - | exampleInboundMessage = ( - | $inBoundExample - | ), - | adapterImplementation = Some(AdapterImplementation("${tag}", 1)) - | ) - | override def $signature = ${methodBody} - """.stripMargin -} - -case class GetGenerator(override val methodName: String, tp: Type) extends CommonGenerator(methodName, tp) { - private[this] val resultType = tp.resultType.toString.replaceAll("(\\w+\\.)+", "") - - private[this] val isReturnBox = resultType.startsWith("Box[") - - private[this] val cachMethodName = if(isReturnBox) "memoizeSyncWithProvider" else "memoizeWithProvider" - - private[this] val timeoutFieldName = uncapitalize(methodName.replaceFirst("^[a-z]+", "")) + "TTL" - private[this] val cacheTimeout = ReflectUtils.findMethod(ru.typeOf[KafkaMappedConnector_vMay2019], timeoutFieldName)(_ => true) - .map(_.name.toString) - .getOrElse("accountTTL") - - override def paramAnResult = super.paramAnResult - .replaceFirst("""callContext:\s*Option\[CallContext\]""", "@CacheKeyOmit callContext: Option[CallContext]") - - override protected[this] def methodBody: String = - s"""saveConnectorMetric { - | /** - | * Please note that "var cacheKey = (randomUUID().toString, randomUUID().toString, randomUUID().toString)" - | * is just a temporary value filed with UUID values in order to prevent any ambiguity. - | * The real value will be assigned by Macro during compile time at this line of a code: - | * https://github.com/OpenBankProject/scala-macros/blob/master/macros/src/main/scala/com/tesobe/CacheKeyFromArgumentsMacro.scala#L49 - | */ - | var cacheKey = (randomUUID().toString, randomUUID().toString, randomUUID().toString) - | CacheKeyFromArguments.buildCacheKey { - | Caching.${cachMethodName}(Some(cacheKey.toString()))(${cacheTimeout} second) ${super.methodBody.replaceAll("(?m)^ ", " ")} - | } - | }("$methodName") - """.stripMargin + ConnectorBuilderUtil.generateMethods(genMethodNames, + "src/main/scala/code/bankconnectors/vMay2019/KafkaMappedConnector_vMay2019.scala", + "processRequest[InBound](req)", true) } diff --git a/obp-api/src/main/scala/code/bankconnectors/vSept2018/KafkaConnectorBuilder.scala b/obp-api/src/main/scala/code/bankconnectors/vSept2018/KafkaConnectorBuilder.scala index 288f0bdcc..678ff36a8 100644 --- a/obp-api/src/main/scala/code/bankconnectors/vSept2018/KafkaConnectorBuilder.scala +++ b/obp-api/src/main/scala/code/bankconnectors/vSept2018/KafkaConnectorBuilder.scala @@ -1,35 +1,13 @@ package code.bankconnectors.vSept2018 -import java.io.File -import java.util.Date -import java.util.regex.Matcher - -import code.api.util.ApiTag.ResourceDocTag -import code.api.util.{ApiTag, CallContext, OBPQueryParam} -import code.bankconnectors.Connector -import com.openbankproject.commons.util.ReflectUtils -import org.apache.commons.io.FileUtils -import org.apache.commons.lang3.StringUtils._ +import code.bankconnectors.ConnectorBuilderUtil import scala.collection.immutable.List import scala.language.postfixOps -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} - -import code.api.util.CodeGenerateUtils.createDocExample object KafkaConnectorBuilder extends App { - // rewrite method code.webuiprops.MappedWebUiPropsProvider#getWebUiPropsValue, avoid access DB cause dataSource not found exception - { - import javassist.ClassPool - val pool = ClassPool.getDefault - val ct = pool.getCtClass("code.webuiprops.MappedWebUiPropsProvider$") - val m = ct.getDeclaredMethod("getWebUiPropsValue") - m.insertBefore("""return ""; """) - ct.toClass - } - val needToGenerateMethodsNames = List( + val genMethodNames = List( // "getKycChecks", // "getKycDocuments", // "getKycMedias", @@ -42,223 +20,12 @@ object KafkaConnectorBuilder extends App { "createBankAccount", ) - private val mirror: ru.Mirror = ru.runtimeMirror(getClass().getClassLoader) - private val clazz: ru.ClassSymbol = ru.typeOf[Connector].typeSymbol.asClass - private val classMirror: ru.ClassMirror = mirror.reflectClass(clazz) - private val generatedMethods: Iterable[CommonGenerator] = ru.typeOf[Connector].decls//this will return all Connector.scala direct(no inherited) declared members,eg: method, val - .filter(_.isMethod) //Note: filter by method type. - .filter(directlyDeclaredMember => needToGenerateMethodsNames.contains(directlyDeclaredMember.name.toString))// Find the method according to the `genMethodNames` List. - .filter(directlyDeclaredMember => { - directlyDeclaredMember.typeSignature.paramLists(0).find(_.asTerm.info =:= ru.typeOf[Option[CallContext]]).isDefined //Just find the method, which has the `CallContext` as parameter - }) - .map(directlyDeclaredMember => (directlyDeclaredMember.name.toString, directlyDeclaredMember.typeSignature)) //eg: (name =createBankAccount), (typeSignature = all parameters, return type info) - .map{ - case (methodName, typeSignature) if(methodName.matches("^(get|check).+")) => GetGenerator(methodName, typeSignature) - //Not finished yet, need to prepare create,delete Generator too. - case (methodName, typeSignature) => new CommonGenerator(methodName, typeSignature) - } - - //If there are more methods in the `needToGenerateMethodsNames` than `generatedMethods`, it mean some methods names are wrong... - //This will throw the Exception back directly - if(needToGenerateMethodsNames.size > generatedMethods.size) { - val generatedMethodsNames = generatedMethods.map(_.methodName).toList - val invalidMethodNames = needToGenerateMethodsNames.filterNot(generatedMethodsNames.contains(_)) - throw new IllegalArgumentException(s"Some methods names are invalid, please check following methods typo: ${invalidMethodNames.mkString(", ")}") - } - - println("-------------------") -// generatedMethods.map(_.toString).foreach(println(_)) - println("===================") - - val path = new File(getClass.getResource("").toURI.toString.replaceFirst("target/.*", "").replace("file:", ""), "src/main/scala/code/bankconnectors/vSept2018/KafkaMappedConnector_vSept2018.scala") - val source = FileUtils.readFileToString(path) - val start = "//---------------- dynamic start -------------------please don't modify this line" - val end = "//---------------- dynamic end ---------------------please don't modify this line" - val placeHolderInSource = s"""(?s)$start.+$end""" - val insertCode = - s""" - |$start - |// ---------- create on ${new Date()} - |${generatedMethods.map(_.toString).mkString} - |$end - """.stripMargin - val newSource = source.replaceFirst(placeHolderInSource, Matcher.quoteReplacement(insertCode)) - FileUtils.writeStringToFile(path, newSource) - - // to check whether example is correct. - private val tp: ru.Type = ReflectUtils.getTypeByName("com.openbankproject.commons.dto.InBoundGetProductCollectionItemsTree") - - println(createDocExample(tp)) -} - -/** - * We will generate all the kafka connector code in to toString method: - * eg: if we use `createBankAccount` as an example: - * toString will return `messageDocs` and `override def createBankAccount` - * - * @param methodName eg: createBankAccount - * @param typeSignature eg: all the parameters and return type information are all in this filed. - */ -class CommonGenerator(val methodName: String, typeSignature: Type) { - /** - * typeSignature.toString --> - * (bankId: com.openbankproject.commons.model.BankId, accountId: com.openbankproject.commons.model.AccountId, accountType: String, - * accountLabel: String, currency: String, initialBalance: BigDecimal, accountHolderName: String, branchId: String, accountRoutingScheme: String, - * accountRoutingAddress: String, callContext: Option[code.api.util.CallContext]) - * code.api.util.APIUtil.OBPReturnType[net.liftweb.common.Box[com.openbankproject.commons.model.BankAccount]] - * - * .replaceAll("(\\w+\\.)+", "")--> this will clean the package path, only keep the Class Name. - * (bankId: BankId, accountId: AccountId, accountType: String, accountLabel: String, currency: String, initialBalance: BigDecimal, - * accountHolderName: String, branchId: String, accountRoutingScheme: String, accountRoutingAddress: String, callContext: Option[CallContext]) - * OBPReturnType[Box[BankAccount]] - * - * .replaceFirst("\\)", "): ") --> this will add the `:` before the returnType. - * (bankId: BankId, accountId: AccountId, accountType: String, accountLabel: String, currency: String, initialBalance: BigDecimal, - * accountHolderName: String, branchId: String, accountRoutingScheme: String, accountRoutingAddress: String, callContext: Option[CallContext]): - * OBPReturnType[Box[BankAccount]] - * - * .replaceFirst("""\btype\b""", "`type`") --> type is key word of scala, it must be escaped as a parameter - * (bankId: BankId, accountId: AccountId, accountType: String, accountLabel: String, currency: String, initialBalance: BigDecimal, - * accountHolderName: String, branchId: String, accountRoutingScheme: String, accountRoutingAddress: String, callContext: Option[CallContext]): - * OBPReturnType[Box[BankAccount]] - * - */ - protected[this] def cleanParametersAndReturnTpyeString = typeSignature.toString - .replaceAll("(\\w+\\.)+", "") - .replaceFirst("\\)", "): ") - .replaceFirst("""\btype\b""", "`type`") - - /** - * Get all the parameters name as a String from `typeSignature` object. - * eg: it will return - * , bankId, accountId, accountType, accountLabel, currency, initialBalance, accountHolderName, branchId, accountRoutingScheme, accountRoutingAddress - */ - private[this] val parametersNamesString = typeSignature.paramLists(0)//paramLists will return all the curry parameters set. - .filterNot(_.asTerm.info =:= ru.typeOf[Option[CallContext]]) // remove the `CallContext` field. - .map(_.name.toString)//get all parameters name - .map(it => if(it =="type") "`type`" else it)//This is special case for `type`, it is the keyword in scala. - match { - case Nil => "" - case list:List[String] => list.mkString(", ", ", ", "") - } - - /** - * get the messageDocDescription field from the connector method name: - * - * eg: - * createBankAccountFuture --> Create Bank Account - * createBankAccount-->Create Bank Account - */ - private[this] val messageDocDescription = methodName - .replace("Future", "") - .replaceAll("([a-z])([A-Z])", "$1 $2") //createBankAccount-->create Bank Account - .capitalize // create Bank Account --> Create Bank Account - - - /** - * this val really depends on the OutBound classes under path `com.openbankproject.commons.dto`. - * Need prepare the OutBound classes before create this. - */ - private[this] val outBoundExample = { - val fullyQualifiedClassName = s"com.openbankproject.commons.dto.OutBound${methodName.capitalize}" // com.openbankproject.commons.dto.OutBoundCreateBankAccount - val outBoundType = if(ReflectUtils.isTypeExists(fullyQualifiedClassName)) - ReflectUtils.getTypeByName(fullyQualifiedClassName) - else - throw new RuntimeException(s"OutBound${methodName.capitalize} class is not existing in `com.openbankproject.commons.dto` path. Please create it first. ") - createDocExample(outBoundType).replaceAll("(?m)^(\\S)", " $1") - } - - - private[this] val inBoundExample = { - val fullyQualifiedClassName = s"com.openbankproject.commons.dto.InBound${methodName.capitalize}" - - val inBoundType = if(ReflectUtils.isTypeExists(fullyQualifiedClassName)) - ReflectUtils.getTypeByName(fullyQualifiedClassName) - else - throw new RuntimeException(s"InBound${methodName.capitalize} class is not existing in `com.openbankproject.commons.dto` path. Please create it first. ") - - createDocExample(inBoundType).replaceAll("(?m)^(\\S)", " $1") - } - - val signature = s"$methodName$cleanParametersAndReturnTpyeString" - - val outboundName = s"OutBound${methodName.capitalize}" - val inboundName = s"InBound${methodName.capitalize}" - - val tagValues = ReflectUtils.getType(ApiTag).decls - .filter(it => it.isMethod && it.asMethod.returnType <:< typeOf[ResourceDocTag]) - .map(_.asMethod) - .filter(method => method.paramLists.isEmpty) - .map(method => ReflectUtils.invokeMethod(ApiTag, method)) - .map(_.asInstanceOf[ResourceDocTag]) - .map(_.tag) - .map(it => (it.replaceAll("""\W""", "").toLowerCase, it)) - .toMap - - val tag = tagValues.filter(it => methodName.toLowerCase().contains(it._1)).map(_._2).toList.sortBy(_.size).lastOption.getOrElse("- Core") - - - protected[this] def methodBody: String = - s"""{ - | import com.openbankproject.commons.dto.{${outboundName} => OutBound, ${inboundName} => InBound} - | - | val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).get ${parametersNamesString}) - | logger.debug(s"Kafka ${methodName} Req is: $$req") - | processRequest[InBound](req) map (convertToTuple(callContext)) - | } - """.stripMargin - - override def toString = - s""" - | messageDocs += MessageDoc( - | process = "obp.$methodName", - | messageFormat = messageFormat, - | description = "$messageDocDescription", - | outboundTopic = Some(Topics.createTopicByClassName(${outboundName}.getClass.getSimpleName).request), - | inboundTopic = Some(Topics.createTopicByClassName(${outboundName}.getClass.getSimpleName).response), - | exampleOutboundMessage = ( - | $outBoundExample - | ), - | exampleInboundMessage = ( - | $inBoundExample - | ), - | adapterImplementation = Some(AdapterImplementation("${tag}", 1)) - | ) - | override def $signature = ${methodBody} - """.stripMargin -} - -case class GetGenerator(override val methodName: String, typeSignature: Type) extends CommonGenerator(methodName, typeSignature) { - private[this] val resultType = typeSignature.resultType.toString.replaceAll("(\\w+\\.)+", "") - - private[this] val isReturnBox = resultType.startsWith("Box[") - - private[this] val cachMethodName = if(isReturnBox) "memoizeSyncWithProvider" else "memoizeWithProvider" - - private[this] val timeoutFieldName = uncapitalize(methodName.replaceFirst("^[a-z]+", "")) + "TTL" - private[this] val cacheTimeout = ReflectUtils.findMethod(ru.typeOf[KafkaMappedConnector_vSept2018], timeoutFieldName)(_ => true) - .map(_.name.toString) - .getOrElse("accountTTL") - - override def cleanParametersAndReturnTpyeString = super.cleanParametersAndReturnTpyeString - .replaceFirst("""callContext:\s*Option\[CallContext\]""", "@CacheKeyOmit callContext: Option[CallContext]") - - override protected[this] def methodBody: String = - s"""saveConnectorMetric { - | /** - | * Please note that "var cacheKey = (randomUUID().toString, randomUUID().toString, randomUUID().toString)" - | * is just a temporary value filed with UUID values in order to prevent any ambiguity. - | * The real value will be assigned by Macro during compile time at this line of a code: - | * https://github.com/OpenBankProject/scala-macros/blob/master/macros/src/main/scala/com/tesobe/CacheKeyFromArgumentsMacro.scala#L49 - | */ - | var cacheKey = (randomUUID().toString, randomUUID().toString, randomUUID().toString) - | CacheKeyFromArguments.buildCacheKey { - | Caching.${cachMethodName}(Some(cacheKey.toString()))(${cacheTimeout} second) ${super.methodBody.replaceAll("(?m)^ ", " ")} - | } - | }("$methodName") - """.stripMargin + ConnectorBuilderUtil.generateMethods(genMethodNames, + "src/main/scala/code/bankconnectors/vSept2018/KafkaMappedConnector_vSept2018.scala", + "processRequest[InBound](req)", true) } + From d3f7d88a88fa8f021540a1f37042fdf9403a5b29 Mon Sep 17 00:00:00 2001 From: shuang Date: Tue, 16 Jun 2020 11:53:36 +0800 Subject: [PATCH 02/10] feature/create_akka_connector_builder: add all missing OutBound and InBound case class, clear up builder connector method names. --- .../MessageDocsSwaggerDefinitions.scala | 12 +- .../code/api/util/CodeGenerateUtils.scala | 14 +- .../code/api/util/CustomJsonFormats.scala | 17 +- .../scala/code/api/util/ErrorMessages.scala | 2 +- .../main/scala/code/api/util/NewStyle.scala | 5 +- .../code/api/v1_4_0/JSONFactory1_4_0.scala | 3 +- .../code/api/v2_2_0/JSONFactory2.2.0.scala | 2 +- .../scala/code/api/v3_0_0/APIMethods300.scala | 2 +- .../scala/code/api/v4_0_0/APIMethods400.scala | 3 +- .../code/api/v4_0_0/JSONFactory4.0.0.scala | 2 +- .../scala/code/bankconnectors/Connector.scala | 52 +- .../bankconnectors/ConnectorBuilderUtil.scala | 246 +++++- .../bankconnectors/KafkaMappedConnector.scala | 19 +- .../KafkaMappedConnector_JVMcompatible.scala | 17 +- .../bankconnectors/LocalMappedConnector.scala | 49 +- .../bankconnectors/LocalRecordConnector.scala | 4 +- .../ObpJvmMappedConnector.scala | 17 +- .../akka/AkkaConnectorBuilder.scala | 185 +--- .../rest/RestConnectorBuilder.scala | 184 +--- .../StoredProcedureConnectorBuilder.scala | 184 +--- .../StoredProcedureConnector_vDec2019.scala | 790 ++---------------- .../vMar2017/KafkaJsonFactory_vMar2017.scala | 4 +- .../KafkaMappedConnector_vMar2017.scala | 20 +- .../vMay2019/KafkaConnectorBuilder.scala | 18 +- .../vSept2018/KafkaConnectorBuilder.scala | 4 +- .../scala/code/directdebit/DirectDebit.scala | 15 +- .../code/directdebit/MappedDirectDebit.scala | 1 + .../src/main/scala/code/fx/MappedFXRate.scala | 15 +- .../scala/code/management/ImporterAPI.scala | 2 +- .../main/scala/code/model/BankingData.scala | 6 +- .../scala/code/sandbox/OBPDataImport.scala | 2 +- .../code/transaction/MappedTransaction.scala | 2 +- .../MappedTransactionRequestProvider.scala | 1 + .../MappedTransactionRequestTypeCharge.scala | 16 +- .../TransactionRequests.scala | 5 - .../api/v1_4_0/TransactionRequestsTest.scala | 3 +- .../api/v2_0_0/TransactionRequestsTest.scala | 2 +- .../api/v2_1_0/TransactionRequestsTest.scala | 2 +- .../api/v4_0_0/TransactionRequestsTest.scala | 2 +- .../BankAccountCreationTest.scala | 10 +- .../scala/code/management/ImporterTest.scala | 8 +- .../code/sandbox/SandboxDataLoadingTest.scala | 26 +- .../commons/dto/JsonsTransfer.scala | 586 +++++++------ .../commons/model/CommonModel.scala | 60 ++ .../commons/model/CommonModelTrait.scala | 31 + .../commons/model/enums/Enumerations.scala | 5 + .../commons/util/JsonAble.scala | 17 +- .../commons/util/OBPEnum.scala | 2 +- 48 files changed, 945 insertions(+), 1729 deletions(-) diff --git a/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/MessageDocsSwaggerDefinitions.scala b/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/MessageDocsSwaggerDefinitions.scala index 5adf98282..5047aba20 100644 --- a/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/MessageDocsSwaggerDefinitions.scala +++ b/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/MessageDocsSwaggerDefinitions.scala @@ -5,7 +5,8 @@ import java.util.Date import code.api.util.APIUtil._ import code.api.util.ExampleValue._ import com.github.dwickern.macros.NameOf.nameOf -import com.openbankproject.commons.model.{BankAccountCommons, CustomerCommons, InboundAdapterCallContext, InboundAdapterInfoInternal, InboundStatusMessage, _} +import com.openbankproject.commons.model.enums.CustomerAttributeType +import com.openbankproject.commons.model.{BankAccountCommons, CustomerAttributeCommons, CustomerCommons, InboundAdapterCallContext, InboundAdapterInfoInternal, InboundStatusMessage, _} import com.openbankproject.commons.util.ReflectUtils import scala.collection.immutable.{List, Nil} @@ -163,6 +164,15 @@ object MessageDocsSwaggerDefinitions branchId = branchIdExample.value, nameSuffix = nameSuffixExample.value ) + + val customerAttribute = CustomerAttributeCommons( + bankId = BankId(customerCommons.bankId), + customerId = CustomerId(customerCommons.customerId), + customerAttributeId = "some_customer_attributeId_value", + attributeType = CustomerAttributeType.INTEGER, + name = "customer_attribute_field", + value = "example_value" + ) val counterparty = Counterparty( nationalIdentifier= "", // This is the scheme a consumer would use to instruct a payment e.g. IBAN diff --git a/obp-api/src/main/scala/code/api/util/CodeGenerateUtils.scala b/obp-api/src/main/scala/code/api/util/CodeGenerateUtils.scala index b3fb1690e..bff1e4587 100644 --- a/obp-api/src/main/scala/code/api/util/CodeGenerateUtils.scala +++ b/obp-api/src/main/scala/code/api/util/CodeGenerateUtils.scala @@ -2,6 +2,8 @@ package code.api.util import java.util.Date +import com.openbankproject.commons.dto.CustomerAndAttribute +import com.openbankproject.commons.model.enums.TransactionRequestStatus import com.openbankproject.commons.model.enums.StrongCustomerAuthentication import com.openbankproject.commons.model.{CardAction, CardReplacementReason, InboundAdapterCallContext, OutboundAdapterCallContext, PinResetReason, Status} import com.openbankproject.commons.util.{EnumValue, ReflectUtils} @@ -44,8 +46,18 @@ object CodeGenerateUtils { NameTypeExample(null, typeOf[OutboundAdapterCallContext], "MessageDocsSwaggerDefinitions.outboundAdapterCallContext"), NameTypeExample(null, typeOf[InboundAdapterCallContext], "MessageDocsSwaggerDefinitions.inboundAdapterCallContext"), NameTypeExample("status", typeOf[Status], "MessageDocsSwaggerDefinitions.inboundStatus"), + NameTypeExample("statusValue", typeOf[String], s""""${TransactionRequestStatus.values.mkString(" | ")}""""), + NameTypeExample(null, typeOf[List[CustomerAndAttribute]], + """ List( + | CustomerAndAttribute( + | MessageDocsSwaggerDefinitions.customerCommons, + | List(MessageDocsSwaggerDefinitions.customerAttribute) + | ) + | ) + |""".stripMargin), ) + private def getFixedExample(fieldName: String, tp: Type): Option[String] = fixedExamples.find(_.isFieldMatch(fieldName, tp)).map(_.example) @@ -214,7 +226,7 @@ object CodeGenerateUtils { val valueName = symbol.name.toString.replaceFirst("^type$", "`type`") s"""$str, |${valueName}=${value}""".stripMargin - }).substring(2) + }).replaceFirst("""^\s*,\s*""", "") val withNew = if(!concreteObpType.get.typeSymbol.asClass.isCaseClass) "new" else "" s"$withNew ${concreteObpType.get.typeSymbol.name}($fields)" } else { diff --git a/obp-api/src/main/scala/code/api/util/CustomJsonFormats.scala b/obp-api/src/main/scala/code/api/util/CustomJsonFormats.scala index ef3fa48cf..77f03b850 100644 --- a/obp-api/src/main/scala/code/api/util/CustomJsonFormats.scala +++ b/obp-api/src/main/scala/code/api/util/CustomJsonFormats.scala @@ -9,7 +9,7 @@ import code.api.util.ApiRole.rolesMappedToClasses import code.api.v3_1_0.ListResult import code.util.Helper.MdcLoggable import com.openbankproject.commons.model.JsonFieldReName -import com.openbankproject.commons.util.{EnumValue, Functions, JsonAbleSerializer, OBPEnumeration, ReflectUtils} +import com.openbankproject.commons.util.{EnumValueSerializer, Functions, JsonAbleSerializer, ReflectUtils} import com.tesobe.CacheKeyFromArguments import net.liftweb.json.JsonAST.JValue import net.liftweb.json.{TypeInfo, compactRender, _} @@ -66,21 +66,6 @@ object BigDecimalSerializer extends Serializer[BigDecimal] { } } -object EnumValueSerializer extends Serializer[EnumValue] { - private val IntervalClass = classOf[EnumValue] - - override def deserialize(implicit format: Formats): PartialFunction[(TypeInfo, JValue), EnumValue] = { - case (TypeInfo(clazz, _), json) if(IntervalClass.isAssignableFrom(clazz)) => json match { - case JString(s) => OBPEnumeration.withName(clazz.asInstanceOf[Class[EnumValue]], s) - case x => throw new MappingException(s"Can't convert $x to $clazz") - } - } - - override def serialize(implicit format: Formats): PartialFunction[Any, JValue] = { - case x: EnumValue => JString(x.toString()) - } -} - object FiledRenameSerializer extends Serializer[JsonFieldReName] { private val clazz = classOf[JsonFieldReName] diff --git a/obp-api/src/main/scala/code/api/util/ErrorMessages.scala b/obp-api/src/main/scala/code/api/util/ErrorMessages.scala index 82fca3cf8..93945e8e8 100644 --- a/obp-api/src/main/scala/code/api/util/ErrorMessages.scala +++ b/obp-api/src/main/scala/code/api/util/ErrorMessages.scala @@ -2,7 +2,7 @@ package code.api.util import java.util.Objects import java.util.regex.Pattern -import code.transactionrequests.TransactionRequests.TransactionRequestStatus._ +import com.openbankproject.commons.model.enums.TransactionRequestStatus._ import code.api.Constant._ object ErrorMessages { diff --git a/obp-api/src/main/scala/code/api/util/NewStyle.scala b/obp-api/src/main/scala/code/api/util/NewStyle.scala index 92db91b51..e55672e71 100644 --- a/obp-api/src/main/scala/code/api/util/NewStyle.scala +++ b/obp-api/src/main/scala/code/api/util/NewStyle.scala @@ -20,11 +20,12 @@ import code.bankconnectors.Connector import code.bankconnectors.rest.RestConnector_vMar2019 import code.branches.Branches.{Branch, DriveUpString, LobbyString} import code.consumer.Consumers -import code.directdebit.DirectDebitTrait +import com.openbankproject.commons.model.DirectDebitTrait import code.dynamicEntity.{DynamicEntityProvider, DynamicEntityT} import code.entitlement.Entitlement import code.entitlementrequest.EntitlementRequest -import code.fx.{FXRate, MappedFXRate, fx} +import code.fx.{MappedFXRate, fx} +import com.openbankproject.commons.model.FXRate import code.metadata.counterparties.Counterparties import code.methodrouting.{MethodRoutingProvider, MethodRoutingT} import code.model._ diff --git a/obp-api/src/main/scala/code/api/v1_4_0/JSONFactory1_4_0.scala b/obp-api/src/main/scala/code/api/v1_4_0/JSONFactory1_4_0.scala index ae1b43d3d..3309c042a 100644 --- a/obp-api/src/main/scala/code/api/v1_4_0/JSONFactory1_4_0.scala +++ b/obp-api/src/main/scala/code/api/v1_4_0/JSONFactory1_4_0.scala @@ -4,10 +4,9 @@ import java.util.Date import code.api.util.APIUtil.{EmptyBody, PrimaryDataBody, ResourceDoc} import code.api.util.{ApiRole, PegdownOptions} -import code.api.v2_1_0.CounterpartyIdJson import code.api.v3_1_0.ListResult import code.crm.CrmEvent.CrmEvent -import code.transactionrequests.TransactionRequestTypeCharge +import com.openbankproject.commons.model.TransactionRequestTypeCharge import com.openbankproject.commons.model.{Product, _} import com.openbankproject.commons.util.{EnumValue, OBPEnumeration, ReflectUtils} import net.liftweb.common.Full diff --git a/obp-api/src/main/scala/code/api/v2_2_0/JSONFactory2.2.0.scala b/obp-api/src/main/scala/code/api/v2_2_0/JSONFactory2.2.0.scala index 35ede1ef7..c74a0e468 100644 --- a/obp-api/src/main/scala/code/api/v2_2_0/JSONFactory2.2.0.scala +++ b/obp-api/src/main/scala/code/api/v2_2_0/JSONFactory2.2.0.scala @@ -39,7 +39,7 @@ import code.api.v1_4_0.JSONFactory1_4_0._ import code.api.v2_1_0.{JSONFactory210, LocationJsonV210, PostCounterpartyBespokeJson, ResourceUserJSON} import code.atms.Atms.Atm import code.branches.Branches.{Branch, DriveUpString, LobbyString} -import code.fx.FXRate +import com.openbankproject.commons.model.FXRate import code.metrics.ConnectorMetric import code.model.dataAccess.ResourceUser import code.model._ diff --git a/obp-api/src/main/scala/code/api/v3_0_0/APIMethods300.scala b/obp-api/src/main/scala/code/api/v3_0_0/APIMethods300.scala index 4f4d55ccb..41446098c 100644 --- a/obp-api/src/main/scala/code/api/v3_0_0/APIMethods300.scala +++ b/obp-api/src/main/scala/code/api/v3_0_0/APIMethods300.scala @@ -520,7 +520,7 @@ trait APIMethods300 { //2 each bankAccount object find the proper view. //3 use view and user to moderate the bankaccount object. bankIdAccountId <- availableBankIdAccountIdList2 - bankAccount <- Connector.connector.vend.getBankAccount(bankIdAccountId.bankId, bankIdAccountId.accountId) ?~! s"$BankAccountNotFound Current Bank_Id(${bankIdAccountId.bankId}), Account_Id(${bankIdAccountId.accountId}) " + bankAccount <- Connector.connector.vend.getBankAccountOld(bankIdAccountId.bankId, bankIdAccountId.accountId) ?~! s"$BankAccountNotFound Current Bank_Id(${bankIdAccountId.bankId}), Account_Id(${bankIdAccountId.accountId}) " moderatedAccount <- bankAccount.moderatedBankAccount(view, bankIdAccountId, Full(u), callContext) //Error handling is in lower method } yield { moderatedAccount diff --git a/obp-api/src/main/scala/code/api/v4_0_0/APIMethods400.scala b/obp-api/src/main/scala/code/api/v4_0_0/APIMethods400.scala index 2449613dc..3b82c466d 100644 --- a/obp-api/src/main/scala/code/api/v4_0_0/APIMethods400.scala +++ b/obp-api/src/main/scala/code/api/v4_0_0/APIMethods400.scala @@ -41,7 +41,8 @@ import code.transactionChallenge.MappedExpectedChallengeAnswer import code.transactionrequests.MappedTransactionRequestProvider import code.transactionrequests.TransactionRequests.TransactionChallengeTypes._ import code.transactionrequests.TransactionRequests.TransactionRequestTypes.{apply => _, _} -import code.transactionrequests.TransactionRequests.{TransactionRequestStatus, TransactionRequestTypes} +import code.transactionrequests.TransactionRequests.TransactionRequestTypes +import com.openbankproject.commons.model.enums.TransactionRequestStatus import code.userlocks.UserLocksProvider import code.users.Users import code.util.Helper.booleanToBox diff --git a/obp-api/src/main/scala/code/api/v4_0_0/JSONFactory4.0.0.scala b/obp-api/src/main/scala/code/api/v4_0_0/JSONFactory4.0.0.scala index ec0d370c4..151666406 100644 --- a/obp-api/src/main/scala/code/api/v4_0_0/JSONFactory4.0.0.scala +++ b/obp-api/src/main/scala/code/api/v4_0_0/JSONFactory4.0.0.scala @@ -40,7 +40,7 @@ import code.api.v3_0_0.JSONFactory300.createAccountRoutingsJSON import code.api.v3_0_0.{CustomerAttributeResponseJsonV300, ViewBasicV300} import code.api.v3_1_0.AccountAttributeResponseJson import code.api.v3_1_0.JSONFactory310.createAccountAttributeJson -import code.directdebit.DirectDebitTrait +import com.openbankproject.commons.model.DirectDebitTrait import code.entitlement.Entitlement import code.model.{Consumer, ModeratedBankAccountCore} import code.standingorders.StandingOrderTrait diff --git a/obp-api/src/main/scala/code/bankconnectors/Connector.scala b/obp-api/src/main/scala/code/bankconnectors/Connector.scala index e78fcf4c2..4cbdb9214 100644 --- a/obp-api/src/main/scala/code/bankconnectors/Connector.scala +++ b/obp-api/src/main/scala/code/bankconnectors/Connector.scala @@ -24,9 +24,8 @@ import code.bankconnectors.vMar2017.KafkaMappedConnector_vMar2017 import code.bankconnectors.vMay2019.KafkaMappedConnector_vMay2019 import code.bankconnectors.vSept2018.KafkaMappedConnector_vSept2018 import code.branches.Branches.Branch -import code.customerattribute.MappedCustomerAttribute -import code.directdebit.DirectDebitTrait -import code.fx.FXRate +import com.openbankproject.commons.model.DirectDebitTrait +import com.openbankproject.commons.model.FXRate import code.fx.fx.TTL import code.management.ImporterAPI.ImporterTransaction import code.model.dataAccess.ResourceUser @@ -34,12 +33,13 @@ import code.model.toUserExtended import code.standingorders.StandingOrderTrait import code.transactionrequests.TransactionRequests.TransactionRequestTypes._ import code.transactionrequests.TransactionRequests._ -import code.transactionrequests.{TransactionRequestTypeCharge, TransactionRequests} +import code.transactionrequests.TransactionRequests +import com.openbankproject.commons.model.TransactionRequestTypeCharge import code.users.Users import code.util.Helper._ import code.util.JsonUtils import code.views.Views -import com.openbankproject.commons.model.enums.{AccountAttributeType, AttributeCategory, AttributeType, CardAttributeType, CustomerAttributeType, DynamicEntityOperation, ProductAttributeType, TransactionAttributeType} +import com.openbankproject.commons.model.enums.{AccountAttributeType, AttributeCategory, AttributeType, CardAttributeType, CustomerAttributeType, DynamicEntityOperation, ProductAttributeType, TransactionAttributeType, TransactionRequestStatus} import com.openbankproject.commons.model.{AccountApplication, Bank, CounterpartyTrait, CustomerAddress, Product, ProductCollection, ProductCollectionItem, TaxResidence, TransactionRequestStatus, UserAuthContext, UserAuthContextUpdate, _} import com.tesobe.CacheKeyFromArguments import net.liftweb.common.{Box, Empty, EmptyBox, Failure, Full, ParamFailure} @@ -422,7 +422,7 @@ trait Connector extends MdcLoggable { def updateUserAccountViewsOld(user: ResourceUser) = {} //This is old one, no callContext there. only for old style endpoints. - def getBankAccount(bankId : BankId, accountId : AccountId) : Box[BankAccount]= { + def getBankAccountOld(bankId : BankId, accountId : AccountId) : Box[BankAccount]= { getBankAccountLegacy(bankId, accountId, None).map(_._1) } @@ -431,12 +431,12 @@ trait Connector extends MdcLoggable { //This one return the Future. def getBankAccount(bankId : BankId, accountId : AccountId, callContext: Option[CallContext]) : OBPReturnType[Box[BankAccount]]= Future{(Failure(setUnimplementedError),callContext)} - + def getBankAccountByIban(iban : String, callContext: Option[CallContext]) : OBPReturnType[Box[BankAccount]]= Future{(Failure(setUnimplementedError),callContext)} def getBankAccountByRouting(scheme : String, address : String, callContext: Option[CallContext]) : Box[(BankAccount, Option[CallContext])]= Failure(setUnimplementedError) def getBankAccounts(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]) : OBPReturnType[Box[List[BankAccount]]]= Future{(Failure(setUnimplementedError), callContext)} - + def getBankAccountsBalances(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]) : OBPReturnType[Box[AccountsBalances]]= Future{(Failure(setUnimplementedError), callContext)} def getCoreBankAccountsLegacy(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]) : Box[(List[CoreAccount], Option[CallContext])] = @@ -517,10 +517,10 @@ trait Connector extends MdcLoggable { } def getPhysicalCards(user : User) : Box[List[PhysicalCard]] = Failure(setUnimplementedError) - + def getPhysicalCardForBank(bankId: BankId, cardId: String, callContext:Option[CallContext]) : OBPReturnType[Box[PhysicalCardTrait]] = Future{(Failure(setUnimplementedError), callContext)} def deletePhysicalCardForBank(bankId: BankId, cardId: String, callContext:Option[CallContext]) : OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError), callContext)} - + def getPhysicalCardsForBankLegacy(bank: Bank, user : User, queryParams: List[OBPQueryParam]) : Box[List[PhysicalCard]] = Failure(setUnimplementedError) def getPhysicalCardsForBank(bank: Bank, user : User, queryParams: List[OBPQueryParam], callContext:Option[CallContext]) : OBPReturnType[Box[List[PhysicalCard]]] = Future{(Failure(setUnimplementedError), callContext)} @@ -596,7 +596,7 @@ trait Connector extends MdcLoggable { customerId: String, callContext: Option[CallContext] ): OBPReturnType[Box[PhysicalCardTrait]] = Future{(Failure{setUnimplementedError}, callContext)} - + //Payments api: just return Failure("not supported") from makePaymentImpl if you don't want to implement it /** * \ @@ -610,10 +610,10 @@ trait Connector extends MdcLoggable { def makePayment(initiator : User, fromAccountUID : BankIdAccountId, toAccountUID : BankIdAccountId, amt : BigDecimal, description : String, transactionRequestType: TransactionRequestType) : Box[TransactionId] = { for{ - fromAccount <- getBankAccount(fromAccountUID.bankId, fromAccountUID.accountId) ?~ + fromAccount <- getBankAccountOld(fromAccountUID.bankId, fromAccountUID.accountId) ?~ s"$BankAccountNotFound Account ${fromAccountUID.accountId} not found at bank ${fromAccountUID.bankId}" isOwner <- booleanToBox(initiator.hasOwnerViewAccess(BankIdAccountId(fromAccount.bankId,fromAccount.accountId)), UserNoOwnerView) - toAccount <- getBankAccount(toAccountUID.bankId, toAccountUID.accountId) ?~ + toAccount <- getBankAccountOld(toAccountUID.bankId, toAccountUID.accountId) ?~ s"$BankAccountNotFound Account ${toAccountUID.accountId} not found at bank ${toAccountUID.bankId}" sameCurrency <- booleanToBox(fromAccount.currency == toAccount.currency, { s"$InvalidTransactionRequestCurrency, Cannot send payment to account with different currency (From ${fromAccount.currency} to ${toAccount.currency}" @@ -689,10 +689,10 @@ trait Connector extends MdcLoggable { //create a new transaction request val request = for { - fromAccountType <- getBankAccount(fromAccount.bankId, fromAccount.accountId) ?~ + fromAccountType <- getBankAccountOld(fromAccount.bankId, fromAccount.accountId) ?~ s"account ${fromAccount.accountId} not found at bank ${fromAccount.bankId}" isOwner <- booleanToBox(initiator.hasOwnerViewAccess(BankIdAccountId(fromAccount.bankId,fromAccount.accountId)), UserNoOwnerView) - toAccountType <- getBankAccount(toAccount.bankId, toAccount.accountId) ?~ + toAccountType <- getBankAccountOld(toAccount.bankId, toAccount.accountId) ?~ s"account ${toAccount.accountId} not found at bank ${toAccount.bankId}" rawAmt <- tryo { BigDecimal(body.value.amount) } ?~! s"amount ${body.value.amount} not convertible to number" sameCurrency <- booleanToBox(fromAccount.currency == toAccount.currency, { @@ -749,9 +749,9 @@ trait Connector extends MdcLoggable { // Always create a new Transaction Request val request = for { - fromAccountType <- getBankAccount(fromAccount.bankId, fromAccount.accountId) ?~ s"account ${fromAccount.accountId} not found at bank ${fromAccount.bankId}" + fromAccountType <- getBankAccountOld(fromAccount.bankId, fromAccount.accountId) ?~ s"account ${fromAccount.accountId} not found at bank ${fromAccount.bankId}" isOwner <- booleanToBox(initiator.hasOwnerViewAccess(BankIdAccountId(fromAccount.bankId,fromAccount.accountId)) == true || hasEntitlement(fromAccount.bankId.value, initiator.userId, canCreateAnyTransactionRequest) == true, ErrorMessages.InsufficientAuthorisationToCreateTransactionRequest) - toAccountType <- getBankAccount(toAccount.bankId, toAccount.accountId) ?~ s"account ${toAccount.accountId} not found at bank ${toAccount.bankId}" + toAccountType <- getBankAccountOld(toAccount.bankId, toAccount.accountId) ?~ s"account ${toAccount.accountId} not found at bank ${toAccount.bankId}" rawAmt <- tryo { BigDecimal(body.value.amount) } ?~! s"amount ${body.value.amount} not convertible to number" // isValidTransactionRequestType is checked at API layer. Maybe here too. isPositiveAmtToSend <- booleanToBox(rawAmt > BigDecimal("0"), s"Can't send a payment with a value of 0 or less. (${rawAmt})") @@ -913,17 +913,17 @@ trait Connector extends MdcLoggable { for { //if challenge necessary, create a new one (challengeId, callContext) <- createChallenge( - fromAccount.bankId, - fromAccount.accountId, - initiator.userId, - transactionRequestType: TransactionRequestType, + fromAccount.bankId, + fromAccount.accountId, + initiator.userId, + transactionRequestType: TransactionRequestType, transactionRequest.id.value, scaMethod, callContext ) map { i => (unboxFullOrFail(i._1, callContext, s"$InvalidConnectorResponseForGetChargeLevel ", 400), i._2) } - + newChallenge = TransactionRequestChallenge(challengeId, allowed_attempts = 3, challenge_type = challengeType.getOrElse(TransactionChallengeTypes.OTP_VIA_API.toString)) _ <- Future (saveTransactionRequestChallenge(transactionRequest.id, newChallenge)) transactionRequest <- Future(transactionRequest.copy(challenge = newChallenge)) @@ -1028,7 +1028,7 @@ trait Connector extends MdcLoggable { permission <- Views.views.vend.permissions(BankIdAccountId(bankId, accountId)) ) yield { // Check the user has granted view with action canAddTransactionRequestToAnyAccount - // in case it's true the a challenge will be sent to it + // in case it's true the a challenge will be sent to it permission.views.exists(_.canAddTransactionRequestToAnyAccount == true) match { case true => Some(permission.user) case _ => None @@ -1109,14 +1109,14 @@ trait Connector extends MdcLoggable { chargePolicy: String ) - def saveTransactionRequestTransaction(transactionRequestId: TransactionRequestId, transactionId: TransactionId) = { + def saveTransactionRequestTransaction(transactionRequestId: TransactionRequestId, transactionId: TransactionId): Box[Boolean] = { //put connector agnostic logic here if necessary saveTransactionRequestTransactionImpl(transactionRequestId, transactionId) } protected def saveTransactionRequestTransactionImpl(transactionRequestId: TransactionRequestId, transactionId: TransactionId): Box[Boolean] = LocalMappedConnector.saveTransactionRequestTransactionImpl(transactionRequestId: TransactionRequestId, transactionId: TransactionId) - def saveTransactionRequestChallenge(transactionRequestId: TransactionRequestId, challenge: TransactionRequestChallenge) = { + def saveTransactionRequestChallenge(transactionRequestId: TransactionRequestId, challenge: TransactionRequestChallenge): Box[Boolean] = { //put connector agnostic logic here if necessary saveTransactionRequestChallengeImpl(transactionRequestId, challenge) } @@ -1128,7 +1128,7 @@ trait Connector extends MdcLoggable { def getTransactionRequests(initiator : User, fromAccount : BankAccount) : Box[List[TransactionRequest]] = { val transactionRequests = for { - fromAccount <- getBankAccount(fromAccount.bankId, fromAccount.accountId) ?~ + fromAccount <- getBankAccountOld(fromAccount.bankId, fromAccount.accountId) ?~ s"account ${fromAccount.accountId} not found at bank ${fromAccount.bankId}" isOwner <- booleanToBox(initiator.hasOwnerViewAccess(BankIdAccountId(fromAccount.bankId,fromAccount.accountId)), UserNoOwnerView) transactionRequests <- getTransactionRequestsImpl(fromAccount) diff --git a/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala b/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala index 37a0c70b1..fb2d3693d 100644 --- a/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala +++ b/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala @@ -43,9 +43,6 @@ object ConnectorBuilderUtil { val nameSignature: Iterable[ConnectorMethodGenerator] = ru.typeOf[Connector].decls .filter(_.isMethod) .filter(it => connectorMethodNames.contains(it.name.toString)) - .filter(it => { - it.typeSignature.paramLists(0).exists(_.asTerm.info =:= ru.typeOf[Option[CallContext]]) - }) .map(it => { val (methodName, typeSignature) = (it.name.toString, it.typeSignature) ConnectorMethodGenerator(methodName, typeSignature) @@ -84,7 +81,8 @@ object ConnectorBuilderUtil { private case class ConnectorMethodGenerator(methodName: String, tp: Type) { private[this] def paramAnResult = tp.toString - .replaceAll("(\\w+\\.)+", "") + .replaceAll("""[.\w]+\.(\w+\.([A-Z]+\b|Value)\b)""", "$1") // two times replaceAll to delete package name, but keep enum type name + .replaceAll("""([.\w]+\.){2,}(\w+\b)""", "$2") .replaceFirst("\\)", "): ") .replace("cardAttributeType: Value", "cardAttributeType: CardAttributeType.Value") // scala enum is bad for Reflection .replace("productAttributeType: Value", "productAttributeType: ProductAttributeType.Value") // scala enum is bad for Reflection @@ -113,6 +111,9 @@ object ConnectorBuilderUtil { var signature = s"$methodName$paramAnResult" + val hasCallContext = tp.paramLists(0) + .exists(_.asTerm.info =:= ru.typeOf[Option[CallContext]]) + /** * Get all the parameters name as a String from `typeSignature` object. * eg: it will return @@ -124,8 +125,10 @@ object ConnectorBuilderUtil { .map(it => if(it =="type") "`type`" else it)//This is special case for `type`, it is the keyword in scala. .map(it => if(it == "queryParams") "OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)" else it) match { + case Nil if hasCallContext => "callContext.map(_.toOutboundAdapterCallContext).orNull" case Nil => "" - case list:List[String] => list.mkString(", ", ", ", "") + case list:List[String] if hasCallContext => list.mkString("callContext.map(_.toOutboundAdapterCallContext).orNull, ", ", ", "") + case list:List[String] => list.mkString(", ") } // for cache @@ -155,18 +158,17 @@ object ConnectorBuilderUtil { case false => (None, None) } - val missingCallContext = if(tp.paramLists(0) //if parameter have no callContext, add None to Body - .exists(_.asTerm.info =:= ru.typeOf[Option[CallContext]])) { - "" + val callContext = if(hasCallContext) { + "callContext" } else { - "val callContext: Option[CallContext] = None \n" + "None" } var body = s"""| import com.openbankproject.commons.dto.{$outBoundName => OutBound, $inBoundName => InBound} - | ${missingCallContext}val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull $parametersNamesString) + | val req = OutBound($parametersNamesString) | val response: Future[Box[InBound]] = ${responseExpression(methodName)} - | response.map(convertToTuple[$inboundDataFieldType](callContext)) """.stripMargin + | response.map(convertToTuple[$inboundDataFieldType]($callContext)) """.stripMargin if(doCache && methodName.matches("^(get|check|validate).+")) { @@ -213,6 +215,228 @@ object ConnectorBuilderUtil { """.stripMargin } } + + val commonMethodNames = List( + "getAdapterInfo", + "getChallengeThreshold", + "getChargeLevel", + "createChallenge", + "getBank", + "getBanks", + "getBankAccountsForUser", + "getUser", + "getBankAccount", + "getBankAccountsBalances", + "getCoreBankAccounts", + "getBankAccountsHeld", + "getCounterpartyTrait", + "getCounterpartyByCounterpartyId", + "getCounterpartyByIban", + "getCounterparties", + "getTransactions", + "getTransactionsCore", + "getTransaction", + "getPhysicalCardForBank", + "deletePhysicalCardForBank", + "getPhysicalCardsForBank", + "createPhysicalCard", + "updatePhysicalCard", + "makePaymentv210", + "createTransactionRequestv210", + "getTransactionRequests210", + "getTransactionRequestImpl", + "createTransactionAfterChallengeV210", + "updateBankAccount", + "createBankAccount", + "accountExists", + "getBranch", + "getBranches", + "getAtm", + "getAtms", + "createTransactionAfterChallengev300", + "makePaymentv300", + "createTransactionRequestv300", + "createCounterparty", + "checkCustomerNumberAvailable", + "createCustomer", + "updateCustomerScaData", + "updateCustomerCreditData", + "updateCustomerGeneralData", + "getCustomersByUserId", + "getCustomerByCustomerId", + "getCustomerByCustomerNumber", + "getCustomerAddress", + "createCustomerAddress", + "updateCustomerAddress", + "deleteCustomerAddress", + "createTaxResidence", + "getTaxResidence", + "deleteTaxResidence", + "getCustomers", + "getCheckbookOrders", + "getStatusOfCreditCardOrder", + "createUserAuthContext", + "createUserAuthContextUpdate", + "deleteUserAuthContexts", + "deleteUserAuthContextById", + "getUserAuthContexts", + "createOrUpdateProductAttribute", + "getProductAttributeById", + "getProductAttributesByBankAndCode", + "deleteProductAttribute", + "getAccountAttributeById", + "createOrUpdateAccountAttribute", + "createAccountAttributes", + "getAccountAttributesByAccount", + "createOrUpdateCardAttribute", + "getCardAttributeById", + "getCardAttributesFromProvider", + "createAccountApplication", + "getAllAccountApplication", + "getAccountApplicationById", + "updateAccountApplicationStatus", + "getOrCreateProductCollection", + "getProductCollection", + "getOrCreateProductCollectionItem", + "getProductCollectionItem", + "getProductCollectionItemsTree", + "createMeeting", + "getMeetings", + "getMeeting", + "createOrUpdateKycCheck", + "createOrUpdateKycDocument", + "createOrUpdateKycMedia", + "createOrUpdateKycStatus", + "getKycChecks", + "getKycDocuments", + "getKycMedias", + "getKycStatuses", + "createMessage", + "makeHistoricalPayment", + "validateChallengeAnswer", + "getBankLegacy", + "getBanksLegacy", + "getBankAccountsForUserLegacy", + "getBankAccountLegacy", + "getBankAccountByIban", + "getBankAccountByRouting", + "getBankAccounts", + "getCoreBankAccountsLegacy", + "getBankAccountsHeldLegacy", + "checkBankAccountExistsLegacy", + "getCounterpartyByCounterpartyIdLegacy", + "getCounterpartiesLegacy", + "getTransactionsLegacy", + "getTransactionLegacy", + "createPhysicalCardLegacy", + "getCustomerByCustomerIdLegacy", + + "createChallenges", + "createTransactionRequestv400", + "getCustomersByCustomerPhoneNumber", + "getTransactionAttributeById", + "createOrUpdateCustomerAttribute", + "createOrUpdateTransactionAttribute", + "getCustomerAttributes", + "getCustomerIdsByAttributeNameValues", + "getCustomerAttributesForCustomers", + "getTransactionIdsByAttributeNameValues", + "getTransactionAttributes", + "getCustomerAttributeById", + "createDirectDebit", + "deleteCustomerAttribute", + + "getBankAccountOld", // old method, but v3.0.0 apis use a lot + ).distinct + + /** + * these connector methods have special parameter or return type + */ + val specialMethods = List( + "getCounterparty", + "getPhysicalCards", + "makePayment", + "makePaymentv200", + "createTransactionRequest", + "createTransactionRequestv200", + "getStatus", + "getChargeValue", + "saveTransactionRequestTransaction", + "saveTransactionRequestChallenge", + "getTransactionRequests", + "getTransactionRequestStatuses", + "getTransactionRequestTypes", + "createTransactionAfterChallenge", + "createTransactionAfterChallengev200", + "createBankAndAccount", + "createSandboxBankAccount", + "accountExists", + "removeAccount", + "getMatchingTransactionCount", + "updateAccountBalance", + "setBankAccountLastUpdated", + "updateAccountLabel", + "updateAccount", + "getProducts", + "getProduct", + "createOrUpdateBranch", + "createOrUpdateBank", + "createOrUpdateAtm", + "createOrUpdateProduct", + "createOrUpdateFXRate", + "accountOwnerExists", + "getCurrentFxRate", + "getCurrentFxRateCached", + "getTransactionRequestTypeCharge", + "getTransactionRequestTypeCharges", + "getPhysicalCardsForBankLegacy", + "getBranchLegacy", + "getAtmLegacy", + "getEmptyBankAccount", + "getCounterpartyFromTransaction", + "getCounterpartiesFromTransaction", + ).distinct + + /** + * modifier is protected methods, not recommend generate these methods, they should always for special purpose + */ + val protectedMethods = List( + "makePaymentImpl", + "createTransactionRequestImpl", + "createTransactionRequestImpl210", + "saveTransactionRequestTransactionImpl", + "saveTransactionRequestChallengeImpl", + "saveTransactionRequestStatusImpl", + "getTransactionRequestStatusesImpl", + "getTransactionRequestsImpl", + "getTransactionRequestsImpl210", + "getTransactionRequestTypesImpl" + ).distinct + + val omitMethods = List( + // "answerTransactionRequestChallenge", //deprecated + //"setAccountHolder", //deprecated + // "createImportedTransaction", // should create manually + // "createViews", // should not be auto generated + // "UpdateUserAccoutViewsByUsername", // a helper function should not be auto generated + // "updateUserAccountViewsOld", // deprecated + // "createBankAccountLegacy", //deprecated + + // "createOrUpdateAttributeDefinition", // should not be auto generated + // "deleteAttributeDefinition", // should not be auto generated + // "getAttributeDefinition", // should not be auto generated + + // "createStandingOrder", // should not be auto generated + + // "addBankAccount", // non-standard calls, should be used for test + + //** the follow 5 methods should not be generated, should create manually + // "dynamicEntityProcess", + // "dynamicEndpointProcess", + // "createDynamicEndpoint", + // "getDynamicEndpoint", + // "getDynamicEndpoints", + ).distinct } diff --git a/obp-api/src/main/scala/code/bankconnectors/KafkaMappedConnector.scala b/obp-api/src/main/scala/code/bankconnectors/KafkaMappedConnector.scala index 4d26368ee..6d1b95d1f 100644 --- a/obp-api/src/main/scala/code/bankconnectors/KafkaMappedConnector.scala +++ b/obp-api/src/main/scala/code/bankconnectors/KafkaMappedConnector.scala @@ -30,7 +30,7 @@ import com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SCA import code.api.util._ import code.bankconnectors.vMar2017.KafkaMappedConnector_vMar2017 import code.branches.Branches.Branch -import code.fx.{FXRate, fx} +import code.fx.fx import code.kafka.KafkaHelper import code.management.ImporterAPI.ImporterTransaction import code.metadata.comments.Comments @@ -45,7 +45,8 @@ import com.openbankproject.commons.model.Product import code.transaction.MappedTransaction import code.transactionrequests.TransactionRequests.TransactionRequestTypes._ import code.transactionrequests.TransactionRequests._ -import code.transactionrequests.{TransactionRequestTypeCharge, TransactionRequests} +import code.transactionrequests.TransactionRequests +import com.openbankproject.commons.model.TransactionRequestTypeCharge import code.util.Helper.MdcLoggable import code.util.{Helper, TTLCache} import code.views.Views @@ -744,7 +745,7 @@ object KafkaMappedConnector extends Connector with KafkaHelper with MdcLoggable val viewsDeleted = Views.views.vend.removeAllViews(bankId, accountId) //delete account - val account = getBankAccount(bankId, accountId) + val account = getBankAccountOld(bankId, accountId) val accountDeleted = account match { case acc => true //acc.delete_! //TODO @@ -783,7 +784,7 @@ object KafkaMappedConnector extends Connector with KafkaHelper with MdcLoggable private def createAccountIfNotExisting(bankId: BankId, accountId: AccountId, accountNumber: String, accountType: String, accountLabel: String, currency: String, balanceInSmallestCurrencyUnits: Long, accountHolderName: String) : BankAccount = { - getBankAccount(bankId, accountId) match { + getBankAccountOld(bankId, accountId) match { case Full(a) => logger.info(s"account with id $accountId at bank with id $bankId already exists. No need to create a new one.") a @@ -833,7 +834,7 @@ object KafkaMappedConnector extends Connector with KafkaHelper with MdcLoggable //this will be Full(true) if everything went well val result = for { - acc <- getBankAccount(bankId, accountId) + acc <- getBankAccountOld(bankId, accountId) (bank, _)<- getBankLegacy(bankId, None) } yield { //acc.balance = newBalance @@ -925,7 +926,7 @@ object KafkaMappedConnector extends Connector with KafkaHelper with MdcLoggable bankId <- getBankByNationalIdentifier(bankNationalIdentifier).map(_.bankId) account <- getAccountByNumber(bankId, accountNumber) } yield { - val acc = getBankAccount(bankId, account.accountId) + val acc = getBankAccountOld(bankId, account.accountId) acc match { case a => true //a.lastUpdate = updateDate //TODO // case _ => logger.warn("can't set bank account.lastUpdated because the account was not found"); false @@ -942,7 +943,7 @@ object KafkaMappedConnector extends Connector with KafkaHelper with MdcLoggable override def updateAccountLabel(bankId: BankId, accountId: AccountId, label: String) = { //this will be Full(true) if everything went well val result = for { - acc <- getBankAccount(bankId, accountId) + acc <- getBankAccountOld(bankId, accountId) (bank, _)<- getBankLegacy(bankId, None) d <- MappedBankAccountData.find(By(MappedBankAccountData.accountId, accountId.value), By(MappedBankAccountData.bankId, bank.bankId.value)) } yield { @@ -1013,7 +1014,7 @@ object KafkaMappedConnector extends Connector with KafkaHelper with MdcLoggable case Full(f) => Full(KafkaTransactionRequestTypeCharge(f)) case _ => for { - fromAccount <- getBankAccount(bankId, accountId) + fromAccount <- getBankAccountOld(bankId, accountId) fromAccountCurrency <- tryo{ fromAccount.currency } } yield { KafkaTransactionRequestTypeCharge(KafkaInboundTransactionRequestTypeCharge(transactionRequestType.value, bankId.value, fromAccountCurrency, "0.00", "Warning! Default value!")) @@ -1054,7 +1055,7 @@ object KafkaMappedConnector extends Connector with KafkaHelper with MdcLoggable for { counterpartyId <- tryo{r.counterpartyId} counterpartyName <- tryo{r.counterpartyName} - thisAccount <- getBankAccount(BankId(r.bankId), AccountId(r.accountId)) + thisAccount <- getBankAccountOld(BankId(r.bankId), AccountId(r.accountId)) //creates a dummy OtherBankAccount without an OtherBankAccountMetadata, which results in one being generated (in OtherBankAccount init) dummyOtherBankAccount <- tryo{createCounterparty(counterpartyId, counterpartyName, thisAccount, None)} //and create the proper OtherBankAccount with the correct "id" attribute set to the metadataId of the OtherBankAccountMetadata object diff --git a/obp-api/src/main/scala/code/bankconnectors/KafkaMappedConnector_JVMcompatible.scala b/obp-api/src/main/scala/code/bankconnectors/KafkaMappedConnector_JVMcompatible.scala index 9c8fff522..3c9396d16 100644 --- a/obp-api/src/main/scala/code/bankconnectors/KafkaMappedConnector_JVMcompatible.scala +++ b/obp-api/src/main/scala/code/bankconnectors/KafkaMappedConnector_JVMcompatible.scala @@ -38,7 +38,7 @@ import code.api.util._ import code.atms.{Atms, MappedAtm} import code.bankconnectors.vMar2017.KafkaMappedConnector_vMar2017 import code.branches.Branches.Branch -import code.fx.FXRate +import com.openbankproject.commons.model.FXRate import code.kafka.KafkaHelper import code.management.ImporterAPI.ImporterTransaction import code.metadata.comments.Comments @@ -52,7 +52,8 @@ import com.openbankproject.commons.model.Product import code.transaction.MappedTransaction import code.transactionrequests.TransactionRequests.TransactionRequestTypes._ import code.transactionrequests.TransactionRequests._ -import code.transactionrequests.{MappedTransactionRequestTypeCharge, TransactionRequestTypeCharge, TransactionRequestTypeChargeMock, TransactionRequests} +import code.transactionrequests.{MappedTransactionRequestTypeCharge, TransactionRequestTypeChargeMock, TransactionRequests} +import com.openbankproject.commons.model.TransactionRequestTypeCharge import code.util.Helper import code.util.Helper.MdcLoggable import code.views.Views @@ -915,7 +916,7 @@ object KafkaMappedConnector_JVMcompatible extends Connector with KafkaHelper wit val viewsDeleted = Views.views.vend.removeAllViews(bankId, accountId) //delete account - val account = getBankAccount(bankId, accountId) + val account = getBankAccountOld(bankId, accountId) val accountDeleted = account match { case acc => true //acc.delete_! //TODO @@ -954,7 +955,7 @@ object KafkaMappedConnector_JVMcompatible extends Connector with KafkaHelper wit private def createAccountIfNotExisting(bankId: BankId, accountId: AccountId, accountNumber: String, accountType: String, accountLabel: String, currency: String, balanceInSmallestCurrencyUnits: Long, accountHolderName: String) : BankAccount = { - getBankAccount(bankId, accountId) match { + getBankAccountOld(bankId, accountId) match { case Full(a) => logger.debug(s"account with id $accountId at bank with id $bankId already exists. No need to create a new one.") a @@ -1004,7 +1005,7 @@ object KafkaMappedConnector_JVMcompatible extends Connector with KafkaHelper wit //this will be Full(true) if everything went well val result = for { - acc <- getBankAccount(bankId, accountId) + acc <- getBankAccountOld(bankId, accountId) (bank, _)<- getBankLegacy(bankId, None) } yield { //acc.balance = newBalance @@ -1116,7 +1117,7 @@ object KafkaMappedConnector_JVMcompatible extends Connector with KafkaHelper wit override def updateAccountLabel(bankId: BankId, accountId: AccountId, label: String) = { //this will be Full(true) if everything went well val result = for { - acc <- getBankAccount(bankId, accountId) + acc <- getBankAccountOld(bankId, accountId) (bank, _)<- getBankLegacy(bankId, None) d <- MappedBankAccountData.find(By(MappedBankAccountData.accountId, accountId.value), By(MappedBankAccountData.bankId, bank.bankId.value)) } yield { @@ -1183,7 +1184,7 @@ object KafkaMappedConnector_JVMcompatible extends Connector with KafkaHelper wit //If it is empty, return the default value : "0.0000000" and set the BankAccount currency case _ => for { - fromAccount <- getBankAccount(bankId, accountId) + fromAccount <- getBankAccountOld(bankId, accountId) fromAccountCurrency <- tryo{ fromAccount.currency } } yield { TransactionRequestTypeChargeMock(transactionRequestType.value, bankId.value, fromAccountCurrency, "0.00", "Warning! Default value!") @@ -1228,7 +1229,7 @@ object KafkaMappedConnector_JVMcompatible extends Connector with KafkaHelper wit for { counterpartyId <- tryo{r.counterpartyId} counterpartyName <- tryo{r.counterpartyName} - thisAccount <- getBankAccount(BankId(r.bankId), AccountId(r.accountId)) + thisAccount <- getBankAccountOld(BankId(r.bankId), AccountId(r.accountId)) //creates a dummy OtherBankAccount without an OtherBankAccountMetadata, which results in one being generated (in OtherBankAccount init) dummyOtherBankAccount <- tryo{createCounterparty(counterpartyId, counterpartyName, thisAccount, None)} //and create the proper OtherBankAccount with the correct "id" attribute set to the metadataId of the OtherBankAccountMetadata object diff --git a/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnector.scala b/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnector.scala index a8ffde9f5..d1e39aa66 100644 --- a/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnector.scala +++ b/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnector.scala @@ -28,10 +28,12 @@ import code.context.{UserAuthContextProvider, UserAuthContextUpdateProvider} import code.customer._ import code.customeraddress.CustomerAddressX import code.customerattribute.{CustomerAttributeX, MappedCustomerAttribute} -import code.directdebit.{DirectDebitTrait, DirectDebits} +import code.directdebit.DirectDebits +import com.openbankproject.commons.model.DirectDebitTrait import code.dynamicEntity.{DynamicEntityProvider, DynamicEntityT} import code.fx.fx.TTL -import code.fx.{FXRate, MappedFXRate, fx} +import code.fx.{MappedFXRate, fx} +import com.openbankproject.commons.model.FXRate import code.kycchecks.KycChecks import code.kycdocuments.KycDocuments import code.kycmedias.KycMedias @@ -57,7 +59,8 @@ import code.transaction.MappedTransaction import code.transactionChallenge.ExpectedChallengeAnswer import code.transactionattribute.TransactionAttributeX import code.transactionrequests.TransactionRequests.TransactionRequestTypes.{ACCOUNT, ACCOUNT_OTP, COUNTERPARTY, FREE_FORM, REFUND, SANDBOX_TAN, SEPA, SEPA_CREDIT_TRANSFERS} -import code.transactionrequests.TransactionRequests.{TransactionChallengeTypes, TransactionRequestStatus, TransactionRequestTypes} +import code.transactionrequests.TransactionRequests.{TransactionChallengeTypes, TransactionRequestTypes} +import com.openbankproject.commons.model.enums.TransactionRequestStatus import code.transactionrequests._ import code.users.Users import code.util.Helper @@ -434,7 +437,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { updateAccountTransactions(bankId, accountId) - for (account <- getBankAccount(bankId, accountId)) + for (account <- getBankAccountOld(bankId, accountId)) yield mappedTransactions.flatMap(_.toTransaction(account)) //each transaction will be modified by account, here we return the `class Transaction` not a trait. } } @@ -478,7 +481,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { val mappedTransactions = MappedTransaction.findAll(mapperParams: _*) - for (account <- getBankAccount(bankId, accountId)) + for (account <- getBankAccountOld(bankId, accountId)) yield mappedTransactions.flatMap(_.toTransactionCore(account)) //each transaction will be modified by account, here we return the `class Transaction` not a trait. } } @@ -504,7 +507,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { for { bank <- getMappedBank(bankId) - account <- getBankAccount(bankId, accountId).map(_.asInstanceOf[MappedBankAccount]) + account <- getBankAccountOld(bankId, accountId).map(_.asInstanceOf[MappedBankAccount]) } { Future { val useMessageQueue = APIUtil.getPropsAsBoolValue("messageQueue.updateBankAccountsTransaction", false) @@ -566,7 +569,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { (Full( bankIdAccountIds.map( bankIdAccountId => - getBankAccount( + getBankAccountOld( bankIdAccountId.bankId, bankIdAccountId.accountId ).openOrThrowException(s"${ErrorMessages.BankAccountNotFound} current BANK_ID(${bankIdAccountId.bankId}) and ACCOUNT_ID(${bankIdAccountId.accountId})")) @@ -578,7 +581,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { Future { val accountsBalances = for { bankIdAccountId <- bankIdAccountIds - bankAccount <- getBankAccount(bankIdAccountId.bankId, bankIdAccountId.accountId) ?~! s"${ErrorMessages.BankAccountNotFound} current BANK_ID(${bankIdAccountId.bankId}) and ACCOUNT_ID(${bankIdAccountId.accountId})" + bankAccount <- getBankAccountOld(bankIdAccountId.bankId, bankIdAccountId.accountId) ?~! s"${ErrorMessages.BankAccountNotFound} current BANK_ID(${bankIdAccountId.bankId}) and ACCOUNT_ID(${bankIdAccountId.accountId})" accountBalance = AccountBalance( id = bankAccount.accountId.value, label = bankAccount.label, @@ -629,7 +632,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { Full( bankIdAccountIds .map(bankIdAccountId => - getBankAccount( + getBankAccountOld( bankIdAccountId.bankId, bankIdAccountId.accountId) .openOrThrowException(s"${ErrorMessages.BankAccountNotFound} current BANK_ID(${bankIdAccountId.bankId}) and ACCOUNT_ID(${bankIdAccountId.accountId})")) @@ -655,7 +658,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { Full( bankIdAccountIds .map(bankIdAccountId => - getBankAccount( + getBankAccountOld( bankIdAccountId.bankId, bankIdAccountId.accountId) .openOrThrowException(s"${ErrorMessages.BankAccountNotFound} current BANK_ID(${bankIdAccountId.bankId}) and ACCOUNT_ID(${bankIdAccountId.accountId})")) @@ -686,7 +689,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { */ def createOrUpdateMappedBankAccount(bankId: BankId, accountId: AccountId, currency: String): Box[BankAccount] = { - val mappedBankAccount = getBankAccount(bankId, accountId).map(_.asInstanceOf[MappedBankAccount]) match { + val mappedBankAccount = getBankAccountOld(bankId, accountId).map(_.asInstanceOf[MappedBankAccount]) match { case Full(f) => f.bank(bankId.value).theAccountId(accountId.value).accountCurrency(currency.toUpperCase).saveMe() case _ => @@ -1508,7 +1511,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { accountRoutingScheme: String, accountRoutingAddress: String ): BankAccount = { - getBankAccount(bankId, accountId) match { + getBankAccountOld(bankId, accountId) match { case Full(a) => logger.debug(s"account with id $accountId at bank with id $bankId already exists. No need to create a new one.") a @@ -1543,7 +1546,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { //this will be Full(true) if everything went well val result = for { bank <- getMappedBank(bankId) - account <- getBankAccount(bankId, accountId).map(_.asInstanceOf[MappedBankAccount]) + account <- getBankAccountOld(bankId, accountId).map(_.asInstanceOf[MappedBankAccount]) } yield { account.accountBalance(Helper.convertToSmallestCurrencyUnits(newBalance, account.currency)).save setBankAccountLastUpdated(bank.nationalIdentifier, account.number, now).openOrThrowException(attemptedToOpenAnEmptyBox) @@ -1659,7 +1662,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { override def updateAccountLabel(bankId: BankId, accountId: AccountId, label: String) = { //this will be Full(true) if everything went well val result = for { - acc <- getBankAccount(bankId, accountId).map(_.asInstanceOf[MappedBankAccount]) + acc <- getBankAccountOld(bankId, accountId).map(_.asInstanceOf[MappedBankAccount]) bank <- getMappedBank(bankId) } yield { acc.accountLabel(label).save @@ -2255,7 +2258,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { ) //If it is empty, return the default value : "0.0000000" and set the BankAccount currency case _ => - val fromAccountCurrency: String = getBankAccount(bankId, accountId).openOrThrowException(attemptedToOpenAnEmptyBox).currency + val fromAccountCurrency: String = getBankAccountOld(bankId, accountId).openOrThrowException(attemptedToOpenAnEmptyBox).currency TransactionRequestTypeChargeMock(transactionRequestType.value, bankId.value, fromAccountCurrency, "0.00", "Warning! Default value!") } @@ -3237,7 +3240,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { } //This is old one, no callContext there. only for old style endpoints. - override def getBankAccount(bankId: BankId, accountId: AccountId): Box[BankAccount] = { + override def getBankAccountOld(bankId: BankId, accountId: AccountId): Box[BankAccount] = { getBankAccountLegacy(bankId, accountId, None).map(_._1) } @@ -3266,10 +3269,10 @@ object LocalMappedConnector extends Connector with MdcLoggable { override def makePayment(initiator: User, fromAccountUID: BankIdAccountId, toAccountUID: BankIdAccountId, amt: BigDecimal, description: String, transactionRequestType: TransactionRequestType): Box[TransactionId] = { for { - fromAccount <- getBankAccount(fromAccountUID.bankId, fromAccountUID.accountId) ?~ + fromAccount <- getBankAccountOld(fromAccountUID.bankId, fromAccountUID.accountId) ?~ s"$BankAccountNotFound Account ${fromAccountUID.accountId} not found at bank ${fromAccountUID.bankId}" isOwner <- booleanToBox(initiator.hasOwnerViewAccess(BankIdAccountId(fromAccount.bankId, fromAccount.accountId)), UserNoOwnerView) - toAccount <- getBankAccount(toAccountUID.bankId, toAccountUID.accountId) ?~ + toAccount <- getBankAccountOld(toAccountUID.bankId, toAccountUID.accountId) ?~ s"$BankAccountNotFound Account ${toAccountUID.accountId} not found at bank ${toAccountUID.bankId}" sameCurrency <- booleanToBox(fromAccount.currency == toAccount.currency, { s"$InvalidTransactionRequestCurrency, Cannot send payment to account with different currency (From ${fromAccount.currency} to ${toAccount.currency}" @@ -3323,10 +3326,10 @@ object LocalMappedConnector extends Connector with MdcLoggable { //create a new transaction request val request = for { - fromAccountType <- getBankAccount(fromAccount.bankId, fromAccount.accountId) ?~ + fromAccountType <- getBankAccountOld(fromAccount.bankId, fromAccount.accountId) ?~ s"account ${fromAccount.accountId} not found at bank ${fromAccount.bankId}" isOwner <- booleanToBox(initiator.hasOwnerViewAccess(BankIdAccountId(fromAccount.bankId, fromAccount.accountId)), UserNoOwnerView) - toAccountType <- getBankAccount(toAccount.bankId, toAccount.accountId) ?~ + toAccountType <- getBankAccountOld(toAccount.bankId, toAccount.accountId) ?~ s"account ${toAccount.accountId} not found at bank ${toAccount.bankId}" rawAmt <- tryo { BigDecimal(body.value.amount) @@ -3384,9 +3387,9 @@ object LocalMappedConnector extends Connector with MdcLoggable { // Always create a new Transaction Request val request = for { - fromAccountType <- getBankAccount(fromAccount.bankId, fromAccount.accountId) ?~ s"account ${fromAccount.accountId} not found at bank ${fromAccount.bankId}" + fromAccountType <- getBankAccountOld(fromAccount.bankId, fromAccount.accountId) ?~ s"account ${fromAccount.accountId} not found at bank ${fromAccount.bankId}" isOwner <- booleanToBox(initiator.hasOwnerViewAccess(BankIdAccountId(fromAccount.bankId, fromAccount.accountId)) == true || hasEntitlement(fromAccount.bankId.value, initiator.userId, canCreateAnyTransactionRequest) == true, ErrorMessages.InsufficientAuthorisationToCreateTransactionRequest) - toAccountType <- getBankAccount(toAccount.bankId, toAccount.accountId) ?~ s"account ${toAccount.accountId} not found at bank ${toAccount.bankId}" + toAccountType <- getBankAccountOld(toAccount.bankId, toAccount.accountId) ?~ s"account ${toAccount.accountId} not found at bank ${toAccount.bankId}" rawAmt <- tryo { BigDecimal(body.value.amount) } ?~! s"amount ${body.value.amount} not convertible to number" @@ -3725,7 +3728,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { override def getTransactionRequests(initiator: User, fromAccount: BankAccount): Box[List[TransactionRequest]] = { val transactionRequests = for { - fromAccount <- getBankAccount(fromAccount.bankId, fromAccount.accountId) ?~ + fromAccount <- getBankAccountOld(fromAccount.bankId, fromAccount.accountId) ?~ s"account ${fromAccount.accountId} not found at bank ${fromAccount.bankId}" isOwner <- booleanToBox(initiator.hasOwnerViewAccess(BankIdAccountId(fromAccount.bankId, fromAccount.accountId)), UserNoOwnerView) transactionRequests <- getTransactionRequestsImpl(fromAccount) diff --git a/obp-api/src/main/scala/code/bankconnectors/LocalRecordConnector.scala b/obp-api/src/main/scala/code/bankconnectors/LocalRecordConnector.scala index f3fb43aab..63aca36e3 100644 --- a/obp-api/src/main/scala/code/bankconnectors/LocalRecordConnector.scala +++ b/obp-api/src/main/scala/code/bankconnectors/LocalRecordConnector.scala @@ -507,7 +507,7 @@ private object LocalRecordConnector extends Connector with MdcLoggable { //used by the transaction import api override def updateAccountBalance(bankId: BankId, accountId: AccountId, newBalance: BigDecimal) = { - getBankAccount(bankId, accountId).map(_.asInstanceOf[Account]) match { + getBankAccountOld(bankId, accountId).map(_.asInstanceOf[Account]) match { case Full(acc) => acc.accountBalance(newBalance).saveTheRecord().isDefined Full(true) @@ -527,7 +527,7 @@ private object LocalRecordConnector extends Connector with MdcLoggable { } override def updateAccountLabel(bankId: BankId, accountId: AccountId, label: String) = { - getBankAccount(bankId, accountId).map(_.asInstanceOf[Account]) match { + getBankAccountOld(bankId, accountId).map(_.asInstanceOf[Account]) match { case Full(acc) => acc.accountLabel(label).saveTheRecord().isDefined Full(true) diff --git a/obp-api/src/main/scala/code/bankconnectors/ObpJvmMappedConnector.scala b/obp-api/src/main/scala/code/bankconnectors/ObpJvmMappedConnector.scala index adbefe39d..5eb0617ce 100644 --- a/obp-api/src/main/scala/code/bankconnectors/ObpJvmMappedConnector.scala +++ b/obp-api/src/main/scala/code/bankconnectors/ObpJvmMappedConnector.scala @@ -10,7 +10,8 @@ import code.accountholders.{AccountHolders, MapperAccountHolders} import code.api.util.ErrorMessages._ import code.api.util._ import code.branches.Branches.Branch -import code.fx.{FXRate, fx} +import code.fx.fx +import com.openbankproject.commons.model.FXRate import code.management.ImporterAPI.ImporterTransaction import code.metadata.comments.Comments import code.metadata.narrative.MappedNarrative @@ -764,7 +765,7 @@ object ObpJvmMappedConnector extends Connector with MdcLoggable { val viewsDeleted = Views.views.vend.removeAllViews(bankId, accountId) //delete account - val account = getBankAccount(bankId, accountId) + val account = getBankAccountOld(bankId, accountId) val accountDeleted = account match { case acc => true //acc.delete_! //TODO @@ -803,7 +804,7 @@ object ObpJvmMappedConnector extends Connector with MdcLoggable { private def createAccountIfNotExisting(bankId: BankId, accountId: AccountId, accountNumber: String, accountType: String, accountLabel: String, currency: String, balanceInSmallestCurrencyUnits: Long, accountHolderName: String) : BankAccount = { - getBankAccount(bankId, accountId) match { + getBankAccountOld(bankId, accountId) match { case Full(a) => logger.info(s"account with id $accountId at bank with id $bankId already exists. No need to create a new one.") a @@ -854,7 +855,7 @@ object ObpJvmMappedConnector extends Connector with MdcLoggable { //this will be Full(true) if everything went well val result = for { - acc <- getBankAccount(bankId, accountId) + acc <- getBankAccountOld(bankId, accountId) (bank, _)<- getBankLegacy(bankId, None) } yield { //acc.balance = newBalance @@ -946,7 +947,7 @@ object ObpJvmMappedConnector extends Connector with MdcLoggable { bankId <- getBankByNationalIdentifier(bankNationalIdentifier).map(_.bankId) account <- getAccountByNumber(bankId, accountNumber, AuthUser.getCurrentUserUsername) } yield { - val acc = getBankAccount(bankId, account.accountId) + val acc = getBankAccountOld(bankId, account.accountId) acc match { case a => true //a.lastUpdate = updateDate //TODO // case _ => logger.warn("can't set bank account.lastUpdated because the account was not found"); false @@ -963,7 +964,7 @@ object ObpJvmMappedConnector extends Connector with MdcLoggable { override def updateAccountLabel(bankId: BankId, accountId: AccountId, label: String) = { //this will be Full(true) if everything went well val result = for { - acc <- getBankAccount(bankId, accountId) + acc <- getBankAccountOld(bankId, accountId) (bank, _)<- getBankLegacy(bankId, None) d <- MappedBankAccountData.find(By(MappedBankAccountData.accountId, accountId.value), By(MappedBankAccountData.bankId, bank.bankId.value)) } yield { @@ -992,7 +993,7 @@ object ObpJvmMappedConnector extends Connector with MdcLoggable { for { cparty <- r.counterparty - thisAccount <- getBankAccount(BankId(r.this_account.bank), AccountId(r.this_account.id)) + thisAccount <- getBankAccountOld(BankId(r.this_account.bank), AccountId(r.this_account.id)) //creates a dummy Counterparty without an CounterpartyMetadata, which results in one being generated (in Counterparty init) dummyCounterparty <- tryo{createCounterparty(cparty, thisAccount, None)} //and create the proper Counterparty with the correct "id" attribute set to the metadataId of the CounterpartyMetadata object @@ -1325,7 +1326,7 @@ object ObpJvmMappedConnector extends Connector with MdcLoggable { //If it is empty, return the default value : "0.0000000" and set the BankAccount currency case _ => for { - fromAccount <- getBankAccount(bankId, accountId) + fromAccount <- getBankAccountOld(bankId, accountId) fromAccountCurrency <- tryo{ fromAccount.currency } } yield { TransactionRequestTypeChargeMock(transactionRequestType.value, bankId.value, fromAccountCurrency, "0.00", "Warning! Default value!") diff --git a/obp-api/src/main/scala/code/bankconnectors/akka/AkkaConnectorBuilder.scala b/obp-api/src/main/scala/code/bankconnectors/akka/AkkaConnectorBuilder.scala index 6f7663703..4c854529a 100644 --- a/obp-api/src/main/scala/code/bankconnectors/akka/AkkaConnectorBuilder.scala +++ b/obp-api/src/main/scala/code/bankconnectors/akka/AkkaConnectorBuilder.scala @@ -1,191 +1,12 @@ package code.bankconnectors.akka -import code.bankconnectors.ConnectorBuilderUtil +import code.bankconnectors.ConnectorBuilderUtil._ -import scala.collection.immutable.List import scala.language.postfixOps object AkkaConnectorBuilder extends App { - val genMethodNames = List( - // "getEmptyBankAccount", //not useful! - // "getCounterpartyFromTransaction", //not useful! - // "getCounterpartiesFromTransaction",//not useful! - - "getAdapterInfo", - "getChallengeThreshold", - "getChargeLevel", - "createChallenge", - "getBank", - "getBanks", - "getBankAccountsForUser", - "getUser", - "getBankAccount", - "getBankAccount", - "getBankAccountsBalances", - "getCoreBankAccounts", - "getBankAccountsHeld", - "checkBankAccountExists", - "getCounterparty", - "getCounterpartyTrait", - "getCounterpartyByCounterpartyId", - "getCounterpartyByIban", - "getCounterparties", - "getTransactions", - "getTransactionsCore", - "getTransaction", - "getPhysicalCards", - "getPhysicalCardForBank", - "deletePhysicalCardForBank", - "getPhysicalCardsForBank", - "createPhysicalCard", - "updatePhysicalCard", - "makePayment", - "makePaymentv200", - "makePaymentv210", - "makePaymentImpl", - "createTransactionRequest", - "createTransactionRequestv200", - "getStatus", - "getChargeValue", - "createTransactionRequestv210", - "createTransactionRequestImpl", - "createTransactionRequestImpl210", - "saveTransactionRequestTransaction", - "saveTransactionRequestTransactionImpl", - "saveTransactionRequestChallenge", - "saveTransactionRequestChallengeImpl", - "saveTransactionRequestStatusImpl", - "getTransactionRequests", - "getTransactionRequests210", - "getTransactionRequestStatuses", - "getTransactionRequestStatusesImpl", - "getTransactionRequestsImpl", - "getTransactionRequestsImpl210", - "getTransactionRequestImpl", - "getTransactionRequestTypes", - "getTransactionRequestTypesImpl", - "answerTransactionRequestChallenge", - "createTransactionAfterChallenge", - "createTransactionAfterChallengev200", - "createTransactionAfterChallengeV210", - "updateBankAccount", - "createBankAndAccount", - "createBankAccount", - "createSandboxBankAccount", - "setAccountHolder", - "accountExists", - "removeAccount", - "getMatchingTransactionCount", - "createImportedTransaction", - "updateAccountBalance", - "setBankAccountLastUpdated", - "updateAccountLabel", - "updateAccount", - "getProducts", - "getProduct", - "createOrUpdateBranch", - "createOrUpdateBank", - "createOrUpdateAtm", - "createOrUpdateProduct", - "createOrUpdateFXRate", - "getBranch", - "getBranches", - "getAtm", - "getAtms", - "accountOwnerExists", - "createViews", - "getCurrentFxRate", - "getCurrentFxRateCached", - "getTransactionRequestTypeCharge", - "UpdateUserAccoutViewsByUsername", - "createTransactionAfterChallengev300", - "makePaymentv300", - "createTransactionRequestv300", - "getTransactionRequestTypeCharges", - "createCounterparty", - "checkCustomerNumberAvailable", - "createCustomer", - "updateCustomerScaData", - "updateCustomerCreditData", - "updateCustomerGeneralData", - "getCustomersByUserId", - "getCustomerByCustomerId", - "getCustomerByCustomerNumber", - "getCustomerAddress", - "createCustomerAddress", - "updateCustomerAddress", - "deleteCustomerAddress", - "createTaxResidence", - "getTaxResidence", - "deleteTaxResidence", - "getCustomers", - "getCheckbookOrders", - "getStatusOfCreditCardOrder", - "createUserAuthContext", - "createUserAuthContextUpdate", - "deleteUserAuthContexts", - "deleteUserAuthContextById", - "getUserAuthContexts", - "createOrUpdateProductAttribute", - "getProductAttributeById", - "getProductAttributesByBankAndCode", - "deleteProductAttribute", - "getAccountAttributeById", - "createOrUpdateAccountAttribute", - "createAccountAttributes", - "getAccountAttributesByAccount", - "createOrUpdateCardAttribute", - "getCardAttributeById", - "getCardAttributesFromProvider", - "createAccountApplication", - "getAllAccountApplication", - "getAccountApplicationById", - "updateAccountApplicationStatus", - "getOrCreateProductCollection", - "getProductCollection", - "getOrCreateProductCollectionItem", - "getProductCollectionItem", - "getProductCollectionItemsTree", - "createMeeting", - "getMeetings", - "getMeeting", - "createOrUpdateKycCheck", - "createOrUpdateKycDocument", - "createOrUpdateKycMedia", - "createOrUpdateKycStatus", - "getKycChecks", - "getKycDocuments", - "getKycMedias", - "getKycStatuses", - "createMessage", - "makeHistoricalPayment", - // new removed comments - "validateChallengeAnswer", - "getBankLegacy", - "getBanksLegacy", - "getBankAccountsForUserLegacy", - "updateUserAccountViewsOld", - "getBankAccountLegacy", - "getBankAccountByIban", - "getBankAccountByRouting", - "getBankAccounts", - "getCoreBankAccountsLegacy", - "getBankAccountsHeldLegacy", - "checkBankAccountExistsLegacy", - "getCounterpartyByCounterpartyIdLegacy", - "getCounterpartiesLegacy", - "getTransactionsLegacy", - "getTransactionLegacy", - "getPhysicalCardsForBankLegacy", - "createPhysicalCardLegacy", - "createBankAccountLegacy", - "getBranchLegacy", - "getAtmLegacy", - "getCustomerByCustomerIdLegacy", - ) - - ConnectorBuilderUtil.generateMethods(genMethodNames, + generateMethods(commonMethodNames, "src/main/scala/code/bankconnectors/akka/AkkaConnector_vDec2018.scala", - "(southSideActor ? req).mapTo[InBound].map(Box !!(_))") + "(southSideActor ? req).mapTo[InBound].map(Box !! _)") } diff --git a/obp-api/src/main/scala/code/bankconnectors/rest/RestConnectorBuilder.scala b/obp-api/src/main/scala/code/bankconnectors/rest/RestConnectorBuilder.scala index a30c2c956..b43bdc480 100644 --- a/obp-api/src/main/scala/code/bankconnectors/rest/RestConnectorBuilder.scala +++ b/obp-api/src/main/scala/code/bankconnectors/rest/RestConnectorBuilder.scala @@ -1,192 +1,12 @@ package code.bankconnectors.rest -import code.bankconnectors.ConnectorBuilderUtil +import code.bankconnectors.ConnectorBuilderUtil._ -import scala.collection.immutable.List import scala.language.postfixOps object RestConnectorBuilder extends App { - - val genMethodNames = List( - // "getEmptyBankAccount", //not useful! - // "getCounterpartyFromTransaction", //not useful! - // "getCounterpartiesFromTransaction",//not useful! - - "getAdapterInfo", - "getChallengeThreshold", - "getChargeLevel", - "createChallenge", - "getBank", - "getBanks", - "getBankAccountsForUser", - "getUser", - "getBankAccount", - "getBankAccount", - "getBankAccountsBalances", - "getCoreBankAccounts", - "getBankAccountsHeld", - "checkBankAccountExists", - "getCounterparty", - "getCounterpartyTrait", - "getCounterpartyByCounterpartyId", - "getCounterpartyByIban", - "getCounterparties", - "getTransactions", - "getTransactionsCore", - "getTransaction", - "getPhysicalCards", - "getPhysicalCardForBank", - "deletePhysicalCardForBank", - "getPhysicalCardsForBank", - "createPhysicalCard", - "updatePhysicalCard", - "makePayment", - "makePaymentv200", - "makePaymentv210", - "makePaymentImpl", - "createTransactionRequest", - "createTransactionRequestv200", - "getStatus", - "getChargeValue", - "createTransactionRequestv210", - "createTransactionRequestImpl", - "createTransactionRequestImpl210", - "saveTransactionRequestTransaction", - "saveTransactionRequestTransactionImpl", - "saveTransactionRequestChallenge", - "saveTransactionRequestChallengeImpl", - "saveTransactionRequestStatusImpl", - "getTransactionRequests", - "getTransactionRequests210", - "getTransactionRequestStatuses", - "getTransactionRequestStatusesImpl", - "getTransactionRequestsImpl", - "getTransactionRequestsImpl210", - "getTransactionRequestImpl", - "getTransactionRequestTypes", - "getTransactionRequestTypesImpl", - "answerTransactionRequestChallenge", - "createTransactionAfterChallenge", - "createTransactionAfterChallengev200", - "createTransactionAfterChallengeV210", - "updateBankAccount", - "createBankAndAccount", - "createBankAccount", - "createSandboxBankAccount", - "setAccountHolder", - "accountExists", - "removeAccount", - "getMatchingTransactionCount", - "createImportedTransaction", - "updateAccountBalance", - "setBankAccountLastUpdated", - "updateAccountLabel", - "updateAccount", - "getProducts", - "getProduct", - "createOrUpdateBranch", - "createOrUpdateBank", - "createOrUpdateAtm", - "createOrUpdateProduct", - "createOrUpdateFXRate", - "getBranch", - "getBranches", - "getAtm", - "getAtms", - "accountOwnerExists", - "createViews", - "getCurrentFxRate", - "getCurrentFxRateCached", - "getTransactionRequestTypeCharge", - "UpdateUserAccoutViewsByUsername", - "createTransactionAfterChallengev300", - "makePaymentv300", - "createTransactionRequestv300", - "getTransactionRequestTypeCharges", - "createCounterparty", - "checkCustomerNumberAvailable", - "createCustomer", - "updateCustomerScaData", - "updateCustomerCreditData", - "updateCustomerGeneralData", - "getCustomersByUserId", - "getCustomerByCustomerId", - "getCustomerByCustomerNumber", - "getCustomerAddress", - "createCustomerAddress", - "updateCustomerAddress", - "deleteCustomerAddress", - "createTaxResidence", - "getTaxResidence", - "deleteTaxResidence", - "getCustomers", - "getCheckbookOrders", - "getStatusOfCreditCardOrder", - "createUserAuthContext", - "createUserAuthContextUpdate", - "deleteUserAuthContexts", - "deleteUserAuthContextById", - "getUserAuthContexts", - "createOrUpdateProductAttribute", - "getProductAttributeById", - "getProductAttributesByBankAndCode", - "deleteProductAttribute", - "getAccountAttributeById", - "createOrUpdateAccountAttribute", - "createAccountAttributes", - "getAccountAttributesByAccount", - "createOrUpdateCardAttribute", - "getCardAttributeById", - "getCardAttributesFromProvider", - "createAccountApplication", - "getAllAccountApplication", - "getAccountApplicationById", - "updateAccountApplicationStatus", - "getOrCreateProductCollection", - "getProductCollection", - "getOrCreateProductCollectionItem", - "getProductCollectionItem", - "getProductCollectionItemsTree", - "createMeeting", - "getMeetings", - "getMeeting", - "createOrUpdateKycCheck", - "createOrUpdateKycDocument", - "createOrUpdateKycMedia", - "createOrUpdateKycStatus", - "getKycChecks", - "getKycDocuments", - "getKycMedias", - "getKycStatuses", - "createMessage", - "makeHistoricalPayment", - // new removed comments - "validateChallengeAnswer", - "getBankLegacy", - "getBanksLegacy", - "getBankAccountsForUserLegacy", - "updateUserAccountViewsOld", - "getBankAccountLegacy", - "getBankAccountByIban", - "getBankAccountByRouting", - "getBankAccounts", - "getCoreBankAccountsLegacy", - "getBankAccountsHeldLegacy", - "checkBankAccountExistsLegacy", - "getCounterpartyByCounterpartyIdLegacy", - "getCounterpartiesLegacy", - "getTransactionsLegacy", - "getTransactionLegacy", - "getPhysicalCardsForBankLegacy", - "createPhysicalCardLegacy", - "createBankAccountLegacy", - "getBranchLegacy", - "getAtmLegacy", - "getCustomerByCustomerIdLegacy", - ) - - ConnectorBuilderUtil.buildMethods(genMethodNames, + buildMethods(commonMethodNames, "src/main/scala/code/bankconnectors/rest/RestConnector_vMar2019.scala", methodName => s"""sendRequest[InBound](getUrl(callContext, "$methodName"), HttpMethods.POST, req, callContext)""") } diff --git a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnectorBuilder.scala b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnectorBuilder.scala index a5738fab4..6e520d947 100644 --- a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnectorBuilder.scala +++ b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnectorBuilder.scala @@ -1,193 +1,13 @@ package code.bankconnectors.storedprocedure -import code.bankconnectors.ConnectorBuilderUtil +import code.bankconnectors.ConnectorBuilderUtil._ import net.liftweb.util.StringHelpers -import scala.collection.immutable.List import scala.language.postfixOps object StoredProcedureConnectorBuilder extends App { - val genMethodNames = List( - "getAdapterInfo", - "getChallengeThreshold", - "getChargeLevel", - "createChallenge", - "getBank", - "getBanks", - "getBankAccountsForUser", - "getUser", - "getBankAccount", - "getBankAccount", - "getBankAccountsBalances", - "getCoreBankAccounts", - "getBankAccountsHeld", - "checkBankAccountExists", - "getCounterparty", - "getCounterpartyTrait", - "getCounterpartyByCounterpartyId", - "getCounterpartyByIban", - "getCounterparties", - "getTransactions", - "getTransactionsCore", - "getTransaction", - "getPhysicalCards", - "getPhysicalCardForBank", - "deletePhysicalCardForBank", - "getPhysicalCardsForBank", - "createPhysicalCard", - "updatePhysicalCard", - "makePayment", - "makePaymentv200", - "makePaymentv210", - "makePaymentImpl", - "createTransactionRequest", - "createTransactionRequestv200", - "createTransactionRequestv210", - "createTransactionRequestImpl", - "createTransactionRequestImpl210", - "getTransactionRequests", - "getTransactionRequests210", - "getTransactionRequestsImpl", - "getTransactionRequestsImpl210", - "getTransactionRequestImpl", - "getTransactionRequestTypesImpl", - "createTransactionAfterChallenge", - "createTransactionAfterChallengev200", - "createTransactionAfterChallengeV210", - "updateBankAccount", - "createBankAccount", - "getProducts", - "getProduct", - "createOrUpdateBank", - "createOrUpdateProduct", - "getBranch", - "getBranches", - "getAtm", - "getAtms", - "createTransactionAfterChallengev300", - "makePaymentv300", - "createTransactionRequestv300", - "createCounterparty", - "checkCustomerNumberAvailable", - "createCustomer", - "updateCustomerScaData", - "updateCustomerCreditData", - "updateCustomerGeneralData", - "getCustomersByUserId", - "getCustomerByCustomerId", - "getCustomerByCustomerNumber", - "getCustomerAddress", - "createCustomerAddress", - "updateCustomerAddress", - "deleteCustomerAddress", - "createTaxResidence", - "getTaxResidence", - "deleteTaxResidence", - "getCustomers", - "getCheckbookOrders", - "getStatusOfCreditCardOrder", - "createUserAuthContext", - "createUserAuthContextUpdate", - "deleteUserAuthContexts", - "deleteUserAuthContextById", - "getUserAuthContexts", - "createOrUpdateProductAttribute", - "getProductAttributeById", - "getProductAttributesByBankAndCode", - "deleteProductAttribute", - "getAccountAttributeById", - "createOrUpdateAccountAttribute", - "createAccountAttributes", - "getAccountAttributesByAccount", - "createOrUpdateCardAttribute", - "getCardAttributeById", - "getCardAttributesFromProvider", - "createAccountApplication", - "getAllAccountApplication", - "getAccountApplicationById", - "updateAccountApplicationStatus", - "getOrCreateProductCollection", - "getProductCollection", - "getOrCreateProductCollectionItem", - "getProductCollectionItem", - "getProductCollectionItemsTree", - "createMeeting", - "getMeetings", - "getMeeting", - "createOrUpdateKycCheck", - "createOrUpdateKycDocument", - "createOrUpdateKycMedia", - "createOrUpdateKycStatus", - "getKycChecks", - "getKycDocuments", - "getKycMedias", - "getKycStatuses", - "createMessage", - "makeHistoricalPayment", - "validateChallengeAnswer", - "getBankLegacy", - "getBanksLegacy", - "getBankAccountsForUserLegacy", - "getBankAccountLegacy", - "getBankAccountByIban", - "getBankAccountByRouting", - "getBankAccounts", - "getCoreBankAccountsLegacy", - "getBankAccountsHeldLegacy", - "checkBankAccountExistsLegacy", - "getCounterpartyByCounterpartyIdLegacy", - "getCounterpartiesLegacy", - "getTransactionsLegacy", - "getTransactionLegacy", - "getPhysicalCardsForBankLegacy", - "createPhysicalCardLegacy", - "createBankAccountLegacy", - "getBranchLegacy", - "getAtmLegacy", - "getCustomerByCustomerIdLegacy", - - //** not support methods: - //"getStatus", - //"getChargeValue", - //"saveTransactionRequestTransaction", - //"saveTransactionRequestTransactionImpl", - //"saveTransactionRequestChallenge", - //"saveTransactionRequestChallengeImpl", - //"saveTransactionRequestStatusImpl", - //"getTransactionRequestStatuses", - //"getTransactionRequestStatusesImpl", - // "getTransactionRequestTypes", // final method cant be override - //"answerTransactionRequestChallenge", - // "createBankAndAccount", - // "createSandboxBankAccount", - // "setAccountHolder", - // "accountExists", - // "removeAccount", - // "getMatchingTransactionCount", - // "createImportedTransaction", - // "updateAccountBalance", - // "setBankAccountLastUpdated", - // "updateAccountLabel", - // "updateAccount", - // "createOrUpdateBranch", - // "createOrUpdateAtm", - // "createOrUpdateFXRate", - // "accountOwnerExists", - // "createViews", - // "getCurrentFxRate", - // "getCurrentFxRateCached", - // "getTransactionRequestTypeCharge", - // "UpdateUserAccoutViewsByUsername", - // "getTransactionRequestTypeCharges", - //"updateUserAccountViewsOld", - - // "getEmptyBankAccount", //not useful! - // "getCounterpartyFromTransaction", //not useful! - // "getCounterpartiesFromTransaction",//not useful! - ) - - ConnectorBuilderUtil.buildMethods(genMethodNames, + buildMethods(commonMethodNames, "src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnector_vDec2019.scala", methodName => s"sendRequest[InBound](${StringHelpers.snakify(methodName)}, req, 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 4e66f9e4d..9cd5c83e9 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 @@ -902,40 +902,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetUser(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetUser( name=usernameExample.value, password="string") ), exampleInboundMessage = ( - InBoundGetUser(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), + InBoundGetUser( status= Status(errorCode=statusErrorCodeExample.value, backendMessages=List( InboundStatusMessage(source=sourceExample.value, status=inboundStatusMessageStatusExample.value, @@ -952,7 +924,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { import com.openbankproject.commons.dto.{OutBoundGetUser => OutBound, InBoundGetUser => InBound} val procedureName = "get_user" val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , name, password) + val req = OutBound(name, password) val result: OBPReturnType[Box[InboundUser]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) result } @@ -1031,11 +1003,11 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) // stored procedure name: get_bank_account - override def getBankAccount(bankId: BankId, accountId: AccountId): Box[BankAccount] = { - import com.openbankproject.commons.dto.{OutBoundGetBankAccount => OutBound, InBoundGetBankAccount => InBound} + override def getBankAccountOld(bankId: BankId, accountId: AccountId): Box[BankAccount] = { + import com.openbankproject.commons.dto.{OutBoundGetBankAccountOld => OutBound, InBoundGetBankAccountOld => InBound} val procedureName = "get_bank_account" val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountId) + val req = OutBound(bankId, accountId) val result: OBPReturnType[Box[BankAccountCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) result } @@ -1990,41 +1962,13 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetCounterparty(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetCounterparty( thisBankId=BankId(bankIdExample.value), thisAccountId=AccountId(accountIdExample.value), couterpartyId="string") ), exampleInboundMessage = ( - InBoundGetCounterparty(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), + InBoundGetCounterparty( status= Status(errorCode=statusErrorCodeExample.value, backendMessages=List( InboundStatusMessage(source=sourceExample.value, status=inboundStatusMessageStatusExample.value, @@ -2050,7 +1994,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { import com.openbankproject.commons.dto.{OutBoundGetCounterparty => OutBound, InBoundGetCounterparty => InBound} val procedureName = "get_counterparty" val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , thisBankId, thisAccountId, couterpartyId) + val req = OutBound(thisBankId, thisAccountId, couterpartyId) val result: OBPReturnType[Box[Counterparty]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) result } @@ -3098,32 +3042,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetPhysicalCards(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetPhysicalCards( user= UserCommons(userPrimaryKey=UserPrimaryKey(123), userId=userIdExample.value, idGivenByProvider="string", @@ -3132,10 +3051,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { name=usernameExample.value)) ), exampleInboundMessage = ( - InBoundGetPhysicalCards(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), + InBoundGetPhysicalCards( status= Status(errorCode=statusErrorCodeExample.value, backendMessages=List( InboundStatusMessage(source=sourceExample.value, status=inboundStatusMessageStatusExample.value, @@ -3189,7 +3105,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { import com.openbankproject.commons.dto.{OutBoundGetPhysicalCards => OutBound, InBoundGetPhysicalCards => InBound} val procedureName = "get_physical_cards" val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , user) + val req = OutBound(user) val result: OBPReturnType[Box[List[PhysicalCard]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) result } @@ -3378,32 +3294,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetPhysicalCardsForBankLegacy(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetPhysicalCardsForBankLegacy( bank= BankCommons(bankId=BankId(bankIdExample.value), shortName=bankShortNameExample.value, fullName=bankFullNameExample.value, @@ -3425,10 +3316,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { toDate="string") ), exampleInboundMessage = ( - InBoundGetPhysicalCardsForBankLegacy(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), + InBoundGetPhysicalCardsForBankLegacy( status= Status(errorCode=statusErrorCodeExample.value, backendMessages=List( InboundStatusMessage(source=sourceExample.value, status=inboundStatusMessageStatusExample.value, @@ -3482,7 +3370,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { import com.openbankproject.commons.dto.{OutBoundGetPhysicalCardsForBankLegacy => OutBound, InBoundGetPhysicalCardsForBankLegacy => InBound} val procedureName = "get_physical_cards_for_bank_legacy" val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bank, user, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) + val req = OutBound(bank, user, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) val result: OBPReturnType[Box[List[PhysicalCard]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) result } @@ -3998,32 +3886,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundMakePayment(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundMakePayment( initiator= UserCommons(userPrimaryKey=UserPrimaryKey(123), userId=userIdExample.value, idGivenByProvider="string", @@ -4039,10 +3902,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { transactionRequestType=TransactionRequestType(transactionRequestTypeExample.value)) ), exampleInboundMessage = ( - InBoundMakePayment(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), + InBoundMakePayment( status= Status(errorCode=statusErrorCodeExample.value, backendMessages=List( InboundStatusMessage(source=sourceExample.value, status=inboundStatusMessageStatusExample.value, @@ -4057,7 +3917,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { import com.openbankproject.commons.dto.{OutBoundMakePayment => OutBound, InBoundMakePayment => InBound} val procedureName = "make_payment" val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , initiator, fromAccountUID, toAccountUID, amt, description, transactionRequestType) + val req = OutBound(initiator, fromAccountUID, toAccountUID, amt, description, transactionRequestType) val result: OBPReturnType[Box[TransactionId]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) result } @@ -4075,32 +3935,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundMakePaymentv200(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundMakePaymentv200( fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), accountType=accountTypeExample.value, balance=BigDecimal(balanceAmountExample.value), @@ -4146,10 +3981,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { chargePolicy="string") ), exampleInboundMessage = ( - InBoundMakePaymentv200(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), + InBoundMakePaymentv200( status= Status(errorCode=statusErrorCodeExample.value, backendMessages=List( InboundStatusMessage(source=sourceExample.value, status=inboundStatusMessageStatusExample.value, @@ -4164,7 +3996,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { import com.openbankproject.commons.dto.{OutBoundMakePaymentv200 => OutBound, InBoundMakePaymentv200 => InBound} val procedureName = "make_paymentv200" val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , fromAccount, toAccount, transactionRequestCommonBody, amount, description, transactionRequestType, chargePolicy) + val req = OutBound(fromAccount, toAccount, transactionRequestCommonBody, amount, description, transactionRequestType, chargePolicy) val result: OBPReturnType[Box[TransactionId]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) result } @@ -4289,32 +4121,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundMakePaymentImpl(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundMakePaymentImpl( fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), accountType=accountTypeExample.value, balance=BigDecimal(balanceAmountExample.value), @@ -4360,10 +4167,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { chargePolicy="string") ), exampleInboundMessage = ( - InBoundMakePaymentImpl(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), + InBoundMakePaymentImpl( status= Status(errorCode=statusErrorCodeExample.value, backendMessages=List( InboundStatusMessage(source=sourceExample.value, status=inboundStatusMessageStatusExample.value, @@ -4378,7 +4182,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { import com.openbankproject.commons.dto.{OutBoundMakePaymentImpl => OutBound, InBoundMakePaymentImpl => InBound} val procedureName = "make_payment_impl" val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , fromAccount, toAccount, transactionRequestCommonBody, amt, description, transactionRequestType, chargePolicy) + val req = OutBound(fromAccount, toAccount, transactionRequestCommonBody, amt, description, transactionRequestType, chargePolicy) val result: OBPReturnType[Box[TransactionId]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) result } @@ -4396,32 +4200,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateTransactionRequest(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateTransactionRequest( initiator= UserCommons(userPrimaryKey=UserPrimaryKey(123), userId=userIdExample.value, idGivenByProvider="string", @@ -4472,10 +4251,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { description="string")) ), exampleInboundMessage = ( - InBoundCreateTransactionRequest(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), + InBoundCreateTransactionRequest( status= Status(errorCode=statusErrorCodeExample.value, backendMessages=List( InboundStatusMessage(source=sourceExample.value, status=inboundStatusMessageStatusExample.value, @@ -4555,7 +4331,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { import com.openbankproject.commons.dto.{OutBoundCreateTransactionRequest => OutBound, InBoundCreateTransactionRequest => InBound} val procedureName = "create_transaction_request" val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , initiator, fromAccount, toAccount, transactionRequestType, body) + val req = OutBound(initiator, fromAccount, toAccount, transactionRequestType, body) val result: OBPReturnType[Box[TransactionRequest]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) result } @@ -4573,32 +4349,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateTransactionRequestv200(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateTransactionRequestv200( initiator= UserCommons(userPrimaryKey=UserPrimaryKey(123), userId=userIdExample.value, idGivenByProvider="string", @@ -4649,10 +4400,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { description="string")) ), exampleInboundMessage = ( - InBoundCreateTransactionRequestv200(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), + InBoundCreateTransactionRequestv200( status= Status(errorCode=statusErrorCodeExample.value, backendMessages=List( InboundStatusMessage(source=sourceExample.value, status=inboundStatusMessageStatusExample.value, @@ -4732,7 +4480,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { import com.openbankproject.commons.dto.{OutBoundCreateTransactionRequestv200 => OutBound, InBoundCreateTransactionRequestv200 => InBound} val procedureName = "create_transaction_requestv200" val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , initiator, fromAccount, toAccount, transactionRequestType, body) + val req = OutBound(initiator, fromAccount, toAccount, transactionRequestType, body) val result: OBPReturnType[Box[TransactionRequest]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) result } @@ -4930,32 +4678,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateTransactionRequestImpl(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateTransactionRequestImpl( transactionRequestId=TransactionRequestId("string"), transactionRequestType=TransactionRequestType(transactionRequestTypeExample.value), fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), @@ -5005,10 +4728,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { amount="string"))) ), exampleInboundMessage = ( - InBoundCreateTransactionRequestImpl(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), + InBoundCreateTransactionRequestImpl( status= Status(errorCode=statusErrorCodeExample.value, backendMessages=List( InboundStatusMessage(source=sourceExample.value, status=inboundStatusMessageStatusExample.value, @@ -5088,7 +4808,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { import com.openbankproject.commons.dto.{OutBoundCreateTransactionRequestImpl => OutBound, InBoundCreateTransactionRequestImpl => InBound} val procedureName = "create_transaction_request_impl" val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , transactionRequestId, transactionRequestType, fromAccount, counterparty, body, status, charge) + val req = OutBound(transactionRequestId, transactionRequestType, fromAccount, counterparty, body, status, charge) val result: OBPReturnType[Box[TransactionRequest]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) result } @@ -5106,32 +4826,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateTransactionRequestImpl210(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateTransactionRequestImpl210( transactionRequestId=TransactionRequestId("string"), transactionRequestType=TransactionRequestType(transactionRequestTypeExample.value), fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), @@ -5181,10 +4876,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { chargePolicy="string") ), exampleInboundMessage = ( - InBoundCreateTransactionRequestImpl210(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), + InBoundCreateTransactionRequestImpl210( status= Status(errorCode=statusErrorCodeExample.value, backendMessages=List( InboundStatusMessage(source=sourceExample.value, status=inboundStatusMessageStatusExample.value, @@ -5264,7 +4956,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { import com.openbankproject.commons.dto.{OutBoundCreateTransactionRequestImpl210 => OutBound, InBoundCreateTransactionRequestImpl210 => InBound} val procedureName = "create_transaction_request_impl210" val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , transactionRequestId, transactionRequestType, fromAccount, toAccount, transactionRequestCommonBody, details, status, charge, chargePolicy) + val req = OutBound(transactionRequestId, transactionRequestType, fromAccount, toAccount, transactionRequestCommonBody, details, status, charge, chargePolicy) val result: OBPReturnType[Box[TransactionRequest]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) result } @@ -5282,32 +4974,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetTransactionRequests(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetTransactionRequests( initiator= UserCommons(userPrimaryKey=UserPrimaryKey(123), userId=userIdExample.value, idGivenByProvider="string", @@ -5334,10 +5001,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { accountHolder=bankAccountAccountHolderExample.value)) ), exampleInboundMessage = ( - InBoundGetTransactionRequests(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), + InBoundGetTransactionRequests( status= Status(errorCode=statusErrorCodeExample.value, backendMessages=List( InboundStatusMessage(source=sourceExample.value, status=inboundStatusMessageStatusExample.value, @@ -5417,7 +5081,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { import com.openbankproject.commons.dto.{OutBoundGetTransactionRequests => OutBound, InBoundGetTransactionRequests => InBound} val procedureName = "get_transaction_requests" val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , initiator, fromAccount) + val req = OutBound(initiator, fromAccount) val result: OBPReturnType[Box[List[TransactionRequest]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) result } @@ -5588,32 +5252,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetTransactionRequestsImpl(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetTransactionRequestsImpl( fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), accountType=accountTypeExample.value, balance=BigDecimal(balanceAmountExample.value), @@ -5634,10 +5273,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { accountHolder=bankAccountAccountHolderExample.value)) ), exampleInboundMessage = ( - InBoundGetTransactionRequestsImpl(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), + InBoundGetTransactionRequestsImpl( status= Status(errorCode=statusErrorCodeExample.value, backendMessages=List( InboundStatusMessage(source=sourceExample.value, status=inboundStatusMessageStatusExample.value, @@ -5717,7 +5353,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { import com.openbankproject.commons.dto.{OutBoundGetTransactionRequestsImpl => OutBound, InBoundGetTransactionRequestsImpl => InBound} val procedureName = "get_transaction_requests_impl" val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , fromAccount) + val req = OutBound(fromAccount) val result: OBPReturnType[Box[List[TransactionRequest]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) result } @@ -5735,32 +5371,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetTransactionRequestsImpl210(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetTransactionRequestsImpl210( fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), accountType=accountTypeExample.value, balance=BigDecimal(balanceAmountExample.value), @@ -5781,10 +5392,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { accountHolder=bankAccountAccountHolderExample.value)) ), exampleInboundMessage = ( - InBoundGetTransactionRequestsImpl210(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), + InBoundGetTransactionRequestsImpl210( status= Status(errorCode=statusErrorCodeExample.value, backendMessages=List( InboundStatusMessage(source=sourceExample.value, status=inboundStatusMessageStatusExample.value, @@ -5864,7 +5472,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { import com.openbankproject.commons.dto.{OutBoundGetTransactionRequestsImpl210 => OutBound, InBoundGetTransactionRequestsImpl210 => InBound} val procedureName = "get_transaction_requests_impl210" val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , fromAccount) + val req = OutBound(fromAccount) val result: OBPReturnType[Box[List[TransactionRequest]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) result } @@ -6012,32 +5620,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetTransactionRequestTypesImpl(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetTransactionRequestTypesImpl( fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), accountType=accountTypeExample.value, balance=BigDecimal(balanceAmountExample.value), @@ -6058,10 +5641,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { accountHolder=bankAccountAccountHolderExample.value)) ), exampleInboundMessage = ( - InBoundGetTransactionRequestTypesImpl(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), + InBoundGetTransactionRequestTypesImpl( status= Status(errorCode=statusErrorCodeExample.value, backendMessages=List( InboundStatusMessage(source=sourceExample.value, status=inboundStatusMessageStatusExample.value, @@ -6076,7 +5656,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { import com.openbankproject.commons.dto.{OutBoundGetTransactionRequestTypesImpl => OutBound, InBoundGetTransactionRequestTypesImpl => InBound} val procedureName = "get_transaction_request_types_impl" val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , fromAccount) + val req = OutBound(fromAccount) val result: OBPReturnType[Box[List[TransactionRequestType]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) result } @@ -6094,32 +5674,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateTransactionAfterChallenge(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateTransactionAfterChallenge( initiator= UserCommons(userPrimaryKey=UserPrimaryKey(123), userId=userIdExample.value, idGivenByProvider="string", @@ -6129,10 +5684,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { transReqId=TransactionRequestId("string")) ), exampleInboundMessage = ( - InBoundCreateTransactionAfterChallenge(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), + InBoundCreateTransactionAfterChallenge( status= Status(errorCode=statusErrorCodeExample.value, backendMessages=List( InboundStatusMessage(source=sourceExample.value, status=inboundStatusMessageStatusExample.value, @@ -6212,7 +5764,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { import com.openbankproject.commons.dto.{OutBoundCreateTransactionAfterChallenge => OutBound, InBoundCreateTransactionAfterChallenge => InBound} val procedureName = "create_transaction_after_challenge" val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , initiator, transReqId) + val req = OutBound(initiator, transReqId) val result: OBPReturnType[Box[TransactionRequest]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) result } @@ -6230,32 +5782,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateTransactionAfterChallengev200(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateTransactionAfterChallengev200( fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), accountType=accountTypeExample.value, balance=BigDecimal(balanceAmountExample.value), @@ -6360,10 +5887,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { future_date=Some("string"))) ), exampleInboundMessage = ( - InBoundCreateTransactionAfterChallengev200(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), + InBoundCreateTransactionAfterChallengev200( status= Status(errorCode=statusErrorCodeExample.value, backendMessages=List( InboundStatusMessage(source=sourceExample.value, status=inboundStatusMessageStatusExample.value, @@ -6443,7 +5967,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { import com.openbankproject.commons.dto.{OutBoundCreateTransactionAfterChallengev200 => OutBound, InBoundCreateTransactionAfterChallengev200 => InBound} val procedureName = "create_transaction_after_challengev200" val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , fromAccount, toAccount, transactionRequest) + val req = OutBound(fromAccount, toAccount, transactionRequest) val result: OBPReturnType[Box[TransactionRequest]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) result } @@ -6944,39 +6468,11 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetProducts(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), - bankId=BankId(bankIdExample.value), Map.empty) + OutBoundGetProducts( + bankId=BankId(bankIdExample.value), Nil) ), exampleInboundMessage = ( - InBoundGetProducts(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), + InBoundGetProducts( status= Status(errorCode=statusErrorCodeExample.value, backendMessages=List( InboundStatusMessage(source=sourceExample.value, status=inboundStatusMessageStatusExample.value, @@ -7002,7 +6498,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { import com.openbankproject.commons.dto.{OutBoundGetProducts => OutBound, InBoundGetProducts => InBound} val procedureName = "get_products" val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, params) + val req = OutBound(bankId, params) val result: OBPReturnType[Box[List[ProductCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) result } @@ -7020,40 +6516,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetProduct(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetProduct( bankId=BankId(bankIdExample.value), productCode=ProductCode("string")) ), exampleInboundMessage = ( - InBoundGetProduct(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), + InBoundGetProduct( status= Status(errorCode=statusErrorCodeExample.value, backendMessages=List( InboundStatusMessage(source=sourceExample.value, status=inboundStatusMessageStatusExample.value, @@ -7079,7 +6547,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { import com.openbankproject.commons.dto.{OutBoundGetProduct => OutBound, InBoundGetProduct => InBound} val procedureName = "get_product" val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, productCode) + val req = OutBound(bankId, productCode) val result: OBPReturnType[Box[ProductCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) result } @@ -7097,32 +6565,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateOrUpdateBank(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateOrUpdateBank( bankId=bankIdExample.value, fullBankName="string", shortBankName="string", @@ -7134,10 +6577,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { bankRoutingAddress=bankRoutingAddressExample.value) ), exampleInboundMessage = ( - InBoundCreateOrUpdateBank(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), + InBoundCreateOrUpdateBank( status= Status(errorCode=statusErrorCodeExample.value, backendMessages=List( InboundStatusMessage(source=sourceExample.value, status=inboundStatusMessageStatusExample.value, @@ -7160,7 +6600,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateBank => OutBound, InBoundCreateOrUpdateBank => InBound} val procedureName = "create_or_update_bank" val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, fullBankName, shortBankName, logoURL, websiteURL, swiftBIC, national_identifier, bankRoutingScheme, bankRoutingAddress) + val req = OutBound(bankId, fullBankName, shortBankName, logoURL, websiteURL, swiftBIC, national_identifier, bankRoutingScheme, bankRoutingAddress) val result: OBPReturnType[Box[BankCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) result } @@ -7178,32 +6618,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateOrUpdateProduct(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateOrUpdateProduct( bankId=bankIdExample.value, code="string", parentProductCode=Some("string"), @@ -7218,10 +6633,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { metaLicenceName="string") ), exampleInboundMessage = ( - InBoundCreateOrUpdateProduct(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), + InBoundCreateOrUpdateProduct( status= Status(errorCode=statusErrorCodeExample.value, backendMessages=List( InboundStatusMessage(source=sourceExample.value, status=inboundStatusMessageStatusExample.value, @@ -7247,7 +6659,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateProduct => OutBound, InBoundCreateOrUpdateProduct => InBound} val procedureName = "create_or_update_product" val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, code, parentProductCode, name, category, family, superFamily, moreInfoUrl, details, description, metaLicenceId, metaLicenceName) + val req = OutBound(bankId, code, parentProductCode, name, category, family, superFamily, moreInfoUrl, details, description, metaLicenceId, metaLicenceName) val result: OBPReturnType[Box[ProductCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) result } @@ -7265,40 +6677,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetBranchLegacy(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetBranchLegacy( bankId=BankId(bankIdExample.value), branchId=BranchId(branchIdExample.value)) ), exampleInboundMessage = ( - InBoundGetBranchLegacy(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), + InBoundGetBranchLegacy( status= Status(errorCode=statusErrorCodeExample.value, backendMessages=List( InboundStatusMessage(source=sourceExample.value, status=inboundStatusMessageStatusExample.value, @@ -7369,7 +6753,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { import com.openbankproject.commons.dto.{OutBoundGetBranchLegacy => OutBound, InBoundGetBranchLegacy => InBound} val procedureName = "get_branch_legacy" val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, branchId) + val req = OutBound(bankId, branchId) val result: OBPReturnType[Box[BranchTCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) result } @@ -7634,40 +7018,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetAtmLegacy(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetAtmLegacy( bankId=BankId(bankIdExample.value), atmId=AtmId("string")) ), exampleInboundMessage = ( - InBoundGetAtmLegacy(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), + InBoundGetAtmLegacy( status= Status(errorCode=statusErrorCodeExample.value, backendMessages=List( InboundStatusMessage(source=sourceExample.value, status=inboundStatusMessageStatusExample.value, @@ -7718,7 +7074,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { import com.openbankproject.commons.dto.{OutBoundGetAtmLegacy => OutBound, InBoundGetAtmLegacy => InBound} val procedureName = "get_atm_legacy" val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, atmId) + val req = OutBound(bankId, atmId) val result: OBPReturnType[Box[AtmTCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) result } diff --git a/obp-api/src/main/scala/code/bankconnectors/vMar2017/KafkaJsonFactory_vMar2017.scala b/obp-api/src/main/scala/code/bankconnectors/vMar2017/KafkaJsonFactory_vMar2017.scala index 9d204a936..d3f9fcb1d 100644 --- a/obp-api/src/main/scala/code/bankconnectors/vMar2017/KafkaJsonFactory_vMar2017.scala +++ b/obp-api/src/main/scala/code/bankconnectors/vMar2017/KafkaJsonFactory_vMar2017.scala @@ -30,10 +30,10 @@ import java.util.Date import code.api.util.APIUtil import code.api.util.APIUtil.{MessageDoc} -import code.fx.FXRate +import com.openbankproject.commons.model.FXRate import code.model._ import code.model.dataAccess.MappedBankAccountData -import code.transactionrequests.TransactionRequestTypeCharge +import com.openbankproject.commons.model.TransactionRequestTypeCharge import com.openbankproject.commons.model.{CounterpartyTrait, _} import net.liftweb.json.JsonAST.JValue import net.liftweb.mapper.By diff --git a/obp-api/src/main/scala/code/bankconnectors/vMar2017/KafkaMappedConnector_vMar2017.scala b/obp-api/src/main/scala/code/bankconnectors/vMar2017/KafkaMappedConnector_vMar2017.scala index 3f147b706..8afab6a62 100644 --- a/obp-api/src/main/scala/code/bankconnectors/vMar2017/KafkaMappedConnector_vMar2017.scala +++ b/obp-api/src/main/scala/code/bankconnectors/vMar2017/KafkaMappedConnector_vMar2017.scala @@ -33,7 +33,8 @@ import code.api.util._ import code.api.v2_1_0._ import code.bankconnectors._ import code.branches.Branches.Branch -import code.fx.{FXRate, fx} +import code.fx.fx +import com.openbankproject.commons.model.FXRate import code.kafka.KafkaHelper import code.management.ImporterAPI.ImporterTransaction import code.metadata.comments.Comments @@ -48,7 +49,8 @@ import com.openbankproject.commons.model.Product import code.transaction.MappedTransaction import code.transactionrequests.TransactionRequests.TransactionRequestTypes._ import code.transactionrequests.TransactionRequests._ -import code.transactionrequests.{TransactionRequestTypeCharge, TransactionRequests} +import code.transactionrequests.TransactionRequests +import com.openbankproject.commons.model.TransactionRequestTypeCharge import code.util.Helper.MdcLoggable import code.util.{Helper, TTLCache} import code.views.Views @@ -1165,7 +1167,7 @@ trait KafkaMappedConnector_vMar2017 extends Connector with KafkaHelper with MdcL case Full(f) => Full(TransactionRequestTypeCharge2(f)) case _ => for { - fromAccount <- getBankAccount(bankId, accountId) + fromAccount <- getBankAccountOld(bankId, accountId) fromAccountCurrency <- tryo{ fromAccount.currency } } yield { TransactionRequestTypeCharge2(InboundTransactionRequestTypeCharge( @@ -1330,7 +1332,7 @@ trait KafkaMappedConnector_vMar2017 extends Connector with KafkaHelper with MdcL val viewsDeleted = Views.views.vend.removeAllViews(bankId, accountId) //delete account - val account = getBankAccount(bankId, accountId) + val account = getBankAccountOld(bankId, accountId) val accountDeleted = account match { case acc => true //acc.delete_! //TODO @@ -1370,7 +1372,7 @@ trait KafkaMappedConnector_vMar2017 extends Connector with KafkaHelper with MdcL private def createAccountIfNotExisting(bankId: BankId, accountId: AccountId, accountNumber: String, accountType: String, accountLabel: String, currency: String, balanceInSmallestCurrencyUnits: Long, accountHolderName: String) : BankAccount = { - getBankAccount(bankId, accountId) match { + getBankAccountOld(bankId, accountId) match { case Full(a) => logger.info(s"account with id $accountId at bank with id $bankId already exists. No need to create a new one.") a @@ -1420,7 +1422,7 @@ trait KafkaMappedConnector_vMar2017 extends Connector with KafkaHelper with MdcL //this will be Full(true) if everything went well val result = for { - acc <- getBankAccount(bankId, accountId) + acc <- getBankAccountOld(bankId, accountId) (bank, _)<- getBankLegacy(bankId, None) } yield { //acc.balance = newBalance @@ -1512,7 +1514,7 @@ trait KafkaMappedConnector_vMar2017 extends Connector with KafkaHelper with MdcL bankId <- getBankByNationalIdentifier(bankNationalIdentifier).map(_.bankId) account <- getAccountByNumber(bankId, accountNumber) } yield { - val acc = getBankAccount(bankId, account.accountId) + val acc = getBankAccountOld(bankId, account.accountId) acc match { case a => true //a.lastUpdate = updateDate //TODO // case _ => logger.warn("can't set bank account.lastUpdated because the account was not found"); false @@ -1529,7 +1531,7 @@ trait KafkaMappedConnector_vMar2017 extends Connector with KafkaHelper with MdcL override def updateAccountLabel(bankId: BankId, accountId: AccountId, label: String) = { //this will be Full(true) if everything went well val result = for { - acc <- getBankAccount(bankId, accountId) + acc <- getBankAccountOld(bankId, accountId) (bank, _)<- getBankLegacy(bankId, None) d <- MappedBankAccountData.find(By(MappedBankAccountData.accountId, accountId.value), By(MappedBankAccountData.bankId, bank.bankId.value)) } yield { @@ -1595,7 +1597,7 @@ trait KafkaMappedConnector_vMar2017 extends Connector with KafkaHelper with MdcL for { counterpartyId <- tryo{r.counterpartyId} counterpartyName <- tryo{r.counterpartyName} - thisAccount <- getBankAccount(BankId(r.bankId), AccountId(r.accountId)) + thisAccount <- getBankAccountOld(BankId(r.bankId), AccountId(r.accountId)) //creates a dummy OtherBankAccount without an OtherBankAccountMetadata, which results in one being generated (in OtherBankAccount init) dummyOtherBankAccount <- tryo{createCounterparty(counterpartyId, counterpartyName, thisAccount, None)} //and create the proper OtherBankAccount with the correct "id" attribute set to the metadataId of the OtherBankAccountMetadata object diff --git a/obp-api/src/main/scala/code/bankconnectors/vMay2019/KafkaConnectorBuilder.scala b/obp-api/src/main/scala/code/bankconnectors/vMay2019/KafkaConnectorBuilder.scala index 86e8458d2..87105f42d 100644 --- a/obp-api/src/main/scala/code/bankconnectors/vMay2019/KafkaConnectorBuilder.scala +++ b/obp-api/src/main/scala/code/bankconnectors/vMay2019/KafkaConnectorBuilder.scala @@ -1,23 +1,9 @@ package code.bankconnectors.vMay2019 -import java.io.File -import java.util.Date -import java.util.regex.Matcher - -import code.api.util.ApiTag.ResourceDocTag -import code.api.util.{ApiTag, CallContext, OBPQueryParam} -import code.bankconnectors.{Connector, ConnectorBuilderUtil} -import com.openbankproject.commons.util.ReflectUtils -import org.apache.commons.io.FileUtils -import org.apache.commons.lang3.StringUtils._ +import code.bankconnectors.ConnectorBuilderUtil._ import scala.collection.immutable.List import scala.language.postfixOps -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import code.api.util.CodeGenerateUtils.createDocExample -import code.bankconnectors.vSept2018.KafkaConnectorBuilder.genMethodNames -import javassist.ClassPool object KafkaConnectorBuilder extends App { @@ -35,7 +21,7 @@ object KafkaConnectorBuilder extends App { "getCustomerByCustomerNumber" ) - ConnectorBuilderUtil.generateMethods(genMethodNames, + generateMethods(commonMethodNames, "src/main/scala/code/bankconnectors/vMay2019/KafkaMappedConnector_vMay2019.scala", "processRequest[InBound](req)", true) } diff --git a/obp-api/src/main/scala/code/bankconnectors/vSept2018/KafkaConnectorBuilder.scala b/obp-api/src/main/scala/code/bankconnectors/vSept2018/KafkaConnectorBuilder.scala index 678ff36a8..488125a6d 100644 --- a/obp-api/src/main/scala/code/bankconnectors/vSept2018/KafkaConnectorBuilder.scala +++ b/obp-api/src/main/scala/code/bankconnectors/vSept2018/KafkaConnectorBuilder.scala @@ -1,6 +1,6 @@ package code.bankconnectors.vSept2018 -import code.bankconnectors.ConnectorBuilderUtil +import code.bankconnectors.ConnectorBuilderUtil._ import scala.collection.immutable.List import scala.language.postfixOps @@ -20,7 +20,7 @@ object KafkaConnectorBuilder extends App { "createBankAccount", ) - ConnectorBuilderUtil.generateMethods(genMethodNames, + generateMethods(genMethodNames, "src/main/scala/code/bankconnectors/vSept2018/KafkaMappedConnector_vSept2018.scala", "processRequest[InBound](req)", true) } diff --git a/obp-api/src/main/scala/code/directdebit/DirectDebit.scala b/obp-api/src/main/scala/code/directdebit/DirectDebit.scala index 009f2bfaa..712f0b24c 100644 --- a/obp-api/src/main/scala/code/directdebit/DirectDebit.scala +++ b/obp-api/src/main/scala/code/directdebit/DirectDebit.scala @@ -4,6 +4,7 @@ import java.util.Date import net.liftweb.common.Box import net.liftweb.util.SimpleInjector +import com.openbankproject.commons.model.DirectDebitTrait object DirectDebits extends SimpleInjector { @@ -24,17 +25,3 @@ trait DirectDebitProvider { def getDirectDebitsByCustomer(customerId: String) : List[DirectDebitTrait] def getDirectDebitsByUser(userId: String) : List[DirectDebitTrait] } - -trait DirectDebitTrait { - def directDebitId: String - def bankId: String - def accountId: String - def customerId: String - def userId: String - def counterpartyId: String - def dateSigned: Date - def dateCancelled: Date - def dateStarts: Date - def dateExpires: Date - def active: Boolean -} \ No newline at end of file diff --git a/obp-api/src/main/scala/code/directdebit/MappedDirectDebit.scala b/obp-api/src/main/scala/code/directdebit/MappedDirectDebit.scala index 50ce1a966..4f0b9356f 100644 --- a/obp-api/src/main/scala/code/directdebit/MappedDirectDebit.scala +++ b/obp-api/src/main/scala/code/directdebit/MappedDirectDebit.scala @@ -4,6 +4,7 @@ import java.util.Date import code.api.util.APIUtil import code.util.UUIDString +import com.openbankproject.commons.model.DirectDebitTrait import net.liftweb.common.Box import net.liftweb.mapper._ diff --git a/obp-api/src/main/scala/code/fx/MappedFXRate.scala b/obp-api/src/main/scala/code/fx/MappedFXRate.scala index b61eae6ef..75f7bd223 100644 --- a/obp-api/src/main/scala/code/fx/MappedFXRate.scala +++ b/obp-api/src/main/scala/code/fx/MappedFXRate.scala @@ -3,7 +3,7 @@ package code.fx import java.util.Date import code.util.UUIDString -import com.openbankproject.commons.model.BankId +import com.openbankproject.commons.model.{BankId, FXRate} import net.liftweb.mapper.{MappedStringForeignKey, _} class MappedFXRate extends FXRate with LongKeyedMapper[MappedFXRate] with IdPK { @@ -42,17 +42,4 @@ class MappedFXRate extends FXRate with LongKeyedMapper[MappedFXRate] with IdPK { object MappedFXRate extends MappedFXRate with LongKeyedMetaMapper[MappedFXRate] {} -trait FXRate { - def bankId : BankId - - def fromCurrencyCode: String - - def toCurrencyCode: String - - def conversionValue: Double - - def inverseConversionValue: Double - - def effectiveDate: Date -} diff --git a/obp-api/src/main/scala/code/management/ImporterAPI.scala b/obp-api/src/main/scala/code/management/ImporterAPI.scala index 69b545da5..d81831581 100644 --- a/obp-api/src/main/scala/code/management/ImporterAPI.scala +++ b/obp-api/src/main/scala/code/management/ImporterAPI.scala @@ -68,7 +68,7 @@ object ImporterAPI extends RestHelper with MdcLoggable { } val thisBank = Connector.connector.vend.getBankLegacy(t.bankId, None).map(_._1) - val thisAcc = Connector.connector.vend.getBankAccount(t.bankId, t.accountId) + val thisAcc = Connector.connector.vend.getBankAccountOld(t.bankId, t.accountId) val thisAccJson = JObject(List(JField("holder", JObject(List( JField("holder", JString(thisAcc.map(_.accountHolder).getOrElse(""))), diff --git a/obp-api/src/main/scala/code/model/BankingData.scala b/obp-api/src/main/scala/code/model/BankingData.scala index 3c0d8a690..45fe12b4f 100644 --- a/obp-api/src/main/scala/code/model/BankingData.scala +++ b/obp-api/src/main/scala/code/model/BankingData.scala @@ -485,7 +485,7 @@ case class BankAccountExtended(val bankAccount: BankAccount) extends MdcLoggable object BankAccountX { def apply(bankId: BankId, accountId: AccountId) : Box[BankAccount] = { - Connector.connector.vend.getBankAccount(bankId, accountId) + Connector.connector.vend.getBankAccountOld(bankId, accountId) } def apply(bankId: BankId, accountId: AccountId, callContext: Option[CallContext]) : Box[(BankAccount,Option[CallContext])] = { @@ -532,9 +532,9 @@ object BankAccountX { val incomingAccountId= AccountId(Constant.INCOMING_ACCOUNT_ID) val outgoingAccountId= AccountId(Constant.OUTGOING_ACCOUNT_ID) if (isOutgoingAccount){ - LocalMappedConnector.getBankAccount(defaultBankId,outgoingAccountId) + LocalMappedConnector.getBankAccountOld(defaultBankId,outgoingAccountId) } else{ - LocalMappedConnector.getBankAccount(defaultBankId,incomingAccountId) + LocalMappedConnector.getBankAccountOld(defaultBankId,incomingAccountId) } } } diff --git a/obp-api/src/main/scala/code/sandbox/OBPDataImport.scala b/obp-api/src/main/scala/code/sandbox/OBPDataImport.scala index 4a1094c42..89fc21cc8 100644 --- a/obp-api/src/main/scala/code/sandbox/OBPDataImport.scala +++ b/obp-api/src/main/scala/code/sandbox/OBPDataImport.scala @@ -319,7 +319,7 @@ trait OBPDataImport extends MdcLoggable { val duplicateNumbers = numbers diff numbers.distinct val existing = data.accounts.flatMap(acc => { - Connector.connector.vend.getBankAccount(BankId(acc.bank), AccountId(acc.id)) + Connector.connector.vend.getBankAccountOld(BankId(acc.bank), AccountId(acc.id)) }) if(!banksNotSpecifiedInImport.isEmpty) { diff --git a/obp-api/src/main/scala/code/transaction/MappedTransaction.scala b/obp-api/src/main/scala/code/transaction/MappedTransaction.scala index 567e0a99c..f45256d9d 100644 --- a/obp-api/src/main/scala/code/transaction/MappedTransaction.scala +++ b/obp-api/src/main/scala/code/transaction/MappedTransaction.scala @@ -218,7 +218,7 @@ class MappedTransaction extends LongKeyedMapper[MappedTransaction] with IdPK wit } yield transaction case _ => for { - acc <- LocalMappedConnector.getBankAccount(theBankId, theAccountId) + acc <- LocalMappedConnector.getBankAccountOld(theBankId, theAccountId) transaction <- toTransaction(acc) } yield transaction } diff --git a/obp-api/src/main/scala/code/transactionrequests/MappedTransactionRequestProvider.scala b/obp-api/src/main/scala/code/transactionrequests/MappedTransactionRequestProvider.scala index fd573fa13..d370a761d 100644 --- a/obp-api/src/main/scala/code/transactionrequests/MappedTransactionRequestProvider.scala +++ b/obp-api/src/main/scala/code/transactionrequests/MappedTransactionRequestProvider.scala @@ -7,6 +7,7 @@ import code.model._ import code.transactionrequests.TransactionRequests.{TransactionRequestTypes, _} import code.util.{AccountIdString, UUIDString} import com.openbankproject.commons.model._ +import com.openbankproject.commons.model.enums.TransactionRequestStatus import net.liftweb.common.{Box, Failure, Full, Logger} import net.liftweb.json import net.liftweb.json.JsonAST.{JField, JObject, JString} diff --git a/obp-api/src/main/scala/code/transactionrequests/MappedTransactionRequestTypeCharge.scala b/obp-api/src/main/scala/code/transactionrequests/MappedTransactionRequestTypeCharge.scala index 4f21ffeba..a00dd2991 100644 --- a/obp-api/src/main/scala/code/transactionrequests/MappedTransactionRequestTypeCharge.scala +++ b/obp-api/src/main/scala/code/transactionrequests/MappedTransactionRequestTypeCharge.scala @@ -1,6 +1,7 @@ package code.transactionrequests -import code.util.{UUIDString} +import code.util.UUIDString +import com.openbankproject.commons.model.TransactionRequestTypeCharge import net.liftweb.mapper._ class MappedTransactionRequestTypeCharge extends TransactionRequestTypeCharge with LongKeyedMapper[MappedTransactionRequestTypeCharge] with IdPK with CreatedUpdated{ @@ -47,16 +48,3 @@ case class TransactionRequestTypeChargeMock( } -trait TransactionRequestTypeCharge { - - def transactionRequestTypeId: String - - def bankId: String - - def chargeCurrency: String - - def chargeAmount: String - - def chargeSummary: String -} - diff --git a/obp-api/src/main/scala/code/transactionrequests/TransactionRequests.scala b/obp-api/src/main/scala/code/transactionrequests/TransactionRequests.scala index 92c5e94ab..a6eea419c 100644 --- a/obp-api/src/main/scala/code/transactionrequests/TransactionRequests.scala +++ b/obp-api/src/main/scala/code/transactionrequests/TransactionRequests.scala @@ -14,11 +14,6 @@ object TransactionRequests extends SimpleInjector { type PaymentServiceTypes = Value val payments, bulk_payments, periodic_payments = Value } - - object TransactionRequestStatus extends Enumeration { - type TransactionRequestStatus = Value - val INITIATED, PENDING, NEXT_CHALLENGE_PENDING, FAILED, COMPLETED, FORWARDED, REJECTED = Value - } object TransactionChallengeTypes extends Enumeration { type TransactionChallengeTypes = Value diff --git a/obp-api/src/test/scala/code/api/v1_4_0/TransactionRequestsTest.scala b/obp-api/src/test/scala/code/api/v1_4_0/TransactionRequestsTest.scala index 2201e8318..11f4eb9c4 100644 --- a/obp-api/src/test/scala/code/api/v1_4_0/TransactionRequestsTest.scala +++ b/obp-api/src/test/scala/code/api/v1_4_0/TransactionRequestsTest.scala @@ -8,7 +8,8 @@ import code.api.v1_4_0.JSONFactory1_4_0._ import code.bankconnectors.Connector import code.setup.DefaultUsers import code.transactionrequests.TransactionRequests.TransactionRequestTypes._ -import code.transactionrequests.TransactionRequests.{TransactionChallengeTypes, TransactionRequestStatus} +import code.transactionrequests.TransactionRequests.TransactionChallengeTypes +import com.openbankproject.commons.model.enums.TransactionRequestStatus import net.liftweb.json.JsonAST.JString import net.liftweb.json.Serialization.write import org.scalatest.Tag diff --git a/obp-api/src/test/scala/code/api/v2_0_0/TransactionRequestsTest.scala b/obp-api/src/test/scala/code/api/v2_0_0/TransactionRequestsTest.scala index 4c5e8a895..9050b4189 100644 --- a/obp-api/src/test/scala/code/api/v2_0_0/TransactionRequestsTest.scala +++ b/obp-api/src/test/scala/code/api/v2_0_0/TransactionRequestsTest.scala @@ -9,7 +9,7 @@ import code.api.v1_4_0.JSONFactory1_4_0.{ChallengeAnswerJSON, TransactionRequest import code.bankconnectors.Connector import code.fx.fx import code.setup.DefaultUsers -import code.transactionrequests.TransactionRequests.TransactionRequestStatus +import com.openbankproject.commons.model.enums.TransactionRequestStatus import code.transactionrequests.TransactionRequests.TransactionRequestTypes._ import net.liftweb.json.JsonAST.JString import net.liftweb.json.Serialization.write diff --git a/obp-api/src/test/scala/code/api/v2_1_0/TransactionRequestsTest.scala b/obp-api/src/test/scala/code/api/v2_1_0/TransactionRequestsTest.scala index 1f94ff548..7a1b38814 100644 --- a/obp-api/src/test/scala/code/api/v2_1_0/TransactionRequestsTest.scala +++ b/obp-api/src/test/scala/code/api/v2_1_0/TransactionRequestsTest.scala @@ -15,7 +15,7 @@ import code.bankconnectors.Connector import code.fx.fx import code.model.BankAccountX import code.setup.{APIResponse, DefaultUsers} -import code.transactionrequests.TransactionRequests.TransactionRequestStatus +import com.openbankproject.commons.model.enums.TransactionRequestStatus import code.transactionrequests.TransactionRequests.TransactionRequestTypes._ import com.openbankproject.commons.model.{AccountId, BankAccount, TransactionRequestId} import net.liftweb.json.Serialization.write diff --git a/obp-api/src/test/scala/code/api/v4_0_0/TransactionRequestsTest.scala b/obp-api/src/test/scala/code/api/v4_0_0/TransactionRequestsTest.scala index 1ee340bfc..c0203af0d 100644 --- a/obp-api/src/test/scala/code/api/v4_0_0/TransactionRequestsTest.scala +++ b/obp-api/src/test/scala/code/api/v4_0_0/TransactionRequestsTest.scala @@ -16,7 +16,7 @@ import code.bankconnectors.Connector import code.fx.fx import code.model.BankAccountX import code.setup.{APIResponse, DefaultUsers} -import code.transactionrequests.TransactionRequests.TransactionRequestStatus +import com.openbankproject.commons.model.enums.TransactionRequestStatus import code.transactionrequests.TransactionRequests.TransactionRequestTypes._ import com.github.dwickern.macros.NameOf.nameOf import com.openbankproject.commons.model._ diff --git a/obp-api/src/test/scala/code/bankaccountcreation/BankAccountCreationTest.scala b/obp-api/src/test/scala/code/bankaccountcreation/BankAccountCreationTest.scala index 83af4a867..acb5bcd86 100644 --- a/obp-api/src/test/scala/code/bankaccountcreation/BankAccountCreationTest.scala +++ b/obp-api/src/test/scala/code/bankaccountcreation/BankAccountCreationTest.scala @@ -75,7 +75,7 @@ class BankAccountCreationTest extends ServerSetup with DefaultUsers with Default newBank.nationalIdentifier should equal(bankNationalIdentifier) And("An account should now exist, with the correct parameters") - val foundAccountBox = Connector.connector.vend.getBankAccount(newBank.bankId, returnedAccount.accountId) + val foundAccountBox = Connector.connector.vend.getBankAccountOld(newBank.bankId, returnedAccount.accountId) foundAccountBox.isDefined should equal(true) val foundAccount = foundAccountBox.openOrThrowException(attemptedToOpenAnEmptyBox) @@ -109,7 +109,7 @@ class BankAccountCreationTest extends ServerSetup with DefaultUsers with Default allBanksAfter(0).nationalIdentifier should equal(existingBank.nationalIdentifier) And("An account should now exist, with the correct parameters") - val foundAccountBox = Connector.connector.vend.getBankAccount(existingBank.bankId, returnedAccount.accountId) + val foundAccountBox = Connector.connector.vend.getBankAccountOld(existingBank.bankId, returnedAccount.accountId) foundAccountBox.isDefined should equal(true) val foundAccount = foundAccountBox.openOrThrowException(attemptedToOpenAnEmptyBox) @@ -143,7 +143,7 @@ class BankAccountCreationTest extends ServerSetup with DefaultUsers with Default ) Then("No account is created") - Connector.connector.vend.getBankAccount(bankId, accountId).isDefined should equal(false) + Connector.connector.vend.getBankAccountOld(bankId, accountId).isDefined should equal(false) } @@ -157,7 +157,7 @@ class BankAccountCreationTest extends ServerSetup with DefaultUsers with Default "","","" ) //added field in V220 Then("An account with the proper parameters should be created") - val createdAccBox = Connector.connector.vend.getBankAccount(bankId, accountId) + val createdAccBox = Connector.connector.vend.getBankAccountOld(bankId, accountId) createdAccBox.isDefined should be(true) val createdAcc = createdAccBox.openOrThrowException(attemptedToOpenAnEmptyBox) @@ -179,7 +179,7 @@ class BankAccountCreationTest extends ServerSetup with DefaultUsers with Default "","", "")//added field in V220 Then("An account with the proper parameters should be created") - val createdAccBox = Connector.connector.vend.getBankAccount(bankId, accountId) + val createdAccBox = Connector.connector.vend.getBankAccountOld(bankId, accountId) createdAccBox.isDefined should be(true) val createdAcc = createdAccBox.openOrThrowException(attemptedToOpenAnEmptyBox) diff --git a/obp-api/src/test/scala/code/management/ImporterTest.scala b/obp-api/src/test/scala/code/management/ImporterTest.scala index f7b6bfba1..0ebbb9b4b 100644 --- a/obp-api/src/test/scala/code/management/ImporterTest.scala +++ b/obp-api/src/test/scala/code/management/ImporterTest.scala @@ -209,7 +209,7 @@ class ImporterTest extends ServerSetup with MdcLoggable with DefaultConnectorTes And("The account should have its balance set to the 'new_balance' value of the most recently completed transaction") - val account = Connector.connector.vend.getBankAccount(f.account.bankId, f.account.accountId).openOrThrowException(attemptedToOpenAnEmptyBox) + val account = Connector.connector.vend.getBankAccountOld(f.account.bankId, f.account.accountId).openOrThrowException(attemptedToOpenAnEmptyBox) account.balance.toString should equal(f.t2NewBalance) //t2 has a later completed date than t1 And("The account should have accountLastUpdate set to the current time") @@ -244,7 +244,7 @@ class ImporterTest extends ServerSetup with MdcLoggable with DefaultConnectorTes tsAfter.foreach(checkTransactionOkay) And("The account should have its balance set to the 'new_balance' value of the most recently completed transaction") - val account = Connector.connector.vend.getBankAccount(f.account.bankId, f.account.accountId).openOrThrowException(attemptedToOpenAnEmptyBox) + val account = Connector.connector.vend.getBankAccountOld(f.account.bankId, f.account.accountId).openOrThrowException(attemptedToOpenAnEmptyBox) account.balance.toString should equal(f.t1NewBalance) And("The account should have accountLastUpdate set to the current time") @@ -267,7 +267,7 @@ class ImporterTest extends ServerSetup with MdcLoggable with DefaultConnectorTes tsBefore.foreach(checkTransactionOkay) //remember lastUpdate time - var account = Connector.connector.vend.getBankAccount(f.account.bankId, f.account.accountId).openOrThrowException(attemptedToOpenAnEmptyBox) + var account = Connector.connector.vend.getBankAccountOld(f.account.bankId, f.account.accountId).openOrThrowException(attemptedToOpenAnEmptyBox) val oldTime = if(account.lastUpdate != null) account.lastUpdate.getTime else 0 When("We try to add those transactions again") @@ -283,7 +283,7 @@ class ImporterTest extends ServerSetup with MdcLoggable with DefaultConnectorTes tsAfter.foreach(checkTransactionOkay) And("The account should have accountLastUpdate set to the current time (different from first insertion)") - account = Connector.connector.vend.getBankAccount(f.account.bankId, f.account.accountId).openOrThrowException(attemptedToOpenAnEmptyBox) + account = Connector.connector.vend.getBankAccountOld(f.account.bankId, f.account.accountId).openOrThrowException(attemptedToOpenAnEmptyBox) val dt = (account.lastUpdate.getTime - oldTime) dt > 0 should equal(true) } diff --git a/obp-api/src/test/scala/code/sandbox/SandboxDataLoadingTest.scala b/obp-api/src/test/scala/code/sandbox/SandboxDataLoadingTest.scala index 4cefb5df8..8e0505600 100644 --- a/obp-api/src/test/scala/code/sandbox/SandboxDataLoadingTest.scala +++ b/obp-api/src/test/scala/code/sandbox/SandboxDataLoadingTest.scala @@ -266,7 +266,7 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with Match def verifyAccountCreated(account : SandboxAccountImport) = { val accId = AccountId(account.id) val bankId = BankId(account.bank) - val foundAccountBox = Connector.connector.vend.getBankAccount(bankId, accId) + val foundAccountBox = Connector.connector.vend.getBankAccountOld(bankId, accId) foundAccountBox.isDefined should equal(true) val foundAccount = foundAccountBox.openOrThrowException(attemptedToOpenAnEmptyBox) @@ -901,7 +901,7 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with Match getResponse(List(accountWithEmptyId)).code should equal(FAILED) //no account should exist with an empty id - Connector.connector.vend.getBankAccount(BankId(account1AtBank1.bank), AccountId("")).isDefined should equal(false) + Connector.connector.vend.getBankAccountOld(BankId(account1AtBank1.bank), AccountId("")).isDefined should equal(false) getResponse(List(acc1AtBank1Json)).code should equal(SUCCESS) @@ -924,7 +924,7 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with Match getResponse(List(account1AtBank1Json, accountWithSameId)).code should equal(FAILED) //no accounts should have been created - Connector.connector.vend.getBankAccount(BankId(account1AtBank1.bank), AccountId(account1AtBank1.id)).isDefined should equal(false) + Connector.connector.vend.getBankAccountOld(BankId(account1AtBank1.bank), AccountId(account1AtBank1.id)).isDefined should equal(false) val accountIdTwo = "2" accountIdTwo should not equal(account1AtBank1.id) @@ -934,8 +934,8 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with Match getResponse(List(account1AtBank1Json, accountWithDifferentId)).code should equal(SUCCESS) //two accounts should have been created - Connector.connector.vend.getBankAccount(BankId(account1AtBank1.bank), AccountId(account1AtBank1.id)).isDefined should equal(true) - Connector.connector.vend.getBankAccount(BankId(account1AtBank1.bank), AccountId(accountIdTwo)).isDefined should equal(true) + Connector.connector.vend.getBankAccountOld(BankId(account1AtBank1.bank), AccountId(account1AtBank1.id)).isDefined should equal(true) + Connector.connector.vend.getBankAccountOld(BankId(account1AtBank1.bank), AccountId(accountIdTwo)).isDefined should equal(true) } @@ -956,7 +956,7 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with Match getResponse(List(account1AtBank1Json, Extraction.decompose(otherAccount))).code should equal(FAILED) //and the other account should not have been created - Connector.connector.vend.getBankAccount(BankId(otherAccount.bank), AccountId(otherAccount.id)).isDefined should equal(false) + Connector.connector.vend.getBankAccountOld(BankId(otherAccount.bank), AccountId(otherAccount.id)).isDefined should equal(false) } it should "not allow an account to have a bankId not specified in the imported banks" in { @@ -977,7 +977,7 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with Match getResponse(List(badBankAccount)).code should equal(FAILED) //no account should have been created - Connector.connector.vend.getBankAccount(BankId(badBankId), AccountId(account1AtBank1.id)).isDefined should equal(false) + Connector.connector.vend.getBankAccountOld(BankId(badBankId), AccountId(account1AtBank1.id)).isDefined should equal(false) } it should "not allow an account to be created without an owner" in { @@ -1018,14 +1018,14 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with Match getResponse(List(Extraction.decompose(accountWithInvalidOwner))).code should equal(FAILED) //it should not have been created - Connector.connector.vend.getBankAccount(BankId(accountWithInvalidOwner.bank), AccountId(accountWithInvalidOwner.id)).isDefined should equal(false) + Connector.connector.vend.getBankAccountOld(BankId(accountWithInvalidOwner.bank), AccountId(accountWithInvalidOwner.id)).isDefined should equal(false) //a mix of valid an invalid owners should also not work val accountWithSomeValidSomeInvalidOwners = accountWithInvalidOwner.copy(owners = List(accountWithInvalidOwner.owners + user1.user_name)) getResponse(List(Extraction.decompose(accountWithSomeValidSomeInvalidOwners))).code should equal(FAILED) //it should not have been created - Connector.connector.vend.getBankAccount(BankId(accountWithSomeValidSomeInvalidOwners.bank), AccountId(accountWithSomeValidSomeInvalidOwners.id)).isDefined should equal(false) + Connector.connector.vend.getBankAccountOld(BankId(accountWithSomeValidSomeInvalidOwners.bank), AccountId(accountWithSomeValidSomeInvalidOwners.id)).isDefined should equal(false) } @@ -1048,15 +1048,15 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with Match getResponse(List(acc1Json, sameNumberJson)).code should equal(FAILED) //no accounts should have been created - Connector.connector.vend.getBankAccount(BankId(acc1.bank), AccountId(acc1.id)).isDefined should equal(false) - Connector.connector.vend.getBankAccount(BankId(acc1.bank), AccountId(acc2.id)).isDefined should equal(false) + Connector.connector.vend.getBankAccountOld(BankId(acc1.bank), AccountId(acc1.id)).isDefined should equal(false) + Connector.connector.vend.getBankAccountOld(BankId(acc1.bank), AccountId(acc2.id)).isDefined should equal(false) //check it works with the normal different number getResponse(List(acc1Json, acc2Json)).code should equal(SUCCESS) //and the accounts should be created - Connector.connector.vend.getBankAccount(BankId(acc1.bank), AccountId(acc1.id)).isDefined should equal(true) - Connector.connector.vend.getBankAccount(BankId(acc1.bank), AccountId(acc2.id)).isDefined should equal(true) + Connector.connector.vend.getBankAccountOld(BankId(acc1.bank), AccountId(acc1.id)).isDefined should equal(true) + Connector.connector.vend.getBankAccountOld(BankId(acc1.bank), AccountId(acc2.id)).isDefined should equal(true) } it should "require transactions to have non-empty ids" in { 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 f0b19f096..f7207e36a 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 @@ -28,7 +28,7 @@ package com.openbankproject.commons.dto import java.util.Date -import com.openbankproject.commons.model.enums.{CardAttributeType, DynamicEntityOperation} +import com.openbankproject.commons.model.enums.{CardAttributeType, CustomerAttributeType, DynamicEntityOperation, StrongCustomerAuthentication, TransactionAttributeType, TransactionRequestStatus} import com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SCA import com.openbankproject.commons.model.{enums, _} import net.liftweb.json.{JObject, JValue} @@ -77,6 +77,13 @@ 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 @@ -440,9 +447,11 @@ case class OutBoundGetMeeting(outboundAdapterCallContext: OutboundAdapterCallCon meetingId: String) extends TopicTrait case class InBoundGetMeeting(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: MeetingCommons) extends InBoundTrait[MeetingCommons] -case class OutBoundGetUser(outboundAdapterCallContext: OutboundAdapterCallContext, name: String, password: String) extends TopicTrait +case class OutBoundGetUser(name: String, password: String) extends TopicTrait -case class InBoundGetUser(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: InboundUser) extends InBoundTrait[InboundUser] +case class InBoundGetUser(status: Status, data: InboundUser) extends InBoundTrait[InboundUser] { + override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() +} //create bound case classes @@ -482,42 +491,12 @@ case class OutBoundGetBankAccountsHeld(outboundAdapterCallContext: OutboundAdapt case class InBoundGetBankAccountsHeld(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[AccountHeld]) extends InBoundTrait[List[AccountHeld]] -case class OutBoundGetEmptyBankAccount(outboundAdapterCallContext: OutboundAdapterCallContext) extends TopicTrait -case class InBoundGetEmptyBankAccount(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] - - -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(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(outboundAdapterCallContext: OutboundAdapterCallContext, - thisBankId: BankId, - thisAccountId: AccountId, - couterpartyId: String) extends TopicTrait -case class InBoundGetCounterparty(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Counterparty) extends InBoundTrait[Counterparty] - - case class OutBoundGetCounterparties(outboundAdapterCallContext: OutboundAdapterCallContext, thisBankId: BankId, thisAccountId: AccountId, viewId: ViewId) extends TopicTrait case class InBoundGetCounterparties(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CounterpartyTraitCommons]) extends InBoundTrait[List[CounterpartyTraitCommons]] -case class OutBoundGetPhysicalCards(outboundAdapterCallContext: OutboundAdapterCallContext, - user: User) extends TopicTrait -case class InBoundGetPhysicalCards(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[PhysicalCard]) extends InBoundTrait[List[PhysicalCard]] - - - case class OutBoundMakeHistoricalPayment(outboundAdapterCallContext: OutboundAdapterCallContext, fromAccount: BankAccount, @@ -714,196 +693,11 @@ case class OutBoundCreatePhysicalCard(outboundAdapterCallContext: OutboundAdapte case class InBoundCreatePhysicalCard(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: PhysicalCard) extends InBoundTrait[PhysicalCard] -case class OutBoundMakePayment(outboundAdapterCallContext: OutboundAdapterCallContext, - initiator: User, - fromAccountUID: BankIdAccountId, - toAccountUID: BankIdAccountId, - amt: BigDecimal, - description: String, - transactionRequestType: TransactionRequestType) extends TopicTrait -case class InBoundMakePayment(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionId) extends InBoundTrait[TransactionId] - - -case class OutBoundMakePaymentv200(outboundAdapterCallContext: OutboundAdapterCallContext, - fromAccount: BankAccount, - toAccount: BankAccount, - transactionRequestCommonBody: TransactionRequestCommonBodyJSON, - amount: BigDecimal, - description: String, - transactionRequestType: TransactionRequestType, - chargePolicy: String) extends TopicTrait -case class InBoundMakePaymentv200(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionId) extends InBoundTrait[TransactionId] - - -case class OutBoundMakePaymentImpl(outboundAdapterCallContext: OutboundAdapterCallContext, - fromAccount: BankAccount, - toAccount: BankAccount, - transactionRequestCommonBody: TransactionRequestCommonBodyJSON, - amt: BigDecimal, - description: String, - transactionRequestType: TransactionRequestType, - chargePolicy: String) extends TopicTrait -case class InBoundMakePaymentImpl(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionId) extends InBoundTrait[TransactionId] - - -case class OutBoundCreateTransactionRequest(outboundAdapterCallContext: OutboundAdapterCallContext, - initiator: User, - fromAccount: BankAccount, - toAccount: BankAccount, - transactionRequestType: TransactionRequestType, - body: TransactionRequestBody) extends TopicTrait -case class InBoundCreateTransactionRequest(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] - - -case class OutBoundCreateTransactionRequestv200(outboundAdapterCallContext: OutboundAdapterCallContext, - initiator: User, - fromAccount: BankAccount, - toAccount: BankAccount, - transactionRequestType: TransactionRequestType, - body: TransactionRequestBody) extends TopicTrait -case class InBoundCreateTransactionRequestv200(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] - - -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 OutBoundCreateTransactionRequestImpl210(outboundAdapterCallContext: OutboundAdapterCallContext, - transactionRequestId: TransactionRequestId, - transactionRequestType: TransactionRequestType, - fromAccount: BankAccount, - toAccount: BankAccount, - transactionRequestCommonBody: TransactionRequestCommonBodyJSON, - details: String, - status: String, - charge: TransactionRequestCharge, - chargePolicy: String) extends TopicTrait -case class InBoundCreateTransactionRequestImpl210(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] - - -case class OutBoundGetTransactionRequests(outboundAdapterCallContext: OutboundAdapterCallContext, - initiator: User, - fromAccount: BankAccount) extends TopicTrait -case class InBoundGetTransactionRequests(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionRequest]) extends InBoundTrait[List[TransactionRequest]] - - -case class OutBoundGetTransactionRequestStatuses(outboundAdapterCallContext: OutboundAdapterCallContext, - ) extends TopicTrait -case class InBoundGetTransactionRequestStatuses(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequestStatusCommons) extends InBoundTrait[TransactionRequestStatusCommons] - - -case class OutBoundGetTransactionRequestStatusesImpl(outboundAdapterCallContext: OutboundAdapterCallContext, - ) extends TopicTrait -case class InBoundGetTransactionRequestStatusesImpl(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequestStatusCommons) extends InBoundTrait[TransactionRequestStatusCommons] - - -case class OutBoundGetTransactionRequestsImpl(outboundAdapterCallContext: OutboundAdapterCallContext, - fromAccount: BankAccount) extends TopicTrait -case class InBoundGetTransactionRequestsImpl(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionRequest]) extends InBoundTrait[List[TransactionRequest]] - - -case class OutBoundGetTransactionRequestsImpl210(outboundAdapterCallContext: OutboundAdapterCallContext, - fromAccount: BankAccount) extends TopicTrait -case class InBoundGetTransactionRequestsImpl210(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionRequest]) extends InBoundTrait[List[TransactionRequest]] - - case class OutBoundGetTransactionRequestImpl(outboundAdapterCallContext: OutboundAdapterCallContext, transactionRequestId: TransactionRequestId) extends TopicTrait case class InBoundGetTransactionRequestImpl(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] -case class OutBoundGetTransactionRequestTypes(outboundAdapterCallContext: OutboundAdapterCallContext, - initiator: User, - fromAccount: BankAccount) extends TopicTrait -case class InBoundGetTransactionRequestTypes(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionRequestType]) extends InBoundTrait[List[TransactionRequestType]] - - -case class OutBoundGetTransactionRequestTypesImpl(outboundAdapterCallContext: OutboundAdapterCallContext, - fromAccount: BankAccount) extends TopicTrait -case class InBoundGetTransactionRequestTypesImpl(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(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] - - -case class OutBoundCreateTransactionAfterChallengev200(outboundAdapterCallContext: OutboundAdapterCallContext, - fromAccount: BankAccount, - toAccount: BankAccount, - transactionRequest: TransactionRequest) extends TopicTrait -case class InBoundCreateTransactionAfterChallengev200(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] - - -case class OutBoundCreateBankAndAccount(outboundAdapterCallContext: OutboundAdapterCallContext, - 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(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: (BankCommons, BankAccountCommons)) - - -case class OutBoundGetProducts(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, params: Map[String, List[String]]) extends TopicTrait -case class InBoundGetProducts(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[ProductCommons]) extends InBoundTrait[List[ProductCommons]] - - -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 OutBoundCreateOrUpdateBank(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: String, - fullBankName: String, - shortBankName: String, - logoURL: String, - websiteURL: String, - swiftBIC: String, - national_identifier: String, - bankRoutingScheme: String, - bankRoutingAddress: String) extends TopicTrait -case class InBoundCreateOrUpdateBank(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankCommons) extends InBoundTrait[BankCommons] - - -case class OutBoundCreateOrUpdateProduct(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: String, - code: String, - parentProductCode: Option[String], - name: String, - category: String, - family: String, - superFamily: String, - moreInfoUrl: String, - details: String, - description: String, - metaLicenceId: String, - metaLicenceName: String) extends TopicTrait -case class InBoundCreateOrUpdateProduct(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: ProductCommons) extends InBoundTrait[ProductCommons] - - -case class OutBoundGetTransactionRequestTypeCharge(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - accountId: AccountId, - viewId: ViewId, - transactionRequestType: TransactionRequestType) extends TopicTrait - - case class OutBoundGetCustomerByCustomerId(outboundAdapterCallContext: OutboundAdapterCallContext, customerId: String) extends TopicTrait case class InBoundGetCustomerByCustomerId(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CustomerCommons) extends InBoundTrait[CustomerCommons] @@ -1087,17 +881,6 @@ case class OutBoundGetTransactionLegacy (outboundAdapterCallContext: OutboundAda case class InBoundGetTransactionLegacy (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionCommons) extends InBoundTrait[TransactionCommons] -case class OutBoundGetPhysicalCardsForBankLegacy (outboundAdapterCallContext: OutboundAdapterCallContext, - bank: Bank, - user: User, - limit: Int, - offset: Int, - fromDate: String, - toDate: String - ) extends TopicTrait -case class InBoundGetPhysicalCardsForBankLegacy (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data:List[PhysicalCard]) extends InBoundTrait[List[PhysicalCard]] - - case class OutBoundCreatePhysicalCardLegacy (outboundAdapterCallContext: OutboundAdapterCallContext, bankCardNumber: String, nameOnCard: String, @@ -1136,18 +919,6 @@ case class OutBoundCreateBankAccountLegacy (outboundAdapterCallContext: Outbound case class InBoundCreateBankAccountLegacy (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] -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 OutBoundGetAtmLegacy (outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - atmId: AtmId) extends TopicTrait -case class InBoundGetAtmLegacy (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AtmTCommons) extends InBoundTrait[AtmTCommons] - - case class OutBoundGetCustomerByCustomerIdLegacy (outboundAdapterCallContext: OutboundAdapterCallContext, customerId: String) extends TopicTrait case class InBoundGetCustomerByCustomerIdLegacy (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CustomerCommons) extends InBoundTrait[CustomerCommons] @@ -1174,4 +945,335 @@ case class OutBoundDynamicEntityProcessDoc (outboundAdapterCallContext: Outbound entityName: String, requestBody: Option[FooBar], entityId: Option[String]) extends TopicTrait -case class InBoundDynamicEntityProcessDoc (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: FooBar) extends InBoundTrait[FooBar] \ No newline at end of file +case class InBoundDynamicEntityProcessDoc (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: FooBar) extends InBoundTrait[FooBar] + + +// --------------------- some special connector methods corresponding InBound and OutBound +case class OutBoundCreateChallenges(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, accountId: AccountId, userIds: List[String], transactionRequestType: TransactionRequestType, transactionRequestId: String, scaMethod: Option[StrongCustomerAuthentication.SCA]) extends TopicTrait +case class InBoundCreateChallenges(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[String]) extends InBoundTrait[List[String]] + +case class OutBoundGetEmptyBankAccount() extends TopicTrait +case class InBoundGetEmptyBankAccount(status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] { + override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() +} + +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 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 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 OutBoundGetPhysicalCards(user: User) extends TopicTrait +case class InBoundGetPhysicalCards(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 OutBoundMakePayment(initiator: User, fromAccountUID: BankIdAccountId, toAccountUID: BankIdAccountId, amt: BigDecimal, description: String, transactionRequestType: TransactionRequestType) extends TopicTrait +case class InBoundMakePayment(status: Status, data: TransactionId) extends InBoundTrait[TransactionId] { + override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() +} + +case class OutBoundMakePaymentv200(fromAccount: BankAccount, toAccount: BankAccount, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, amount: BigDecimal, description: String, transactionRequestType: TransactionRequestType, chargePolicy: String) extends TopicTrait +case class InBoundMakePaymentv200(status: Status, data: TransactionId) extends InBoundTrait[TransactionId] { + override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() +} + +case class OutBoundMakePaymentImpl(fromAccount: BankAccount, toAccount: BankAccount, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, amt: BigDecimal, description: String, transactionRequestType: TransactionRequestType, chargePolicy: String) extends TopicTrait +case class InBoundMakePaymentImpl(status: Status, data: TransactionId) extends InBoundTrait[TransactionId] { + override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() +} + +case class OutBoundCreateTransactionRequest(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 OutBoundCreateTransactionRequestv200(initiator: User, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, body: TransactionRequestBody) extends TopicTrait +case class InBoundCreateTransactionRequestv200(status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] { + override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() +} + +case class OutBoundGetStatus(challengeThresholdAmount: BigDecimal, transactionRequestCommonBodyAmount: BigDecimal, transactionRequestType: TransactionRequestType) extends TopicTrait +case class InBoundGetStatus(status: Status, statusValue: String) 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 OutBoundCreateTransactionRequestv400(outboundAdapterCallContext: OutboundAdapterCallContext, initiator: User, viewId: ViewId, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, detailsPlain: String, chargePolicy: String, challengeType: Option[String], scaMethod: Option[StrongCustomerAuthentication.SCA]) extends TopicTrait +case class InBoundCreateTransactionRequestv400(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] + +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 OutBoundCreateTransactionRequestImpl210(transactionRequestId: TransactionRequestId, transactionRequestType: TransactionRequestType, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, details: String, status: String, charge: TransactionRequestCharge, chargePolicy: String) extends TopicTrait +case class InBoundCreateTransactionRequestImpl210(status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] { + override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() +} + +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 OutBoundSaveTransactionRequestTransactionImpl(transactionRequestId: TransactionRequestId, transactionId: TransactionId) extends TopicTrait +case class InBoundSaveTransactionRequestTransactionImpl(status: Status, data: Boolean) extends InBoundTrait[Boolean] { + override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() +} + +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 OutBoundSaveTransactionRequestChallengeImpl(transactionRequestId: TransactionRequestId, challenge: TransactionRequestChallenge) extends TopicTrait +case class InBoundSaveTransactionRequestChallengeImpl(status: Status, data: Boolean) extends InBoundTrait[Boolean] { + override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() +} + +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 OutBoundGetTransactionRequests(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 OutBoundGetTransactionRequestStatuses() extends TopicTrait +case class InBoundGetTransactionRequestStatuses(status: Status, data: TransactionRequestStatusCommons) extends InBoundTrait[TransactionRequestStatusCommons] { + override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() +} + +case class OutBoundGetTransactionRequestStatusesImpl() extends TopicTrait +case class InBoundGetTransactionRequestStatusesImpl(status: Status, data: TransactionRequestStatusCommons) extends InBoundTrait[TransactionRequestStatusCommons] { + override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() +} + +case class OutBoundGetTransactionRequestsImpl(fromAccount: BankAccount) extends TopicTrait +case class InBoundGetTransactionRequestsImpl(status: Status, data: List[TransactionRequest]) extends InBoundTrait[List[TransactionRequest]] { + override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() +} + +case class OutBoundGetTransactionRequestsImpl210(fromAccount: BankAccount) extends TopicTrait +case class InBoundGetTransactionRequestsImpl210(status: Status, data: List[TransactionRequest]) extends InBoundTrait[List[TransactionRequest]] { + override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() +} + +case class OutBoundGetTransactionRequestTypes(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 OutBoundGetTransactionRequestTypesImpl(fromAccount: BankAccount) extends TopicTrait +case class InBoundGetTransactionRequestTypesImpl(status: Status, data: List[TransactionRequestType]) extends InBoundTrait[List[TransactionRequestType]] { + override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() +} + +case class OutBoundCreateTransactionAfterChallenge(initiator: User, transReqId: TransactionRequestId) extends TopicTrait +case class InBoundCreateTransactionAfterChallenge(status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] { + override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() +} + +case class OutBoundCreateTransactionAfterChallengev200(fromAccount: BankAccount, toAccount: BankAccount, transactionRequest: TransactionRequest) extends TopicTrait +case class InBoundCreateTransactionAfterChallengev200(status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] { + override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() +} + +case class OutBoundAddBankAccount(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, accountType: String, accountLabel: String, currency: String, initialBalance: BigDecimal, accountHolderName: String, branchId: String, accountRoutingScheme: String, accountRoutingAddress: String) extends TopicTrait +case class InBoundAddBankAccount(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] + +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, accountRoutingScheme: String, accountRoutingAddress: String) extends TopicTrait +case class InBoundCreateSandboxBankAccount(status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] { + override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() +} + +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 GetProductsParam(name: String, value: List[String]) + +object GetProductsParam { + implicit def mapToParam(params: Map[String,List[String]]) = params.map { pair=> + val (key, value) = pair + GetProductsParam(key, value) + }.toList +} + +case class OutBoundGetProducts(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 OutBoundGetProduct(bankId: BankId, productCode: ProductCode) extends TopicTrait +case class InBoundGetProduct(status: Status, data: ProductCommons) extends InBoundTrait[ProductCommons] { + override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() +} + + +case class OutBoundCreateOrUpdateBranch(branch: BranchT) extends TopicTrait +case class InBoundCreateOrUpdateBranch(status: Status, data: BranchTCommons) extends InBoundTrait[BranchTCommons] { + override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() +} + +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 OutBoundCreateOrUpdateAtm(atm: AtmT) extends TopicTrait +case class InBoundCreateOrUpdateAtm(status: Status, data: AtmTCommons) extends InBoundTrait[AtmTCommons] { + override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() +} + +case class OutBoundCreateOrUpdateProduct(bankId: String, code: String, parentProductCode: Option[String], name: String, category: String, family: String, superFamily: String, moreInfoUrl: 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 OutBoundAccountOwnerExists(user: User, bankId: BankId, accountId: AccountId) extends TopicTrait +case class InBoundAccountOwnerExists(status: Status, data: Boolean) extends InBoundTrait[Boolean] { + 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 OutBoundGetCurrentFxRateCached(bankId: BankId, fromCurrencyCode: String, toCurrencyCode: String) extends TopicTrait +case class InBoundGetCurrentFxRateCached(status: Status, data: FXRateCommons) extends InBoundTrait[FXRateCommons] { + override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() +} + +case class OutBoundGetTransactionRequestTypeCharge(bankId: BankId, accountId: AccountId, viewId: ViewId, transactionRequestType: TransactionRequestType) extends TopicTrait +case class InBoundGetTransactionRequestTypeCharge(status: Status, data: TransactionRequestTypeChargeCommons) extends InBoundTrait[TransactionRequestTypeChargeCommons] { + 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 OutBoundGetCustomersByCustomerPhoneNumber(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, phoneNumber: String) extends TopicTrait +case class InBoundGetCustomersByCustomerPhoneNumber(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CustomerCommons]) extends InBoundTrait[List[CustomerCommons]] + +case class OutBoundGetTransactionAttributeById(outboundAdapterCallContext: OutboundAdapterCallContext, transactionAttributeId: String) extends TopicTrait +case class InBoundGetTransactionAttributeById(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionAttributeCommons) extends InBoundTrait[TransactionAttributeCommons] + +case class OutBoundCreateOrUpdateCustomerAttribute(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, customerId: CustomerId, customerAttributeId: Option[String], name: String, attributeType: CustomerAttributeType.Value, value: String) extends TopicTrait +case class InBoundCreateOrUpdateCustomerAttribute(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CustomerAttributeCommons) extends InBoundTrait[CustomerAttributeCommons] + + +case class OutBoundCreateOrUpdateTransactionAttribute(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, transactionId: TransactionId, transactionAttributeId: Option[String], name: String, attributeType: TransactionAttributeType.Value, value: String) extends TopicTrait +case class InBoundCreateOrUpdateTransactionAttribute(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionAttributeCommons) extends InBoundTrait[TransactionAttributeCommons] + +case class OutBoundGetCustomerAttributes(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, customerId: CustomerId) extends TopicTrait +case class InBoundGetCustomerAttributes(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CustomerAttributeCommons]) extends InBoundTrait[List[CustomerAttributeCommons]] + +case class OutBoundGetCustomerIdsByAttributeNameValues(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, nameValues: Map[String,List[String]]) extends TopicTrait +case class InBoundGetCustomerIdsByAttributeNameValues(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[String]) extends InBoundTrait[List[String]] + +case class CustomerAndAttribute(customer: CustomerCommons, attributes: List[CustomerAttributeCommons]) +case class OutBoundGetCustomerAttributesForCustomers(outboundAdapterCallContext: OutboundAdapterCallContext, customers: List[Customer]) extends TopicTrait +case class InBoundGetCustomerAttributesForCustomers(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, value: List[CustomerAndAttribute]) extends InBoundTrait[List[(Customer, List[CustomerAttribute])]] { + override val data: List[(Customer, List[CustomerAttribute])] = value.map(it => (it.customer, it.attributes)) +} + +case class OutBoundGetTransactionIdsByAttributeNameValues(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, nameValues: Map[String,List[String]]) extends TopicTrait +case class InBoundGetTransactionIdsByAttributeNameValues(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[String]) extends InBoundTrait[List[String]] + +case class OutBoundGetTransactionAttributes(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, transactionId: TransactionId) extends TopicTrait +case class InBoundGetTransactionAttributes(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionAttributeCommons]) extends InBoundTrait[List[TransactionAttributeCommons]] + +case class OutBoundGetCustomerAttributeById(outboundAdapterCallContext: OutboundAdapterCallContext, customerAttributeId: String) extends TopicTrait +case class InBoundGetCustomerAttributeById(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CustomerAttributeCommons) extends InBoundTrait[CustomerAttributeCommons] + +case class OutBoundCreateDirectDebit(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: String, accountId: String, customerId: String, userId: String, counterpartyId: String, dateSigned: Date, dateStarts: Date, dateExpires: Option[Date]) extends TopicTrait +case class InBoundCreateDirectDebit(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: DirectDebitTraitCommons) extends InBoundTrait[DirectDebitTraitCommons] + +case class OutBoundDeleteCustomerAttribute(outboundAdapterCallContext: OutboundAdapterCallContext, customerAttributeId: String) extends TopicTrait +case class InBoundDeleteCustomerAttribute(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] +// --------------------- some special connector methods corresponding InBound and OutBound -- end -- \ No newline at end of file diff --git a/obp-commons/src/main/scala/com/openbankproject/commons/model/CommonModel.scala b/obp-commons/src/main/scala/com/openbankproject/commons/model/CommonModel.scala index ccbe2622c..1dc83a5c7 100644 --- a/obp-commons/src/main/scala/com/openbankproject/commons/model/CommonModel.scala +++ b/obp-commons/src/main/scala/com/openbankproject/commons/model/CommonModel.scala @@ -418,7 +418,67 @@ case class CustomerMessageCommons( ) extends CustomerMessage object CustomerMessageCommons extends Converter[CustomerMessage, CustomerMessageCommons] +case class CustomerAttributeCommons ( + override val bankId: BankId, + override val customerId: CustomerId, + override val customerAttributeId: String, + override val attributeType: CustomerAttributeType.Value, + override val name: String, + override val value: String, +) extends CustomerAttribute +object CustomerAttributeCommons extends Converter[CustomerAttribute, CustomerAttributeCommons] +case class TransactionAttributeCommons ( + override val bankId: BankId, + override val transactionId: TransactionId, + override val transactionAttributeId: String, + override val attributeType: TransactionAttributeType.Value, + override val name: String, + override val value: String, +) extends TransactionAttribute +object TransactionAttributeCommons extends Converter[TransactionAttribute, TransactionAttributeCommons] + +case class FXRateCommons ( + override val bankId : BankId, + override val fromCurrencyCode: String, + override val toCurrencyCode: String, + override val conversionValue: Double, + override val inverseConversionValue: Double, + override val effectiveDate: Date +) extends FXRate +object FXRateCommons extends Converter[FXRate, FXRateCommons] + + +case class TransactionRequestTypeChargeCommons ( + override val transactionRequestTypeId: String, + override val bankId: String, + override val chargeCurrency: String, + override val chargeAmount: String, + override val chargeSummary: String +) extends TransactionRequestTypeCharge +object TransactionRequestTypeChargeCommons extends Converter[TransactionRequestTypeCharge, TransactionRequestTypeChargeCommons] + +case class DirectDebitTraitCommons ( + override val directDebitId: String, + override val bankId: String, + override val accountId: String, + override val customerId: String, + override val userId: String, + override val counterpartyId: String, + override val dateSigned: Date, + override val dateCancelled: Date, + override val dateStarts: Date, + override val dateExpires: Date, + override val active: Boolean +) extends DirectDebitTrait +object DirectDebitTraitCommons extends Converter[DirectDebitTrait, DirectDebitTraitCommons] + +case class TransactionStatusCommons( + override val transactionId : String, + override val transactionStatus: String, + override val transactionTimestamp: String +) extends TransactionStatus +object TransactionStatusCommons extends Converter[TransactionStatus, TransactionStatusCommons] //----------------obp-api moved to here case classes diff --git a/obp-commons/src/main/scala/com/openbankproject/commons/model/CommonModelTrait.scala b/obp-commons/src/main/scala/com/openbankproject/commons/model/CommonModelTrait.scala index b1ffcc2e7..429aadeef 100644 --- a/obp-commons/src/main/scala/com/openbankproject/commons/model/CommonModelTrait.scala +++ b/obp-commons/src/main/scala/com/openbankproject/commons/model/CommonModelTrait.scala @@ -404,6 +404,37 @@ trait TransactionAttribute { def value: String } +trait FXRate { + def bankId : BankId + def fromCurrencyCode: String + def toCurrencyCode: String + def conversionValue: Double + def inverseConversionValue: Double + def effectiveDate: Date +} + +trait TransactionRequestTypeCharge { + def transactionRequestTypeId: String + def bankId: String + def chargeCurrency: String + def chargeAmount: String + def chargeSummary: String +} + +trait DirectDebitTrait { + def directDebitId: String + def bankId: String + def accountId: String + def customerId: String + def userId: String + def counterpartyId: String + def dateSigned: Date + def dateCancelled: Date + def dateStarts: Date + def dateExpires: Date + def active: Boolean +} + //---------------------------------------- trait dependents of case class @deprecated("Use Lobby instead which contains detailed fields, not this string","24 July 2017") diff --git a/obp-commons/src/main/scala/com/openbankproject/commons/model/enums/Enumerations.scala b/obp-commons/src/main/scala/com/openbankproject/commons/model/enums/Enumerations.scala index af09de4b6..8aafdbdc6 100644 --- a/obp-commons/src/main/scala/com/openbankproject/commons/model/enums/Enumerations.scala +++ b/obp-commons/src/main/scala/com/openbankproject/commons/model/enums/Enumerations.scala @@ -130,4 +130,9 @@ object AttributeCategory extends OBPEnumeration[AttributeCategory]{ object Account extends Value object Transaction extends Value object Card extends Value +} + +object TransactionRequestStatus extends Enumeration { + type TransactionRequestStatus = Value + val INITIATED, PENDING, NEXT_CHALLENGE_PENDING, FAILED, COMPLETED, FORWARDED, REJECTED = Value } \ No newline at end of file diff --git a/obp-commons/src/main/scala/com/openbankproject/commons/util/JsonAble.scala b/obp-commons/src/main/scala/com/openbankproject/commons/util/JsonAble.scala index b92d91486..8206c8f84 100644 --- a/obp-commons/src/main/scala/com/openbankproject/commons/util/JsonAble.scala +++ b/obp-commons/src/main/scala/com/openbankproject/commons/util/JsonAble.scala @@ -1,6 +1,6 @@ package com.openbankproject.commons.util -import net.liftweb.json.{Formats, JValue, Serializer, TypeInfo} +import net.liftweb.json._ trait JsonAble { def toJValue: JValue @@ -16,4 +16,19 @@ object JsonAbleSerializer extends Serializer[JsonAble] { override def serialize(implicit format: Formats): PartialFunction[Any, JValue] = { case JsonAble(jValue) => jValue } +} + +object EnumValueSerializer extends Serializer[EnumValue] { + private val IntervalClass = classOf[EnumValue] + + override def deserialize(implicit format: Formats): PartialFunction[(TypeInfo, JValue), EnumValue] = { + case (TypeInfo(clazz, _), json) if(IntervalClass.isAssignableFrom(clazz)) => json match { + case JString(s) => OBPEnumeration.withName(clazz.asInstanceOf[Class[EnumValue]], s) + case x => throw new MappingException(s"Can't convert $x to $clazz") + } + } + + override def serialize(implicit format: Formats): PartialFunction[Any, JValue] = { + case x: EnumValue => JString(x.toString()) + } } \ No newline at end of file diff --git a/obp-commons/src/main/scala/com/openbankproject/commons/util/OBPEnum.scala b/obp-commons/src/main/scala/com/openbankproject/commons/util/OBPEnum.scala index d70edbfe0..54e6ccbb8 100644 --- a/obp-commons/src/main/scala/com/openbankproject/commons/util/OBPEnum.scala +++ b/obp-commons/src/main/scala/com/openbankproject/commons/util/OBPEnum.scala @@ -16,7 +16,7 @@ import scala.reflect.runtime.{universe => ru} * } * }}} */ -trait EnumValue { +trait EnumValue{ override def toString: String = this.getClass.getSimpleName.replaceFirst("\\$$", "") } From 05f380838c057f26e4092d31004a64c1f7b61c8f Mon Sep 17 00:00:00 2001 From: shuang Date: Tue, 16 Jun 2020 12:00:13 +0800 Subject: [PATCH 03/10] feature/create_akka_connector_builder: bump up version from 1.4.4 to 1.5.0 --- obp-api/pom.xml | 2 +- obp-commons/pom.xml | 2 +- pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/obp-api/pom.xml b/obp-api/pom.xml index 4feab6055..cf8533345 100644 --- a/obp-api/pom.xml +++ b/obp-api/pom.xml @@ -8,7 +8,7 @@ com.tesobe obp-parent ../pom.xml - 1.4.4 + 1.5.0 obp-api war diff --git a/obp-commons/pom.xml b/obp-commons/pom.xml index 6afd8b250..dc81746f6 100644 --- a/obp-commons/pom.xml +++ b/obp-commons/pom.xml @@ -7,7 +7,7 @@ com.tesobe obp-parent ../pom.xml - 1.4.4 + 1.5.0 obp-commons jar diff --git a/pom.xml b/pom.xml index e0561a2f2..95fd2fe69 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.tesobe obp-parent - 1.4.4 + 1.5.0 pom Open Bank Project API Parent 2011 From 26b090a02d357f48b09fc3ffc3bce430e11e9ff3 Mon Sep 17 00:00:00 2001 From: shuang Date: Tue, 16 Jun 2020 15:54:52 +0800 Subject: [PATCH 04/10] feature/create_akka_connector_builder: fix fail unit test --- .../rest/RestConnector_vMar2019.scala | 10 -------- .../StoredProcedureConnector_vDec2019.scala | 18 --------------- .../KafkaMappedConnector_vMay2019.scala | 13 ----------- .../KafkaMappedConnector_vSept2018.scala | 23 ------------------- .../commons/util/ReflectUtils.scala | 4 ++-- 5 files changed, 2 insertions(+), 66 deletions(-) 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 4605b34e6..8a6a75fb0 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 @@ -9595,16 +9595,6 @@ trait RestConnector_vMar2019 extends Connector with KafkaHelper with MdcLoggable //-----helper methods - private[this] def convertToTuple[T](callContext: Option[CallContext]) (inbound: Box[InBoundTrait[T]]): (Box[T], Option[CallContext]) = { - val boxedResult = inbound match { - case Full(in) if (in.status.hasNoError) => Full(in.data) - case Full(inbound) if (inbound.status.hasError) => - Failure("INTERNAL-"+ inbound.status.errorCode+". + CoreBank-Status:" + inbound.status.backendMessages) - case failureOrEmpty: Failure => failureOrEmpty - } - (boxedResult, callContext) - } - //TODO hongwei confirm the third valu: OutboundAdapterCallContext#adapterAuthInfo private[this] def buildCallContext(inboundAdapterCallContext: InboundAdapterCallContext, callContext: Option[CallContext]): Option[CallContext] = for (cc <- 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 9cd5c83e9..dbb2c47d2 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 @@ -12382,24 +12382,6 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { //-----helper methods - private[this] def convertToTuple[T](callContext: Option[CallContext])(inbound: Box[InBoundTrait[T]]): (Box[T], Option[CallContext]) = { - val boxedResult = inbound match { - case Full(in) if (in.status.hasNoError) => Full(in.data) - case Full(inbound) if (inbound.status.hasError) => { - val errorMessage = "CoreBank - Status: " + inbound.status.backendMessages - val errorCode: Int = try { - inbound.status.errorCode.toInt - } catch { - case _: Throwable => 400 - } - ParamFailure(errorMessage, Empty, Empty, APIFailure(errorMessage, errorCode)) - } - case failureOrEmpty: Failure => failureOrEmpty - } - - (boxedResult, callContext) - } - //TODO hongwei confirm the third valu: OutboundAdapterCallContext#adapterAuthInfo private[this] def buildCallContext(inboundAdapterCallContext: InboundAdapterCallContext, callContext: Option[CallContext]): Option[CallContext] = for (cc <- callContext) diff --git a/obp-api/src/main/scala/code/bankconnectors/vMay2019/KafkaMappedConnector_vMay2019.scala b/obp-api/src/main/scala/code/bankconnectors/vMay2019/KafkaMappedConnector_vMay2019.scala index d48639306..0095bddfe 100644 --- a/obp-api/src/main/scala/code/bankconnectors/vMay2019/KafkaMappedConnector_vMay2019.scala +++ b/obp-api/src/main/scala/code/bankconnectors/vMay2019/KafkaMappedConnector_vMay2019.scala @@ -1152,19 +1152,6 @@ trait KafkaMappedConnector_vMay2019 extends Connector with KafkaHelper with MdcL //---------------- dynamic end ---------------------please don't modify this line - - //-----helper methods - - private[this] def convertToTuple[T](callContext: Option[CallContext]) (inbound: Box[InBoundTrait[T]]): (Box[T], Option[CallContext]) = { - val boxedResult = inbound match { - case Full(in) if (in.status.hasNoError) => Full(in.data) - case Full(inbound) if (inbound.status.hasError) => - Failure("INTERNAL-"+ inbound.status.errorCode+". + CoreBank-Status:" + inbound.status.backendMessages) - case failureOrEmpty: Failure => failureOrEmpty - } - (boxedResult, callContext) - } - } object KafkaMappedConnector_vMay2019 extends KafkaMappedConnector_vMay2019{ diff --git a/obp-api/src/main/scala/code/bankconnectors/vSept2018/KafkaMappedConnector_vSept2018.scala b/obp-api/src/main/scala/code/bankconnectors/vSept2018/KafkaMappedConnector_vSept2018.scala index 94169cc4b..380f9b46f 100644 --- a/obp-api/src/main/scala/code/bankconnectors/vSept2018/KafkaMappedConnector_vSept2018.scala +++ b/obp-api/src/main/scala/code/bankconnectors/vSept2018/KafkaMappedConnector_vSept2018.scala @@ -3864,29 +3864,6 @@ trait KafkaMappedConnector_vSept2018 extends Connector with KafkaHelper with Mdc //---------------- dynamic end ---------------------please don't modify this line - - - - - - - - - - - - //-----helper methods - - private[this] def convertToTuple[T](callContext: Option[CallContext]) (inbound: Box[InBoundTrait[T]]): (Box[T], Option[CallContext]) = { - val boxedResult = inbound match { - case Full(in) if (in.status.hasNoError) => Full(in.data) - case Full(inbound) if (inbound.status.hasError) => - Failure("INTERNAL-"+ inbound.status.errorCode+". + CoreBank-Status:" + inbound.status.backendMessages) - case failureOrEmpty: Failure => failureOrEmpty - } - (boxedResult, callContext) - } - } diff --git a/obp-commons/src/main/scala/com/openbankproject/commons/util/ReflectUtils.scala b/obp-commons/src/main/scala/com/openbankproject/commons/util/ReflectUtils.scala index 01c238043..3ad1d76ce 100644 --- a/obp-commons/src/main/scala/com/openbankproject/commons/util/ReflectUtils.scala +++ b/obp-commons/src/main/scala/com/openbankproject/commons/util/ReflectUtils.scala @@ -246,8 +246,8 @@ object ReflectUtils { * @param mirror : has the default this.mirror * @return */ - def getTypeByName(fullName: String, mirror: ru.Mirror = this.mirror): ru.Type = - mirror.staticClass(fullName).asType.toType + def getTypeByName(fullName: String, mirror: ru.Mirror = this.mirror): ru.Type = + mirror.staticClass(fullName).asType.toType /** * Check if the class is existing in the java path or not. From 65bfc5f58959c327c3422968124ca2664eca0090 Mon Sep 17 00:00:00 2001 From: shuang Date: Tue, 16 Jun 2020 19:58:07 +0800 Subject: [PATCH 05/10] feature/create_akka_connector_builder: fix StoredProcedureConnectorBuilder generate wrong code. --- .../bankconnectors/ConnectorBuilderUtil.scala | 12 +- .../StoredProcedureConnectorBuilder.scala | 2 +- .../StoredProcedureConnector_vDec2019.scala | 9834 ++++------------- 3 files changed, 1868 insertions(+), 7980 deletions(-) diff --git a/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala b/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala index fb2d3693d..69a7651e4 100644 --- a/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala +++ b/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala @@ -32,6 +32,10 @@ object ConnectorBuilderUtil { private val mirror: ru.Mirror = ru.runtimeMirror(getClass().getClassLoader) private val clazz: ru.ClassSymbol = ru.typeOf[Connector].typeSymbol.asClass private val classMirror: ru.ClassMirror = mirror.reflectClass(clazz) + /* + * generateMethods and buildMethods has the same function, only responseExpression parameter type + * different, because overload method can't compile for different responseExpression parameter. + */ def generateMethods(connectorMethodNames: List[String], connectorCodePath: String, responseExpression: String, setTopic: Boolean = false, doCache: Boolean = false) = @@ -159,16 +163,16 @@ object ConnectorBuilderUtil { } val callContext = if(hasCallContext) { - "callContext" + "" } else { - "None" + "\n val callContext: Option[CallContext] = None" } var body = - s"""| import com.openbankproject.commons.dto.{$outBoundName => OutBound, $inBoundName => InBound} + s"""| import com.openbankproject.commons.dto.{$outBoundName => OutBound, $inBoundName => InBound} $callContext | val req = OutBound($parametersNamesString) | val response: Future[Box[InBound]] = ${responseExpression(methodName)} - | response.map(convertToTuple[$inboundDataFieldType]($callContext)) """.stripMargin + | response.map(convertToTuple[$inboundDataFieldType](callContext)) """.stripMargin if(doCache && methodName.matches("^(get|check|validate).+")) { diff --git a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnectorBuilder.scala b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnectorBuilder.scala index 6e520d947..b7bf66e0f 100644 --- a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnectorBuilder.scala +++ b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnectorBuilder.scala @@ -9,6 +9,6 @@ object StoredProcedureConnectorBuilder extends App { buildMethods(commonMethodNames, "src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnector_vDec2019.scala", - methodName => s"sendRequest[InBound](${StringHelpers.snakify(methodName)}, req, callContext)") + methodName => s"""sendRequest[InBound]("${StringHelpers.snakify(methodName)}", req, 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 dbb2c47d2..4c6325bbe 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 @@ -23,46 +23,32 @@ Osloerstrasse 16/17 Berlin 13359, Germany */ -import java.net.URLEncoder import java.util.Date -import java.util.UUID.randomUUID -import akka.http.scaladsl.model.headers.RawHeader -import akka.http.scaladsl.model.{HttpProtocol, _} -import akka.util.ByteString -import code.api.cache.Caching -import code.api.util.APIUtil.{AdapterImplementation, MessageDoc, OBPReturnType, saveConnectorMetric, _} +import code.api.ResourceDocs1_4_0.MessageDocsSwaggerDefinitions +import code.api.util.APIUtil.{AdapterImplementation, MessageDoc, OBPReturnType, _} import code.api.util.ErrorMessages._ import code.api.util.ExampleValue._ -import code.api.util.{APIUtil, CallContext, CustomJsonFormats, NewStyle, OBPQueryParam} -import code.api.{APIFailure, APIFailureNewStyle, ApiVersionHolder} -import com.openbankproject.commons.model.ErrorMessage +import code.api.util.{APIUtil, CallContext, OBPQueryParam} import code.bankconnectors._ import code.bankconnectors.vJune2017.AuthInfo import code.customer.internalMapping.MappedCustomerIdMappingProvider -import code.kafka.KafkaHelper import code.model.dataAccess.internalMapping.MappedAccountIdMappingProvider -import code.util.Helper import code.util.Helper.MdcLoggable +import com.openbankproject.commons.ExecutionContext.Implicits.global import com.openbankproject.commons.dto.{InBoundTrait, _} -import com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SCA -import com.openbankproject.commons.model.enums.{AccountAttributeType, CardAttributeType, DynamicEntityOperation, ProductAttributeType} +import com.openbankproject.commons.model.enums._ import com.openbankproject.commons.model.{TopicTrait, _} import com.openbankproject.commons.util.ReflectUtils -import com.tesobe.{CacheKeyFromArguments, CacheKeyOmit} -import dispatch.url -import net.liftweb.common.{Box, Empty, _} +import net.liftweb.common.{Box, _} import net.liftweb.json._ -import net.liftweb.util.Helpers.tryo import net.liftweb.util.StringHelpers import scala.collection.immutable.List import scala.collection.mutable.ArrayBuffer -import scala.concurrent.duration._ -import scala.concurrent.{Await, Future} +import scala.concurrent.Future import scala.language.postfixOps import scala.reflect.runtime.universe._ -import com.openbankproject.commons.ExecutionContext.Implicits.global trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { //this one import is for implicit convert, don't delete @@ -87,58 +73,21 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { val connectorName = "stored_procedure_vDec2019" //---------------- dynamic start -------------------please don't modify this line -// ---------- create on Thu Dec 12 20:57:07 CST 2019 +// ---------- create on Tue Jun 16 19:55:42 CST 2020 - messageDocs += getAdapterInfoDoc6 - private def getAdapterInfoDoc6 = MessageDoc( + messageDocs += getAdapterInfoDoc + def getAdapterInfoDoc = MessageDoc( process = "obp.getAdapterInfo", messageFormat = messageFormat, - description = """ - |Get Adapter Info - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_adapter_info - """.stripMargin, + description = "Get Adapter Info", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetAdapterInfo( OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value)))))))))) + OutBoundGetAdapterInfo(MessageDocsSwaggerDefinitions.outboundAdapterCallContext) ), exampleInboundMessage = ( - InBoundGetAdapterInfo(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetAdapterInfo(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= InboundAdapterInfoInternal(errorCode=inboundAdapterInfoInternalErrorCodeExample.value, backendMessages=List( InboundStatusMessage(source=sourceExample.value, status=inboundStatusMessageStatusExample.value, @@ -151,55 +100,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_adapter_info + override def getAdapterInfo(callContext: Option[CallContext]): Future[Box[(InboundAdapterInfoInternal, Option[CallContext])]] = { - import com.openbankproject.commons.dto.{OutBoundGetAdapterInfo => OutBound, InBoundGetAdapterInfo => InBound} - val procedureName = "get_adapter_info" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull ) - val result: OBPReturnType[Box[InboundAdapterInfoInternal]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetAdapterInfo => InBound, OutBoundGetAdapterInfo => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_adapter_info", req, callContext) + response.map(convertToTuple[InboundAdapterInfoInternal](callContext)) } - - messageDocs += getChallengeThresholdDoc30 - private def getChallengeThresholdDoc30 = MessageDoc( + + messageDocs += getChallengeThresholdDoc + def getChallengeThresholdDoc = MessageDoc( process = "obp.getChallengeThreshold", messageFormat = messageFormat, - description = """ - |Get Challenge Threshold - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_challenge_threshold - """.stripMargin, + description = "Get Challenge Threshold", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetChallengeThreshold(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetChallengeThreshold(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=bankIdExample.value, accountId=accountIdExample.value, viewId=viewIdExample.value, @@ -209,69 +126,30 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { userName="string") ), exampleInboundMessage = ( - InBoundGetChallengeThreshold(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetChallengeThreshold(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= AmountOfMoney(currency=currencyExample.value, amount="string")) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_challenge_threshold + override def getChallengeThreshold(bankId: String, accountId: String, viewId: String, transactionRequestType: String, currency: String, userId: String, userName: String, callContext: Option[CallContext]): OBPReturnType[Box[AmountOfMoney]] = { - import com.openbankproject.commons.dto.{OutBoundGetChallengeThreshold => OutBound, InBoundGetChallengeThreshold => InBound} - val procedureName = "get_challenge_threshold" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountId, viewId, transactionRequestType, currency, userId, userName) - val result: OBPReturnType[Box[AmountOfMoney]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetChallengeThreshold => InBound, OutBoundGetChallengeThreshold => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, viewId, transactionRequestType, currency, userId, userName) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_challenge_threshold", req, callContext) + response.map(convertToTuple[AmountOfMoney](callContext)) } - - messageDocs += getChargeLevelDoc5 - private def getChargeLevelDoc5 = MessageDoc( + + messageDocs += getChargeLevelDoc + def getChargeLevelDoc = MessageDoc( process = "obp.getChargeLevel", messageFormat = messageFormat, - description = """ - |Get Charge Level - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_charge_level - """.stripMargin, + description = "Get Charge Level", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetChargeLevel(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetChargeLevel(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), accountId=AccountId(accountIdExample.value), viewId=ViewId(viewIdExample.value), @@ -281,69 +159,30 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { currency=currencyExample.value) ), exampleInboundMessage = ( - InBoundGetChargeLevel(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetChargeLevel(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= AmountOfMoney(currency=currencyExample.value, amount="string")) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_charge_level + override def getChargeLevel(bankId: BankId, accountId: AccountId, viewId: ViewId, userId: String, userName: String, transactionRequestType: String, currency: String, callContext: Option[CallContext]): OBPReturnType[Box[AmountOfMoney]] = { - import com.openbankproject.commons.dto.{OutBoundGetChargeLevel => OutBound, InBoundGetChargeLevel => InBound} - val procedureName = "get_charge_level" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountId, viewId, userId, userName, transactionRequestType, currency) - val result: OBPReturnType[Box[AmountOfMoney]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetChargeLevel => InBound, OutBoundGetChargeLevel => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, viewId, userId, userName, transactionRequestType, currency) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_charge_level", req, callContext) + response.map(convertToTuple[AmountOfMoney](callContext)) } - - messageDocs += createChallengeDoc62 - private def createChallengeDoc62 = MessageDoc( + + messageDocs += createChallengeDoc + def createChallengeDoc = MessageDoc( process = "obp.createChallenge", messageFormat = messageFormat, - description = """ - |Create Challenge - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_challenge - """.stripMargin, + description = "Create Challenge", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateChallenge(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateChallenge(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), accountId=AccountId(accountIdExample.value), userId=userIdExample.value, @@ -352,146 +191,92 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { scaMethod=Some(com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SMS)) ), exampleInboundMessage = ( - InBoundCreateChallenge(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreateChallenge(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data="string") ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_challenge - override def createChallenge(bankId: BankId, accountId: AccountId, userId: String, transactionRequestType: TransactionRequestType, transactionRequestId: String, scaMethod: Option[SCA], callContext: Option[CallContext]): OBPReturnType[Box[String]] = { - import com.openbankproject.commons.dto.{OutBoundCreateChallenge => OutBound, InBoundCreateChallenge => InBound} - val procedureName = "create_challenge" - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountId, userId, transactionRequestType, transactionRequestId, scaMethod) - val result: OBPReturnType[Box[String]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + override def createChallenge(bankId: BankId, accountId: AccountId, userId: String, transactionRequestType: TransactionRequestType, transactionRequestId: String, scaMethod: Option[StrongCustomerAuthentication.SCA], callContext: Option[CallContext]): OBPReturnType[Box[String]] = { + import com.openbankproject.commons.dto.{InBoundCreateChallenge => InBound, OutBoundCreateChallenge => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, userId, transactionRequestType, transactionRequestId, scaMethod) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_challenge", req, callContext) + response.map(convertToTuple[String](callContext)) } - - messageDocs += validateChallengeAnswerDoc76 - private def validateChallengeAnswerDoc76 = MessageDoc( - process = "obp.validateChallengeAnswer", + + messageDocs += createChallengesDoc + def createChallengesDoc = MessageDoc( + process = "obp.createChallenges", messageFormat = messageFormat, - description = """ - |Validate Challenge Answer - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: validate_challenge_answer - """.stripMargin, + description = "Create Challenges", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundValidateChallengeAnswer(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateChallenges(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + accountId=AccountId(accountIdExample.value), + userIds=List(userIdExample.value), + transactionRequestType=TransactionRequestType(transactionRequestTypeExample.value), + transactionRequestId="string", + scaMethod=Some(com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SMS)) + ), + exampleInboundMessage = ( + InBoundCreateChallenges(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List("string")) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createChallenges(bankId: BankId, accountId: AccountId, userIds: List[String], transactionRequestType: TransactionRequestType, transactionRequestId: String, scaMethod: Option[StrongCustomerAuthentication.SCA], callContext: Option[CallContext]): OBPReturnType[Box[List[String]]] = { + import com.openbankproject.commons.dto.{InBoundCreateChallenges => InBound, OutBoundCreateChallenges => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, userIds, transactionRequestType, transactionRequestId, scaMethod) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_challenges", req, callContext) + response.map(convertToTuple[List[String]](callContext)) + } + + messageDocs += validateChallengeAnswerDoc + def validateChallengeAnswerDoc = MessageDoc( + process = "obp.validateChallengeAnswer", + messageFormat = messageFormat, + description = "Validate Challenge Answer", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundValidateChallengeAnswer(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, challengeId="string", hashOfSuppliedAnswer="string") ), exampleInboundMessage = ( - InBoundValidateChallengeAnswer(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundValidateChallengeAnswer(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=true) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: validate_challenge_answer + override def validateChallengeAnswer(challengeId: String, hashOfSuppliedAnswer: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { - import com.openbankproject.commons.dto.{OutBoundValidateChallengeAnswer => OutBound, InBoundValidateChallengeAnswer => InBound} - val procedureName = "validate_challenge_answer" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , challengeId, hashOfSuppliedAnswer) - val result: OBPReturnType[Box[Boolean]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundValidateChallengeAnswer => InBound, OutBoundValidateChallengeAnswer => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, challengeId, hashOfSuppliedAnswer) + val response: Future[Box[InBound]] = sendRequest[InBound]("validate_challenge_answer", req, callContext) + response.map(convertToTuple[Boolean](callContext)) } - - messageDocs += getBankLegacyDoc75 - private def getBankLegacyDoc75 = MessageDoc( + + messageDocs += getBankLegacyDoc + def getBankLegacyDoc = MessageDoc( process = "obp.getBankLegacy", messageFormat = messageFormat, - description = """ - |Get Bank Legacy - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_bank_legacy - """.stripMargin, + description = "Get Bank Legacy", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetBankLegacy(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetBankLegacy(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value)) ), exampleInboundMessage = ( - InBoundGetBankLegacy(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetBankLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= BankCommons(bankId=BankId(bankIdExample.value), shortName=bankShortNameExample.value, fullName=bankFullNameExample.value, @@ -504,67 +289,28 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_bank_legacy + override def getBankLegacy(bankId: BankId, callContext: Option[CallContext]): Box[(Bank, Option[CallContext])] = { - import com.openbankproject.commons.dto.{OutBoundGetBankLegacy => OutBound, InBoundGetBankLegacy => InBound} - val procedureName = "get_bank_legacy" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId) - val result: OBPReturnType[Box[BankCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetBankLegacy => InBound, OutBoundGetBankLegacy => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank_legacy", req, callContext) + response.map(convertToTuple[BankCommons](callContext)) } - - messageDocs += getBankDoc38 - private def getBankDoc38 = MessageDoc( + + messageDocs += getBankDoc + def getBankDoc = MessageDoc( process = "obp.getBank", messageFormat = messageFormat, - description = """ - |Get Bank - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_bank - """.stripMargin, + description = "Get Bank", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetBank(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetBank(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value)) ), exampleInboundMessage = ( - InBoundGetBank(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetBank(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= BankCommons(bankId=BankId(bankIdExample.value), shortName=bankShortNameExample.value, fullName=bankFullNameExample.value, @@ -577,66 +323,27 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_bank + override def getBank(bankId: BankId, callContext: Option[CallContext]): Future[Box[(Bank, Option[CallContext])]] = { - import com.openbankproject.commons.dto.{OutBoundGetBank => OutBound, InBoundGetBank => InBound} - val procedureName = "get_bank" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId) - val result: OBPReturnType[Box[BankCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetBank => InBound, OutBoundGetBank => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank", req, callContext) + response.map(convertToTuple[BankCommons](callContext)) } - - messageDocs += getBanksLegacyDoc48 - private def getBanksLegacyDoc48 = MessageDoc( + + messageDocs += getBanksLegacyDoc + def getBanksLegacyDoc = MessageDoc( process = "obp.getBanksLegacy", messageFormat = messageFormat, - description = """ - |Get Banks Legacy - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_banks_legacy - """.stripMargin, + description = "Get Banks Legacy", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetBanksLegacy( OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value)))))))))) + OutBoundGetBanksLegacy(MessageDocsSwaggerDefinitions.outboundAdapterCallContext) ), exampleInboundMessage = ( - InBoundGetBanksLegacy(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetBanksLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( BankCommons(bankId=BankId(bankIdExample.value), shortName=bankShortNameExample.value, fullName=bankFullNameExample.value, @@ -649,66 +356,27 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_banks_legacy + override def getBanksLegacy(callContext: Option[CallContext]): Box[(List[Bank], Option[CallContext])] = { - import com.openbankproject.commons.dto.{OutBoundGetBanksLegacy => OutBound, InBoundGetBanksLegacy => InBound} - val procedureName = "get_banks_legacy" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull ) - val result: OBPReturnType[Box[List[BankCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetBanksLegacy => InBound, OutBoundGetBanksLegacy => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_banks_legacy", req, callContext) + response.map(convertToTuple[List[BankCommons]](callContext)) } - - messageDocs += getBanksDoc77 - private def getBanksDoc77 = MessageDoc( + + messageDocs += getBanksDoc + def getBanksDoc = MessageDoc( process = "obp.getBanks", messageFormat = messageFormat, - description = """ - |Get Banks - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_banks - """.stripMargin, + description = "Get Banks", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetBanks( OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value)))))))))) + OutBoundGetBanks(MessageDocsSwaggerDefinitions.outboundAdapterCallContext) ), exampleInboundMessage = ( - InBoundGetBanks(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetBanks(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( BankCommons(bankId=BankId(bankIdExample.value), shortName=bankShortNameExample.value, fullName=bankFullNameExample.value, @@ -721,67 +389,28 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_banks + override def getBanks(callContext: Option[CallContext]): Future[Box[(List[Bank], Option[CallContext])]] = { - import com.openbankproject.commons.dto.{OutBoundGetBanks => OutBound, InBoundGetBanks => InBound} - val procedureName = "get_banks" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull ) - val result: OBPReturnType[Box[List[BankCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetBanks => InBound, OutBoundGetBanks => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_banks", req, callContext) + response.map(convertToTuple[List[BankCommons]](callContext)) } - - messageDocs += getBankAccountsForUserLegacyDoc21 - private def getBankAccountsForUserLegacyDoc21 = MessageDoc( + + messageDocs += getBankAccountsForUserLegacyDoc + def getBankAccountsForUserLegacyDoc = MessageDoc( process = "obp.getBankAccountsForUserLegacy", messageFormat = messageFormat, - description = """ - |Get Bank Accounts For User Legacy - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_bank_accounts_for_user_legacy - """.stripMargin, + description = "Get Bank Accounts For User Legacy", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetBankAccountsForUserLegacy(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetBankAccountsForUserLegacy(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, username=usernameExample.value) ), exampleInboundMessage = ( - InBoundGetBankAccountsForUserLegacy(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetBankAccountsForUserLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( InboundAccountCommons(bankId=bankIdExample.value, branchId=branchIdExample.value, accountId=accountIdExample.value, @@ -800,67 +429,28 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_bank_accounts_for_user_legacy + override def getBankAccountsForUserLegacy(username: String, callContext: Option[CallContext]): Box[(List[InboundAccount], Option[CallContext])] = { - import com.openbankproject.commons.dto.{OutBoundGetBankAccountsForUserLegacy => OutBound, InBoundGetBankAccountsForUserLegacy => InBound} - val procedureName = "get_bank_accounts_for_user_legacy" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , username) - val result: OBPReturnType[Box[List[InboundAccountCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetBankAccountsForUserLegacy => InBound, OutBoundGetBankAccountsForUserLegacy => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, username) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank_accounts_for_user_legacy", req, callContext) + response.map(convertToTuple[List[InboundAccountCommons]](callContext)) } - - messageDocs += getBankAccountsForUserDoc50 - private def getBankAccountsForUserDoc50 = MessageDoc( + + messageDocs += getBankAccountsForUserDoc + def getBankAccountsForUserDoc = MessageDoc( process = "obp.getBankAccountsForUser", messageFormat = messageFormat, - description = """ - |Get Bank Accounts For User - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_bank_accounts_for_user - """.stripMargin, + description = "Get Bank Accounts For User", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetBankAccountsForUser(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetBankAccountsForUser(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, username=usernameExample.value) ), exampleInboundMessage = ( - InBoundGetBankAccountsForUser(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetBankAccountsForUser(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( InboundAccountCommons(bankId=bankIdExample.value, branchId=branchIdExample.value, accountId=accountIdExample.value, @@ -879,108 +469,55 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_bank_accounts_for_user + override def getBankAccountsForUser(username: String, callContext: Option[CallContext]): Future[Box[(List[InboundAccount], Option[CallContext])]] = { - import com.openbankproject.commons.dto.{OutBoundGetBankAccountsForUser => OutBound, InBoundGetBankAccountsForUser => InBound} - val procedureName = "get_bank_accounts_for_user" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , username) - val result: OBPReturnType[Box[List[InboundAccountCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetBankAccountsForUser => InBound, OutBoundGetBankAccountsForUser => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, username) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank_accounts_for_user", req, callContext) + response.map(convertToTuple[List[InboundAccountCommons]](callContext)) } - - messageDocs += getUserDoc5 - private def getUserDoc5 = MessageDoc( + + messageDocs += getUserDoc + def getUserDoc = MessageDoc( process = "obp.getUser", messageFormat = messageFormat, - description = """ - |Get User - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_user - """.stripMargin, + description = "Get User", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetUser( - name=usernameExample.value, + OutBoundGetUser(name=usernameExample.value, password="string") ), exampleInboundMessage = ( - InBoundGetUser( - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetUser(status=MessageDocsSwaggerDefinitions.inboundStatus, data= InboundUser(email=emailExample.value, password="string", displayName="string")) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_user + override def getUser(name: String, password: String): Box[InboundUser] = { - import com.openbankproject.commons.dto.{OutBoundGetUser => OutBound, InBoundGetUser => InBound} - val procedureName = "get_user" + import com.openbankproject.commons.dto.{InBoundGetUser => InBound, OutBoundGetUser => OutBound} val callContext: Option[CallContext] = None val req = OutBound(name, password) - val result: OBPReturnType[Box[InboundUser]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + val response: Future[Box[InBound]] = sendRequest[InBound]("get_user", req, callContext) + response.map(convertToTuple[InboundUser](callContext)) } - - messageDocs += getBankAccountDoc6 - private def getBankAccountDoc6 = MessageDoc( - process = "obp.getBankAccount", + + messageDocs += getBankAccountOldDoc + def getBankAccountOldDoc = MessageDoc( + process = "obp.getBankAccountOld", messageFormat = messageFormat, - description = """ - |Get Bank Account - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_bank_account - """.stripMargin, + description = "Get Bank Account Old", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetBankAccount(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), - bankId=BankId(bankIdExample.value), + OutBoundGetBankAccountOld(bankId=BankId(bankIdExample.value), accountId=AccountId(accountIdExample.value)) ), exampleInboundMessage = ( - InBoundGetBankAccount(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetBankAccountOld(status=MessageDocsSwaggerDefinitions.inboundStatus, data= BankAccountCommons(accountId=AccountId(accountIdExample.value), accountType=accountTypeExample.value, balance=BigDecimal(balanceAmountExample.value), @@ -1002,68 +539,30 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_bank_account + override def getBankAccountOld(bankId: BankId, accountId: AccountId): Box[BankAccount] = { - import com.openbankproject.commons.dto.{OutBoundGetBankAccountOld => OutBound, InBoundGetBankAccountOld => InBound} - val procedureName = "get_bank_account" + import com.openbankproject.commons.dto.{InBoundGetBankAccountOld => InBound, OutBoundGetBankAccountOld => OutBound} val callContext: Option[CallContext] = None val req = OutBound(bankId, accountId) - val result: OBPReturnType[Box[BankAccountCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank_account_old", req, callContext) + response.map(convertToTuple[BankAccountCommons](callContext)) } - - messageDocs += getBankAccountLegacyDoc66 - private def getBankAccountLegacyDoc66 = MessageDoc( + + messageDocs += getBankAccountLegacyDoc + def getBankAccountLegacyDoc = MessageDoc( process = "obp.getBankAccountLegacy", messageFormat = messageFormat, - description = """ - |Get Bank Account Legacy - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_bank_account_legacy - """.stripMargin, + description = "Get Bank Account Legacy", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetBankAccountLegacy(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetBankAccountLegacy(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), accountId=AccountId(accountIdExample.value)) ), exampleInboundMessage = ( - InBoundGetBankAccountLegacy(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetBankAccountLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= BankAccountCommons(accountId=AccountId(accountIdExample.value), accountType=accountTypeExample.value, balance=BigDecimal(balanceAmountExample.value), @@ -1085,68 +584,29 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_bank_account_legacy + override def getBankAccountLegacy(bankId: BankId, accountId: AccountId, callContext: Option[CallContext]): Box[(BankAccount, Option[CallContext])] = { - import com.openbankproject.commons.dto.{OutBoundGetBankAccountLegacy => OutBound, InBoundGetBankAccountLegacy => InBound} - val procedureName = "get_bank_account_legacy" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountId) - val result: OBPReturnType[Box[BankAccountCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetBankAccountLegacy => InBound, OutBoundGetBankAccountLegacy => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank_account_legacy", req, callContext) + response.map(convertToTuple[BankAccountCommons](callContext)) } - - messageDocs += getBankAccountDoc62 - private def getBankAccountDoc62 = MessageDoc( + + messageDocs += getBankAccountDoc + def getBankAccountDoc = MessageDoc( process = "obp.getBankAccount", messageFormat = messageFormat, - description = """ - |Get Bank Account - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_bank_account - """.stripMargin, + description = "Get Bank Account", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetBankAccount(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetBankAccount(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), accountId=AccountId(accountIdExample.value)) ), exampleInboundMessage = ( - InBoundGetBankAccount(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetBankAccount(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= BankAccountCommons(accountId=AccountId(accountIdExample.value), accountType=accountTypeExample.value, balance=BigDecimal(balanceAmountExample.value), @@ -1168,67 +628,28 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_bank_account + override def getBankAccount(bankId: BankId, accountId: AccountId, callContext: Option[CallContext]): OBPReturnType[Box[BankAccount]] = { - import com.openbankproject.commons.dto.{OutBoundGetBankAccount => OutBound, InBoundGetBankAccount => InBound} - val procedureName = "get_bank_account" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountId) - val result: OBPReturnType[Box[BankAccountCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetBankAccount => InBound, OutBoundGetBankAccount => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank_account", req, callContext) + response.map(convertToTuple[BankAccountCommons](callContext)) } - - messageDocs += getBankAccountByIbanDoc10 - private def getBankAccountByIbanDoc10 = MessageDoc( + + messageDocs += getBankAccountByIbanDoc + def getBankAccountByIbanDoc = MessageDoc( process = "obp.getBankAccountByIban", messageFormat = messageFormat, - description = """ - |Get Bank Account By Iban - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_bank_account_by_iban - """.stripMargin, + description = "Get Bank Account By Iban", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetBankAccountByIban(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetBankAccountByIban(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, iban=ibanExample.value) ), exampleInboundMessage = ( - InBoundGetBankAccountByIban(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetBankAccountByIban(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= BankAccountCommons(accountId=AccountId(accountIdExample.value), accountType=accountTypeExample.value, balance=BigDecimal(balanceAmountExample.value), @@ -1250,68 +671,29 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_bank_account_by_iban + override def getBankAccountByIban(iban: String, callContext: Option[CallContext]): OBPReturnType[Box[BankAccount]] = { - import com.openbankproject.commons.dto.{OutBoundGetBankAccountByIban => OutBound, InBoundGetBankAccountByIban => InBound} - val procedureName = "get_bank_account_by_iban" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , iban) - val result: OBPReturnType[Box[BankAccountCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetBankAccountByIban => InBound, OutBoundGetBankAccountByIban => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, iban) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank_account_by_iban", req, callContext) + response.map(convertToTuple[BankAccountCommons](callContext)) } - - messageDocs += getBankAccountByRoutingDoc43 - private def getBankAccountByRoutingDoc43 = MessageDoc( + + messageDocs += getBankAccountByRoutingDoc + def getBankAccountByRoutingDoc = MessageDoc( process = "obp.getBankAccountByRouting", messageFormat = messageFormat, - description = """ - |Get Bank Account By Routing - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_bank_account_by_routing - """.stripMargin, + description = "Get Bank Account By Routing", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetBankAccountByRouting(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetBankAccountByRouting(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, scheme="string", address="string") ), exampleInboundMessage = ( - InBoundGetBankAccountByRouting(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetBankAccountByRouting(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= BankAccountCommons(accountId=AccountId(accountIdExample.value), accountType=accountTypeExample.value, balance=BigDecimal(balanceAmountExample.value), @@ -1333,68 +715,29 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_bank_account_by_routing + override def getBankAccountByRouting(scheme: String, address: String, callContext: Option[CallContext]): Box[(BankAccount, Option[CallContext])] = { - import com.openbankproject.commons.dto.{OutBoundGetBankAccountByRouting => OutBound, InBoundGetBankAccountByRouting => InBound} - val procedureName = "get_bank_account_by_routing" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , scheme, address) - val result: OBPReturnType[Box[BankAccountCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetBankAccountByRouting => InBound, OutBoundGetBankAccountByRouting => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, scheme, address) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank_account_by_routing", req, callContext) + response.map(convertToTuple[BankAccountCommons](callContext)) } - - messageDocs += getBankAccountsDoc32 - private def getBankAccountsDoc32 = MessageDoc( + + messageDocs += getBankAccountsDoc + def getBankAccountsDoc = MessageDoc( process = "obp.getBankAccounts", messageFormat = messageFormat, - description = """ - |Get Bank Accounts - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_bank_accounts - """.stripMargin, + description = "Get Bank Accounts", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetBankAccounts(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetBankAccounts(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankIdAccountIds=List( BankIdAccountId(bankId=BankId(bankIdExample.value), accountId=AccountId(accountIdExample.value)))) ), exampleInboundMessage = ( - InBoundGetBankAccounts(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetBankAccounts(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( BankAccountCommons(accountId=AccountId(accountIdExample.value), accountType=accountTypeExample.value, balance=BigDecimal(balanceAmountExample.value), @@ -1416,68 +759,29 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_bank_accounts + override def getBankAccounts(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]): OBPReturnType[Box[List[BankAccount]]] = { - import com.openbankproject.commons.dto.{OutBoundGetBankAccounts => OutBound, InBoundGetBankAccounts => InBound} - val procedureName = "get_bank_accounts" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankIdAccountIds) - val result: OBPReturnType[Box[List[BankAccountCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetBankAccounts => InBound, OutBoundGetBankAccounts => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankIdAccountIds) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank_accounts", req, callContext) + response.map(convertToTuple[List[BankAccountCommons]](callContext)) } - - messageDocs += getBankAccountsBalancesDoc99 - private def getBankAccountsBalancesDoc99 = MessageDoc( + + messageDocs += getBankAccountsBalancesDoc + def getBankAccountsBalancesDoc = MessageDoc( process = "obp.getBankAccountsBalances", messageFormat = messageFormat, - description = """ - |Get Bank Accounts Balances - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_bank_accounts_balances - """.stripMargin, + description = "Get Bank Accounts Balances", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetBankAccountsBalances(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetBankAccountsBalances(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankIdAccountIds=List( BankIdAccountId(bankId=BankId(bankIdExample.value), accountId=AccountId(accountIdExample.value)))) ), exampleInboundMessage = ( - InBoundGetBankAccountsBalances(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetBankAccountsBalances(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= AccountsBalances(accounts=List( AccountBalance(id=accountIdExample.value, label=labelExample.value, bankId=bankIdExample.value, @@ -1491,68 +795,29 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_bank_accounts_balances + override def getBankAccountsBalances(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]): OBPReturnType[Box[AccountsBalances]] = { - import com.openbankproject.commons.dto.{OutBoundGetBankAccountsBalances => OutBound, InBoundGetBankAccountsBalances => InBound} - val procedureName = "get_bank_accounts_balances" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankIdAccountIds) - val result: OBPReturnType[Box[AccountsBalances]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetBankAccountsBalances => InBound, OutBoundGetBankAccountsBalances => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankIdAccountIds) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank_accounts_balances", req, callContext) + response.map(convertToTuple[AccountsBalances](callContext)) } - - messageDocs += getCoreBankAccountsLegacyDoc99 - private def getCoreBankAccountsLegacyDoc99 = MessageDoc( + + messageDocs += getCoreBankAccountsLegacyDoc + def getCoreBankAccountsLegacyDoc = MessageDoc( process = "obp.getCoreBankAccountsLegacy", messageFormat = messageFormat, - description = """ - |Get Core Bank Accounts Legacy - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_core_bank_accounts_legacy - """.stripMargin, + description = "Get Core Bank Accounts Legacy", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetCoreBankAccountsLegacy(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetCoreBankAccountsLegacy(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankIdAccountIds=List( BankIdAccountId(bankId=BankId(bankIdExample.value), accountId=AccountId(accountIdExample.value)))) ), exampleInboundMessage = ( - InBoundGetCoreBankAccountsLegacy(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetCoreBankAccountsLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( CoreAccount(id=accountIdExample.value, label=labelExample.value, bankId=bankIdExample.value, @@ -1562,68 +827,29 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_core_bank_accounts_legacy + override def getCoreBankAccountsLegacy(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]): Box[(List[CoreAccount], Option[CallContext])] = { - import com.openbankproject.commons.dto.{OutBoundGetCoreBankAccountsLegacy => OutBound, InBoundGetCoreBankAccountsLegacy => InBound} - val procedureName = "get_core_bank_accounts_legacy" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankIdAccountIds) - val result: OBPReturnType[Box[List[CoreAccount]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetCoreBankAccountsLegacy => InBound, OutBoundGetCoreBankAccountsLegacy => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankIdAccountIds) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_core_bank_accounts_legacy", req, callContext) + response.map(convertToTuple[List[CoreAccount]](callContext)) } - - messageDocs += getCoreBankAccountsDoc89 - private def getCoreBankAccountsDoc89 = MessageDoc( + + messageDocs += getCoreBankAccountsDoc + def getCoreBankAccountsDoc = MessageDoc( process = "obp.getCoreBankAccounts", messageFormat = messageFormat, - description = """ - |Get Core Bank Accounts - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_core_bank_accounts - """.stripMargin, + description = "Get Core Bank Accounts", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetCoreBankAccounts(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetCoreBankAccounts(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankIdAccountIds=List( BankIdAccountId(bankId=BankId(bankIdExample.value), accountId=AccountId(accountIdExample.value)))) ), exampleInboundMessage = ( - InBoundGetCoreBankAccounts(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetCoreBankAccounts(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( CoreAccount(id=accountIdExample.value, label=labelExample.value, bankId=bankIdExample.value, @@ -1633,68 +859,29 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_core_bank_accounts + override def getCoreBankAccounts(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]): Future[Box[(List[CoreAccount], Option[CallContext])]] = { - import com.openbankproject.commons.dto.{OutBoundGetCoreBankAccounts => OutBound, InBoundGetCoreBankAccounts => InBound} - val procedureName = "get_core_bank_accounts" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankIdAccountIds) - val result: OBPReturnType[Box[List[CoreAccount]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetCoreBankAccounts => InBound, OutBoundGetCoreBankAccounts => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankIdAccountIds) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_core_bank_accounts", req, callContext) + response.map(convertToTuple[List[CoreAccount]](callContext)) } - - messageDocs += getBankAccountsHeldLegacyDoc41 - private def getBankAccountsHeldLegacyDoc41 = MessageDoc( + + messageDocs += getBankAccountsHeldLegacyDoc + def getBankAccountsHeldLegacyDoc = MessageDoc( process = "obp.getBankAccountsHeldLegacy", messageFormat = messageFormat, - description = """ - |Get Bank Accounts Held Legacy - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_bank_accounts_held_legacy - """.stripMargin, + description = "Get Bank Accounts Held Legacy", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetBankAccountsHeldLegacy(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetBankAccountsHeldLegacy(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankIdAccountIds=List( BankIdAccountId(bankId=BankId(bankIdExample.value), accountId=AccountId(accountIdExample.value)))) ), exampleInboundMessage = ( - InBoundGetBankAccountsHeldLegacy(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetBankAccountsHeldLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( AccountHeld(id="string", bankId=bankIdExample.value, number="string", @@ -1703,68 +890,29 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_bank_accounts_held_legacy + override def getBankAccountsHeldLegacy(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]): Box[List[AccountHeld]] = { - import com.openbankproject.commons.dto.{OutBoundGetBankAccountsHeldLegacy => OutBound, InBoundGetBankAccountsHeldLegacy => InBound} - val procedureName = "get_bank_accounts_held_legacy" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankIdAccountIds) - val result: OBPReturnType[Box[List[AccountHeld]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetBankAccountsHeldLegacy => InBound, OutBoundGetBankAccountsHeldLegacy => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankIdAccountIds) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank_accounts_held_legacy", req, callContext) + response.map(convertToTuple[List[AccountHeld]](callContext)) } - - messageDocs += getBankAccountsHeldDoc49 - private def getBankAccountsHeldDoc49 = MessageDoc( + + messageDocs += getBankAccountsHeldDoc + def getBankAccountsHeldDoc = MessageDoc( process = "obp.getBankAccountsHeld", messageFormat = messageFormat, - description = """ - |Get Bank Accounts Held - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_bank_accounts_held - """.stripMargin, + description = "Get Bank Accounts Held", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetBankAccountsHeld(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetBankAccountsHeld(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankIdAccountIds=List( BankIdAccountId(bankId=BankId(bankIdExample.value), accountId=AccountId(accountIdExample.value)))) ), exampleInboundMessage = ( - InBoundGetBankAccountsHeld(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetBankAccountsHeld(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( AccountHeld(id="string", bankId=bankIdExample.value, number="string", @@ -1773,68 +921,29 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_bank_accounts_held + override def getBankAccountsHeld(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]): OBPReturnType[Box[List[AccountHeld]]] = { - import com.openbankproject.commons.dto.{OutBoundGetBankAccountsHeld => OutBound, InBoundGetBankAccountsHeld => InBound} - val procedureName = "get_bank_accounts_held" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankIdAccountIds) - val result: OBPReturnType[Box[List[AccountHeld]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetBankAccountsHeld => InBound, OutBoundGetBankAccountsHeld => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankIdAccountIds) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank_accounts_held", req, callContext) + response.map(convertToTuple[List[AccountHeld]](callContext)) } - - messageDocs += checkBankAccountExistsLegacyDoc7 - private def checkBankAccountExistsLegacyDoc7 = MessageDoc( + + messageDocs += checkBankAccountExistsLegacyDoc + def checkBankAccountExistsLegacyDoc = MessageDoc( process = "obp.checkBankAccountExistsLegacy", messageFormat = messageFormat, - description = """ - |Check Bank Account Exists Legacy - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: check_bank_account_exists_legacy - """.stripMargin, + description = "Check Bank Account Exists Legacy", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCheckBankAccountExistsLegacy(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCheckBankAccountExistsLegacy(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), accountId=AccountId(accountIdExample.value)) ), exampleInboundMessage = ( - InBoundCheckBankAccountExistsLegacy(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCheckBankAccountExistsLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= BankAccountCommons(accountId=AccountId(accountIdExample.value), accountType=accountTypeExample.value, balance=BigDecimal(balanceAmountExample.value), @@ -1856,202 +965,30 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: check_bank_account_exists_legacy + override def checkBankAccountExistsLegacy(bankId: BankId, accountId: AccountId, callContext: Option[CallContext]): Box[(BankAccount, Option[CallContext])] = { - import com.openbankproject.commons.dto.{OutBoundCheckBankAccountExistsLegacy => OutBound, InBoundCheckBankAccountExistsLegacy => InBound} - val procedureName = "check_bank_account_exists_legacy" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountId) - val result: OBPReturnType[Box[BankAccountCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCheckBankAccountExistsLegacy => InBound, OutBoundCheckBankAccountExistsLegacy => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId) + val response: Future[Box[InBound]] = sendRequest[InBound]("check_bank_account_exists_legacy", req, callContext) + response.map(convertToTuple[BankAccountCommons](callContext)) } - - messageDocs += checkBankAccountExistsDoc52 - private def checkBankAccountExistsDoc52 = MessageDoc( - process = "obp.checkBankAccountExists", - messageFormat = messageFormat, - description = """ - |Check Bank Account Exists - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: check_bank_account_exists - """.stripMargin, - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundCheckBankAccountExists(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), - bankId=BankId(bankIdExample.value), - accountId=AccountId(accountIdExample.value)) - ), - exampleInboundMessage = ( - InBoundCheckBankAccountExists(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), - data= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=bankAccountNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=bankAccountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value)) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - // stored procedure name: check_bank_account_exists - override def checkBankAccountExists(bankId: BankId, accountId: AccountId, callContext: Option[CallContext]): OBPReturnType[Box[BankAccount]] = { - import com.openbankproject.commons.dto.{OutBoundCheckBankAccountExists => OutBound, InBoundCheckBankAccountExists => InBound} - val procedureName = "check_bank_account_exists" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountId) - val result: OBPReturnType[Box[BankAccountCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result - } - - messageDocs += getCounterpartyDoc95 - private def getCounterpartyDoc95 = MessageDoc( - process = "obp.getCounterparty", - messageFormat = messageFormat, - description = """ - |Get Counterparty - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_counterparty - """.stripMargin, - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundGetCounterparty( - thisBankId=BankId(bankIdExample.value), - thisAccountId=AccountId(accountIdExample.value), - couterpartyId="string") - ), - exampleInboundMessage = ( - InBoundGetCounterparty( - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), - data= Counterparty(nationalIdentifier=counterpartyNationalIdentifierExample.value, - kind=counterpartyKindExample.value, - counterpartyId=counterpartyIdExample.value, - counterpartyName=counterpartyNameExample.value, - thisBankId=BankId(bankIdExample.value), - thisAccountId=AccountId(accountIdExample.value), - otherBankRoutingScheme=counterpartyOtherBankRoutingSchemeExample.value, - otherBankRoutingAddress=Some(counterpartyOtherBankRoutingAddressExample.value), - otherAccountRoutingScheme=counterpartyOtherAccountRoutingSchemeExample.value, - otherAccountRoutingAddress=Some(counterpartyOtherAccountRoutingAddressExample.value), - otherAccountProvider=counterpartyOtherAccountProviderExample.value, - isBeneficiary=isBeneficiaryExample.value.toBoolean)) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - // stored procedure name: get_counterparty - override def getCounterparty(thisBankId: BankId, thisAccountId: AccountId, couterpartyId: String): Box[Counterparty] = { - import com.openbankproject.commons.dto.{OutBoundGetCounterparty => OutBound, InBoundGetCounterparty => InBound} - val procedureName = "get_counterparty" - val callContext: Option[CallContext] = None - val req = OutBound(thisBankId, thisAccountId, couterpartyId) - val result: OBPReturnType[Box[Counterparty]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result - } - - messageDocs += getCounterpartyTraitDoc42 - private def getCounterpartyTraitDoc42 = MessageDoc( + + messageDocs += getCounterpartyTraitDoc + def getCounterpartyTraitDoc = MessageDoc( process = "obp.getCounterpartyTrait", messageFormat = messageFormat, - description = """ - |Get Counterparty Trait - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_counterparty_trait - """.stripMargin, + description = "Get Counterparty Trait", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetCounterpartyTrait(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetCounterpartyTrait(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), accountId=AccountId(accountIdExample.value), couterpartyId="string") ), exampleInboundMessage = ( - InBoundGetCounterpartyTrait(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetCounterpartyTrait(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= CounterpartyTraitCommons(createdByUserId="string", name="string", description="string", @@ -2073,67 +1010,28 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_counterparty_trait + override def getCounterpartyTrait(bankId: BankId, accountId: AccountId, couterpartyId: String, callContext: Option[CallContext]): OBPReturnType[Box[CounterpartyTrait]] = { - import com.openbankproject.commons.dto.{OutBoundGetCounterpartyTrait => OutBound, InBoundGetCounterpartyTrait => InBound} - val procedureName = "get_counterparty_trait" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountId, couterpartyId) - val result: OBPReturnType[Box[CounterpartyTraitCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetCounterpartyTrait => InBound, OutBoundGetCounterpartyTrait => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, couterpartyId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_counterparty_trait", req, callContext) + response.map(convertToTuple[CounterpartyTraitCommons](callContext)) } - - messageDocs += getCounterpartyByCounterpartyIdLegacyDoc82 - private def getCounterpartyByCounterpartyIdLegacyDoc82 = MessageDoc( + + messageDocs += getCounterpartyByCounterpartyIdLegacyDoc + def getCounterpartyByCounterpartyIdLegacyDoc = MessageDoc( process = "obp.getCounterpartyByCounterpartyIdLegacy", messageFormat = messageFormat, - description = """ - |Get Counterparty By Counterparty Id Legacy - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_counterparty_by_counterparty_id_legacy - """.stripMargin, + description = "Get Counterparty By Counterparty Id Legacy", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetCounterpartyByCounterpartyIdLegacy(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetCounterpartyByCounterpartyIdLegacy(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, counterpartyId=CounterpartyId(counterpartyIdExample.value)) ), exampleInboundMessage = ( - InBoundGetCounterpartyByCounterpartyIdLegacy(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetCounterpartyByCounterpartyIdLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= CounterpartyTraitCommons(createdByUserId="string", name="string", description="string", @@ -2155,67 +1053,28 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_counterparty_by_counterparty_id_legacy + override def getCounterpartyByCounterpartyIdLegacy(counterpartyId: CounterpartyId, callContext: Option[CallContext]): Box[(CounterpartyTrait, Option[CallContext])] = { - import com.openbankproject.commons.dto.{OutBoundGetCounterpartyByCounterpartyIdLegacy => OutBound, InBoundGetCounterpartyByCounterpartyIdLegacy => InBound} - val procedureName = "get_counterparty_by_counterparty_id_legacy" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , counterpartyId) - val result: OBPReturnType[Box[CounterpartyTraitCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetCounterpartyByCounterpartyIdLegacy => InBound, OutBoundGetCounterpartyByCounterpartyIdLegacy => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, counterpartyId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_counterparty_by_counterparty_id_legacy", req, callContext) + response.map(convertToTuple[CounterpartyTraitCommons](callContext)) } - - messageDocs += getCounterpartyByCounterpartyIdDoc49 - private def getCounterpartyByCounterpartyIdDoc49 = MessageDoc( + + messageDocs += getCounterpartyByCounterpartyIdDoc + def getCounterpartyByCounterpartyIdDoc = MessageDoc( process = "obp.getCounterpartyByCounterpartyId", messageFormat = messageFormat, - description = """ - |Get Counterparty By Counterparty Id - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_counterparty_by_counterparty_id - """.stripMargin, + description = "Get Counterparty By Counterparty Id", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetCounterpartyByCounterpartyId(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetCounterpartyByCounterpartyId(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, counterpartyId=CounterpartyId(counterpartyIdExample.value)) ), exampleInboundMessage = ( - InBoundGetCounterpartyByCounterpartyId(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetCounterpartyByCounterpartyId(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= CounterpartyTraitCommons(createdByUserId="string", name="string", description="string", @@ -2237,67 +1096,28 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_counterparty_by_counterparty_id + override def getCounterpartyByCounterpartyId(counterpartyId: CounterpartyId, callContext: Option[CallContext]): OBPReturnType[Box[CounterpartyTrait]] = { - import com.openbankproject.commons.dto.{OutBoundGetCounterpartyByCounterpartyId => OutBound, InBoundGetCounterpartyByCounterpartyId => InBound} - val procedureName = "get_counterparty_by_counterparty_id" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , counterpartyId) - val result: OBPReturnType[Box[CounterpartyTraitCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetCounterpartyByCounterpartyId => InBound, OutBoundGetCounterpartyByCounterpartyId => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, counterpartyId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_counterparty_by_counterparty_id", req, callContext) + response.map(convertToTuple[CounterpartyTraitCommons](callContext)) } - - messageDocs += getCounterpartyByIbanDoc32 - private def getCounterpartyByIbanDoc32 = MessageDoc( + + messageDocs += getCounterpartyByIbanDoc + def getCounterpartyByIbanDoc = MessageDoc( process = "obp.getCounterpartyByIban", messageFormat = messageFormat, - description = """ - |Get Counterparty By Iban - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_counterparty_by_iban - """.stripMargin, + description = "Get Counterparty By Iban", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetCounterpartyByIban(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetCounterpartyByIban(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, iban=ibanExample.value) ), exampleInboundMessage = ( - InBoundGetCounterpartyByIban(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetCounterpartyByIban(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= CounterpartyTraitCommons(createdByUserId="string", name="string", description="string", @@ -2319,69 +1139,30 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_counterparty_by_iban + override def getCounterpartyByIban(iban: String, callContext: Option[CallContext]): OBPReturnType[Box[CounterpartyTrait]] = { - import com.openbankproject.commons.dto.{OutBoundGetCounterpartyByIban => OutBound, InBoundGetCounterpartyByIban => InBound} - val procedureName = "get_counterparty_by_iban" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , iban) - val result: OBPReturnType[Box[CounterpartyTraitCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetCounterpartyByIban => InBound, OutBoundGetCounterpartyByIban => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, iban) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_counterparty_by_iban", req, callContext) + response.map(convertToTuple[CounterpartyTraitCommons](callContext)) } - - messageDocs += getCounterpartiesLegacyDoc24 - private def getCounterpartiesLegacyDoc24 = MessageDoc( + + messageDocs += getCounterpartiesLegacyDoc + def getCounterpartiesLegacyDoc = MessageDoc( process = "obp.getCounterpartiesLegacy", messageFormat = messageFormat, - description = """ - |Get Counterparties Legacy - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_counterparties_legacy - """.stripMargin, + description = "Get Counterparties Legacy", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetCounterpartiesLegacy(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetCounterpartiesLegacy(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, thisBankId=BankId(bankIdExample.value), thisAccountId=AccountId(accountIdExample.value), viewId=ViewId(viewIdExample.value)) ), exampleInboundMessage = ( - InBoundGetCounterpartiesLegacy(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetCounterpartiesLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( CounterpartyTraitCommons(createdByUserId="string", name="string", description="string", @@ -2403,69 +1184,30 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_counterparties_legacy + override def getCounterpartiesLegacy(thisBankId: BankId, thisAccountId: AccountId, viewId: ViewId, callContext: Option[CallContext]): Box[(List[CounterpartyTrait], Option[CallContext])] = { - import com.openbankproject.commons.dto.{OutBoundGetCounterpartiesLegacy => OutBound, InBoundGetCounterpartiesLegacy => InBound} - val procedureName = "get_counterparties_legacy" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , thisBankId, thisAccountId, viewId) - val result: OBPReturnType[Box[List[CounterpartyTraitCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetCounterpartiesLegacy => InBound, OutBoundGetCounterpartiesLegacy => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, thisBankId, thisAccountId, viewId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_counterparties_legacy", req, callContext) + response.map(convertToTuple[List[CounterpartyTraitCommons]](callContext)) } - - messageDocs += getCounterpartiesDoc51 - private def getCounterpartiesDoc51 = MessageDoc( + + messageDocs += getCounterpartiesDoc + def getCounterpartiesDoc = MessageDoc( process = "obp.getCounterparties", messageFormat = messageFormat, - description = """ - |Get Counterparties - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_counterparties - """.stripMargin, + description = "Get Counterparties", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetCounterparties(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetCounterparties(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, thisBankId=BankId(bankIdExample.value), thisAccountId=AccountId(accountIdExample.value), viewId=ViewId(viewIdExample.value)) ), exampleInboundMessage = ( - InBoundGetCounterparties(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetCounterparties(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( CounterpartyTraitCommons(createdByUserId="string", name="string", description="string", @@ -2487,55 +1229,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_counterparties + override def getCounterparties(thisBankId: BankId, thisAccountId: AccountId, viewId: ViewId, callContext: Option[CallContext]): OBPReturnType[Box[List[CounterpartyTrait]]] = { - import com.openbankproject.commons.dto.{OutBoundGetCounterparties => OutBound, InBoundGetCounterparties => InBound} - val procedureName = "get_counterparties" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , thisBankId, thisAccountId, viewId) - val result: OBPReturnType[Box[List[CounterpartyTraitCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetCounterparties => InBound, OutBoundGetCounterparties => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, thisBankId, thisAccountId, viewId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_counterparties", req, callContext) + response.map(convertToTuple[List[CounterpartyTraitCommons]](callContext)) } - - messageDocs += getTransactionsLegacyDoc73 - private def getTransactionsLegacyDoc73 = MessageDoc( + + messageDocs += getTransactionsLegacyDoc + def getTransactionsLegacyDoc = MessageDoc( process = "obp.getTransactionsLegacy", messageFormat = messageFormat, - description = """ - |Get Transactions Legacy - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_transactions_legacy - """.stripMargin, + description = "Get Transactions Legacy", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetTransactionsLegacy(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetTransactionsLegacy(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), accountID=AccountId(accountIdExample.value), limit=limitExample.value.toInt, @@ -2544,15 +1254,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { toDate="string") ), exampleInboundMessage = ( - InBoundGetTransactionsLegacy(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetTransactionsLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( TransactionCommons(uuid=transactionUuidExample.value, id=TransactionId(transactionIdExample.value), thisAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), @@ -2595,55 +1298,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_transactions_legacy + override def getTransactionsLegacy(bankId: BankId, accountID: AccountId, callContext: Option[CallContext], queryParams: List[OBPQueryParam]): Box[(List[Transaction], Option[CallContext])] = { - import com.openbankproject.commons.dto.{OutBoundGetTransactionsLegacy => OutBound, InBoundGetTransactionsLegacy => InBound} - val procedureName = "get_transactions_legacy" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountID, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) - val result: OBPReturnType[Box[List[TransactionCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetTransactionsLegacy => InBound, OutBoundGetTransactionsLegacy => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountID, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_transactions_legacy", req, callContext) + response.map(convertToTuple[List[TransactionCommons]](callContext)) } - - messageDocs += getTransactionsDoc43 - private def getTransactionsDoc43 = MessageDoc( + + messageDocs += getTransactionsDoc + def getTransactionsDoc = MessageDoc( process = "obp.getTransactions", messageFormat = messageFormat, - description = """ - |Get Transactions - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_transactions - """.stripMargin, + description = "Get Transactions", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetTransactions(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetTransactions(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), accountId=AccountId(accountIdExample.value), limit=limitExample.value.toInt, @@ -2652,15 +1323,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { toDate=outBoundGetTransactionsToDateExample.value) ), exampleInboundMessage = ( - InBoundGetTransactions(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetTransactions(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( TransactionCommons(uuid=transactionUuidExample.value, id=TransactionId(transactionIdExample.value), thisAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), @@ -2703,55 +1367,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_transactions + override def getTransactions(bankId: BankId, accountID: AccountId, callContext: Option[CallContext], queryParams: List[OBPQueryParam]): OBPReturnType[Box[List[Transaction]]] = { - import com.openbankproject.commons.dto.{OutBoundGetTransactions => OutBound, InBoundGetTransactions => InBound} - val procedureName = "get_transactions" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountID, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) - val result: OBPReturnType[Box[List[TransactionCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetTransactions => InBound, OutBoundGetTransactions => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountID, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_transactions", req, callContext) + response.map(convertToTuple[List[TransactionCommons]](callContext)) } - - messageDocs += getTransactionsCoreDoc70 - private def getTransactionsCoreDoc70 = MessageDoc( + + messageDocs += getTransactionsCoreDoc + def getTransactionsCoreDoc = MessageDoc( process = "obp.getTransactionsCore", messageFormat = messageFormat, - description = """ - |Get Transactions Core - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_transactions_core - """.stripMargin, + description = "Get Transactions Core", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetTransactionsCore(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetTransactionsCore(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), accountID=AccountId(accountIdExample.value), limit=limitExample.value.toInt, @@ -2760,15 +1392,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { toDate="string") ), exampleInboundMessage = ( - InBoundGetTransactionsCore(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetTransactionsCore(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( TransactionCore(id=TransactionId(transactionIdExample.value), thisAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), accountType=accountTypeExample.value, @@ -2809,69 +1434,30 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_transactions_core + override def getTransactionsCore(bankId: BankId, accountID: AccountId, queryParams: List[OBPQueryParam], callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionCore]]] = { - import com.openbankproject.commons.dto.{OutBoundGetTransactionsCore => OutBound, InBoundGetTransactionsCore => InBound} - val procedureName = "get_transactions_core" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountID, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) - val result: OBPReturnType[Box[List[TransactionCore]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetTransactionsCore => InBound, OutBoundGetTransactionsCore => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountID, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_transactions_core", req, callContext) + response.map(convertToTuple[List[TransactionCore]](callContext)) } - - messageDocs += getTransactionLegacyDoc68 - private def getTransactionLegacyDoc68 = MessageDoc( + + messageDocs += getTransactionLegacyDoc + def getTransactionLegacyDoc = MessageDoc( process = "obp.getTransactionLegacy", messageFormat = messageFormat, - description = """ - |Get Transaction Legacy - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_transaction_legacy - """.stripMargin, + description = "Get Transaction Legacy", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetTransactionLegacy(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetTransactionLegacy(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), accountID=AccountId(accountIdExample.value), transactionId=TransactionId(transactionIdExample.value)) ), exampleInboundMessage = ( - InBoundGetTransactionLegacy(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetTransactionLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= TransactionCommons(uuid=transactionUuidExample.value, id=TransactionId(transactionIdExample.value), thisAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), @@ -2914,69 +1500,30 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_transaction_legacy + override def getTransactionLegacy(bankId: BankId, accountID: AccountId, transactionId: TransactionId, callContext: Option[CallContext]): Box[(Transaction, Option[CallContext])] = { - import com.openbankproject.commons.dto.{OutBoundGetTransactionLegacy => OutBound, InBoundGetTransactionLegacy => InBound} - val procedureName = "get_transaction_legacy" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountID, transactionId) - val result: OBPReturnType[Box[TransactionCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetTransactionLegacy => InBound, OutBoundGetTransactionLegacy => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountID, transactionId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_transaction_legacy", req, callContext) + response.map(convertToTuple[TransactionCommons](callContext)) } - - messageDocs += getTransactionDoc61 - private def getTransactionDoc61 = MessageDoc( + + messageDocs += getTransactionDoc + def getTransactionDoc = MessageDoc( process = "obp.getTransaction", messageFormat = messageFormat, - description = """ - |Get Transaction - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_transaction - """.stripMargin, + description = "Get Transaction", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetTransaction(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetTransaction(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), accountId=AccountId(accountIdExample.value), transactionId=TransactionId(transactionIdExample.value)) ), exampleInboundMessage = ( - InBoundGetTransaction(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetTransaction(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= TransactionCommons(uuid=transactionUuidExample.value, id=TransactionId(transactionIdExample.value), thisAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), @@ -3019,149 +1566,29 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_transaction + override def getTransaction(bankId: BankId, accountID: AccountId, transactionId: TransactionId, callContext: Option[CallContext]): OBPReturnType[Box[Transaction]] = { - import com.openbankproject.commons.dto.{OutBoundGetTransaction => OutBound, InBoundGetTransaction => InBound} - val procedureName = "get_transaction" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountID, transactionId) - val result: OBPReturnType[Box[TransactionCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetTransaction => InBound, OutBoundGetTransaction => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountID, transactionId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_transaction", req, callContext) + response.map(convertToTuple[TransactionCommons](callContext)) } - - messageDocs += getPhysicalCardsDoc50 - private def getPhysicalCardsDoc50 = MessageDoc( - process = "obp.getPhysicalCards", - messageFormat = messageFormat, - description = """ - |Get Physical Cards - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_physical_cards - """.stripMargin, - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundGetPhysicalCards( - user= UserCommons(userPrimaryKey=UserPrimaryKey(123), - userId=userIdExample.value, - idGivenByProvider="string", - provider="string", - emailAddress=emailExample.value, - name=usernameExample.value)) - ), - exampleInboundMessage = ( - InBoundGetPhysicalCards( - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), - data=List( PhysicalCard(cardId=cardIdExample.value, - bankId=bankIdExample.value, - bankCardNumber=bankCardNumberExample.value, - cardType=cardTypeExample.value, - nameOnCard=nameOnCardExample.value, - issueNumber=issueNumberExample.value, - serialNumber=serialNumberExample.value, - validFrom=new Date(), - expires=new Date(), - enabled=true, - cancelled=true, - onHotList=true, - technology="string", - networks=List("string"), - allows=List(com.openbankproject.commons.model.CardAction.DEBIT), - account= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=bankAccountNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=accountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value), - replacement=Some( CardReplacementInfo(requestedDate=new Date(), - reasonRequested=com.openbankproject.commons.model.CardReplacementReason.FIRST)), - pinResets=List( PinResetInfo(requestedDate=new Date(), - reasonRequested=com.openbankproject.commons.model.PinResetReason.FORGOT)), - collected=Some(CardCollectionInfo(new Date())), - posted=Some(CardPostedInfo(new Date())), - customerId=customerIdExample.value))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - // stored procedure name: get_physical_cards - override def getPhysicalCards(user: User): Box[List[PhysicalCard]] = { - import com.openbankproject.commons.dto.{OutBoundGetPhysicalCards => OutBound, InBoundGetPhysicalCards => InBound} - val procedureName = "get_physical_cards" - val callContext: Option[CallContext] = None - val req = OutBound(user) - val result: OBPReturnType[Box[List[PhysicalCard]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result - } - - messageDocs += getPhysicalCardForBankDoc26 - private def getPhysicalCardForBankDoc26 = MessageDoc( + + messageDocs += getPhysicalCardForBankDoc + def getPhysicalCardForBankDoc = MessageDoc( process = "obp.getPhysicalCardForBank", messageFormat = messageFormat, - description = """ - |Get Physical Card For Bank - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_physical_card_for_bank - """.stripMargin, + description = "Get Physical Card For Bank", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetPhysicalCardForBank(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetPhysicalCardForBank(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), cardId=cardIdExample.value) ), exampleInboundMessage = ( - InBoundGetPhysicalCardForBank(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetPhysicalCardForBank(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= PhysicalCard(cardId=cardIdExample.value, bankId=bankIdExample.value, bankCardNumber=bankCardNumberExample.value, @@ -3205,215 +1632,50 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_physical_card_for_bank + override def getPhysicalCardForBank(bankId: BankId, cardId: String, callContext: Option[CallContext]): OBPReturnType[Box[PhysicalCardTrait]] = { - import com.openbankproject.commons.dto.{OutBoundGetPhysicalCardForBank => OutBound, InBoundGetPhysicalCardForBank => InBound} - val procedureName = "get_physical_card_for_bank" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, cardId) - val result: OBPReturnType[Box[PhysicalCard]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetPhysicalCardForBank => InBound, OutBoundGetPhysicalCardForBank => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, cardId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_physical_card_for_bank", req, callContext) + response.map(convertToTuple[PhysicalCard](callContext)) } - - messageDocs += deletePhysicalCardForBankDoc55 - private def deletePhysicalCardForBankDoc55 = MessageDoc( + + messageDocs += deletePhysicalCardForBankDoc + def deletePhysicalCardForBankDoc = MessageDoc( process = "obp.deletePhysicalCardForBank", messageFormat = messageFormat, - description = """ - |Delete Physical Card For Bank - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: delete_physical_card_for_bank - """.stripMargin, + description = "Delete Physical Card For Bank", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundDeletePhysicalCardForBank(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundDeletePhysicalCardForBank(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), cardId=cardIdExample.value) ), exampleInboundMessage = ( - InBoundDeletePhysicalCardForBank(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundDeletePhysicalCardForBank(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=true) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: delete_physical_card_for_bank + override def deletePhysicalCardForBank(bankId: BankId, cardId: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { - import com.openbankproject.commons.dto.{OutBoundDeletePhysicalCardForBank => OutBound, InBoundDeletePhysicalCardForBank => InBound} - val procedureName = "delete_physical_card_for_bank" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, cardId) - val result: OBPReturnType[Box[Boolean]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundDeletePhysicalCardForBank => InBound, OutBoundDeletePhysicalCardForBank => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, cardId) + val response: Future[Box[InBound]] = sendRequest[InBound]("delete_physical_card_for_bank", req, callContext) + response.map(convertToTuple[Boolean](callContext)) } - - messageDocs += getPhysicalCardsForBankLegacyDoc28 - private def getPhysicalCardsForBankLegacyDoc28 = MessageDoc( - process = "obp.getPhysicalCardsForBankLegacy", - messageFormat = messageFormat, - description = """ - |Get Physical Cards For Bank Legacy - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_physical_cards_for_bank_legacy - """.stripMargin, - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundGetPhysicalCardsForBankLegacy( - bank= BankCommons(bankId=BankId(bankIdExample.value), - shortName=bankShortNameExample.value, - fullName=bankFullNameExample.value, - logoUrl=bankLogoUrlExample.value, - websiteUrl=bankWebsiteUrlExample.value, - bankRoutingScheme=bankRoutingSchemeExample.value, - bankRoutingAddress=bankRoutingAddressExample.value, - swiftBic=bankSwiftBicExample.value, - nationalIdentifier=bankNationalIdentifierExample.value), - user= UserCommons(userPrimaryKey=UserPrimaryKey(123), - userId=userIdExample.value, - idGivenByProvider="string", - provider="string", - emailAddress=emailExample.value, - name=usernameExample.value), - limit=limitExample.value.toInt, - offset=offsetExample.value.toInt, - fromDate="string", - toDate="string") - ), - exampleInboundMessage = ( - InBoundGetPhysicalCardsForBankLegacy( - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), - data=List( PhysicalCard(cardId=cardIdExample.value, - bankId=bankIdExample.value, - bankCardNumber=bankCardNumberExample.value, - cardType=cardTypeExample.value, - nameOnCard=nameOnCardExample.value, - issueNumber=issueNumberExample.value, - serialNumber=serialNumberExample.value, - validFrom=new Date(), - expires=new Date(), - enabled=true, - cancelled=true, - onHotList=true, - technology="string", - networks=List("string"), - allows=List(com.openbankproject.commons.model.CardAction.DEBIT), - account= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=bankAccountNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=accountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value), - replacement=Some( CardReplacementInfo(requestedDate=new Date(), - reasonRequested=com.openbankproject.commons.model.CardReplacementReason.FIRST)), - pinResets=List( PinResetInfo(requestedDate=new Date(), - reasonRequested=com.openbankproject.commons.model.PinResetReason.FORGOT)), - collected=Some(CardCollectionInfo(new Date())), - posted=Some(CardPostedInfo(new Date())), - customerId=customerIdExample.value))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - // stored procedure name: get_physical_cards_for_bank_legacy - override def getPhysicalCardsForBankLegacy(bank: Bank, user: User, queryParams: List[OBPQueryParam]): Box[List[PhysicalCard]] = { - import com.openbankproject.commons.dto.{OutBoundGetPhysicalCardsForBankLegacy => OutBound, InBoundGetPhysicalCardsForBankLegacy => InBound} - val procedureName = "get_physical_cards_for_bank_legacy" - val callContext: Option[CallContext] = None - val req = OutBound(bank, user, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) - val result: OBPReturnType[Box[List[PhysicalCard]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result - } - - messageDocs += getPhysicalCardsForBankDoc51 - private def getPhysicalCardsForBankDoc51 = MessageDoc( + + messageDocs += getPhysicalCardsForBankDoc + def getPhysicalCardsForBankDoc = MessageDoc( process = "obp.getPhysicalCardsForBank", messageFormat = messageFormat, - description = """ - |Get Physical Cards For Bank - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_physical_cards_for_bank - """.stripMargin, + description = "Get Physical Cards For Bank", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetPhysicalCardsForBank(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetPhysicalCardsForBank(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bank= BankCommons(bankId=BankId(bankIdExample.value), shortName=bankShortNameExample.value, fullName=bankFullNameExample.value, @@ -3435,15 +1697,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { toDate="string") ), exampleInboundMessage = ( - InBoundGetPhysicalCardsForBank(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetPhysicalCardsForBank(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( PhysicalCard(cardId=cardIdExample.value, bankId=bankIdExample.value, bankCardNumber=bankCardNumberExample.value, @@ -3487,55 +1742,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_physical_cards_for_bank + override def getPhysicalCardsForBank(bank: Bank, user: User, queryParams: List[OBPQueryParam], callContext: Option[CallContext]): OBPReturnType[Box[List[PhysicalCard]]] = { - import com.openbankproject.commons.dto.{OutBoundGetPhysicalCardsForBank => OutBound, InBoundGetPhysicalCardsForBank => InBound} - val procedureName = "get_physical_cards_for_bank" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bank, user, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) - val result: OBPReturnType[Box[List[PhysicalCard]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetPhysicalCardsForBank => InBound, OutBoundGetPhysicalCardsForBank => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bank, user, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_physical_cards_for_bank", req, callContext) + response.map(convertToTuple[List[PhysicalCard]](callContext)) } - - messageDocs += createPhysicalCardLegacyDoc40 - private def createPhysicalCardLegacyDoc40 = MessageDoc( + + messageDocs += createPhysicalCardLegacyDoc + def createPhysicalCardLegacyDoc = MessageDoc( process = "obp.createPhysicalCardLegacy", messageFormat = messageFormat, - description = """ - |Create Physical Card Legacy - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_physical_card_legacy - """.stripMargin, + description = "Create Physical Card Legacy", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreatePhysicalCardLegacy(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreatePhysicalCardLegacy(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankCardNumber=bankCardNumberExample.value, nameOnCard=nameOnCardExample.value, cardType=cardTypeExample.value, @@ -3560,15 +1783,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { customerId=customerIdExample.value) ), exampleInboundMessage = ( - InBoundCreatePhysicalCardLegacy(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreatePhysicalCardLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= PhysicalCard(cardId=cardIdExample.value, bankId=bankIdExample.value, bankCardNumber=bankCardNumberExample.value, @@ -3612,55 +1828,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_physical_card_legacy + override def createPhysicalCardLegacy(bankCardNumber: String, nameOnCard: String, cardType: String, issueNumber: String, serialNumber: String, validFrom: Date, expires: Date, enabled: Boolean, cancelled: Boolean, onHotList: Boolean, technology: String, networks: List[String], allows: List[String], accountId: String, bankId: String, replacement: Option[CardReplacementInfo], pinResets: List[PinResetInfo], collected: Option[CardCollectionInfo], posted: Option[CardPostedInfo], customerId: String, callContext: Option[CallContext]): Box[PhysicalCard] = { - import com.openbankproject.commons.dto.{OutBoundCreatePhysicalCardLegacy => OutBound, InBoundCreatePhysicalCardLegacy => InBound} - val procedureName = "create_physical_card_legacy" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankCardNumber, nameOnCard, cardType, issueNumber, serialNumber, validFrom, expires, enabled, cancelled, onHotList, technology, networks, allows, accountId, bankId, replacement, pinResets, collected, posted, customerId) - val result: OBPReturnType[Box[PhysicalCard]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCreatePhysicalCardLegacy => InBound, OutBoundCreatePhysicalCardLegacy => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankCardNumber, nameOnCard, cardType, issueNumber, serialNumber, validFrom, expires, enabled, cancelled, onHotList, technology, networks, allows, accountId, bankId, replacement, pinResets, collected, posted, customerId) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_physical_card_legacy", req, callContext) + response.map(convertToTuple[PhysicalCard](callContext)) } - - messageDocs += createPhysicalCardDoc79 - private def createPhysicalCardDoc79 = MessageDoc( + + messageDocs += createPhysicalCardDoc + def createPhysicalCardDoc = MessageDoc( process = "obp.createPhysicalCard", messageFormat = messageFormat, - description = """ - |Create Physical Card - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_physical_card - """.stripMargin, + description = "Create Physical Card", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreatePhysicalCard(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreatePhysicalCard(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankCardNumber=bankCardNumberExample.value, nameOnCard=nameOnCardExample.value, cardType=cardTypeExample.value, @@ -3685,15 +1869,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { customerId=customerIdExample.value) ), exampleInboundMessage = ( - InBoundCreatePhysicalCard(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreatePhysicalCard(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= PhysicalCard(cardId=cardIdExample.value, bankId=bankIdExample.value, bankCardNumber=bankCardNumberExample.value, @@ -3737,55 +1914,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_physical_card + override def createPhysicalCard(bankCardNumber: String, nameOnCard: String, cardType: String, issueNumber: String, serialNumber: String, validFrom: Date, expires: Date, enabled: Boolean, cancelled: Boolean, onHotList: Boolean, technology: String, networks: List[String], allows: List[String], accountId: String, bankId: String, replacement: Option[CardReplacementInfo], pinResets: List[PinResetInfo], collected: Option[CardCollectionInfo], posted: Option[CardPostedInfo], customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[PhysicalCard]] = { - import com.openbankproject.commons.dto.{OutBoundCreatePhysicalCard => OutBound, InBoundCreatePhysicalCard => InBound} - val procedureName = "create_physical_card" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankCardNumber, nameOnCard, cardType, issueNumber, serialNumber, validFrom, expires, enabled, cancelled, onHotList, technology, networks, allows, accountId, bankId, replacement, pinResets, collected, posted, customerId) - val result: OBPReturnType[Box[PhysicalCard]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCreatePhysicalCard => InBound, OutBoundCreatePhysicalCard => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankCardNumber, nameOnCard, cardType, issueNumber, serialNumber, validFrom, expires, enabled, cancelled, onHotList, technology, networks, allows, accountId, bankId, replacement, pinResets, collected, posted, customerId) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_physical_card", req, callContext) + response.map(convertToTuple[PhysicalCard](callContext)) } - - messageDocs += updatePhysicalCardDoc7 - private def updatePhysicalCardDoc7 = MessageDoc( + + messageDocs += updatePhysicalCardDoc + def updatePhysicalCardDoc = MessageDoc( process = "obp.updatePhysicalCard", messageFormat = messageFormat, - description = """ - |Update Physical Card - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: update_physical_card - """.stripMargin, + description = "Update Physical Card", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundUpdatePhysicalCard(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundUpdatePhysicalCard(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, cardId=cardIdExample.value, bankCardNumber=bankCardNumberExample.value, nameOnCard=nameOnCardExample.value, @@ -3811,15 +1956,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { customerId=customerIdExample.value) ), exampleInboundMessage = ( - InBoundUpdatePhysicalCard(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundUpdatePhysicalCard(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= PhysicalCard(cardId=cardIdExample.value, bankId=bankIdExample.value, bankCardNumber=bankCardNumberExample.value, @@ -3863,183 +2001,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: update_physical_card + override def updatePhysicalCard(cardId: String, bankCardNumber: String, nameOnCard: String, cardType: String, issueNumber: String, serialNumber: String, validFrom: Date, expires: Date, enabled: Boolean, cancelled: Boolean, onHotList: Boolean, technology: String, networks: List[String], allows: List[String], accountId: String, bankId: String, replacement: Option[CardReplacementInfo], pinResets: List[PinResetInfo], collected: Option[CardCollectionInfo], posted: Option[CardPostedInfo], customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[PhysicalCardTrait]] = { - import com.openbankproject.commons.dto.{OutBoundUpdatePhysicalCard => OutBound, InBoundUpdatePhysicalCard => InBound} - val procedureName = "update_physical_card" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , cardId, bankCardNumber, nameOnCard, cardType, issueNumber, serialNumber, validFrom, expires, enabled, cancelled, onHotList, technology, networks, allows, accountId, bankId, replacement, pinResets, collected, posted, customerId) - val result: OBPReturnType[Box[PhysicalCard]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundUpdatePhysicalCard => InBound, OutBoundUpdatePhysicalCard => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, cardId, bankCardNumber, nameOnCard, cardType, issueNumber, serialNumber, validFrom, expires, enabled, cancelled, onHotList, technology, networks, allows, accountId, bankId, replacement, pinResets, collected, posted, customerId) + val response: Future[Box[InBound]] = sendRequest[InBound]("update_physical_card", req, callContext) + response.map(convertToTuple[PhysicalCard](callContext)) } - - messageDocs += makePaymentDoc71 - private def makePaymentDoc71 = MessageDoc( - process = "obp.makePayment", - messageFormat = messageFormat, - description = """ - |Make Payment - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: make_payment - """.stripMargin, - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundMakePayment( - initiator= UserCommons(userPrimaryKey=UserPrimaryKey(123), - userId=userIdExample.value, - idGivenByProvider="string", - provider="string", - emailAddress=emailExample.value, - name=usernameExample.value), - fromAccountUID= BankIdAccountId(bankId=BankId(bankIdExample.value), - accountId=AccountId(accountIdExample.value)), - toAccountUID= BankIdAccountId(bankId=BankId(bankIdExample.value), - accountId=AccountId(accountIdExample.value)), - amt=BigDecimal("123.321"), - description="string", - transactionRequestType=TransactionRequestType(transactionRequestTypeExample.value)) - ), - exampleInboundMessage = ( - InBoundMakePayment( - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), - data=TransactionId(transactionIdExample.value)) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - // stored procedure name: make_payment - override def makePayment(initiator: User, fromAccountUID: BankIdAccountId, toAccountUID: BankIdAccountId, amt: BigDecimal, description: String, transactionRequestType: TransactionRequestType): Box[TransactionId] = { - import com.openbankproject.commons.dto.{OutBoundMakePayment => OutBound, InBoundMakePayment => InBound} - val procedureName = "make_payment" - val callContext: Option[CallContext] = None - val req = OutBound(initiator, fromAccountUID, toAccountUID, amt, description, transactionRequestType) - val result: OBPReturnType[Box[TransactionId]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result - } - - messageDocs += makePaymentv200Doc60 - private def makePaymentv200Doc60 = MessageDoc( - process = "obp.makePaymentv200", - messageFormat = messageFormat, - description = """ - |Make Paymentv200 - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: make_paymentv200 - """.stripMargin, - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundMakePaymentv200( - fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=bankAccountNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=bankAccountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value), - toAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=bankAccountNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=bankAccountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value), - transactionRequestCommonBody= TransactionRequestCommonBodyJSONCommons(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string"), - amount=BigDecimal("123.321"), - description="string", - transactionRequestType=TransactionRequestType(transactionRequestTypeExample.value), - chargePolicy="string") - ), - exampleInboundMessage = ( - InBoundMakePaymentv200( - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), - data=TransactionId(transactionIdExample.value)) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - // stored procedure name: make_paymentv200 - override def makePaymentv200(fromAccount: BankAccount, toAccount: BankAccount, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, amount: BigDecimal, description: String, transactionRequestType: TransactionRequestType, chargePolicy: String): Box[TransactionId] = { - import com.openbankproject.commons.dto.{OutBoundMakePaymentv200 => OutBound, InBoundMakePaymentv200 => InBound} - val procedureName = "make_paymentv200" - val callContext: Option[CallContext] = None - val req = OutBound(fromAccount, toAccount, transactionRequestCommonBody, amount, description, transactionRequestType, chargePolicy) - val result: OBPReturnType[Box[TransactionId]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result - } - - messageDocs += makePaymentv210Doc26 - private def makePaymentv210Doc26 = MessageDoc( + + messageDocs += makePaymentv210Doc + def makePaymentv210Doc = MessageDoc( process = "obp.makePaymentv210", messageFormat = messageFormat, - description = """ - |Make Paymentv210 - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: make_paymentv210 - """.stripMargin, + description = "Make Paymentv210", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundMakePaymentv210(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundMakePaymentv210(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), accountType=accountTypeExample.value, balance=BigDecimal(balanceAmountExample.value), @@ -4085,445 +2063,29 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { chargePolicy="string") ), exampleInboundMessage = ( - InBoundMakePaymentv210(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundMakePaymentv210(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=TransactionId(transactionIdExample.value)) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: make_paymentv210 + override def makePaymentv210(fromAccount: BankAccount, toAccount: BankAccount, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, amount: BigDecimal, description: String, transactionRequestType: TransactionRequestType, chargePolicy: String, callContext: Option[CallContext]): OBPReturnType[Box[TransactionId]] = { - import com.openbankproject.commons.dto.{OutBoundMakePaymentv210 => OutBound, InBoundMakePaymentv210 => InBound} - val procedureName = "make_paymentv210" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , fromAccount, toAccount, transactionRequestCommonBody, amount, description, transactionRequestType, chargePolicy) - val result: OBPReturnType[Box[TransactionId]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundMakePaymentv210 => InBound, OutBoundMakePaymentv210 => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, fromAccount, toAccount, transactionRequestCommonBody, amount, description, transactionRequestType, chargePolicy) + val response: Future[Box[InBound]] = sendRequest[InBound]("make_paymentv210", req, callContext) + response.map(convertToTuple[TransactionId](callContext)) } - - messageDocs += makePaymentImplDoc4 - private def makePaymentImplDoc4 = MessageDoc( - process = "obp.makePaymentImpl", - messageFormat = messageFormat, - description = """ - |Make Payment Impl - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: make_payment_impl - """.stripMargin, - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundMakePaymentImpl( - fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=bankAccountNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=bankAccountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value), - toAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=bankAccountNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=bankAccountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value), - transactionRequestCommonBody= TransactionRequestCommonBodyJSONCommons(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string"), - amt=BigDecimal("123.321"), - description="string", - transactionRequestType=TransactionRequestType(transactionRequestTypeExample.value), - chargePolicy="string") - ), - exampleInboundMessage = ( - InBoundMakePaymentImpl( - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), - data=TransactionId(transactionIdExample.value)) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - // stored procedure name: make_payment_impl - override def makePaymentImpl(fromAccount: BankAccount, toAccount: BankAccount, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, amt: BigDecimal, description: String, transactionRequestType: TransactionRequestType, chargePolicy: String): Box[TransactionId] = { - import com.openbankproject.commons.dto.{OutBoundMakePaymentImpl => OutBound, InBoundMakePaymentImpl => InBound} - val procedureName = "make_payment_impl" - val callContext: Option[CallContext] = None - val req = OutBound(fromAccount, toAccount, transactionRequestCommonBody, amt, description, transactionRequestType, chargePolicy) - val result: OBPReturnType[Box[TransactionId]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result - } - - messageDocs += createTransactionRequestDoc23 - private def createTransactionRequestDoc23 = MessageDoc( - process = "obp.createTransactionRequest", - messageFormat = messageFormat, - description = """ - |Create Transaction Request - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_transaction_request - """.stripMargin, - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundCreateTransactionRequest( - initiator= UserCommons(userPrimaryKey=UserPrimaryKey(123), - userId=userIdExample.value, - idGivenByProvider="string", - provider="string", - emailAddress=emailExample.value, - name=usernameExample.value), - fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=bankAccountNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=bankAccountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value), - toAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=bankAccountNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=bankAccountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value), - transactionRequestType=TransactionRequestType(transactionRequestTypeExample.value), - body= TransactionRequestBody(to= TransactionRequestAccount(bank_id="string", - account_id="string"), - value= AmountOfMoney(currency=currencyExample.value, - amount="string"), - description="string")) - ), - exampleInboundMessage = ( - InBoundCreateTransactionRequest( - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), - data= TransactionRequest(id=TransactionRequestId("string"), - `type`=transactionRequestTypeExample.value, - from= TransactionRequestAccount(bank_id="string", - account_id="string"), - body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id="string", - account_id="string")), - to_sepa=Some(TransactionRequestIban("string")), - to_counterparty=Some(TransactionRequestCounterpartyId("string")), - to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - message="string", - from= FromAccountTransfer(mobile_phone_number="string", - nickname="string"), - to=ToAccountTransferToPhone("string"))), - to_transfer_to_atm=Some( TransactionRequestTransferToAtm(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - message="string", - from= FromAccountTransfer(mobile_phone_number="string", - nickname="string"), - to= ToAccountTransferToAtm(legal_name="string", - date_of_birth="string", - mobile_phone_number="string", - kyc_document= ToAccountTransferToAtmKycDocument(`type`="string", - number="string")))), - to_transfer_to_account=Some( TransactionRequestTransferToAccount(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - transfer_type="string", - future_date="string", - to= ToAccountTransferToAccount(name="string", - bank_code="string", - branch_number="string", - account= ToAccountTransferToAccountAccount(number=accountNumberExample.value, - iban=ibanExample.value)))), - to_sepa_credit_transfers=Some( SepaCreditTransfers(debtorAccount=PaymentAccount("string"), - instructedAmount= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - creditorAccount=PaymentAccount("string"), - creditorName="string")), - value= AmountOfMoney(currency=currencyExample.value, - amount="string"), - description="string"), - transaction_ids="string", - status="string", - start_date=new Date(), - end_date=new Date(), - challenge= TransactionRequestChallenge(id="string", - allowed_attempts=123, - challenge_type="string"), - charge= TransactionRequestCharge(summary="string", - value= AmountOfMoney(currency=currencyExample.value, - amount="string")), - charge_policy="string", - counterparty_id=CounterpartyId(counterpartyIdExample.value), - name="string", - this_bank_id=BankId(bankIdExample.value), - this_account_id=AccountId(accountIdExample.value), - this_view_id=ViewId(viewIdExample.value), - other_account_routing_scheme="string", - other_account_routing_address="string", - other_bank_routing_scheme="string", - other_bank_routing_address="string", - is_beneficiary=true, - future_date=Some("string"))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - // stored procedure name: create_transaction_request - override def createTransactionRequest(initiator: User, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, body: TransactionRequestBody): Box[TransactionRequest] = { - import com.openbankproject.commons.dto.{OutBoundCreateTransactionRequest => OutBound, InBoundCreateTransactionRequest => InBound} - val procedureName = "create_transaction_request" - val callContext: Option[CallContext] = None - val req = OutBound(initiator, fromAccount, toAccount, transactionRequestType, body) - val result: OBPReturnType[Box[TransactionRequest]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result - } - - messageDocs += createTransactionRequestv200Doc10 - private def createTransactionRequestv200Doc10 = MessageDoc( - process = "obp.createTransactionRequestv200", - messageFormat = messageFormat, - description = """ - |Create Transaction Requestv200 - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_transaction_requestv200 - """.stripMargin, - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundCreateTransactionRequestv200( - initiator= UserCommons(userPrimaryKey=UserPrimaryKey(123), - userId=userIdExample.value, - idGivenByProvider="string", - provider="string", - emailAddress=emailExample.value, - name=usernameExample.value), - fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=bankAccountNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=bankAccountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value), - toAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=bankAccountNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=bankAccountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value), - transactionRequestType=TransactionRequestType(transactionRequestTypeExample.value), - body= TransactionRequestBody(to= TransactionRequestAccount(bank_id="string", - account_id="string"), - value= AmountOfMoney(currency=currencyExample.value, - amount="string"), - description="string")) - ), - exampleInboundMessage = ( - InBoundCreateTransactionRequestv200( - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), - data= TransactionRequest(id=TransactionRequestId("string"), - `type`=transactionRequestTypeExample.value, - from= TransactionRequestAccount(bank_id="string", - account_id="string"), - body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id="string", - account_id="string")), - to_sepa=Some(TransactionRequestIban("string")), - to_counterparty=Some(TransactionRequestCounterpartyId("string")), - to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - message="string", - from= FromAccountTransfer(mobile_phone_number="string", - nickname="string"), - to=ToAccountTransferToPhone("string"))), - to_transfer_to_atm=Some( TransactionRequestTransferToAtm(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - message="string", - from= FromAccountTransfer(mobile_phone_number="string", - nickname="string"), - to= ToAccountTransferToAtm(legal_name="string", - date_of_birth="string", - mobile_phone_number="string", - kyc_document= ToAccountTransferToAtmKycDocument(`type`="string", - number="string")))), - to_transfer_to_account=Some( TransactionRequestTransferToAccount(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - transfer_type="string", - future_date="string", - to= ToAccountTransferToAccount(name="string", - bank_code="string", - branch_number="string", - account= ToAccountTransferToAccountAccount(number=accountNumberExample.value, - iban=ibanExample.value)))), - to_sepa_credit_transfers=Some( SepaCreditTransfers(debtorAccount=PaymentAccount("string"), - instructedAmount= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - creditorAccount=PaymentAccount("string"), - creditorName="string")), - value= AmountOfMoney(currency=currencyExample.value, - amount="string"), - description="string"), - transaction_ids="string", - status="string", - start_date=new Date(), - end_date=new Date(), - challenge= TransactionRequestChallenge(id="string", - allowed_attempts=123, - challenge_type="string"), - charge= TransactionRequestCharge(summary="string", - value= AmountOfMoney(currency=currencyExample.value, - amount="string")), - charge_policy="string", - counterparty_id=CounterpartyId(counterpartyIdExample.value), - name="string", - this_bank_id=BankId(bankIdExample.value), - this_account_id=AccountId(accountIdExample.value), - this_view_id=ViewId(viewIdExample.value), - other_account_routing_scheme="string", - other_account_routing_address="string", - other_bank_routing_scheme="string", - other_bank_routing_address="string", - is_beneficiary=true, - future_date=Some("string"))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - // stored procedure name: create_transaction_requestv200 - override def createTransactionRequestv200(initiator: User, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, body: TransactionRequestBody): Box[TransactionRequest] = { - import com.openbankproject.commons.dto.{OutBoundCreateTransactionRequestv200 => OutBound, InBoundCreateTransactionRequestv200 => InBound} - val procedureName = "create_transaction_requestv200" - val callContext: Option[CallContext] = None - val req = OutBound(initiator, fromAccount, toAccount, transactionRequestType, body) - val result: OBPReturnType[Box[TransactionRequest]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result - } - - messageDocs += createTransactionRequestv210Doc79 - private def createTransactionRequestv210Doc79 = MessageDoc( + + messageDocs += createTransactionRequestv210Doc + def createTransactionRequestv210Doc = MessageDoc( process = "obp.createTransactionRequestv210", messageFormat = messageFormat, - description = """ - |Create Transaction Requestv210 - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_transaction_requestv210 - """.stripMargin, + description = "Create Transaction Requestv210", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateTransactionRequestv210(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateTransactionRequestv210(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, initiator= UserCommons(userPrimaryKey=UserPrimaryKey(123), userId=userIdExample.value, idGivenByProvider="string", @@ -4577,15 +2139,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { scaMethod=Some(com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SMS)) ), exampleInboundMessage = ( - InBoundCreateTransactionRequestv210(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreateTransactionRequestv210(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= TransactionRequest(id=TransactionRequestId("string"), `type`=transactionRequestTypeExample.value, from= TransactionRequestAccount(bank_id="string", @@ -4655,180 +2210,30 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_transaction_requestv210 - override def createTransactionRequestv210(initiator: User, viewId: ViewId, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, detailsPlain: String, chargePolicy: String, challengeType: Option[String], scaMethod: Option[SCA], callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = { - import com.openbankproject.commons.dto.{OutBoundCreateTransactionRequestv210 => OutBound, InBoundCreateTransactionRequestv210 => InBound} - val procedureName = "create_transaction_requestv210" - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , initiator, viewId, fromAccount, toAccount, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy, challengeType, scaMethod) - val result: OBPReturnType[Box[TransactionRequest]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + override def createTransactionRequestv210(initiator: User, viewId: ViewId, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, detailsPlain: String, chargePolicy: String, challengeType: Option[String], scaMethod: Option[StrongCustomerAuthentication.SCA], callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = { + import com.openbankproject.commons.dto.{InBoundCreateTransactionRequestv210 => InBound, OutBoundCreateTransactionRequestv210 => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, viewId, fromAccount, toAccount, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy, challengeType, scaMethod) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_transaction_requestv210", req, callContext) + response.map(convertToTuple[TransactionRequest](callContext)) } - - messageDocs += createTransactionRequestImplDoc78 - private def createTransactionRequestImplDoc78 = MessageDoc( - process = "obp.createTransactionRequestImpl", + + messageDocs += createTransactionRequestv400Doc + def createTransactionRequestv400Doc = MessageDoc( + process = "obp.createTransactionRequestv400", messageFormat = messageFormat, - description = """ - |Create Transaction Request Impl - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_transaction_request_impl - """.stripMargin, + description = "Create Transaction Requestv400", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateTransactionRequestImpl( - transactionRequestId=TransactionRequestId("string"), - transactionRequestType=TransactionRequestType(transactionRequestTypeExample.value), - fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=bankAccountNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=bankAccountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value), - counterparty= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=counterpartyNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=bankAccountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value), - body= TransactionRequestBody(to= TransactionRequestAccount(bank_id="string", - account_id="string"), - value= AmountOfMoney(currency=currencyExample.value, - amount="string"), - description="string"), - status="string", - charge= TransactionRequestCharge(summary="string", - value= AmountOfMoney(currency=currencyExample.value, - amount="string"))) - ), - exampleInboundMessage = ( - InBoundCreateTransactionRequestImpl( - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), - data= TransactionRequest(id=TransactionRequestId("string"), - `type`=transactionRequestTypeExample.value, - from= TransactionRequestAccount(bank_id="string", - account_id="string"), - body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id="string", - account_id="string")), - to_sepa=Some(TransactionRequestIban("string")), - to_counterparty=Some(TransactionRequestCounterpartyId("string")), - to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - message="string", - from= FromAccountTransfer(mobile_phone_number="string", - nickname="string"), - to=ToAccountTransferToPhone("string"))), - to_transfer_to_atm=Some( TransactionRequestTransferToAtm(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - message="string", - from= FromAccountTransfer(mobile_phone_number="string", - nickname="string"), - to= ToAccountTransferToAtm(legal_name="string", - date_of_birth="string", - mobile_phone_number="string", - kyc_document= ToAccountTransferToAtmKycDocument(`type`="string", - number="string")))), - to_transfer_to_account=Some( TransactionRequestTransferToAccount(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - transfer_type="string", - future_date="string", - to= ToAccountTransferToAccount(name="string", - bank_code="string", - branch_number="string", - account= ToAccountTransferToAccountAccount(number=accountNumberExample.value, - iban=ibanExample.value)))), - to_sepa_credit_transfers=Some( SepaCreditTransfers(debtorAccount=PaymentAccount("string"), - instructedAmount= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - creditorAccount=PaymentAccount("string"), - creditorName="string")), - value= AmountOfMoney(currency=currencyExample.value, - amount="string"), - description="string"), - transaction_ids="string", - status="string", - start_date=new Date(), - end_date=new Date(), - challenge= TransactionRequestChallenge(id="string", - allowed_attempts=123, - challenge_type="string"), - charge= TransactionRequestCharge(summary="string", - value= AmountOfMoney(currency=currencyExample.value, - amount="string")), - charge_policy="string", - counterparty_id=CounterpartyId(counterpartyIdExample.value), - name="string", - this_bank_id=BankId(bankIdExample.value), - this_account_id=AccountId(accountIdExample.value), - this_view_id=ViewId(viewIdExample.value), - other_account_routing_scheme="string", - other_account_routing_address="string", - other_bank_routing_scheme="string", - other_bank_routing_address="string", - is_beneficiary=true, - future_date=Some("string"))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - // stored procedure name: create_transaction_request_impl - override def createTransactionRequestImpl(transactionRequestId: TransactionRequestId, transactionRequestType: TransactionRequestType, fromAccount: BankAccount, counterparty: BankAccount, body: TransactionRequestBody, status: String, charge: TransactionRequestCharge): Box[TransactionRequest] = { - import com.openbankproject.commons.dto.{OutBoundCreateTransactionRequestImpl => OutBound, InBoundCreateTransactionRequestImpl => InBound} - val procedureName = "create_transaction_request_impl" - val callContext: Option[CallContext] = None - val req = OutBound(transactionRequestId, transactionRequestType, fromAccount, counterparty, body, status, charge) - val result: OBPReturnType[Box[TransactionRequest]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result - } - - messageDocs += createTransactionRequestImpl210Doc24 - private def createTransactionRequestImpl210Doc24 = MessageDoc( - process = "obp.createTransactionRequestImpl210", - messageFormat = messageFormat, - description = """ - |Create Transaction Request Impl210 - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_transaction_request_impl210 - """.stripMargin, - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundCreateTransactionRequestImpl210( - transactionRequestId=TransactionRequestId("string"), - transactionRequestType=TransactionRequestType(transactionRequestTypeExample.value), + OutBoundCreateTransactionRequestv400(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + initiator= UserCommons(userPrimaryKey=UserPrimaryKey(123), + userId=userIdExample.value, + idGivenByProvider="string", + provider="string", + emailAddress=emailExample.value, + name=usernameExample.value), + viewId=ViewId(viewIdExample.value), fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), accountType=accountTypeExample.value, balance=BigDecimal(balanceAmountExample.value), @@ -4865,23 +2270,18 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, value=accountRuleValueExample.value)), accountHolder=bankAccountAccountHolderExample.value), + transactionRequestType=TransactionRequestType(transactionRequestTypeExample.value), transactionRequestCommonBody= TransactionRequestCommonBodyJSONCommons(value= AmountOfMoneyJsonV121(currency=currencyExample.value, amount="string"), description="string"), - details="string", - status="string", - charge= TransactionRequestCharge(summary="string", - value= AmountOfMoney(currency=currencyExample.value, - amount="string")), - chargePolicy="string") + detailsPlain="string", + chargePolicy="string", + challengeType=Some("string"), + scaMethod=Some(com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SMS)) ), exampleInboundMessage = ( - InBoundCreateTransactionRequestImpl210( - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreateTransactionRequestv400(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= TransactionRequest(id=TransactionRequestId("string"), `type`=transactionRequestTypeExample.value, from= TransactionRequestAccount(bank_id="string", @@ -4951,180 +2351,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_transaction_request_impl210 - override def createTransactionRequestImpl210(transactionRequestId: TransactionRequestId, transactionRequestType: TransactionRequestType, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, details: String, status: String, charge: TransactionRequestCharge, chargePolicy: String): Box[TransactionRequest] = { - import com.openbankproject.commons.dto.{OutBoundCreateTransactionRequestImpl210 => OutBound, InBoundCreateTransactionRequestImpl210 => InBound} - val procedureName = "create_transaction_request_impl210" - val callContext: Option[CallContext] = None - val req = OutBound(transactionRequestId, transactionRequestType, fromAccount, toAccount, transactionRequestCommonBody, details, status, charge, chargePolicy) - val result: OBPReturnType[Box[TransactionRequest]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result - } - messageDocs += getTransactionRequestsDoc43 - private def getTransactionRequestsDoc43 = MessageDoc( - process = "obp.getTransactionRequests", - messageFormat = messageFormat, - description = """ - |Get Transaction Requests - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_transaction_requests - """.stripMargin, - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundGetTransactionRequests( - initiator= UserCommons(userPrimaryKey=UserPrimaryKey(123), - userId=userIdExample.value, - idGivenByProvider="string", - provider="string", - emailAddress=emailExample.value, - name=usernameExample.value), - fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=bankAccountNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=bankAccountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value)) - ), - exampleInboundMessage = ( - InBoundGetTransactionRequests( - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), - data=List( TransactionRequest(id=TransactionRequestId("string"), - `type`=transactionRequestTypeExample.value, - from= TransactionRequestAccount(bank_id="string", - account_id="string"), - body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id="string", - account_id="string")), - to_sepa=Some(TransactionRequestIban("string")), - to_counterparty=Some(TransactionRequestCounterpartyId("string")), - to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - message="string", - from= FromAccountTransfer(mobile_phone_number="string", - nickname="string"), - to=ToAccountTransferToPhone("string"))), - to_transfer_to_atm=Some( TransactionRequestTransferToAtm(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - message="string", - from= FromAccountTransfer(mobile_phone_number="string", - nickname="string"), - to= ToAccountTransferToAtm(legal_name="string", - date_of_birth="string", - mobile_phone_number="string", - kyc_document= ToAccountTransferToAtmKycDocument(`type`="string", - number="string")))), - to_transfer_to_account=Some( TransactionRequestTransferToAccount(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - transfer_type="string", - future_date="string", - to= ToAccountTransferToAccount(name="string", - bank_code="string", - branch_number="string", - account= ToAccountTransferToAccountAccount(number=accountNumberExample.value, - iban=ibanExample.value)))), - to_sepa_credit_transfers=Some( SepaCreditTransfers(debtorAccount=PaymentAccount("string"), - instructedAmount= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - creditorAccount=PaymentAccount("string"), - creditorName="string")), - value= AmountOfMoney(currency=currencyExample.value, - amount="string"), - description="string"), - transaction_ids="string", - status="string", - start_date=new Date(), - end_date=new Date(), - challenge= TransactionRequestChallenge(id="string", - allowed_attempts=123, - challenge_type="string"), - charge= TransactionRequestCharge(summary="string", - value= AmountOfMoney(currency=currencyExample.value, - amount="string")), - charge_policy="string", - counterparty_id=CounterpartyId(counterpartyIdExample.value), - name="string", - this_bank_id=BankId(bankIdExample.value), - this_account_id=AccountId(accountIdExample.value), - this_view_id=ViewId(viewIdExample.value), - other_account_routing_scheme="string", - other_account_routing_address="string", - other_bank_routing_scheme="string", - other_bank_routing_address="string", - is_beneficiary=true, - future_date=Some("string")))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - // stored procedure name: get_transaction_requests - override def getTransactionRequests(initiator: User, fromAccount: BankAccount): Box[List[TransactionRequest]] = { - import com.openbankproject.commons.dto.{OutBoundGetTransactionRequests => OutBound, InBoundGetTransactionRequests => InBound} - val procedureName = "get_transaction_requests" - val callContext: Option[CallContext] = None - val req = OutBound(initiator, fromAccount) - val result: OBPReturnType[Box[List[TransactionRequest]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + override def createTransactionRequestv400(initiator: User, viewId: ViewId, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, detailsPlain: String, chargePolicy: String, challengeType: Option[String], scaMethod: Option[StrongCustomerAuthentication.SCA], callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = { + import com.openbankproject.commons.dto.{InBoundCreateTransactionRequestv400 => InBound, OutBoundCreateTransactionRequestv400 => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, viewId, fromAccount, toAccount, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy, challengeType, scaMethod) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_transaction_requestv400", req, callContext) + response.map(convertToTuple[TransactionRequest](callContext)) } - - messageDocs += getTransactionRequests210Doc26 - private def getTransactionRequests210Doc26 = MessageDoc( + + messageDocs += getTransactionRequests210Doc + def getTransactionRequests210Doc = MessageDoc( process = "obp.getTransactionRequests210", messageFormat = messageFormat, - description = """ - |Get Transaction Requests210 - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_transaction_requests210 - """.stripMargin, + description = "Get Transaction Requests210", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetTransactionRequests210(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetTransactionRequests210(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, initiator= UserCommons(userPrimaryKey=UserPrimaryKey(123), userId=userIdExample.value, idGivenByProvider="string", @@ -5151,15 +2394,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { accountHolder=bankAccountAccountHolderExample.value)) ), exampleInboundMessage = ( - InBoundGetTransactionRequests210(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetTransactionRequests210(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( TransactionRequest(id=TransactionRequestId("string"), `type`=transactionRequestTypeExample.value, from= TransactionRequestAccount(bank_id="string", @@ -5229,305 +2465,28 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_transaction_requests210 + override def getTransactionRequests210(initiator: User, fromAccount: BankAccount, callContext: Option[CallContext]): Box[(List[TransactionRequest], Option[CallContext])] = { - import com.openbankproject.commons.dto.{OutBoundGetTransactionRequests210 => OutBound, InBoundGetTransactionRequests210 => InBound} - val procedureName = "get_transaction_requests210" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , initiator, fromAccount) - val result: OBPReturnType[Box[List[TransactionRequest]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetTransactionRequests210 => InBound, OutBoundGetTransactionRequests210 => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, fromAccount) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_transaction_requests210", req, callContext) + response.map(convertToTuple[List[TransactionRequest]](callContext)) } - - messageDocs += getTransactionRequestsImplDoc18 - private def getTransactionRequestsImplDoc18 = MessageDoc( - process = "obp.getTransactionRequestsImpl", - messageFormat = messageFormat, - description = """ - |Get Transaction Requests Impl - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_transaction_requests_impl - """.stripMargin, - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundGetTransactionRequestsImpl( - fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=bankAccountNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=bankAccountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value)) - ), - exampleInboundMessage = ( - InBoundGetTransactionRequestsImpl( - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), - data=List( TransactionRequest(id=TransactionRequestId("string"), - `type`=transactionRequestTypeExample.value, - from= TransactionRequestAccount(bank_id="string", - account_id="string"), - body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id="string", - account_id="string")), - to_sepa=Some(TransactionRequestIban("string")), - to_counterparty=Some(TransactionRequestCounterpartyId("string")), - to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - message="string", - from= FromAccountTransfer(mobile_phone_number="string", - nickname="string"), - to=ToAccountTransferToPhone("string"))), - to_transfer_to_atm=Some( TransactionRequestTransferToAtm(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - message="string", - from= FromAccountTransfer(mobile_phone_number="string", - nickname="string"), - to= ToAccountTransferToAtm(legal_name="string", - date_of_birth="string", - mobile_phone_number="string", - kyc_document= ToAccountTransferToAtmKycDocument(`type`="string", - number="string")))), - to_transfer_to_account=Some( TransactionRequestTransferToAccount(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - transfer_type="string", - future_date="string", - to= ToAccountTransferToAccount(name="string", - bank_code="string", - branch_number="string", - account= ToAccountTransferToAccountAccount(number=accountNumberExample.value, - iban=ibanExample.value)))), - to_sepa_credit_transfers=Some( SepaCreditTransfers(debtorAccount=PaymentAccount("string"), - instructedAmount= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - creditorAccount=PaymentAccount("string"), - creditorName="string")), - value= AmountOfMoney(currency=currencyExample.value, - amount="string"), - description="string"), - transaction_ids="string", - status="string", - start_date=new Date(), - end_date=new Date(), - challenge= TransactionRequestChallenge(id="string", - allowed_attempts=123, - challenge_type="string"), - charge= TransactionRequestCharge(summary="string", - value= AmountOfMoney(currency=currencyExample.value, - amount="string")), - charge_policy="string", - counterparty_id=CounterpartyId(counterpartyIdExample.value), - name="string", - this_bank_id=BankId(bankIdExample.value), - this_account_id=AccountId(accountIdExample.value), - this_view_id=ViewId(viewIdExample.value), - other_account_routing_scheme="string", - other_account_routing_address="string", - other_bank_routing_scheme="string", - other_bank_routing_address="string", - is_beneficiary=true, - future_date=Some("string")))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - // stored procedure name: get_transaction_requests_impl - override def getTransactionRequestsImpl(fromAccount: BankAccount): Box[List[TransactionRequest]] = { - import com.openbankproject.commons.dto.{OutBoundGetTransactionRequestsImpl => OutBound, InBoundGetTransactionRequestsImpl => InBound} - val procedureName = "get_transaction_requests_impl" - val callContext: Option[CallContext] = None - val req = OutBound(fromAccount) - val result: OBPReturnType[Box[List[TransactionRequest]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result - } - - messageDocs += getTransactionRequestsImpl210Doc81 - private def getTransactionRequestsImpl210Doc81 = MessageDoc( - process = "obp.getTransactionRequestsImpl210", - messageFormat = messageFormat, - description = """ - |Get Transaction Requests Impl210 - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_transaction_requests_impl210 - """.stripMargin, - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundGetTransactionRequestsImpl210( - fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=bankAccountNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=bankAccountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value)) - ), - exampleInboundMessage = ( - InBoundGetTransactionRequestsImpl210( - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), - data=List( TransactionRequest(id=TransactionRequestId("string"), - `type`=transactionRequestTypeExample.value, - from= TransactionRequestAccount(bank_id="string", - account_id="string"), - body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id="string", - account_id="string")), - to_sepa=Some(TransactionRequestIban("string")), - to_counterparty=Some(TransactionRequestCounterpartyId("string")), - to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - message="string", - from= FromAccountTransfer(mobile_phone_number="string", - nickname="string"), - to=ToAccountTransferToPhone("string"))), - to_transfer_to_atm=Some( TransactionRequestTransferToAtm(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - message="string", - from= FromAccountTransfer(mobile_phone_number="string", - nickname="string"), - to= ToAccountTransferToAtm(legal_name="string", - date_of_birth="string", - mobile_phone_number="string", - kyc_document= ToAccountTransferToAtmKycDocument(`type`="string", - number="string")))), - to_transfer_to_account=Some( TransactionRequestTransferToAccount(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - transfer_type="string", - future_date="string", - to= ToAccountTransferToAccount(name="string", - bank_code="string", - branch_number="string", - account= ToAccountTransferToAccountAccount(number=accountNumberExample.value, - iban=ibanExample.value)))), - to_sepa_credit_transfers=Some( SepaCreditTransfers(debtorAccount=PaymentAccount("string"), - instructedAmount= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - creditorAccount=PaymentAccount("string"), - creditorName="string")), - value= AmountOfMoney(currency=currencyExample.value, - amount="string"), - description="string"), - transaction_ids="string", - status="string", - start_date=new Date(), - end_date=new Date(), - challenge= TransactionRequestChallenge(id="string", - allowed_attempts=123, - challenge_type="string"), - charge= TransactionRequestCharge(summary="string", - value= AmountOfMoney(currency=currencyExample.value, - amount="string")), - charge_policy="string", - counterparty_id=CounterpartyId(counterpartyIdExample.value), - name="string", - this_bank_id=BankId(bankIdExample.value), - this_account_id=AccountId(accountIdExample.value), - this_view_id=ViewId(viewIdExample.value), - other_account_routing_scheme="string", - other_account_routing_address="string", - other_bank_routing_scheme="string", - other_bank_routing_address="string", - is_beneficiary=true, - future_date=Some("string")))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - // stored procedure name: get_transaction_requests_impl210 - override def getTransactionRequestsImpl210(fromAccount: BankAccount): Box[List[TransactionRequest]] = { - import com.openbankproject.commons.dto.{OutBoundGetTransactionRequestsImpl210 => OutBound, InBoundGetTransactionRequestsImpl210 => InBound} - val procedureName = "get_transaction_requests_impl210" - val callContext: Option[CallContext] = None - val req = OutBound(fromAccount) - val result: OBPReturnType[Box[List[TransactionRequest]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result - } - - messageDocs += getTransactionRequestImplDoc91 - private def getTransactionRequestImplDoc91 = MessageDoc( + + messageDocs += getTransactionRequestImplDoc + def getTransactionRequestImplDoc = MessageDoc( process = "obp.getTransactionRequestImpl", messageFormat = messageFormat, - description = """ - |Get Transaction Request Impl - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_transaction_request_impl - """.stripMargin, + description = "Get Transaction Request Impl", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetTransactionRequestImpl(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetTransactionRequestImpl(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, transactionRequestId=TransactionRequestId("string")) ), exampleInboundMessage = ( - InBoundGetTransactionRequestImpl(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetTransactionRequestImpl(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= TransactionRequest(id=TransactionRequestId("string"), `type`=transactionRequestTypeExample.value, from= TransactionRequestAccount(bank_id="string", @@ -5597,420 +2556,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_transaction_request_impl + override def getTransactionRequestImpl(transactionRequestId: TransactionRequestId, callContext: Option[CallContext]): Box[(TransactionRequest, Option[CallContext])] = { - import com.openbankproject.commons.dto.{OutBoundGetTransactionRequestImpl => OutBound, InBoundGetTransactionRequestImpl => InBound} - val procedureName = "get_transaction_request_impl" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , transactionRequestId) - val result: OBPReturnType[Box[TransactionRequest]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetTransactionRequestImpl => InBound, OutBoundGetTransactionRequestImpl => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, transactionRequestId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_transaction_request_impl", req, callContext) + response.map(convertToTuple[TransactionRequest](callContext)) } - - messageDocs += getTransactionRequestTypesImplDoc86 - private def getTransactionRequestTypesImplDoc86 = MessageDoc( - process = "obp.getTransactionRequestTypesImpl", - messageFormat = messageFormat, - description = """ - |Get Transaction Request Types Impl - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_transaction_request_types_impl - """.stripMargin, - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundGetTransactionRequestTypesImpl( - fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=bankAccountNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=bankAccountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value)) - ), - exampleInboundMessage = ( - InBoundGetTransactionRequestTypesImpl( - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), - data=List(TransactionRequestType(transactionRequestTypeExample.value))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - // stored procedure name: get_transaction_request_types_impl - override def getTransactionRequestTypesImpl(fromAccount: BankAccount): Box[List[TransactionRequestType]] = { - import com.openbankproject.commons.dto.{OutBoundGetTransactionRequestTypesImpl => OutBound, InBoundGetTransactionRequestTypesImpl => InBound} - val procedureName = "get_transaction_request_types_impl" - val callContext: Option[CallContext] = None - val req = OutBound(fromAccount) - val result: OBPReturnType[Box[List[TransactionRequestType]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result - } - - messageDocs += createTransactionAfterChallengeDoc63 - private def createTransactionAfterChallengeDoc63 = MessageDoc( - process = "obp.createTransactionAfterChallenge", - messageFormat = messageFormat, - description = """ - |Create Transaction After Challenge - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_transaction_after_challenge - """.stripMargin, - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundCreateTransactionAfterChallenge( - initiator= UserCommons(userPrimaryKey=UserPrimaryKey(123), - userId=userIdExample.value, - idGivenByProvider="string", - provider="string", - emailAddress=emailExample.value, - name=usernameExample.value), - transReqId=TransactionRequestId("string")) - ), - exampleInboundMessage = ( - InBoundCreateTransactionAfterChallenge( - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), - data= TransactionRequest(id=TransactionRequestId("string"), - `type`=transactionRequestTypeExample.value, - from= TransactionRequestAccount(bank_id="string", - account_id="string"), - body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id="string", - account_id="string")), - to_sepa=Some(TransactionRequestIban("string")), - to_counterparty=Some(TransactionRequestCounterpartyId("string")), - to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - message="string", - from= FromAccountTransfer(mobile_phone_number="string", - nickname="string"), - to=ToAccountTransferToPhone("string"))), - to_transfer_to_atm=Some( TransactionRequestTransferToAtm(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - message="string", - from= FromAccountTransfer(mobile_phone_number="string", - nickname="string"), - to= ToAccountTransferToAtm(legal_name="string", - date_of_birth="string", - mobile_phone_number="string", - kyc_document= ToAccountTransferToAtmKycDocument(`type`="string", - number="string")))), - to_transfer_to_account=Some( TransactionRequestTransferToAccount(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - transfer_type="string", - future_date="string", - to= ToAccountTransferToAccount(name="string", - bank_code="string", - branch_number="string", - account= ToAccountTransferToAccountAccount(number=accountNumberExample.value, - iban=ibanExample.value)))), - to_sepa_credit_transfers=Some( SepaCreditTransfers(debtorAccount=PaymentAccount("string"), - instructedAmount= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - creditorAccount=PaymentAccount("string"), - creditorName="string")), - value= AmountOfMoney(currency=currencyExample.value, - amount="string"), - description="string"), - transaction_ids="string", - status="string", - start_date=new Date(), - end_date=new Date(), - challenge= TransactionRequestChallenge(id="string", - allowed_attempts=123, - challenge_type="string"), - charge= TransactionRequestCharge(summary="string", - value= AmountOfMoney(currency=currencyExample.value, - amount="string")), - charge_policy="string", - counterparty_id=CounterpartyId(counterpartyIdExample.value), - name="string", - this_bank_id=BankId(bankIdExample.value), - this_account_id=AccountId(accountIdExample.value), - this_view_id=ViewId(viewIdExample.value), - other_account_routing_scheme="string", - other_account_routing_address="string", - other_bank_routing_scheme="string", - other_bank_routing_address="string", - is_beneficiary=true, - future_date=Some("string"))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - // stored procedure name: create_transaction_after_challenge - override def createTransactionAfterChallenge(initiator: User, transReqId: TransactionRequestId): Box[TransactionRequest] = { - import com.openbankproject.commons.dto.{OutBoundCreateTransactionAfterChallenge => OutBound, InBoundCreateTransactionAfterChallenge => InBound} - val procedureName = "create_transaction_after_challenge" - val callContext: Option[CallContext] = None - val req = OutBound(initiator, transReqId) - val result: OBPReturnType[Box[TransactionRequest]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result - } - - messageDocs += createTransactionAfterChallengev200Doc63 - private def createTransactionAfterChallengev200Doc63 = MessageDoc( - process = "obp.createTransactionAfterChallengev200", - messageFormat = messageFormat, - description = """ - |Create Transaction After Challengev200 - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_transaction_after_challengev200 - """.stripMargin, - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundCreateTransactionAfterChallengev200( - fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=bankAccountNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=bankAccountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value), - toAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=bankAccountNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=bankAccountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value), - transactionRequest= TransactionRequest(id=TransactionRequestId("string"), - `type`=transactionRequestTypeExample.value, - from= TransactionRequestAccount(bank_id="string", - account_id="string"), - body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id="string", - account_id="string")), - to_sepa=Some(TransactionRequestIban("string")), - to_counterparty=Some(TransactionRequestCounterpartyId("string")), - to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - message="string", - from= FromAccountTransfer(mobile_phone_number="string", - nickname="string"), - to=ToAccountTransferToPhone("string"))), - to_transfer_to_atm=Some( TransactionRequestTransferToAtm(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - message="string", - from= FromAccountTransfer(mobile_phone_number="string", - nickname="string"), - to= ToAccountTransferToAtm(legal_name="string", - date_of_birth="string", - mobile_phone_number="string", - kyc_document= ToAccountTransferToAtmKycDocument(`type`="string", - number="string")))), - to_transfer_to_account=Some( TransactionRequestTransferToAccount(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - transfer_type="string", - future_date="string", - to= ToAccountTransferToAccount(name="string", - bank_code="string", - branch_number="string", - account= ToAccountTransferToAccountAccount(number=accountNumberExample.value, - iban=ibanExample.value)))), - to_sepa_credit_transfers=Some( SepaCreditTransfers(debtorAccount=PaymentAccount("string"), - instructedAmount= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - creditorAccount=PaymentAccount("string"), - creditorName="string")), - value= AmountOfMoney(currency=currencyExample.value, - amount="string"), - description="string"), - transaction_ids="string", - status="string", - start_date=new Date(), - end_date=new Date(), - challenge= TransactionRequestChallenge(id="string", - allowed_attempts=123, - challenge_type="string"), - charge= TransactionRequestCharge(summary="string", - value= AmountOfMoney(currency=currencyExample.value, - amount="string")), - charge_policy="string", - counterparty_id=CounterpartyId(counterpartyIdExample.value), - name="string", - this_bank_id=BankId(bankIdExample.value), - this_account_id=AccountId(accountIdExample.value), - this_view_id=ViewId(viewIdExample.value), - other_account_routing_scheme="string", - other_account_routing_address="string", - other_bank_routing_scheme="string", - other_bank_routing_address="string", - is_beneficiary=true, - future_date=Some("string"))) - ), - exampleInboundMessage = ( - InBoundCreateTransactionAfterChallengev200( - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), - data= TransactionRequest(id=TransactionRequestId("string"), - `type`=transactionRequestTypeExample.value, - from= TransactionRequestAccount(bank_id="string", - account_id="string"), - body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id="string", - account_id="string")), - to_sepa=Some(TransactionRequestIban("string")), - to_counterparty=Some(TransactionRequestCounterpartyId("string")), - to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - message="string", - from= FromAccountTransfer(mobile_phone_number="string", - nickname="string"), - to=ToAccountTransferToPhone("string"))), - to_transfer_to_atm=Some( TransactionRequestTransferToAtm(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - message="string", - from= FromAccountTransfer(mobile_phone_number="string", - nickname="string"), - to= ToAccountTransferToAtm(legal_name="string", - date_of_birth="string", - mobile_phone_number="string", - kyc_document= ToAccountTransferToAtmKycDocument(`type`="string", - number="string")))), - to_transfer_to_account=Some( TransactionRequestTransferToAccount(value= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - description="string", - transfer_type="string", - future_date="string", - to= ToAccountTransferToAccount(name="string", - bank_code="string", - branch_number="string", - account= ToAccountTransferToAccountAccount(number=accountNumberExample.value, - iban=ibanExample.value)))), - to_sepa_credit_transfers=Some( SepaCreditTransfers(debtorAccount=PaymentAccount("string"), - instructedAmount= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount="string"), - creditorAccount=PaymentAccount("string"), - creditorName="string")), - value= AmountOfMoney(currency=currencyExample.value, - amount="string"), - description="string"), - transaction_ids="string", - status="string", - start_date=new Date(), - end_date=new Date(), - challenge= TransactionRequestChallenge(id="string", - allowed_attempts=123, - challenge_type="string"), - charge= TransactionRequestCharge(summary="string", - value= AmountOfMoney(currency=currencyExample.value, - amount="string")), - charge_policy="string", - counterparty_id=CounterpartyId(counterpartyIdExample.value), - name="string", - this_bank_id=BankId(bankIdExample.value), - this_account_id=AccountId(accountIdExample.value), - this_view_id=ViewId(viewIdExample.value), - other_account_routing_scheme="string", - other_account_routing_address="string", - other_bank_routing_scheme="string", - other_bank_routing_address="string", - is_beneficiary=true, - future_date=Some("string"))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - // stored procedure name: create_transaction_after_challengev200 - override def createTransactionAfterChallengev200(fromAccount: BankAccount, toAccount: BankAccount, transactionRequest: TransactionRequest): Box[TransactionRequest] = { - import com.openbankproject.commons.dto.{OutBoundCreateTransactionAfterChallengev200 => OutBound, InBoundCreateTransactionAfterChallengev200 => InBound} - val procedureName = "create_transaction_after_challengev200" - val callContext: Option[CallContext] = None - val req = OutBound(fromAccount, toAccount, transactionRequest) - val result: OBPReturnType[Box[TransactionRequest]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result - } - - messageDocs += createTransactionAfterChallengeV210Doc26 - private def createTransactionAfterChallengeV210Doc26 = MessageDoc( + + messageDocs += createTransactionAfterChallengeV210Doc + def createTransactionAfterChallengeV210Doc = MessageDoc( process = "obp.createTransactionAfterChallengeV210", messageFormat = messageFormat, - description = """ - |Create Transaction After Challenge V210 - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_transaction_after_challenge_v210 - """.stripMargin, + description = "Create Transaction After Challenge V210", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateTransactionAfterChallengeV210(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateTransactionAfterChallengeV210(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), accountType=accountTypeExample.value, balance=BigDecimal(balanceAmountExample.value), @@ -6097,15 +2659,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { future_date=Some("string"))) ), exampleInboundMessage = ( - InBoundCreateTransactionAfterChallengeV210(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreateTransactionAfterChallengeV210(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= TransactionRequest(id=TransactionRequestId("string"), `type`=transactionRequestTypeExample.value, from= TransactionRequestAccount(bank_id="string", @@ -6175,55 +2730,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_transaction_after_challenge_v210 + override def createTransactionAfterChallengeV210(fromAccount: BankAccount, transactionRequest: TransactionRequest, callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = { - import com.openbankproject.commons.dto.{OutBoundCreateTransactionAfterChallengeV210 => OutBound, InBoundCreateTransactionAfterChallengeV210 => InBound} - val procedureName = "create_transaction_after_challenge_v210" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , fromAccount, transactionRequest) - val result: OBPReturnType[Box[TransactionRequest]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCreateTransactionAfterChallengeV210 => InBound, OutBoundCreateTransactionAfterChallengeV210 => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, fromAccount, transactionRequest) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_transaction_after_challenge_v210", req, callContext) + response.map(convertToTuple[TransactionRequest](callContext)) } - - messageDocs += updateBankAccountDoc3 - private def updateBankAccountDoc3 = MessageDoc( + + messageDocs += updateBankAccountDoc + def updateBankAccountDoc = MessageDoc( process = "obp.updateBankAccount", messageFormat = messageFormat, - description = """ - |Update Bank Account - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: update_bank_account - """.stripMargin, + description = "Update Bank Account", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundUpdateBankAccount(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundUpdateBankAccount(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), accountId=AccountId(accountIdExample.value), accountType=accountTypeExample.value, @@ -6233,15 +2756,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { accountRoutingAddress=accountRoutingAddressExample.value) ), exampleInboundMessage = ( - InBoundUpdateBankAccount(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundUpdateBankAccount(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= BankAccountCommons(accountId=AccountId(accountIdExample.value), accountType=accountTypeExample.value, balance=BigDecimal(balanceAmountExample.value), @@ -6263,55 +2779,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: update_bank_account + override def updateBankAccount(bankId: BankId, accountId: AccountId, accountType: String, accountLabel: String, branchId: String, accountRoutingScheme: String, accountRoutingAddress: String, callContext: Option[CallContext]): OBPReturnType[Box[BankAccount]] = { - import com.openbankproject.commons.dto.{OutBoundUpdateBankAccount => OutBound, InBoundUpdateBankAccount => InBound} - val procedureName = "update_bank_account" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountId, accountType, accountLabel, branchId, accountRoutingScheme, accountRoutingAddress) - val result: OBPReturnType[Box[BankAccountCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundUpdateBankAccount => InBound, OutBoundUpdateBankAccount => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, accountType, accountLabel, branchId, accountRoutingScheme, accountRoutingAddress) + val response: Future[Box[InBound]] = sendRequest[InBound]("update_bank_account", req, callContext) + response.map(convertToTuple[BankAccountCommons](callContext)) } - - messageDocs += createBankAccountDoc64 - private def createBankAccountDoc64 = MessageDoc( + + messageDocs += createBankAccountDoc + def createBankAccountDoc = MessageDoc( process = "obp.createBankAccount", messageFormat = messageFormat, - description = """ - |Create Bank Account - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_bank_account - """.stripMargin, + description = "Create Bank Account", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateBankAccount(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateBankAccount(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), accountId=AccountId(accountIdExample.value), accountType=accountTypeExample.value, @@ -6324,15 +2808,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { accountRoutingAddress=accountRoutingAddressExample.value) ), exampleInboundMessage = ( - InBoundCreateBankAccount(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreateBankAccount(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= BankAccountCommons(accountId=AccountId(accountIdExample.value), accountType=accountTypeExample.value, balance=BigDecimal(balanceAmountExample.value), @@ -6354,462 +2831,55 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_bank_account + override def createBankAccount(bankId: BankId, accountId: AccountId, accountType: String, accountLabel: String, currency: String, initialBalance: BigDecimal, accountHolderName: String, branchId: String, accountRoutingScheme: String, accountRoutingAddress: String, callContext: Option[CallContext]): OBPReturnType[Box[BankAccount]] = { - import com.openbankproject.commons.dto.{OutBoundCreateBankAccount => OutBound, InBoundCreateBankAccount => InBound} - val procedureName = "create_bank_account" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountId, accountType, accountLabel, currency, initialBalance, accountHolderName, branchId, accountRoutingScheme, accountRoutingAddress) - val result: OBPReturnType[Box[BankAccountCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCreateBankAccount => InBound, OutBoundCreateBankAccount => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, accountType, accountLabel, currency, initialBalance, accountHolderName, branchId, accountRoutingScheme, accountRoutingAddress) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_bank_account", req, callContext) + response.map(convertToTuple[BankAccountCommons](callContext)) } - - messageDocs += createBankAccountLegacyDoc77 - private def createBankAccountLegacyDoc77 = MessageDoc( - process = "obp.createBankAccountLegacy", + + messageDocs += accountExistsDoc + def accountExistsDoc = MessageDoc( + process = "obp.accountExists", messageFormat = messageFormat, - description = """ - |Create Bank Account Legacy - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_bank_account_legacy - """.stripMargin, + description = "Account Exists", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateBankAccountLegacy(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), - bankId=BankId(bankIdExample.value), - accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - accountLabel="string", - currency=currencyExample.value, - initialBalance=BigDecimal("123.321"), - accountHolderName="string", - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value) + OutBoundAccountExists(bankId=BankId(bankIdExample.value), + accountNumber=accountNumberExample.value) ), exampleInboundMessage = ( - InBoundCreateBankAccountLegacy(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), - data= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=bankAccountNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=bankAccountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value)) + InBoundAccountExists(status=MessageDocsSwaggerDefinitions.inboundStatus, + data=true) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_bank_account_legacy - override def createBankAccountLegacy(bankId: BankId, accountId: AccountId, accountType: String, accountLabel: String, currency: String, initialBalance: BigDecimal, accountHolderName: String, branchId: String, accountRoutingScheme: String, accountRoutingAddress: String): Box[BankAccount] = { - import com.openbankproject.commons.dto.{OutBoundCreateBankAccountLegacy => OutBound, InBoundCreateBankAccountLegacy => InBound} - val procedureName = "create_bank_account_legacy" - val callContext: Option[CallContext] = None - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountId, accountType, accountLabel, currency, initialBalance, accountHolderName, branchId, accountRoutingScheme, accountRoutingAddress) - val result: OBPReturnType[Box[BankAccountCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result - } - messageDocs += getProductsDoc44 - private def getProductsDoc44 = MessageDoc( - process = "obp.getProducts", - messageFormat = messageFormat, - description = """ - |Get Products - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_products - """.stripMargin, - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundGetProducts( - bankId=BankId(bankIdExample.value), Nil) - ), - exampleInboundMessage = ( - InBoundGetProducts( - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), - data=List( ProductCommons(bankId=BankId(bankIdExample.value), - code=ProductCode("string"), - parentProductCode=ProductCode("string"), - name="string", - category="string", - family="string", - superFamily="string", - moreInfoUrl="string", - details="string", - description="string", - meta=Meta( License(id="string", - name="string"))))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - // stored procedure name: get_products - override def getProducts(bankId: BankId, params: Map[String, List[String]]): Box[List[Product]] = { - import com.openbankproject.commons.dto.{OutBoundGetProducts => OutBound, InBoundGetProducts => InBound} - val procedureName = "get_products" + override def accountExists(bankId: BankId, accountNumber: String): Box[Boolean] = { + import com.openbankproject.commons.dto.{InBoundAccountExists => InBound, OutBoundAccountExists => OutBound} val callContext: Option[CallContext] = None - val req = OutBound(bankId, params) - val result: OBPReturnType[Box[List[ProductCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + val req = OutBound(bankId, accountNumber) + val response: Future[Box[InBound]] = sendRequest[InBound]("account_exists", req, callContext) + response.map(convertToTuple[Boolean](callContext)) } - - messageDocs += getProductDoc32 - private def getProductDoc32 = MessageDoc( - process = "obp.getProduct", - messageFormat = messageFormat, - description = """ - |Get Product - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_product - """.stripMargin, - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundGetProduct( - bankId=BankId(bankIdExample.value), - productCode=ProductCode("string")) - ), - exampleInboundMessage = ( - InBoundGetProduct( - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), - data= ProductCommons(bankId=BankId(bankIdExample.value), - code=ProductCode("string"), - parentProductCode=ProductCode("string"), - name="string", - category="string", - family="string", - superFamily="string", - moreInfoUrl="string", - details="string", - description="string", - meta=Meta( License(id="string", - name="string")))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - // stored procedure name: get_product - override def getProduct(bankId: BankId, productCode: ProductCode): Box[Product] = { - import com.openbankproject.commons.dto.{OutBoundGetProduct => OutBound, InBoundGetProduct => InBound} - val procedureName = "get_product" - val callContext: Option[CallContext] = None - val req = OutBound(bankId, productCode) - val result: OBPReturnType[Box[ProductCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result - } - - messageDocs += createOrUpdateBankDoc78 - private def createOrUpdateBankDoc78 = MessageDoc( - process = "obp.createOrUpdateBank", - messageFormat = messageFormat, - description = """ - |Create Or Update Bank - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_or_update_bank - """.stripMargin, - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundCreateOrUpdateBank( - bankId=bankIdExample.value, - fullBankName="string", - shortBankName="string", - logoURL="string", - websiteURL="string", - swiftBIC="string", - national_identifier="string", - bankRoutingScheme=bankRoutingSchemeExample.value, - bankRoutingAddress=bankRoutingAddressExample.value) - ), - exampleInboundMessage = ( - InBoundCreateOrUpdateBank( - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), - data= BankCommons(bankId=BankId(bankIdExample.value), - shortName=bankShortNameExample.value, - fullName=bankFullNameExample.value, - logoUrl=bankLogoUrlExample.value, - websiteUrl=bankWebsiteUrlExample.value, - bankRoutingScheme=bankRoutingSchemeExample.value, - bankRoutingAddress=bankRoutingAddressExample.value, - swiftBic=bankSwiftBicExample.value, - nationalIdentifier=bankNationalIdentifierExample.value)) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - // stored procedure name: create_or_update_bank - override def createOrUpdateBank(bankId: String, fullBankName: String, shortBankName: String, logoURL: String, websiteURL: String, swiftBIC: String, national_identifier: String, bankRoutingScheme: String, bankRoutingAddress: String): Box[Bank] = { - import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateBank => OutBound, InBoundCreateOrUpdateBank => InBound} - val procedureName = "create_or_update_bank" - val callContext: Option[CallContext] = None - val req = OutBound(bankId, fullBankName, shortBankName, logoURL, websiteURL, swiftBIC, national_identifier, bankRoutingScheme, bankRoutingAddress) - val result: OBPReturnType[Box[BankCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result - } - - messageDocs += createOrUpdateProductDoc90 - private def createOrUpdateProductDoc90 = MessageDoc( - process = "obp.createOrUpdateProduct", - messageFormat = messageFormat, - description = """ - |Create Or Update Product - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_or_update_product - """.stripMargin, - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundCreateOrUpdateProduct( - bankId=bankIdExample.value, - code="string", - parentProductCode=Some("string"), - name="string", - category="string", - family="string", - superFamily="string", - moreInfoUrl="string", - details="string", - description="string", - metaLicenceId="string", - metaLicenceName="string") - ), - exampleInboundMessage = ( - InBoundCreateOrUpdateProduct( - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), - data= ProductCommons(bankId=BankId(bankIdExample.value), - code=ProductCode("string"), - parentProductCode=ProductCode("string"), - name="string", - category="string", - family="string", - superFamily="string", - moreInfoUrl="string", - details="string", - description="string", - meta=Meta( License(id="string", - name="string")))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - // stored procedure name: create_or_update_product - override def createOrUpdateProduct(bankId: String, code: String, parentProductCode: Option[String], name: String, category: String, family: String, superFamily: String, moreInfoUrl: String, details: String, description: String, metaLicenceId: String, metaLicenceName: String): Box[Product] = { - import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateProduct => OutBound, InBoundCreateOrUpdateProduct => InBound} - val procedureName = "create_or_update_product" - val callContext: Option[CallContext] = None - val req = OutBound(bankId, code, parentProductCode, name, category, family, superFamily, moreInfoUrl, details, description, metaLicenceId, metaLicenceName) - val result: OBPReturnType[Box[ProductCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result - } - - messageDocs += getBranchLegacyDoc88 - private def getBranchLegacyDoc88 = MessageDoc( - process = "obp.getBranchLegacy", - messageFormat = messageFormat, - description = """ - |Get Branch Legacy - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_branch_legacy - """.stripMargin, - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundGetBranchLegacy( - bankId=BankId(bankIdExample.value), - branchId=BranchId(branchIdExample.value)) - ), - exampleInboundMessage = ( - InBoundGetBranchLegacy( - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), - data= BranchTCommons(branchId=BranchId(branchIdExample.value), - bankId=BankId(bankIdExample.value), - name="string", - address= Address(line1="string", - line2="string", - line3="string", - city="string", - county=Some("string"), - state="string", - postCode="string", - countryCode="string"), - location= Location(latitude=123.123, - longitude=123.123, - date=Some(new Date()), - user=Some( BasicResourceUser(userId=userIdExample.value, - provider="string", - username=usernameExample.value))), - lobbyString=Some(LobbyString("string")), - driveUpString=Some(DriveUpString("string")), - meta=Meta( License(id="string", - name="string")), - branchRouting=Some( Routing(scheme=branchRoutingSchemeExample.value, - address=branchRoutingAddressExample.value)), - lobby=Some( Lobby(monday=List( OpeningTimes(openingTime="string", - closingTime="string")), - tuesday=List( OpeningTimes(openingTime="string", - closingTime="string")), - wednesday=List( OpeningTimes(openingTime="string", - closingTime="string")), - thursday=List( OpeningTimes(openingTime="string", - closingTime="string")), - friday=List( OpeningTimes(openingTime="string", - closingTime="string")), - saturday=List( OpeningTimes(openingTime="string", - closingTime="string")), - sunday=List( OpeningTimes(openingTime="string", - closingTime="string")))), - driveUp=Some( DriveUp(monday= OpeningTimes(openingTime="string", - closingTime="string"), - tuesday= OpeningTimes(openingTime="string", - closingTime="string"), - wednesday= OpeningTimes(openingTime="string", - closingTime="string"), - thursday= OpeningTimes(openingTime="string", - closingTime="string"), - friday= OpeningTimes(openingTime="string", - closingTime="string"), - saturday= OpeningTimes(openingTime="string", - closingTime="string"), - sunday= OpeningTimes(openingTime="string", - closingTime="string"))), - isAccessible=Some(true), - accessibleFeatures=Some("string"), - branchType=Some("string"), - moreInfo=Some("string"), - phoneNumber=Some("string"), - isDeleted=Some(true))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - // stored procedure name: get_branch_legacy - override def getBranchLegacy(bankId: BankId, branchId: BranchId): Box[BranchT] = { - import com.openbankproject.commons.dto.{OutBoundGetBranchLegacy => OutBound, InBoundGetBranchLegacy => InBound} - val procedureName = "get_branch_legacy" - val callContext: Option[CallContext] = None - val req = OutBound(bankId, branchId) - val result: OBPReturnType[Box[BranchTCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result - } - - messageDocs += getBranchDoc57 - private def getBranchDoc57 = MessageDoc( + + messageDocs += getBranchDoc + def getBranchDoc = MessageDoc( process = "obp.getBranch", messageFormat = messageFormat, - description = """ - |Get Branch - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_branch - """.stripMargin, + description = "Get Branch", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetBranch(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetBranch(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), branchId=BranchId(branchIdExample.value)) ), exampleInboundMessage = ( - InBoundGetBranch(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetBranch(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= BranchTCommons(branchId=BranchId(branchIdExample.value), bankId=BankId(bankIdExample.value), name="string", @@ -6870,55 +2940,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_branch + override def getBranch(bankId: BankId, branchId: BranchId, callContext: Option[CallContext]): Future[Box[(BranchT, Option[CallContext])]] = { - import com.openbankproject.commons.dto.{OutBoundGetBranch => OutBound, InBoundGetBranch => InBound} - val procedureName = "get_branch" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, branchId) - val result: OBPReturnType[Box[BranchTCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetBranch => InBound, OutBoundGetBranch => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, branchId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_branch", req, callContext) + response.map(convertToTuple[BranchTCommons](callContext)) } - - messageDocs += getBranchesDoc2 - private def getBranchesDoc2 = MessageDoc( + + messageDocs += getBranchesDoc + def getBranchesDoc = MessageDoc( process = "obp.getBranches", messageFormat = messageFormat, - description = """ - |Get Branches - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_branches - """.stripMargin, + description = "Get Branches", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetBranches(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetBranches(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), limit=limitExample.value.toInt, offset=offsetExample.value.toInt, @@ -6926,15 +2964,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { toDate="string") ), exampleInboundMessage = ( - InBoundGetBranches(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetBranches(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( BranchTCommons(branchId=BranchId(branchIdExample.value), bankId=BankId(bankIdExample.value), name="string", @@ -6995,142 +3026,29 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_branches + override def getBranches(bankId: BankId, callContext: Option[CallContext], queryParams: List[OBPQueryParam]): Future[Box[(List[BranchT], Option[CallContext])]] = { - import com.openbankproject.commons.dto.{OutBoundGetBranches => OutBound, InBoundGetBranches => InBound} - val procedureName = "get_branches" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) - val result: OBPReturnType[Box[List[BranchTCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetBranches => InBound, OutBoundGetBranches => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_branches", req, callContext) + response.map(convertToTuple[List[BranchTCommons]](callContext)) } - - messageDocs += getAtmLegacyDoc52 - private def getAtmLegacyDoc52 = MessageDoc( - process = "obp.getAtmLegacy", - messageFormat = messageFormat, - description = """ - |Get Atm Legacy - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_atm_legacy - """.stripMargin, - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundGetAtmLegacy( - bankId=BankId(bankIdExample.value), - atmId=AtmId("string")) - ), - exampleInboundMessage = ( - InBoundGetAtmLegacy( - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), - data= AtmTCommons(atmId=AtmId("string"), - bankId=BankId(bankIdExample.value), - name="string", - address= Address(line1="string", - line2="string", - line3="string", - city="string", - county=Some("string"), - state="string", - postCode="string", - countryCode="string"), - location= Location(latitude=123.123, - longitude=123.123, - date=Some(new Date()), - user=Some( BasicResourceUser(userId=userIdExample.value, - provider="string", - username=usernameExample.value))), - meta=Meta( License(id="string", - name="string")), - OpeningTimeOnMonday=Some("string"), - ClosingTimeOnMonday=Some("string"), - OpeningTimeOnTuesday=Some("string"), - ClosingTimeOnTuesday=Some("string"), - OpeningTimeOnWednesday=Some("string"), - ClosingTimeOnWednesday=Some("string"), - OpeningTimeOnThursday=Some("string"), - ClosingTimeOnThursday=Some("string"), - OpeningTimeOnFriday=Some("string"), - ClosingTimeOnFriday=Some("string"), - OpeningTimeOnSaturday=Some("string"), - ClosingTimeOnSaturday=Some("string"), - OpeningTimeOnSunday=Some("string"), - ClosingTimeOnSunday=Some("string"), - isAccessible=Some(true), - locatedAt=Some("string"), - moreInfo=Some("string"), - hasDepositCapability=Some(true))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - // stored procedure name: get_atm_legacy - override def getAtmLegacy(bankId: BankId, atmId: AtmId): Box[AtmT] = { - import com.openbankproject.commons.dto.{OutBoundGetAtmLegacy => OutBound, InBoundGetAtmLegacy => InBound} - val procedureName = "get_atm_legacy" - val callContext: Option[CallContext] = None - val req = OutBound(bankId, atmId) - val result: OBPReturnType[Box[AtmTCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result - } - - messageDocs += getAtmDoc78 - private def getAtmDoc78 = MessageDoc( + + messageDocs += getAtmDoc + def getAtmDoc = MessageDoc( process = "obp.getAtm", messageFormat = messageFormat, - description = """ - |Get Atm - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_atm - """.stripMargin, + description = "Get Atm", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetAtm(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetAtm(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), atmId=AtmId("string")) ), exampleInboundMessage = ( - InBoundGetAtm(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetAtm(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= AtmTCommons(atmId=AtmId("string"), bankId=BankId(bankIdExample.value), name="string", @@ -7171,55 +3089,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_atm + override def getAtm(bankId: BankId, atmId: AtmId, callContext: Option[CallContext]): Future[Box[(AtmT, Option[CallContext])]] = { - import com.openbankproject.commons.dto.{OutBoundGetAtm => OutBound, InBoundGetAtm => InBound} - val procedureName = "get_atm" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, atmId) - val result: OBPReturnType[Box[AtmTCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetAtm => InBound, OutBoundGetAtm => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, atmId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_atm", req, callContext) + response.map(convertToTuple[AtmTCommons](callContext)) } - - messageDocs += getAtmsDoc80 - private def getAtmsDoc80 = MessageDoc( + + messageDocs += getAtmsDoc + def getAtmsDoc = MessageDoc( process = "obp.getAtms", messageFormat = messageFormat, - description = """ - |Get Atms - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_atms - """.stripMargin, + description = "Get Atms", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetAtms(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetAtms(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), limit=limitExample.value.toInt, offset=offsetExample.value.toInt, @@ -7227,15 +3113,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { toDate="string") ), exampleInboundMessage = ( - InBoundGetAtms(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetAtms(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( AtmTCommons(atmId=AtmId("string"), bankId=BankId(bankIdExample.value), name="string", @@ -7276,55 +3155,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_atms + override def getAtms(bankId: BankId, callContext: Option[CallContext], queryParams: List[OBPQueryParam]): Future[Box[(List[AtmT], Option[CallContext])]] = { - import com.openbankproject.commons.dto.{OutBoundGetAtms => OutBound, InBoundGetAtms => InBound} - val procedureName = "get_atms" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) - val result: OBPReturnType[Box[List[AtmTCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetAtms => InBound, OutBoundGetAtms => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_atms", req, callContext) + response.map(convertToTuple[List[AtmTCommons]](callContext)) } - - messageDocs += createTransactionAfterChallengev300Doc57 - private def createTransactionAfterChallengev300Doc57 = MessageDoc( + + messageDocs += createTransactionAfterChallengev300Doc + def createTransactionAfterChallengev300Doc = MessageDoc( process = "obp.createTransactionAfterChallengev300", messageFormat = messageFormat, - description = """ - |Create Transaction After Challengev300 - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_transaction_after_challengev300 - """.stripMargin, + description = "Create Transaction After Challengev300", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateTransactionAfterChallengev300(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateTransactionAfterChallengev300(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, initiator= UserCommons(userPrimaryKey=UserPrimaryKey(123), userId=userIdExample.value, idGivenByProvider="string", @@ -7353,15 +3200,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { transactionRequestType=TransactionRequestType(transactionRequestTypeExample.value)) ), exampleInboundMessage = ( - InBoundCreateTransactionAfterChallengev300(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreateTransactionAfterChallengev300(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= TransactionRequest(id=TransactionRequestId("string"), `type`=transactionRequestTypeExample.value, from= TransactionRequestAccount(bank_id="string", @@ -7431,55 +3271,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_transaction_after_challengev300 + override def createTransactionAfterChallengev300(initiator: User, fromAccount: BankAccount, transReqId: TransactionRequestId, transactionRequestType: TransactionRequestType, callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = { - import com.openbankproject.commons.dto.{OutBoundCreateTransactionAfterChallengev300 => OutBound, InBoundCreateTransactionAfterChallengev300 => InBound} - val procedureName = "create_transaction_after_challengev300" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , initiator, fromAccount, transReqId, transactionRequestType) - val result: OBPReturnType[Box[TransactionRequest]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCreateTransactionAfterChallengev300 => InBound, OutBoundCreateTransactionAfterChallengev300 => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, fromAccount, transReqId, transactionRequestType) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_transaction_after_challengev300", req, callContext) + response.map(convertToTuple[TransactionRequest](callContext)) } - - messageDocs += makePaymentv300Doc10 - private def makePaymentv300Doc10 = MessageDoc( + + messageDocs += makePaymentv300Doc + def makePaymentv300Doc = MessageDoc( process = "obp.makePaymentv300", messageFormat = messageFormat, - description = """ - |Make Paymentv300 - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: make_paymentv300 - """.stripMargin, + description = "Make Paymentv300", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundMakePaymentv300(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundMakePaymentv300(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, initiator= UserCommons(userPrimaryKey=UserPrimaryKey(123), userId=userIdExample.value, idGivenByProvider="string", @@ -7547,68 +3355,29 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { chargePolicy="string") ), exampleInboundMessage = ( - InBoundMakePaymentv300(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundMakePaymentv300(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=TransactionId(transactionIdExample.value)) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: make_paymentv300 + override def makePaymentv300(initiator: User, fromAccount: BankAccount, toAccount: BankAccount, toCounterparty: CounterpartyTrait, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, transactionRequestType: TransactionRequestType, chargePolicy: String, callContext: Option[CallContext]): Future[Box[(TransactionId, Option[CallContext])]] = { - import com.openbankproject.commons.dto.{OutBoundMakePaymentv300 => OutBound, InBoundMakePaymentv300 => InBound} - val procedureName = "make_paymentv300" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , initiator, fromAccount, toAccount, toCounterparty, transactionRequestCommonBody, transactionRequestType, chargePolicy) - val result: OBPReturnType[Box[TransactionId]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundMakePaymentv300 => InBound, OutBoundMakePaymentv300 => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, fromAccount, toAccount, toCounterparty, transactionRequestCommonBody, transactionRequestType, chargePolicy) + val response: Future[Box[InBound]] = sendRequest[InBound]("make_paymentv300", req, callContext) + response.map(convertToTuple[TransactionId](callContext)) } - - messageDocs += createTransactionRequestv300Doc57 - private def createTransactionRequestv300Doc57 = MessageDoc( + + messageDocs += createTransactionRequestv300Doc + def createTransactionRequestv300Doc = MessageDoc( process = "obp.createTransactionRequestv300", messageFormat = messageFormat, - description = """ - |Create Transaction Requestv300 - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_transaction_requestv300 - """.stripMargin, + description = "Create Transaction Requestv300", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateTransactionRequestv300(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateTransactionRequestv300(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, initiator= UserCommons(userPrimaryKey=UserPrimaryKey(123), userId=userIdExample.value, idGivenByProvider="string", @@ -7678,15 +3447,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { chargePolicy="string") ), exampleInboundMessage = ( - InBoundCreateTransactionRequestv300(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreateTransactionRequestv300(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= TransactionRequest(id=TransactionRequestId("string"), `type`=transactionRequestTypeExample.value, from= TransactionRequestAccount(bank_id="string", @@ -7756,55 +3518,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_transaction_requestv300 + override def createTransactionRequestv300(initiator: User, viewId: ViewId, fromAccount: BankAccount, toAccount: BankAccount, toCounterparty: CounterpartyTrait, transactionRequestType: TransactionRequestType, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, detailsPlain: String, chargePolicy: String, callContext: Option[CallContext]): Future[Box[(TransactionRequest, Option[CallContext])]] = { - import com.openbankproject.commons.dto.{OutBoundCreateTransactionRequestv300 => OutBound, InBoundCreateTransactionRequestv300 => InBound} - val procedureName = "create_transaction_requestv300" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , initiator, viewId, fromAccount, toAccount, toCounterparty, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy) - val result: OBPReturnType[Box[TransactionRequest]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCreateTransactionRequestv300 => InBound, OutBoundCreateTransactionRequestv300 => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, viewId, fromAccount, toAccount, toCounterparty, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_transaction_requestv300", req, callContext) + response.map(convertToTuple[TransactionRequest](callContext)) } - - messageDocs += createCounterpartyDoc23 - private def createCounterpartyDoc23 = MessageDoc( + + messageDocs += createCounterpartyDoc + def createCounterpartyDoc = MessageDoc( process = "obp.createCounterparty", messageFormat = messageFormat, - description = """ - |Create Counterparty - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_counterparty - """.stripMargin, + description = "Create Counterparty", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateCounterparty(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateCounterparty(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, name="string", description="string", createdByUserId="string", @@ -7824,15 +3554,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { value=valueExample.value))) ), exampleInboundMessage = ( - InBoundCreateCounterparty(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreateCounterparty(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= CounterpartyTraitCommons(createdByUserId="string", name="string", description="string", @@ -7854,121 +3577,50 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_counterparty + override def createCounterparty(name: String, description: String, createdByUserId: String, thisBankId: String, thisAccountId: String, thisViewId: String, otherAccountRoutingScheme: String, otherAccountRoutingAddress: String, otherAccountSecondaryRoutingScheme: String, otherAccountSecondaryRoutingAddress: String, otherBankRoutingScheme: String, otherBankRoutingAddress: String, otherBranchRoutingScheme: String, otherBranchRoutingAddress: String, isBeneficiary: Boolean, bespoke: List[CounterpartyBespoke], callContext: Option[CallContext]): Box[(CounterpartyTrait, Option[CallContext])] = { - import com.openbankproject.commons.dto.{OutBoundCreateCounterparty => OutBound, InBoundCreateCounterparty => InBound} - val procedureName = "create_counterparty" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , name, description, createdByUserId, thisBankId, thisAccountId, thisViewId, otherAccountRoutingScheme, otherAccountRoutingAddress, otherAccountSecondaryRoutingScheme, otherAccountSecondaryRoutingAddress, otherBankRoutingScheme, otherBankRoutingAddress, otherBranchRoutingScheme, otherBranchRoutingAddress, isBeneficiary, bespoke) - val result: OBPReturnType[Box[CounterpartyTraitCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCreateCounterparty => InBound, OutBoundCreateCounterparty => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, name, description, createdByUserId, thisBankId, thisAccountId, thisViewId, otherAccountRoutingScheme, otherAccountRoutingAddress, otherAccountSecondaryRoutingScheme, otherAccountSecondaryRoutingAddress, otherBankRoutingScheme, otherBankRoutingAddress, otherBranchRoutingScheme, otherBranchRoutingAddress, isBeneficiary, bespoke) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_counterparty", req, callContext) + response.map(convertToTuple[CounterpartyTraitCommons](callContext)) } - - messageDocs += checkCustomerNumberAvailableDoc91 - private def checkCustomerNumberAvailableDoc91 = MessageDoc( + + messageDocs += checkCustomerNumberAvailableDoc + def checkCustomerNumberAvailableDoc = MessageDoc( process = "obp.checkCustomerNumberAvailable", messageFormat = messageFormat, - description = """ - |Check Customer Number Available - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: check_customer_number_available - """.stripMargin, + description = "Check Customer Number Available", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCheckCustomerNumberAvailable(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCheckCustomerNumberAvailable(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), customerNumber=customerNumberExample.value) ), exampleInboundMessage = ( - InBoundCheckCustomerNumberAvailable(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCheckCustomerNumberAvailable(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=true) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: check_customer_number_available + override def checkCustomerNumberAvailable(bankId: BankId, customerNumber: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { - import com.openbankproject.commons.dto.{OutBoundCheckCustomerNumberAvailable => OutBound, InBoundCheckCustomerNumberAvailable => InBound} - val procedureName = "check_customer_number_available" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, customerNumber) - val result: OBPReturnType[Box[Boolean]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCheckCustomerNumberAvailable => InBound, OutBoundCheckCustomerNumberAvailable => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, customerNumber) + val response: Future[Box[InBound]] = sendRequest[InBound]("check_customer_number_available", req, callContext) + response.map(convertToTuple[Boolean](callContext)) } - - messageDocs += createCustomerDoc18 - private def createCustomerDoc18 = MessageDoc( + + messageDocs += createCustomerDoc + def createCustomerDoc = MessageDoc( process = "obp.createCustomer", messageFormat = messageFormat, - description = """ - |Create Customer - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_customer - """.stripMargin, + description = "Create Customer", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateCustomer(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateCustomer(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), legalName=legalNameExample.value, mobileNumber=mobileNumberExample.value, @@ -7992,15 +3644,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { nameSuffix=nameSuffixExample.value) ), exampleInboundMessage = ( - InBoundCreateCustomer(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreateCustomer(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= CustomerCommons(customerId=customerIdExample.value, bankId=bankIdExample.value, number=customerNumberExample.value, @@ -8027,70 +3672,31 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_customer + override def createCustomer(bankId: BankId, legalName: String, mobileNumber: String, email: String, faceImage: CustomerFaceImageTrait, dateOfBirth: Date, relationshipStatus: String, dependents: Int, dobOfDependents: List[Date], highestEducationAttained: String, employmentStatus: String, kycStatus: Boolean, lastOkDate: Date, creditRating: Option[CreditRatingTrait], creditLimit: Option[AmountOfMoneyTrait], title: String, branchId: String, nameSuffix: String, callContext: Option[CallContext]): OBPReturnType[Box[Customer]] = { - import com.openbankproject.commons.dto.{OutBoundCreateCustomer => OutBound, InBoundCreateCustomer => InBound} - val procedureName = "create_customer" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, legalName, mobileNumber, email, faceImage, dateOfBirth, relationshipStatus, dependents, dobOfDependents, highestEducationAttained, employmentStatus, kycStatus, lastOkDate, creditRating, creditLimit, title, branchId, nameSuffix) - val result: OBPReturnType[Box[CustomerCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCreateCustomer => InBound, OutBoundCreateCustomer => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, legalName, mobileNumber, email, faceImage, dateOfBirth, relationshipStatus, dependents, dobOfDependents, highestEducationAttained, employmentStatus, kycStatus, lastOkDate, creditRating, creditLimit, title, branchId, nameSuffix) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_customer", req, callContext) + response.map(convertToTuple[CustomerCommons](callContext)) } - - messageDocs += updateCustomerScaDataDoc17 - private def updateCustomerScaDataDoc17 = MessageDoc( + + messageDocs += updateCustomerScaDataDoc + def updateCustomerScaDataDoc = MessageDoc( process = "obp.updateCustomerScaData", messageFormat = messageFormat, - description = """ - |Update Customer Sca Data - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: update_customer_sca_data - """.stripMargin, + description = "Update Customer Sca Data", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundUpdateCustomerScaData(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundUpdateCustomerScaData(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, customerId=customerIdExample.value, mobileNumber=Some(mobileNumberExample.value), email=Some(emailExample.value), customerNumber=Some(customerNumberExample.value)) ), exampleInboundMessage = ( - InBoundUpdateCustomerScaData(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundUpdateCustomerScaData(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= CustomerCommons(customerId=customerIdExample.value, bankId=bankIdExample.value, number=customerNumberExample.value, @@ -8117,55 +3723,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: update_customer_sca_data + override def updateCustomerScaData(customerId: String, mobileNumber: Option[String], email: Option[String], customerNumber: Option[String], callContext: Option[CallContext]): OBPReturnType[Box[Customer]] = { - import com.openbankproject.commons.dto.{OutBoundUpdateCustomerScaData => OutBound, InBoundUpdateCustomerScaData => InBound} - val procedureName = "update_customer_sca_data" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , customerId, mobileNumber, email, customerNumber) - val result: OBPReturnType[Box[CustomerCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundUpdateCustomerScaData => InBound, OutBoundUpdateCustomerScaData => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId, mobileNumber, email, customerNumber) + val response: Future[Box[InBound]] = sendRequest[InBound]("update_customer_sca_data", req, callContext) + response.map(convertToTuple[CustomerCommons](callContext)) } - - messageDocs += updateCustomerCreditDataDoc22 - private def updateCustomerCreditDataDoc22 = MessageDoc( + + messageDocs += updateCustomerCreditDataDoc + def updateCustomerCreditDataDoc = MessageDoc( process = "obp.updateCustomerCreditData", messageFormat = messageFormat, - description = """ - |Update Customer Credit Data - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: update_customer_credit_data - """.stripMargin, + description = "Update Customer Credit Data", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundUpdateCustomerCreditData(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundUpdateCustomerCreditData(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, customerId=customerIdExample.value, creditRating=Some("string"), creditSource=Some("string"), @@ -8173,15 +3747,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { amount=creditLimitAmountExample.value))) ), exampleInboundMessage = ( - InBoundUpdateCustomerCreditData(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundUpdateCustomerCreditData(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= CustomerCommons(customerId=customerIdExample.value, bankId=bankIdExample.value, number=customerNumberExample.value, @@ -8208,55 +3775,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: update_customer_credit_data + override def updateCustomerCreditData(customerId: String, creditRating: Option[String], creditSource: Option[String], creditLimit: Option[AmountOfMoney], callContext: Option[CallContext]): OBPReturnType[Box[Customer]] = { - import com.openbankproject.commons.dto.{OutBoundUpdateCustomerCreditData => OutBound, InBoundUpdateCustomerCreditData => InBound} - val procedureName = "update_customer_credit_data" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , customerId, creditRating, creditSource, creditLimit) - val result: OBPReturnType[Box[CustomerCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundUpdateCustomerCreditData => InBound, OutBoundUpdateCustomerCreditData => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId, creditRating, creditSource, creditLimit) + val response: Future[Box[InBound]] = sendRequest[InBound]("update_customer_credit_data", req, callContext) + response.map(convertToTuple[CustomerCommons](callContext)) } - - messageDocs += updateCustomerGeneralDataDoc50 - private def updateCustomerGeneralDataDoc50 = MessageDoc( + + messageDocs += updateCustomerGeneralDataDoc + def updateCustomerGeneralDataDoc = MessageDoc( process = "obp.updateCustomerGeneralData", messageFormat = messageFormat, - description = """ - |Update Customer General Data - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: update_customer_general_data - """.stripMargin, + description = "Update Customer General Data", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundUpdateCustomerGeneralData(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundUpdateCustomerGeneralData(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, customerId=customerIdExample.value, legalName=Some(legalNameExample.value), faceImage=Some( CustomerFaceImage(date=new Date(), @@ -8271,15 +3806,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { nameSuffix=Some(nameSuffixExample.value)) ), exampleInboundMessage = ( - InBoundUpdateCustomerGeneralData(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundUpdateCustomerGeneralData(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= CustomerCommons(customerId=customerIdExample.value, bankId=bankIdExample.value, number=customerNumberExample.value, @@ -8306,67 +3834,28 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: update_customer_general_data + override def updateCustomerGeneralData(customerId: String, legalName: Option[String], faceImage: Option[CustomerFaceImageTrait], dateOfBirth: Option[Date], relationshipStatus: Option[String], dependents: Option[Int], highestEducationAttained: Option[String], employmentStatus: Option[String], title: Option[String], branchId: Option[String], nameSuffix: Option[String], callContext: Option[CallContext]): OBPReturnType[Box[Customer]] = { - import com.openbankproject.commons.dto.{OutBoundUpdateCustomerGeneralData => OutBound, InBoundUpdateCustomerGeneralData => InBound} - val procedureName = "update_customer_general_data" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , customerId, legalName, faceImage, dateOfBirth, relationshipStatus, dependents, highestEducationAttained, employmentStatus, title, branchId, nameSuffix) - val result: OBPReturnType[Box[CustomerCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundUpdateCustomerGeneralData => InBound, OutBoundUpdateCustomerGeneralData => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId, legalName, faceImage, dateOfBirth, relationshipStatus, dependents, highestEducationAttained, employmentStatus, title, branchId, nameSuffix) + val response: Future[Box[InBound]] = sendRequest[InBound]("update_customer_general_data", req, callContext) + response.map(convertToTuple[CustomerCommons](callContext)) } - - messageDocs += getCustomersByUserIdDoc25 - private def getCustomersByUserIdDoc25 = MessageDoc( + + messageDocs += getCustomersByUserIdDoc + def getCustomersByUserIdDoc = MessageDoc( process = "obp.getCustomersByUserId", messageFormat = messageFormat, - description = """ - |Get Customers By User Id - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_customers_by_user_id - """.stripMargin, + description = "Get Customers By User Id", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetCustomersByUserId(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetCustomersByUserId(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, userId=userIdExample.value) ), exampleInboundMessage = ( - InBoundGetCustomersByUserId(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetCustomersByUserId(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( CustomerCommons(customerId=customerIdExample.value, bankId=bankIdExample.value, number=customerNumberExample.value, @@ -8393,67 +3882,28 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_customers_by_user_id + override def getCustomersByUserId(userId: String, callContext: Option[CallContext]): Future[Box[(List[Customer], Option[CallContext])]] = { - import com.openbankproject.commons.dto.{OutBoundGetCustomersByUserId => OutBound, InBoundGetCustomersByUserId => InBound} - val procedureName = "get_customers_by_user_id" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , userId) - val result: OBPReturnType[Box[List[CustomerCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetCustomersByUserId => InBound, OutBoundGetCustomersByUserId => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, userId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_customers_by_user_id", req, callContext) + response.map(convertToTuple[List[CustomerCommons]](callContext)) } - - messageDocs += getCustomerByCustomerIdLegacyDoc14 - private def getCustomerByCustomerIdLegacyDoc14 = MessageDoc( + + messageDocs += getCustomerByCustomerIdLegacyDoc + def getCustomerByCustomerIdLegacyDoc = MessageDoc( process = "obp.getCustomerByCustomerIdLegacy", messageFormat = messageFormat, - description = """ - |Get Customer By Customer Id Legacy - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_customer_by_customer_id_legacy - """.stripMargin, + description = "Get Customer By Customer Id Legacy", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetCustomerByCustomerIdLegacy(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetCustomerByCustomerIdLegacy(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, customerId=customerIdExample.value) ), exampleInboundMessage = ( - InBoundGetCustomerByCustomerIdLegacy(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetCustomerByCustomerIdLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= CustomerCommons(customerId=customerIdExample.value, bankId=bankIdExample.value, number=customerNumberExample.value, @@ -8480,67 +3930,28 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_customer_by_customer_id_legacy + override def getCustomerByCustomerIdLegacy(customerId: String, callContext: Option[CallContext]): Box[(Customer, Option[CallContext])] = { - import com.openbankproject.commons.dto.{OutBoundGetCustomerByCustomerIdLegacy => OutBound, InBoundGetCustomerByCustomerIdLegacy => InBound} - val procedureName = "get_customer_by_customer_id_legacy" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , customerId) - val result: OBPReturnType[Box[CustomerCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetCustomerByCustomerIdLegacy => InBound, OutBoundGetCustomerByCustomerIdLegacy => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_customer_by_customer_id_legacy", req, callContext) + response.map(convertToTuple[CustomerCommons](callContext)) } - - messageDocs += getCustomerByCustomerIdDoc84 - private def getCustomerByCustomerIdDoc84 = MessageDoc( + + messageDocs += getCustomerByCustomerIdDoc + def getCustomerByCustomerIdDoc = MessageDoc( process = "obp.getCustomerByCustomerId", messageFormat = messageFormat, - description = """ - |Get Customer By Customer Id - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_customer_by_customer_id - """.stripMargin, + description = "Get Customer By Customer Id", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetCustomerByCustomerId(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetCustomerByCustomerId(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, customerId=customerIdExample.value) ), exampleInboundMessage = ( - InBoundGetCustomerByCustomerId(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetCustomerByCustomerId(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= CustomerCommons(customerId=customerIdExample.value, bankId=bankIdExample.value, number=customerNumberExample.value, @@ -8567,68 +3978,29 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_customer_by_customer_id + override def getCustomerByCustomerId(customerId: String, callContext: Option[CallContext]): Future[Box[(Customer, Option[CallContext])]] = { - import com.openbankproject.commons.dto.{OutBoundGetCustomerByCustomerId => OutBound, InBoundGetCustomerByCustomerId => InBound} - val procedureName = "get_customer_by_customer_id" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , customerId) - val result: OBPReturnType[Box[CustomerCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetCustomerByCustomerId => InBound, OutBoundGetCustomerByCustomerId => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_customer_by_customer_id", req, callContext) + response.map(convertToTuple[CustomerCommons](callContext)) } - - messageDocs += getCustomerByCustomerNumberDoc20 - private def getCustomerByCustomerNumberDoc20 = MessageDoc( + + messageDocs += getCustomerByCustomerNumberDoc + def getCustomerByCustomerNumberDoc = MessageDoc( process = "obp.getCustomerByCustomerNumber", messageFormat = messageFormat, - description = """ - |Get Customer By Customer Number - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_customer_by_customer_number - """.stripMargin, + description = "Get Customer By Customer Number", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetCustomerByCustomerNumber(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetCustomerByCustomerNumber(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, customerNumber=customerNumberExample.value, bankId=BankId(bankIdExample.value)) ), exampleInboundMessage = ( - InBoundGetCustomerByCustomerNumber(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetCustomerByCustomerNumber(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= CustomerCommons(customerId=customerIdExample.value, bankId=bankIdExample.value, number=customerNumberExample.value, @@ -8655,67 +4027,28 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_customer_by_customer_number + override def getCustomerByCustomerNumber(customerNumber: String, bankId: BankId, callContext: Option[CallContext]): Future[Box[(Customer, Option[CallContext])]] = { - import com.openbankproject.commons.dto.{OutBoundGetCustomerByCustomerNumber => OutBound, InBoundGetCustomerByCustomerNumber => InBound} - val procedureName = "get_customer_by_customer_number" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , customerNumber, bankId) - val result: OBPReturnType[Box[CustomerCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetCustomerByCustomerNumber => InBound, OutBoundGetCustomerByCustomerNumber => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerNumber, bankId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_customer_by_customer_number", req, callContext) + response.map(convertToTuple[CustomerCommons](callContext)) } - - messageDocs += getCustomerAddressDoc80 - private def getCustomerAddressDoc80 = MessageDoc( + + messageDocs += getCustomerAddressDoc + def getCustomerAddressDoc = MessageDoc( process = "obp.getCustomerAddress", messageFormat = messageFormat, - description = """ - |Get Customer Address - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_customer_address - """.stripMargin, + description = "Get Customer Address", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetCustomerAddress(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetCustomerAddress(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, customerId=customerIdExample.value) ), exampleInboundMessage = ( - InBoundGetCustomerAddress(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetCustomerAddress(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( CustomerAddressCommons(customerId=customerIdExample.value, customerAddressId="string", line1="string", @@ -8732,55 +4065,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_customer_address + override def getCustomerAddress(customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[CustomerAddress]]] = { - import com.openbankproject.commons.dto.{OutBoundGetCustomerAddress => OutBound, InBoundGetCustomerAddress => InBound} - val procedureName = "get_customer_address" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , customerId) - val result: OBPReturnType[Box[List[CustomerAddressCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetCustomerAddress => InBound, OutBoundGetCustomerAddress => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_customer_address", req, callContext) + response.map(convertToTuple[List[CustomerAddressCommons]](callContext)) } - - messageDocs += createCustomerAddressDoc66 - private def createCustomerAddressDoc66 = MessageDoc( + + messageDocs += createCustomerAddressDoc + def createCustomerAddressDoc = MessageDoc( process = "obp.createCustomerAddress", messageFormat = messageFormat, - description = """ - |Create Customer Address - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_customer_address - """.stripMargin, + description = "Create Customer Address", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateCustomerAddress(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateCustomerAddress(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, customerId=customerIdExample.value, line1="string", line2="string", @@ -8794,15 +4095,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { status="string") ), exampleInboundMessage = ( - InBoundCreateCustomerAddress(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreateCustomerAddress(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= CustomerAddressCommons(customerId=customerIdExample.value, customerAddressId="string", line1="string", @@ -8819,55 +4113,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_customer_address + override def createCustomerAddress(customerId: String, line1: String, line2: String, line3: String, city: String, county: String, state: String, postcode: String, countryCode: String, tags: String, status: String, callContext: Option[CallContext]): OBPReturnType[Box[CustomerAddress]] = { - import com.openbankproject.commons.dto.{OutBoundCreateCustomerAddress => OutBound, InBoundCreateCustomerAddress => InBound} - val procedureName = "create_customer_address" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , customerId, line1, line2, line3, city, county, state, postcode, countryCode, tags, status) - val result: OBPReturnType[Box[CustomerAddressCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCreateCustomerAddress => InBound, OutBoundCreateCustomerAddress => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId, line1, line2, line3, city, county, state, postcode, countryCode, tags, status) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_customer_address", req, callContext) + response.map(convertToTuple[CustomerAddressCommons](callContext)) } - - messageDocs += updateCustomerAddressDoc97 - private def updateCustomerAddressDoc97 = MessageDoc( + + messageDocs += updateCustomerAddressDoc + def updateCustomerAddressDoc = MessageDoc( process = "obp.updateCustomerAddress", messageFormat = messageFormat, - description = """ - |Update Customer Address - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: update_customer_address - """.stripMargin, + description = "Update Customer Address", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundUpdateCustomerAddress(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundUpdateCustomerAddress(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, customerAddressId="string", line1="string", line2="string", @@ -8881,15 +4143,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { status="string") ), exampleInboundMessage = ( - InBoundUpdateCustomerAddress(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundUpdateCustomerAddress(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= CustomerAddressCommons(customerId=customerIdExample.value, customerAddressId="string", line1="string", @@ -8906,134 +4161,56 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: update_customer_address + override def updateCustomerAddress(customerAddressId: String, line1: String, line2: String, line3: String, city: String, county: String, state: String, postcode: String, countryCode: String, tags: String, status: String, callContext: Option[CallContext]): OBPReturnType[Box[CustomerAddress]] = { - import com.openbankproject.commons.dto.{OutBoundUpdateCustomerAddress => OutBound, InBoundUpdateCustomerAddress => InBound} - val procedureName = "update_customer_address" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , customerAddressId, line1, line2, line3, city, county, state, postcode, countryCode, tags, status) - val result: OBPReturnType[Box[CustomerAddressCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundUpdateCustomerAddress => InBound, OutBoundUpdateCustomerAddress => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerAddressId, line1, line2, line3, city, county, state, postcode, countryCode, tags, status) + val response: Future[Box[InBound]] = sendRequest[InBound]("update_customer_address", req, callContext) + response.map(convertToTuple[CustomerAddressCommons](callContext)) } - - messageDocs += deleteCustomerAddressDoc84 - private def deleteCustomerAddressDoc84 = MessageDoc( + + messageDocs += deleteCustomerAddressDoc + def deleteCustomerAddressDoc = MessageDoc( process = "obp.deleteCustomerAddress", messageFormat = messageFormat, - description = """ - |Delete Customer Address - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: delete_customer_address - """.stripMargin, + description = "Delete Customer Address", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundDeleteCustomerAddress(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundDeleteCustomerAddress(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, customerAddressId="string") ), exampleInboundMessage = ( - InBoundDeleteCustomerAddress(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundDeleteCustomerAddress(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=true) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: delete_customer_address + override def deleteCustomerAddress(customerAddressId: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { - import com.openbankproject.commons.dto.{OutBoundDeleteCustomerAddress => OutBound, InBoundDeleteCustomerAddress => InBound} - val procedureName = "delete_customer_address" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , customerAddressId) - val result: OBPReturnType[Box[Boolean]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundDeleteCustomerAddress => InBound, OutBoundDeleteCustomerAddress => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerAddressId) + val response: Future[Box[InBound]] = sendRequest[InBound]("delete_customer_address", req, callContext) + response.map(convertToTuple[Boolean](callContext)) } - - messageDocs += createTaxResidenceDoc58 - private def createTaxResidenceDoc58 = MessageDoc( + + messageDocs += createTaxResidenceDoc + def createTaxResidenceDoc = MessageDoc( process = "obp.createTaxResidence", messageFormat = messageFormat, - description = """ - |Create Tax Residence - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_tax_residence - """.stripMargin, + description = "Create Tax Residence", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateTaxResidence(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateTaxResidence(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, customerId=customerIdExample.value, domain="string", taxNumber="string") ), exampleInboundMessage = ( - InBoundCreateTaxResidence(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreateTaxResidence(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= TaxResidenceCommons(customerId=customerIdExample.value, taxResidenceId="string", domain="string", @@ -9041,67 +4218,28 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_tax_residence + override def createTaxResidence(customerId: String, domain: String, taxNumber: String, callContext: Option[CallContext]): OBPReturnType[Box[TaxResidence]] = { - import com.openbankproject.commons.dto.{OutBoundCreateTaxResidence => OutBound, InBoundCreateTaxResidence => InBound} - val procedureName = "create_tax_residence" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , customerId, domain, taxNumber) - val result: OBPReturnType[Box[TaxResidenceCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCreateTaxResidence => InBound, OutBoundCreateTaxResidence => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId, domain, taxNumber) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_tax_residence", req, callContext) + response.map(convertToTuple[TaxResidenceCommons](callContext)) } - - messageDocs += getTaxResidenceDoc28 - private def getTaxResidenceDoc28 = MessageDoc( + + messageDocs += getTaxResidenceDoc + def getTaxResidenceDoc = MessageDoc( process = "obp.getTaxResidence", messageFormat = messageFormat, - description = """ - |Get Tax Residence - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_tax_residence - """.stripMargin, + description = "Get Tax Residence", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetTaxResidence(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetTaxResidence(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, customerId=customerIdExample.value) ), exampleInboundMessage = ( - InBoundGetTaxResidence(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetTaxResidence(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( TaxResidenceCommons(customerId=customerIdExample.value, taxResidenceId="string", domain="string", @@ -9109,120 +4247,49 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_tax_residence + override def getTaxResidence(customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[TaxResidence]]] = { - import com.openbankproject.commons.dto.{OutBoundGetTaxResidence => OutBound, InBoundGetTaxResidence => InBound} - val procedureName = "get_tax_residence" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , customerId) - val result: OBPReturnType[Box[List[TaxResidenceCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetTaxResidence => InBound, OutBoundGetTaxResidence => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_tax_residence", req, callContext) + response.map(convertToTuple[List[TaxResidenceCommons]](callContext)) } - - messageDocs += deleteTaxResidenceDoc54 - private def deleteTaxResidenceDoc54 = MessageDoc( + + messageDocs += deleteTaxResidenceDoc + def deleteTaxResidenceDoc = MessageDoc( process = "obp.deleteTaxResidence", messageFormat = messageFormat, - description = """ - |Delete Tax Residence - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: delete_tax_residence - """.stripMargin, + description = "Delete Tax Residence", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundDeleteTaxResidence(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundDeleteTaxResidence(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, taxResourceId="string") ), exampleInboundMessage = ( - InBoundDeleteTaxResidence(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundDeleteTaxResidence(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=true) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: delete_tax_residence + override def deleteTaxResidence(taxResourceId: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { - import com.openbankproject.commons.dto.{OutBoundDeleteTaxResidence => OutBound, InBoundDeleteTaxResidence => InBound} - val procedureName = "delete_tax_residence" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , taxResourceId) - val result: OBPReturnType[Box[Boolean]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundDeleteTaxResidence => InBound, OutBoundDeleteTaxResidence => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, taxResourceId) + val response: Future[Box[InBound]] = sendRequest[InBound]("delete_tax_residence", req, callContext) + response.map(convertToTuple[Boolean](callContext)) } - - messageDocs += getCustomersDoc12 - private def getCustomersDoc12 = MessageDoc( + + messageDocs += getCustomersDoc + def getCustomersDoc = MessageDoc( process = "obp.getCustomers", messageFormat = messageFormat, - description = """ - |Get Customers - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_customers - """.stripMargin, + description = "Get Customers", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetCustomers(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetCustomers(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), limit=limitExample.value.toInt, offset=offsetExample.value.toInt, @@ -9230,15 +4297,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { toDate="string") ), exampleInboundMessage = ( - InBoundGetCustomers(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetCustomers(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( CustomerCommons(customerId=customerIdExample.value, bankId=bankIdExample.value, number=customerNumberExample.value, @@ -9265,68 +4325,78 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_customers + override def getCustomers(bankId: BankId, callContext: Option[CallContext], queryParams: List[OBPQueryParam]): Future[Box[List[Customer]]] = { - import com.openbankproject.commons.dto.{OutBoundGetCustomers => OutBound, InBoundGetCustomers => InBound} - val procedureName = "get_customers" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) - val result: OBPReturnType[Box[List[CustomerCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetCustomers => InBound, OutBoundGetCustomers => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_customers", req, callContext) + response.map(convertToTuple[List[CustomerCommons]](callContext)) } - - messageDocs += getCheckbookOrdersDoc40 - private def getCheckbookOrdersDoc40 = MessageDoc( - process = "obp.getCheckbookOrders", + + messageDocs += getCustomersByCustomerPhoneNumberDoc + def getCustomersByCustomerPhoneNumberDoc = MessageDoc( + process = "obp.getCustomersByCustomerPhoneNumber", messageFormat = messageFormat, - description = """ - |Get Checkbook Orders - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_checkbook_orders - """.stripMargin, + description = "Get Customers By Customer Phone Number", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetCheckbookOrders(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, + OutBoundGetCustomersByCustomerPhoneNumber(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + phoneNumber="string") + ), + exampleInboundMessage = ( + InBoundGetCustomersByCustomerPhoneNumber(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( CustomerCommons(customerId=customerIdExample.value, + bankId=bankIdExample.value, + number=customerNumberExample.value, legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + mobileNumber=mobileNumberExample.value, + email=emailExample.value, + faceImage= CustomerFaceImage(date=parseDate(customerFaceImageDateExample.value).getOrElse(sys.error("customerFaceImageDateExample.value is not validate date format.")), + url=urlExample.value), + dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")), + relationshipStatus=relationshipStatusExample.value, + dependents=dependentsExample.value.toInt, + dobOfDependents=dobOfDependentsExample.value.split("[,;]").map(parseDate).flatMap(_.toSeq).toList, + highestEducationAttained=highestEducationAttainedExample.value, + employmentStatus=employmentStatusExample.value, + creditRating= CreditRating(rating=ratingExample.value, + source=sourceExample.value), + creditLimit= CreditLimit(currency=currencyExample.value, + amount=creditLimitAmountExample.value), + kycStatus=kycStatusExample.value.toBoolean, + lastOkDate=parseDate(customerLastOkDateExample.value).getOrElse(sys.error("customerLastOkDateExample.value is not validate date format.")), + title=customerTitleExample.value, + branchId=branchIdExample.value, + nameSuffix=nameSuffixExample.value))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getCustomersByCustomerPhoneNumber(bankId: BankId, phoneNumber: String, callContext: Option[CallContext]): OBPReturnType[Box[List[Customer]]] = { + import com.openbankproject.commons.dto.{InBoundGetCustomersByCustomerPhoneNumber => InBound, OutBoundGetCustomersByCustomerPhoneNumber => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, phoneNumber) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_customers_by_customer_phone_number", req, callContext) + response.map(convertToTuple[List[CustomerCommons]](callContext)) + } + + messageDocs += getCheckbookOrdersDoc + def getCheckbookOrdersDoc = MessageDoc( + process = "obp.getCheckbookOrders", + messageFormat = messageFormat, + description = "Get Checkbook Orders", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetCheckbookOrders(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=bankIdExample.value, accountId=accountIdExample.value) ), exampleInboundMessage = ( - InBoundGetCheckbookOrders(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetCheckbookOrders(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= CheckbookOrdersJson(account= AccountV310Json(bank_id="string", account_id="string", account_type="string", @@ -9344,137 +4414,59 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_checkbook_orders + override def getCheckbookOrders(bankId: String, accountId: String, callContext: Option[CallContext]): Future[Box[(CheckbookOrdersJson, Option[CallContext])]] = { - import com.openbankproject.commons.dto.{OutBoundGetCheckbookOrders => OutBound, InBoundGetCheckbookOrders => InBound} - val procedureName = "get_checkbook_orders" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountId) - val result: OBPReturnType[Box[CheckbookOrdersJson]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetCheckbookOrders => InBound, OutBoundGetCheckbookOrders => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_checkbook_orders", req, callContext) + response.map(convertToTuple[CheckbookOrdersJson](callContext)) } - - messageDocs += getStatusOfCreditCardOrderDoc96 - private def getStatusOfCreditCardOrderDoc96 = MessageDoc( + + messageDocs += getStatusOfCreditCardOrderDoc + def getStatusOfCreditCardOrderDoc = MessageDoc( process = "obp.getStatusOfCreditCardOrder", messageFormat = messageFormat, - description = """ - |Get Status Of Credit Card Order - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_status_of_credit_card_order - """.stripMargin, + description = "Get Status Of Credit Card Order", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetStatusOfCreditCardOrder(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetStatusOfCreditCardOrder(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=bankIdExample.value, accountId=accountIdExample.value) ), exampleInboundMessage = ( - InBoundGetStatusOfCreditCardOrder(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetStatusOfCreditCardOrder(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( CardObjectJson(card_type="string", card_description="string", use_type="string"))) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_status_of_credit_card_order + override def getStatusOfCreditCardOrder(bankId: String, accountId: String, callContext: Option[CallContext]): Future[Box[(List[CardObjectJson], Option[CallContext])]] = { - import com.openbankproject.commons.dto.{OutBoundGetStatusOfCreditCardOrder => OutBound, InBoundGetStatusOfCreditCardOrder => InBound} - val procedureName = "get_status_of_credit_card_order" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountId) - val result: OBPReturnType[Box[List[CardObjectJson]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetStatusOfCreditCardOrder => InBound, OutBoundGetStatusOfCreditCardOrder => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_status_of_credit_card_order", req, callContext) + response.map(convertToTuple[List[CardObjectJson]](callContext)) } - - messageDocs += createUserAuthContextDoc5 - private def createUserAuthContextDoc5 = MessageDoc( + + messageDocs += createUserAuthContextDoc + def createUserAuthContextDoc = MessageDoc( process = "obp.createUserAuthContext", messageFormat = messageFormat, - description = """ - |Create User Auth Context - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_user_auth_context - """.stripMargin, + description = "Create User Auth Context", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateUserAuthContext(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateUserAuthContext(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, userId=userIdExample.value, key=keyExample.value, value=valueExample.value) ), exampleInboundMessage = ( - InBoundCreateUserAuthContext(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreateUserAuthContext(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= UserAuthContextCommons(userAuthContextId="string", userId=userIdExample.value, key=keyExample.value, @@ -9482,69 +4474,30 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_user_auth_context + override def createUserAuthContext(userId: String, key: String, value: String, callContext: Option[CallContext]): OBPReturnType[Box[UserAuthContext]] = { - import com.openbankproject.commons.dto.{OutBoundCreateUserAuthContext => OutBound, InBoundCreateUserAuthContext => InBound} - val procedureName = "create_user_auth_context" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , userId, key, value) - val result: OBPReturnType[Box[UserAuthContextCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCreateUserAuthContext => InBound, OutBoundCreateUserAuthContext => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, userId, key, value) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_user_auth_context", req, callContext) + response.map(convertToTuple[UserAuthContextCommons](callContext)) } - - messageDocs += createUserAuthContextUpdateDoc97 - private def createUserAuthContextUpdateDoc97 = MessageDoc( + + messageDocs += createUserAuthContextUpdateDoc + def createUserAuthContextUpdateDoc = MessageDoc( process = "obp.createUserAuthContextUpdate", messageFormat = messageFormat, - description = """ - |Create User Auth Context Update - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_user_auth_context_update - """.stripMargin, + description = "Create User Auth Context Update", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateUserAuthContextUpdate(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateUserAuthContextUpdate(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, userId=userIdExample.value, key=keyExample.value, value=valueExample.value) ), exampleInboundMessage = ( - InBoundCreateUserAuthContextUpdate(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreateUserAuthContextUpdate(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= UserAuthContextUpdateCommons(userAuthContextUpdateId="string", userId=userIdExample.value, key=keyExample.value, @@ -9554,197 +4507,80 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_user_auth_context_update + override def createUserAuthContextUpdate(userId: String, key: String, value: String, callContext: Option[CallContext]): OBPReturnType[Box[UserAuthContextUpdate]] = { - import com.openbankproject.commons.dto.{OutBoundCreateUserAuthContextUpdate => OutBound, InBoundCreateUserAuthContextUpdate => InBound} - val procedureName = "create_user_auth_context_update" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , userId, key, value) - val result: OBPReturnType[Box[UserAuthContextUpdateCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCreateUserAuthContextUpdate => InBound, OutBoundCreateUserAuthContextUpdate => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, userId, key, value) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_user_auth_context_update", req, callContext) + response.map(convertToTuple[UserAuthContextUpdateCommons](callContext)) } - - messageDocs += deleteUserAuthContextsDoc21 - private def deleteUserAuthContextsDoc21 = MessageDoc( + + messageDocs += deleteUserAuthContextsDoc + def deleteUserAuthContextsDoc = MessageDoc( process = "obp.deleteUserAuthContexts", messageFormat = messageFormat, - description = """ - |Delete User Auth Contexts - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: delete_user_auth_contexts - """.stripMargin, + description = "Delete User Auth Contexts", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundDeleteUserAuthContexts(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundDeleteUserAuthContexts(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, userId=userIdExample.value) ), exampleInboundMessage = ( - InBoundDeleteUserAuthContexts(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundDeleteUserAuthContexts(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=true) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: delete_user_auth_contexts + override def deleteUserAuthContexts(userId: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { - import com.openbankproject.commons.dto.{OutBoundDeleteUserAuthContexts => OutBound, InBoundDeleteUserAuthContexts => InBound} - val procedureName = "delete_user_auth_contexts" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , userId) - val result: OBPReturnType[Box[Boolean]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundDeleteUserAuthContexts => InBound, OutBoundDeleteUserAuthContexts => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, userId) + val response: Future[Box[InBound]] = sendRequest[InBound]("delete_user_auth_contexts", req, callContext) + response.map(convertToTuple[Boolean](callContext)) } - - messageDocs += deleteUserAuthContextByIdDoc77 - private def deleteUserAuthContextByIdDoc77 = MessageDoc( + + messageDocs += deleteUserAuthContextByIdDoc + def deleteUserAuthContextByIdDoc = MessageDoc( process = "obp.deleteUserAuthContextById", messageFormat = messageFormat, - description = """ - |Delete User Auth Context By Id - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: delete_user_auth_context_by_id - """.stripMargin, + description = "Delete User Auth Context By Id", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundDeleteUserAuthContextById(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundDeleteUserAuthContextById(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, userAuthContextId="string") ), exampleInboundMessage = ( - InBoundDeleteUserAuthContextById(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundDeleteUserAuthContextById(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=true) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: delete_user_auth_context_by_id + override def deleteUserAuthContextById(userAuthContextId: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { - import com.openbankproject.commons.dto.{OutBoundDeleteUserAuthContextById => OutBound, InBoundDeleteUserAuthContextById => InBound} - val procedureName = "delete_user_auth_context_by_id" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , userAuthContextId) - val result: OBPReturnType[Box[Boolean]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundDeleteUserAuthContextById => InBound, OutBoundDeleteUserAuthContextById => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, userAuthContextId) + val response: Future[Box[InBound]] = sendRequest[InBound]("delete_user_auth_context_by_id", req, callContext) + response.map(convertToTuple[Boolean](callContext)) } - - messageDocs += getUserAuthContextsDoc51 - private def getUserAuthContextsDoc51 = MessageDoc( + + messageDocs += getUserAuthContextsDoc + def getUserAuthContextsDoc = MessageDoc( process = "obp.getUserAuthContexts", messageFormat = messageFormat, - description = """ - |Get User Auth Contexts - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_user_auth_contexts - """.stripMargin, + description = "Get User Auth Contexts", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetUserAuthContexts(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetUserAuthContexts(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, userId=userIdExample.value) ), exampleInboundMessage = ( - InBoundGetUserAuthContexts(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetUserAuthContexts(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( UserAuthContextCommons(userAuthContextId="string", userId=userIdExample.value, key=keyExample.value, @@ -9752,55 +4588,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_user_auth_contexts + override def getUserAuthContexts(userId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[UserAuthContext]]] = { - import com.openbankproject.commons.dto.{OutBoundGetUserAuthContexts => OutBound, InBoundGetUserAuthContexts => InBound} - val procedureName = "get_user_auth_contexts" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , userId) - val result: OBPReturnType[Box[List[UserAuthContextCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetUserAuthContexts => InBound, OutBoundGetUserAuthContexts => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, userId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_user_auth_contexts", req, callContext) + response.map(convertToTuple[List[UserAuthContextCommons]](callContext)) } - - messageDocs += createOrUpdateProductAttributeDoc69 - private def createOrUpdateProductAttributeDoc69 = MessageDoc( + + messageDocs += createOrUpdateProductAttributeDoc + def createOrUpdateProductAttributeDoc = MessageDoc( process = "obp.createOrUpdateProductAttribute", messageFormat = messageFormat, - description = """ - |Create Or Update Product Attribute - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_or_update_product_attribute - """.stripMargin, + description = "Create Or Update Product Attribute", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateOrUpdateProductAttribute(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateOrUpdateProductAttribute(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), productCode=ProductCode("string"), productAttributeId=Some("string"), @@ -9809,15 +4613,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { value=valueExample.value) ), exampleInboundMessage = ( - InBoundCreateOrUpdateProductAttribute(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreateOrUpdateProductAttribute(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= ProductAttributeCommons(bankId=BankId(bankIdExample.value), productCode=ProductCode("string"), productAttributeId="string", @@ -9827,67 +4624,28 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_or_update_product_attribute + override def createOrUpdateProductAttribute(bankId: BankId, productCode: ProductCode, productAttributeId: Option[String], name: String, productAttributeType: ProductAttributeType.Value, value: String, callContext: Option[CallContext]): OBPReturnType[Box[ProductAttribute]] = { - import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateProductAttribute => OutBound, InBoundCreateOrUpdateProductAttribute => InBound} - val procedureName = "create_or_update_product_attribute" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, productCode, productAttributeId, name, productAttributeType, value) - val result: OBPReturnType[Box[ProductAttributeCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCreateOrUpdateProductAttribute => InBound, OutBoundCreateOrUpdateProductAttribute => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, productCode, productAttributeId, name, productAttributeType, value) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_or_update_product_attribute", req, callContext) + response.map(convertToTuple[ProductAttributeCommons](callContext)) } - - messageDocs += getProductAttributeByIdDoc70 - private def getProductAttributeByIdDoc70 = MessageDoc( + + messageDocs += getProductAttributeByIdDoc + def getProductAttributeByIdDoc = MessageDoc( process = "obp.getProductAttributeById", messageFormat = messageFormat, - description = """ - |Get Product Attribute By Id - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_product_attribute_by_id - """.stripMargin, + description = "Get Product Attribute By Id", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetProductAttributeById(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetProductAttributeById(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, productAttributeId="string") ), exampleInboundMessage = ( - InBoundGetProductAttributeById(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetProductAttributeById(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= ProductAttributeCommons(bankId=BankId(bankIdExample.value), productCode=ProductCode("string"), productAttributeId="string", @@ -9897,68 +4655,29 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_product_attribute_by_id + override def getProductAttributeById(productAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[ProductAttribute]] = { - import com.openbankproject.commons.dto.{OutBoundGetProductAttributeById => OutBound, InBoundGetProductAttributeById => InBound} - val procedureName = "get_product_attribute_by_id" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , productAttributeId) - val result: OBPReturnType[Box[ProductAttributeCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetProductAttributeById => InBound, OutBoundGetProductAttributeById => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, productAttributeId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_product_attribute_by_id", req, callContext) + response.map(convertToTuple[ProductAttributeCommons](callContext)) } - - messageDocs += getProductAttributesByBankAndCodeDoc99 - private def getProductAttributesByBankAndCodeDoc99 = MessageDoc( + + messageDocs += getProductAttributesByBankAndCodeDoc + def getProductAttributesByBankAndCodeDoc = MessageDoc( process = "obp.getProductAttributesByBankAndCode", messageFormat = messageFormat, - description = """ - |Get Product Attributes By Bank And Code - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_product_attributes_by_bank_and_code - """.stripMargin, + description = "Get Product Attributes By Bank And Code", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetProductAttributesByBankAndCode(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetProductAttributesByBankAndCode(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bank=BankId(bankIdExample.value), productCode=ProductCode("string")) ), exampleInboundMessage = ( - InBoundGetProductAttributesByBankAndCode(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetProductAttributesByBankAndCode(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( ProductAttributeCommons(bankId=BankId(bankIdExample.value), productCode=ProductCode("string"), productAttributeId="string", @@ -9968,132 +4687,54 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_product_attributes_by_bank_and_code + override def getProductAttributesByBankAndCode(bank: BankId, productCode: ProductCode, callContext: Option[CallContext]): OBPReturnType[Box[List[ProductAttribute]]] = { - import com.openbankproject.commons.dto.{OutBoundGetProductAttributesByBankAndCode => OutBound, InBoundGetProductAttributesByBankAndCode => InBound} - val procedureName = "get_product_attributes_by_bank_and_code" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bank, productCode) - val result: OBPReturnType[Box[List[ProductAttributeCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetProductAttributesByBankAndCode => InBound, OutBoundGetProductAttributesByBankAndCode => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bank, productCode) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_product_attributes_by_bank_and_code", req, callContext) + response.map(convertToTuple[List[ProductAttributeCommons]](callContext)) } - - messageDocs += deleteProductAttributeDoc43 - private def deleteProductAttributeDoc43 = MessageDoc( + + messageDocs += deleteProductAttributeDoc + def deleteProductAttributeDoc = MessageDoc( process = "obp.deleteProductAttribute", messageFormat = messageFormat, - description = """ - |Delete Product Attribute - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: delete_product_attribute - """.stripMargin, + description = "Delete Product Attribute", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundDeleteProductAttribute(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundDeleteProductAttribute(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, productAttributeId="string") ), exampleInboundMessage = ( - InBoundDeleteProductAttribute(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundDeleteProductAttribute(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=true) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: delete_product_attribute + override def deleteProductAttribute(productAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { - import com.openbankproject.commons.dto.{OutBoundDeleteProductAttribute => OutBound, InBoundDeleteProductAttribute => InBound} - val procedureName = "delete_product_attribute" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , productAttributeId) - val result: OBPReturnType[Box[Boolean]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundDeleteProductAttribute => InBound, OutBoundDeleteProductAttribute => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, productAttributeId) + val response: Future[Box[InBound]] = sendRequest[InBound]("delete_product_attribute", req, callContext) + response.map(convertToTuple[Boolean](callContext)) } - - messageDocs += getAccountAttributeByIdDoc35 - private def getAccountAttributeByIdDoc35 = MessageDoc( + + messageDocs += getAccountAttributeByIdDoc + def getAccountAttributeByIdDoc = MessageDoc( process = "obp.getAccountAttributeById", messageFormat = messageFormat, - description = """ - |Get Account Attribute By Id - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_account_attribute_by_id - """.stripMargin, + description = "Get Account Attribute By Id", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetAccountAttributeById(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetAccountAttributeById(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, accountAttributeId="string") ), exampleInboundMessage = ( - InBoundGetAccountAttributeById(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetAccountAttributeById(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= AccountAttributeCommons(bankId=BankId(bankIdExample.value), accountId=AccountId(accountIdExample.value), productCode=ProductCode("string"), @@ -10104,55 +4745,54 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_account_attribute_by_id + override def getAccountAttributeById(accountAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[AccountAttribute]] = { - import com.openbankproject.commons.dto.{OutBoundGetAccountAttributeById => OutBound, InBoundGetAccountAttributeById => InBound} - val procedureName = "get_account_attribute_by_id" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , accountAttributeId) - val result: OBPReturnType[Box[AccountAttributeCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetAccountAttributeById => InBound, OutBoundGetAccountAttributeById => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, accountAttributeId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_account_attribute_by_id", req, callContext) + response.map(convertToTuple[AccountAttributeCommons](callContext)) } - - messageDocs += createOrUpdateAccountAttributeDoc97 - private def createOrUpdateAccountAttributeDoc97 = MessageDoc( - process = "obp.createOrUpdateAccountAttribute", + + messageDocs += getTransactionAttributeByIdDoc + def getTransactionAttributeByIdDoc = MessageDoc( + process = "obp.getTransactionAttributeById", messageFormat = messageFormat, - description = """ - |Create Or Update Account Attribute - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_or_update_account_attribute - """.stripMargin, + description = "Get Transaction Attribute By Id", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateOrUpdateAccountAttribute(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetTransactionAttributeById(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + transactionAttributeId=transactionAttributeIdExample.value) + ), + exampleInboundMessage = ( + InBoundGetTransactionAttributeById(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= TransactionAttributeCommons(bankId=BankId(bankIdExample.value), + transactionId=TransactionId(transactionIdExample.value), + transactionAttributeId=transactionAttributeIdExample.value, + attributeType=com.openbankproject.commons.model.enums.TransactionAttributeType.example, + name=transactionAttributeNameExample.value, + value=transactionAttributeValueExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getTransactionAttributeById(transactionAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[TransactionAttribute]] = { + import com.openbankproject.commons.dto.{InBoundGetTransactionAttributeById => InBound, OutBoundGetTransactionAttributeById => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, transactionAttributeId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_transaction_attribute_by_id", req, callContext) + response.map(convertToTuple[TransactionAttributeCommons](callContext)) + } + + messageDocs += createOrUpdateAccountAttributeDoc + def createOrUpdateAccountAttributeDoc = MessageDoc( + process = "obp.createOrUpdateAccountAttribute", + messageFormat = messageFormat, + description = "Create Or Update Account Attribute", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateOrUpdateAccountAttribute(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), accountId=AccountId(accountIdExample.value), productCode=ProductCode("string"), @@ -10162,15 +4802,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { value=valueExample.value) ), exampleInboundMessage = ( - InBoundCreateOrUpdateAccountAttribute(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreateOrUpdateAccountAttribute(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= AccountAttributeCommons(bankId=BankId(bankIdExample.value), accountId=AccountId(accountIdExample.value), productCode=ProductCode("string"), @@ -10181,55 +4814,95 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_or_update_account_attribute + override def createOrUpdateAccountAttribute(bankId: BankId, accountId: AccountId, productCode: ProductCode, productAttributeId: Option[String], name: String, accountAttributeType: AccountAttributeType.Value, value: String, callContext: Option[CallContext]): OBPReturnType[Box[AccountAttribute]] = { - import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateAccountAttribute => OutBound, InBoundCreateOrUpdateAccountAttribute => InBound} - val procedureName = "create_or_update_account_attribute" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountId, productCode, productAttributeId, name, accountAttributeType, value) - val result: OBPReturnType[Box[AccountAttributeCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCreateOrUpdateAccountAttribute => InBound, OutBoundCreateOrUpdateAccountAttribute => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, productCode, productAttributeId, name, accountAttributeType, value) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_or_update_account_attribute", req, callContext) + response.map(convertToTuple[AccountAttributeCommons](callContext)) } - - messageDocs += createAccountAttributesDoc39 - private def createAccountAttributesDoc39 = MessageDoc( - process = "obp.createAccountAttributes", + + messageDocs += createOrUpdateCustomerAttributeDoc + def createOrUpdateCustomerAttributeDoc = MessageDoc( + process = "obp.createOrUpdateCustomerAttribute", messageFormat = messageFormat, - description = """ - |Create Account Attributes - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_account_attributes - """.stripMargin, + description = "Create Or Update Customer Attribute", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateAccountAttributes(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateOrUpdateCustomerAttribute(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + customerId=CustomerId(customerIdExample.value), + customerAttributeId=Some(customerAttributeIdExample.value), + name="string", + attributeType=com.openbankproject.commons.model.enums.CustomerAttributeType.example, + value=valueExample.value) + ), + exampleInboundMessage = ( + InBoundCreateOrUpdateCustomerAttribute(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= CustomerAttributeCommons(bankId=BankId(bankIdExample.value), + customerId=CustomerId(customerIdExample.value), + customerAttributeId=customerAttributeIdExample.value, + attributeType=com.openbankproject.commons.model.enums.CustomerAttributeType.example, + name=customerAttributeNameExample.value, + value=customerAttributeValueExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createOrUpdateCustomerAttribute(bankId: BankId, customerId: CustomerId, customerAttributeId: Option[String], name: String, attributeType: CustomerAttributeType.Value, value: String, callContext: Option[CallContext]): OBPReturnType[Box[CustomerAttribute]] = { + import com.openbankproject.commons.dto.{InBoundCreateOrUpdateCustomerAttribute => InBound, OutBoundCreateOrUpdateCustomerAttribute => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, customerId, customerAttributeId, name, attributeType, value) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_or_update_customer_attribute", req, callContext) + response.map(convertToTuple[CustomerAttributeCommons](callContext)) + } + + messageDocs += createOrUpdateTransactionAttributeDoc + def createOrUpdateTransactionAttributeDoc = MessageDoc( + process = "obp.createOrUpdateTransactionAttribute", + messageFormat = messageFormat, + description = "Create Or Update Transaction Attribute", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateOrUpdateTransactionAttribute(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + transactionId=TransactionId(transactionIdExample.value), + transactionAttributeId=Some(transactionAttributeIdExample.value), + name="string", + attributeType=com.openbankproject.commons.model.enums.TransactionAttributeType.example, + value=valueExample.value) + ), + exampleInboundMessage = ( + InBoundCreateOrUpdateTransactionAttribute(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= TransactionAttributeCommons(bankId=BankId(bankIdExample.value), + transactionId=TransactionId(transactionIdExample.value), + transactionAttributeId=transactionAttributeIdExample.value, + attributeType=com.openbankproject.commons.model.enums.TransactionAttributeType.example, + name=transactionAttributeNameExample.value, + value=transactionAttributeValueExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createOrUpdateTransactionAttribute(bankId: BankId, transactionId: TransactionId, transactionAttributeId: Option[String], name: String, attributeType: TransactionAttributeType.Value, value: String, callContext: Option[CallContext]): OBPReturnType[Box[TransactionAttribute]] = { + import com.openbankproject.commons.dto.{InBoundCreateOrUpdateTransactionAttribute => InBound, OutBoundCreateOrUpdateTransactionAttribute => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, transactionId, transactionAttributeId, name, attributeType, value) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_or_update_transaction_attribute", req, callContext) + response.map(convertToTuple[TransactionAttributeCommons](callContext)) + } + + messageDocs += createAccountAttributesDoc + def createAccountAttributesDoc = MessageDoc( + process = "obp.createAccountAttributes", + messageFormat = messageFormat, + description = "Create Account Attributes", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateAccountAttributes(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), accountId=AccountId(accountIdExample.value), productCode=ProductCode("string"), @@ -10241,15 +4914,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { value=valueExample.value))) ), exampleInboundMessage = ( - InBoundCreateAccountAttributes(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreateAccountAttributes(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( AccountAttributeCommons(bankId=BankId(bankIdExample.value), accountId=AccountId(accountIdExample.value), productCode=ProductCode("string"), @@ -10260,68 +4926,29 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_account_attributes + override def createAccountAttributes(bankId: BankId, accountId: AccountId, productCode: ProductCode, accountAttributes: List[ProductAttribute], callContext: Option[CallContext]): OBPReturnType[Box[List[AccountAttribute]]] = { - import com.openbankproject.commons.dto.{OutBoundCreateAccountAttributes => OutBound, InBoundCreateAccountAttributes => InBound} - val procedureName = "create_account_attributes" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountId, productCode, accountAttributes) - val result: OBPReturnType[Box[List[AccountAttributeCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCreateAccountAttributes => InBound, OutBoundCreateAccountAttributes => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, productCode, accountAttributes) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_account_attributes", req, callContext) + response.map(convertToTuple[List[AccountAttributeCommons]](callContext)) } - - messageDocs += getAccountAttributesByAccountDoc69 - private def getAccountAttributesByAccountDoc69 = MessageDoc( + + messageDocs += getAccountAttributesByAccountDoc + def getAccountAttributesByAccountDoc = MessageDoc( process = "obp.getAccountAttributesByAccount", messageFormat = messageFormat, - description = """ - |Get Account Attributes By Account - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_account_attributes_by_account - """.stripMargin, + description = "Get Account Attributes By Account", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetAccountAttributesByAccount(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetAccountAttributesByAccount(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), accountId=AccountId(accountIdExample.value)) ), exampleInboundMessage = ( - InBoundGetAccountAttributesByAccount(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetAccountAttributesByAccount(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( AccountAttributeCommons(bankId=BankId(bankIdExample.value), accountId=AccountId(accountIdExample.value), productCode=ProductCode("string"), @@ -10332,55 +4959,226 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_account_attributes_by_account + override def getAccountAttributesByAccount(bankId: BankId, accountId: AccountId, callContext: Option[CallContext]): OBPReturnType[Box[List[AccountAttribute]]] = { - import com.openbankproject.commons.dto.{OutBoundGetAccountAttributesByAccount => OutBound, InBoundGetAccountAttributesByAccount => InBound} - val procedureName = "get_account_attributes_by_account" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountId) - val result: OBPReturnType[Box[List[AccountAttributeCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetAccountAttributesByAccount => InBound, OutBoundGetAccountAttributesByAccount => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_account_attributes_by_account", req, callContext) + response.map(convertToTuple[List[AccountAttributeCommons]](callContext)) } - - messageDocs += createOrUpdateCardAttributeDoc89 - private def createOrUpdateCardAttributeDoc89 = MessageDoc( - process = "obp.createOrUpdateCardAttribute", + + messageDocs += getCustomerAttributesDoc + def getCustomerAttributesDoc = MessageDoc( + process = "obp.getCustomerAttributes", messageFormat = messageFormat, - description = """ - |Create Or Update Card Attribute - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_or_update_card_attribute - """.stripMargin, + description = "Get Customer Attributes", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateOrUpdateCardAttribute(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, + OutBoundGetCustomerAttributes(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + customerId=CustomerId(customerIdExample.value)) + ), + exampleInboundMessage = ( + InBoundGetCustomerAttributes(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( CustomerAttributeCommons(bankId=BankId(bankIdExample.value), + customerId=CustomerId(customerIdExample.value), + customerAttributeId=customerAttributeIdExample.value, + attributeType=com.openbankproject.commons.model.enums.CustomerAttributeType.example, + name=customerAttributeNameExample.value, + value=customerAttributeValueExample.value))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getCustomerAttributes(bankId: BankId, customerId: CustomerId, callContext: Option[CallContext]): OBPReturnType[Box[List[CustomerAttribute]]] = { + import com.openbankproject.commons.dto.{InBoundGetCustomerAttributes => InBound, OutBoundGetCustomerAttributes => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, customerId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_customer_attributes", req, callContext) + response.map(convertToTuple[List[CustomerAttributeCommons]](callContext)) + } + + messageDocs += getCustomerIdsByAttributeNameValuesDoc + def getCustomerIdsByAttributeNameValuesDoc = MessageDoc( + process = "obp.getCustomerIdsByAttributeNameValues", + messageFormat = messageFormat, + description = "Get Customer Ids By Attribute Name Values", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetCustomerIdsByAttributeNameValues(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + nameValues=Map("some_name" -> List("name1", "name2"))) + ), + exampleInboundMessage = ( + InBoundGetCustomerIdsByAttributeNameValues(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List("string")) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getCustomerIdsByAttributeNameValues(bankId: BankId, nameValues: Map[String,List[String]], callContext: Option[CallContext]): OBPReturnType[Box[List[String]]] = { + import com.openbankproject.commons.dto.{InBoundGetCustomerIdsByAttributeNameValues => InBound, OutBoundGetCustomerIdsByAttributeNameValues => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, nameValues) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_customer_ids_by_attribute_name_values", req, callContext) + response.map(convertToTuple[List[String]](callContext)) + } + + messageDocs += getCustomerAttributesForCustomersDoc + def getCustomerAttributesForCustomersDoc = MessageDoc( + process = "obp.getCustomerAttributesForCustomers", + messageFormat = messageFormat, + description = "Get Customer Attributes For Customers", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetCustomerAttributesForCustomers(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + customers=List( CustomerCommons(customerId=customerIdExample.value, + bankId=bankIdExample.value, + number=customerNumberExample.value, legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + mobileNumber=mobileNumberExample.value, + email=emailExample.value, + faceImage= CustomerFaceImage(date=parseDate(customerFaceImageDateExample.value).getOrElse(sys.error("customerFaceImageDateExample.value is not validate date format.")), + url=urlExample.value), + dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")), + relationshipStatus=relationshipStatusExample.value, + dependents=dependentsExample.value.toInt, + dobOfDependents=dobOfDependentsExample.value.split("[,;]").map(parseDate).flatMap(_.toSeq).toList, + highestEducationAttained=highestEducationAttainedExample.value, + employmentStatus=employmentStatusExample.value, + creditRating= CreditRating(rating=ratingExample.value, + source=sourceExample.value), + creditLimit= CreditLimit(currency=currencyExample.value, + amount=creditLimitAmountExample.value), + kycStatus=kycStatusExample.value.toBoolean, + lastOkDate=parseDate(customerLastOkDateExample.value).getOrElse(sys.error("customerLastOkDateExample.value is not validate date format.")), + title=customerTitleExample.value, + branchId=branchIdExample.value, + nameSuffix=nameSuffixExample.value))) + ), + exampleInboundMessage = ( + InBoundGetCustomerAttributesForCustomers(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + value= List( + CustomerAndAttribute( + MessageDocsSwaggerDefinitions.customerCommons, + List(MessageDocsSwaggerDefinitions.customerAttribute) + ) + ) + ) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getCustomerAttributesForCustomers(customers: List[Customer], callContext: Option[CallContext]): OBPReturnType[Box[List[(Customer, List[CustomerAttribute])]]] = { + import com.openbankproject.commons.dto.{InBoundGetCustomerAttributesForCustomers => InBound, OutBoundGetCustomerAttributesForCustomers => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customers) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_customer_attributes_for_customers", req, callContext) + response.map(convertToTuple[List[(Customer, List[CustomerAttribute])]](callContext)) + } + + messageDocs += getTransactionIdsByAttributeNameValuesDoc + def getTransactionIdsByAttributeNameValuesDoc = MessageDoc( + process = "obp.getTransactionIdsByAttributeNameValues", + messageFormat = messageFormat, + description = "Get Transaction Ids By Attribute Name Values", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetTransactionIdsByAttributeNameValues(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + nameValues=Map("some_name" -> List("name1", "name2"))) + ), + exampleInboundMessage = ( + InBoundGetTransactionIdsByAttributeNameValues(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List("string")) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getTransactionIdsByAttributeNameValues(bankId: BankId, nameValues: Map[String,List[String]], callContext: Option[CallContext]): OBPReturnType[Box[List[String]]] = { + import com.openbankproject.commons.dto.{InBoundGetTransactionIdsByAttributeNameValues => InBound, OutBoundGetTransactionIdsByAttributeNameValues => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, nameValues) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_transaction_ids_by_attribute_name_values", req, callContext) + response.map(convertToTuple[List[String]](callContext)) + } + + messageDocs += getTransactionAttributesDoc + def getTransactionAttributesDoc = MessageDoc( + process = "obp.getTransactionAttributes", + messageFormat = messageFormat, + description = "Get Transaction Attributes", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetTransactionAttributes(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + transactionId=TransactionId(transactionIdExample.value)) + ), + exampleInboundMessage = ( + InBoundGetTransactionAttributes(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( TransactionAttributeCommons(bankId=BankId(bankIdExample.value), + transactionId=TransactionId(transactionIdExample.value), + transactionAttributeId=transactionAttributeIdExample.value, + attributeType=com.openbankproject.commons.model.enums.TransactionAttributeType.example, + name=transactionAttributeNameExample.value, + value=transactionAttributeValueExample.value))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getTransactionAttributes(bankId: BankId, transactionId: TransactionId, callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionAttribute]]] = { + import com.openbankproject.commons.dto.{InBoundGetTransactionAttributes => InBound, OutBoundGetTransactionAttributes => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, transactionId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_transaction_attributes", req, callContext) + response.map(convertToTuple[List[TransactionAttributeCommons]](callContext)) + } + + messageDocs += getCustomerAttributeByIdDoc + def getCustomerAttributeByIdDoc = MessageDoc( + process = "obp.getCustomerAttributeById", + messageFormat = messageFormat, + description = "Get Customer Attribute By Id", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetCustomerAttributeById(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + customerAttributeId=customerAttributeIdExample.value) + ), + exampleInboundMessage = ( + InBoundGetCustomerAttributeById(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= CustomerAttributeCommons(bankId=BankId(bankIdExample.value), + customerId=CustomerId(customerIdExample.value), + customerAttributeId=customerAttributeIdExample.value, + attributeType=com.openbankproject.commons.model.enums.CustomerAttributeType.example, + name=customerAttributeNameExample.value, + value=customerAttributeValueExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getCustomerAttributeById(customerAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[CustomerAttribute]] = { + import com.openbankproject.commons.dto.{InBoundGetCustomerAttributeById => InBound, OutBoundGetCustomerAttributeById => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerAttributeId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_customer_attribute_by_id", req, callContext) + response.map(convertToTuple[CustomerAttributeCommons](callContext)) + } + + messageDocs += createOrUpdateCardAttributeDoc + def createOrUpdateCardAttributeDoc = MessageDoc( + process = "obp.createOrUpdateCardAttribute", + messageFormat = messageFormat, + description = "Create Or Update Card Attribute", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateOrUpdateCardAttribute(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=Some(BankId(bankIdExample.value)), cardId=Some(cardIdExample.value), cardAttributeId=Some(cardAttributeIdExample.value), @@ -10389,15 +5187,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { value=valueExample.value) ), exampleInboundMessage = ( - InBoundCreateOrUpdateCardAttribute(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreateOrUpdateCardAttribute(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= CardAttributeCommons(bankId=Some(BankId(bankIdExample.value)), cardId=Some(cardIdExample.value), cardAttributeId=Some(cardAttributeIdExample.value), @@ -10407,67 +5198,28 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_or_update_card_attribute + override def createOrUpdateCardAttribute(bankId: Option[BankId], cardId: Option[String], cardAttributeId: Option[String], name: String, cardAttributeType: CardAttributeType.Value, value: String, callContext: Option[CallContext]): OBPReturnType[Box[CardAttribute]] = { - import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateCardAttribute => OutBound, InBoundCreateOrUpdateCardAttribute => InBound} - val procedureName = "create_or_update_card_attribute" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, cardId, cardAttributeId, name, cardAttributeType, value) - val result: OBPReturnType[Box[CardAttributeCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCreateOrUpdateCardAttribute => InBound, OutBoundCreateOrUpdateCardAttribute => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, cardId, cardAttributeId, name, cardAttributeType, value) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_or_update_card_attribute", req, callContext) + response.map(convertToTuple[CardAttributeCommons](callContext)) } - - messageDocs += getCardAttributeByIdDoc11 - private def getCardAttributeByIdDoc11 = MessageDoc( + + messageDocs += getCardAttributeByIdDoc + def getCardAttributeByIdDoc = MessageDoc( process = "obp.getCardAttributeById", messageFormat = messageFormat, - description = """ - |Get Card Attribute By Id - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_card_attribute_by_id - """.stripMargin, + description = "Get Card Attribute By Id", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetCardAttributeById(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetCardAttributeById(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, cardAttributeId=cardAttributeIdExample.value) ), exampleInboundMessage = ( - InBoundGetCardAttributeById(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetCardAttributeById(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= CardAttributeCommons(bankId=Some(BankId(bankIdExample.value)), cardId=Some(cardIdExample.value), cardAttributeId=Some(cardAttributeIdExample.value), @@ -10477,67 +5229,28 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_card_attribute_by_id + override def getCardAttributeById(cardAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[CardAttribute]] = { - import com.openbankproject.commons.dto.{OutBoundGetCardAttributeById => OutBound, InBoundGetCardAttributeById => InBound} - val procedureName = "get_card_attribute_by_id" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , cardAttributeId) - val result: OBPReturnType[Box[CardAttributeCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetCardAttributeById => InBound, OutBoundGetCardAttributeById => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, cardAttributeId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_card_attribute_by_id", req, callContext) + response.map(convertToTuple[CardAttributeCommons](callContext)) } - - messageDocs += getCardAttributesFromProviderDoc16 - private def getCardAttributesFromProviderDoc16 = MessageDoc( + + messageDocs += getCardAttributesFromProviderDoc + def getCardAttributesFromProviderDoc = MessageDoc( process = "obp.getCardAttributesFromProvider", messageFormat = messageFormat, - description = """ - |Get Card Attributes From Provider - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_card_attributes_from_provider - """.stripMargin, + description = "Get Card Attributes From Provider", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetCardAttributesFromProvider(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetCardAttributesFromProvider(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, cardId=cardIdExample.value) ), exampleInboundMessage = ( - InBoundGetCardAttributesFromProvider(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetCardAttributesFromProvider(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( CardAttributeCommons(bankId=Some(BankId(bankIdExample.value)), cardId=Some(cardIdExample.value), cardAttributeId=Some(cardAttributeIdExample.value), @@ -10547,69 +5260,30 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_card_attributes_from_provider + override def getCardAttributesFromProvider(cardId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[CardAttribute]]] = { - import com.openbankproject.commons.dto.{OutBoundGetCardAttributesFromProvider => OutBound, InBoundGetCardAttributesFromProvider => InBound} - val procedureName = "get_card_attributes_from_provider" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , cardId) - val result: OBPReturnType[Box[List[CardAttributeCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetCardAttributesFromProvider => InBound, OutBoundGetCardAttributesFromProvider => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, cardId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_card_attributes_from_provider", req, callContext) + response.map(convertToTuple[List[CardAttributeCommons]](callContext)) } - - messageDocs += createAccountApplicationDoc73 - private def createAccountApplicationDoc73 = MessageDoc( + + messageDocs += createAccountApplicationDoc + def createAccountApplicationDoc = MessageDoc( process = "obp.createAccountApplication", messageFormat = messageFormat, - description = """ - |Create Account Application - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_account_application - """.stripMargin, + description = "Create Account Application", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateAccountApplication(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateAccountApplication(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, productCode=ProductCode("string"), userId=Some(userIdExample.value), customerId=Some(customerIdExample.value)) ), exampleInboundMessage = ( - InBoundCreateAccountApplication(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreateAccountApplication(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= AccountApplicationCommons(accountApplicationId="string", productCode=ProductCode("string"), userId=userIdExample.value, @@ -10619,66 +5293,27 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_account_application + override def createAccountApplication(productCode: ProductCode, userId: Option[String], customerId: Option[String], callContext: Option[CallContext]): OBPReturnType[Box[AccountApplication]] = { - import com.openbankproject.commons.dto.{OutBoundCreateAccountApplication => OutBound, InBoundCreateAccountApplication => InBound} - val procedureName = "create_account_application" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , productCode, userId, customerId) - val result: OBPReturnType[Box[AccountApplicationCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCreateAccountApplication => InBound, OutBoundCreateAccountApplication => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, productCode, userId, customerId) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_account_application", req, callContext) + response.map(convertToTuple[AccountApplicationCommons](callContext)) } - - messageDocs += getAllAccountApplicationDoc33 - private def getAllAccountApplicationDoc33 = MessageDoc( + + messageDocs += getAllAccountApplicationDoc + def getAllAccountApplicationDoc = MessageDoc( process = "obp.getAllAccountApplication", messageFormat = messageFormat, - description = """ - |Get All Account Application - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_all_account_application - """.stripMargin, + description = "Get All Account Application", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetAllAccountApplication( OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value)))))))))) + OutBoundGetAllAccountApplication(MessageDocsSwaggerDefinitions.outboundAdapterCallContext) ), exampleInboundMessage = ( - InBoundGetAllAccountApplication(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetAllAccountApplication(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( AccountApplicationCommons(accountApplicationId="string", productCode=ProductCode("string"), userId=userIdExample.value, @@ -10688,67 +5323,28 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_all_account_application + override def getAllAccountApplication(callContext: Option[CallContext]): OBPReturnType[Box[List[AccountApplication]]] = { - import com.openbankproject.commons.dto.{OutBoundGetAllAccountApplication => OutBound, InBoundGetAllAccountApplication => InBound} - val procedureName = "get_all_account_application" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull ) - val result: OBPReturnType[Box[List[AccountApplicationCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetAllAccountApplication => InBound, OutBoundGetAllAccountApplication => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_all_account_application", req, callContext) + response.map(convertToTuple[List[AccountApplicationCommons]](callContext)) } - - messageDocs += getAccountApplicationByIdDoc83 - private def getAccountApplicationByIdDoc83 = MessageDoc( + + messageDocs += getAccountApplicationByIdDoc + def getAccountApplicationByIdDoc = MessageDoc( process = "obp.getAccountApplicationById", messageFormat = messageFormat, - description = """ - |Get Account Application By Id - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_account_application_by_id - """.stripMargin, + description = "Get Account Application By Id", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetAccountApplicationById(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetAccountApplicationById(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, accountApplicationId="string") ), exampleInboundMessage = ( - InBoundGetAccountApplicationById(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetAccountApplicationById(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= AccountApplicationCommons(accountApplicationId="string", productCode=ProductCode("string"), userId=userIdExample.value, @@ -10758,68 +5354,29 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_account_application_by_id + override def getAccountApplicationById(accountApplicationId: String, callContext: Option[CallContext]): OBPReturnType[Box[AccountApplication]] = { - import com.openbankproject.commons.dto.{OutBoundGetAccountApplicationById => OutBound, InBoundGetAccountApplicationById => InBound} - val procedureName = "get_account_application_by_id" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , accountApplicationId) - val result: OBPReturnType[Box[AccountApplicationCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetAccountApplicationById => InBound, OutBoundGetAccountApplicationById => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, accountApplicationId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_account_application_by_id", req, callContext) + response.map(convertToTuple[AccountApplicationCommons](callContext)) } - - messageDocs += updateAccountApplicationStatusDoc26 - private def updateAccountApplicationStatusDoc26 = MessageDoc( + + messageDocs += updateAccountApplicationStatusDoc + def updateAccountApplicationStatusDoc = MessageDoc( process = "obp.updateAccountApplicationStatus", messageFormat = messageFormat, - description = """ - |Update Account Application Status - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: update_account_application_status - """.stripMargin, + description = "Update Account Application Status", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundUpdateAccountApplicationStatus(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundUpdateAccountApplicationStatus(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, accountApplicationId="string", status="string") ), exampleInboundMessage = ( - InBoundUpdateAccountApplicationStatus(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundUpdateAccountApplicationStatus(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= AccountApplicationCommons(accountApplicationId="string", productCode=ProductCode("string"), userId=userIdExample.value, @@ -10829,334 +5386,139 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: update_account_application_status + override def updateAccountApplicationStatus(accountApplicationId: String, status: String, callContext: Option[CallContext]): OBPReturnType[Box[AccountApplication]] = { - import com.openbankproject.commons.dto.{OutBoundUpdateAccountApplicationStatus => OutBound, InBoundUpdateAccountApplicationStatus => InBound} - val procedureName = "update_account_application_status" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , accountApplicationId, status) - val result: OBPReturnType[Box[AccountApplicationCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundUpdateAccountApplicationStatus => InBound, OutBoundUpdateAccountApplicationStatus => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, accountApplicationId, status) + val response: Future[Box[InBound]] = sendRequest[InBound]("update_account_application_status", req, callContext) + response.map(convertToTuple[AccountApplicationCommons](callContext)) } - - messageDocs += getOrCreateProductCollectionDoc67 - private def getOrCreateProductCollectionDoc67 = MessageDoc( + + messageDocs += getOrCreateProductCollectionDoc + def getOrCreateProductCollectionDoc = MessageDoc( process = "obp.getOrCreateProductCollection", messageFormat = messageFormat, - description = """ - |Get Or Create Product Collection - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_or_create_product_collection - """.stripMargin, + description = "Get Or Create Product Collection", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetOrCreateProductCollection(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetOrCreateProductCollection(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, collectionCode="string", productCodes=List("string")) ), exampleInboundMessage = ( - InBoundGetOrCreateProductCollection(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetOrCreateProductCollection(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( ProductCollectionCommons(collectionCode="string", productCode="string"))) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_or_create_product_collection + override def getOrCreateProductCollection(collectionCode: String, productCodes: List[String], callContext: Option[CallContext]): OBPReturnType[Box[List[ProductCollection]]] = { - import com.openbankproject.commons.dto.{OutBoundGetOrCreateProductCollection => OutBound, InBoundGetOrCreateProductCollection => InBound} - val procedureName = "get_or_create_product_collection" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , collectionCode, productCodes) - val result: OBPReturnType[Box[List[ProductCollectionCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetOrCreateProductCollection => InBound, OutBoundGetOrCreateProductCollection => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, collectionCode, productCodes) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_or_create_product_collection", req, callContext) + response.map(convertToTuple[List[ProductCollectionCommons]](callContext)) } - - messageDocs += getProductCollectionDoc57 - private def getProductCollectionDoc57 = MessageDoc( + + messageDocs += getProductCollectionDoc + def getProductCollectionDoc = MessageDoc( process = "obp.getProductCollection", messageFormat = messageFormat, - description = """ - |Get Product Collection - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_product_collection - """.stripMargin, + description = "Get Product Collection", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetProductCollection(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetProductCollection(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, collectionCode="string") ), exampleInboundMessage = ( - InBoundGetProductCollection(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetProductCollection(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( ProductCollectionCommons(collectionCode="string", productCode="string"))) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_product_collection + override def getProductCollection(collectionCode: String, callContext: Option[CallContext]): OBPReturnType[Box[List[ProductCollection]]] = { - import com.openbankproject.commons.dto.{OutBoundGetProductCollection => OutBound, InBoundGetProductCollection => InBound} - val procedureName = "get_product_collection" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , collectionCode) - val result: OBPReturnType[Box[List[ProductCollectionCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetProductCollection => InBound, OutBoundGetProductCollection => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, collectionCode) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_product_collection", req, callContext) + response.map(convertToTuple[List[ProductCollectionCommons]](callContext)) } - - messageDocs += getOrCreateProductCollectionItemDoc68 - private def getOrCreateProductCollectionItemDoc68 = MessageDoc( + + messageDocs += getOrCreateProductCollectionItemDoc + def getOrCreateProductCollectionItemDoc = MessageDoc( process = "obp.getOrCreateProductCollectionItem", messageFormat = messageFormat, - description = """ - |Get Or Create Product Collection Item - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_or_create_product_collection_item - """.stripMargin, + description = "Get Or Create Product Collection Item", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetOrCreateProductCollectionItem(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetOrCreateProductCollectionItem(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, collectionCode="string", memberProductCodes=List("string")) ), exampleInboundMessage = ( - InBoundGetOrCreateProductCollectionItem(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetOrCreateProductCollectionItem(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( ProductCollectionItemCommons(collectionCode="string", memberProductCode="string"))) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_or_create_product_collection_item + override def getOrCreateProductCollectionItem(collectionCode: String, memberProductCodes: List[String], callContext: Option[CallContext]): OBPReturnType[Box[List[ProductCollectionItem]]] = { - import com.openbankproject.commons.dto.{OutBoundGetOrCreateProductCollectionItem => OutBound, InBoundGetOrCreateProductCollectionItem => InBound} - val procedureName = "get_or_create_product_collection_item" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , collectionCode, memberProductCodes) - val result: OBPReturnType[Box[List[ProductCollectionItemCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetOrCreateProductCollectionItem => InBound, OutBoundGetOrCreateProductCollectionItem => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, collectionCode, memberProductCodes) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_or_create_product_collection_item", req, callContext) + response.map(convertToTuple[List[ProductCollectionItemCommons]](callContext)) } - - messageDocs += getProductCollectionItemDoc49 - private def getProductCollectionItemDoc49 = MessageDoc( + + messageDocs += getProductCollectionItemDoc + def getProductCollectionItemDoc = MessageDoc( process = "obp.getProductCollectionItem", messageFormat = messageFormat, - description = """ - |Get Product Collection Item - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_product_collection_item - """.stripMargin, + description = "Get Product Collection Item", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetProductCollectionItem(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetProductCollectionItem(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, collectionCode="string") ), exampleInboundMessage = ( - InBoundGetProductCollectionItem(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetProductCollectionItem(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( ProductCollectionItemCommons(collectionCode="string", memberProductCode="string"))) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_product_collection_item + override def getProductCollectionItem(collectionCode: String, callContext: Option[CallContext]): OBPReturnType[Box[List[ProductCollectionItem]]] = { - import com.openbankproject.commons.dto.{OutBoundGetProductCollectionItem => OutBound, InBoundGetProductCollectionItem => InBound} - val procedureName = "get_product_collection_item" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , collectionCode) - val result: OBPReturnType[Box[List[ProductCollectionItemCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetProductCollectionItem => InBound, OutBoundGetProductCollectionItem => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, collectionCode) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_product_collection_item", req, callContext) + response.map(convertToTuple[List[ProductCollectionItemCommons]](callContext)) } - - messageDocs += getProductCollectionItemsTreeDoc57 - private def getProductCollectionItemsTreeDoc57 = MessageDoc( + + messageDocs += getProductCollectionItemsTreeDoc + def getProductCollectionItemsTreeDoc = MessageDoc( process = "obp.getProductCollectionItemsTree", messageFormat = messageFormat, - description = """ - |Get Product Collection Items Tree - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_product_collection_items_tree - """.stripMargin, + description = "Get Product Collection Items Tree", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetProductCollectionItemsTree(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetProductCollectionItemsTree(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, collectionCode="string", bankId=bankIdExample.value) ), exampleInboundMessage = ( - InBoundGetProductCollectionItemsTree(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetProductCollectionItemsTree(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List(( ProductCollectionItemCommons(collectionCode="string", memberProductCode="string"), ProductCommons(bankId=BankId(bankIdExample.value), code=ProductCode("string"), @@ -11178,55 +5540,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_product_collection_items_tree + override def getProductCollectionItemsTree(collectionCode: String, bankId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[(ProductCollectionItem, Product, List[ProductAttribute])]]] = { - import com.openbankproject.commons.dto.{OutBoundGetProductCollectionItemsTree => OutBound, InBoundGetProductCollectionItemsTree => InBound} - val procedureName = "get_product_collection_items_tree" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , collectionCode, bankId) - val result: OBPReturnType[Box[List[(ProductCollectionItemCommons, ProductCommons, List[ProductAttributeCommons])]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetProductCollectionItemsTree => InBound, OutBoundGetProductCollectionItemsTree => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, collectionCode, bankId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_product_collection_items_tree", req, callContext) + response.map(convertToTuple[List[(ProductCollectionItemCommons, ProductCommons, List[ProductAttributeCommons])]](callContext)) } - - messageDocs += createMeetingDoc10 - private def createMeetingDoc10 = MessageDoc( + + messageDocs += createMeetingDoc + def createMeetingDoc = MessageDoc( process = "obp.createMeeting", messageFormat = messageFormat, - description = """ - |Create Meeting - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_meeting - """.stripMargin, + description = "Create Meeting", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateMeeting(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateMeeting(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), staffUser= UserCommons(userPrimaryKey=UserPrimaryKey(123), userId=userIdExample.value, @@ -11255,15 +5585,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { status="string"))) ), exampleInboundMessage = ( - InBoundCreateMeeting(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreateMeeting(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= MeetingCommons(meetingId="string", providerId="string", purposeId="string", @@ -11284,55 +5607,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_meeting + override def createMeeting(bankId: BankId, staffUser: User, customerUser: User, providerId: String, purposeId: String, when: Date, sessionId: String, customerToken: String, staffToken: String, creator: ContactDetails, invitees: List[Invitee], callContext: Option[CallContext]): OBPReturnType[Box[Meeting]] = { - import com.openbankproject.commons.dto.{OutBoundCreateMeeting => OutBound, InBoundCreateMeeting => InBound} - val procedureName = "create_meeting" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, staffUser, customerUser, providerId, purposeId, when, sessionId, customerToken, staffToken, creator, invitees) - val result: OBPReturnType[Box[MeetingCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCreateMeeting => InBound, OutBoundCreateMeeting => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, staffUser, customerUser, providerId, purposeId, when, sessionId, customerToken, staffToken, creator, invitees) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_meeting", req, callContext) + response.map(convertToTuple[MeetingCommons](callContext)) } - - messageDocs += getMeetingsDoc82 - private def getMeetingsDoc82 = MessageDoc( + + messageDocs += getMeetingsDoc + def getMeetingsDoc = MessageDoc( process = "obp.getMeetings", messageFormat = messageFormat, - description = """ - |Get Meetings - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_meetings - """.stripMargin, + description = "Get Meetings", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetMeetings(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetMeetings(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), user= UserCommons(userPrimaryKey=UserPrimaryKey(123), userId=userIdExample.value, @@ -11342,15 +5633,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { name=usernameExample.value)) ), exampleInboundMessage = ( - InBoundGetMeetings(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetMeetings(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( MeetingCommons(meetingId="string", providerId="string", purposeId="string", @@ -11371,55 +5655,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_meetings + override def getMeetings(bankId: BankId, user: User, callContext: Option[CallContext]): OBPReturnType[Box[List[Meeting]]] = { - import com.openbankproject.commons.dto.{OutBoundGetMeetings => OutBound, InBoundGetMeetings => InBound} - val procedureName = "get_meetings" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, user) - val result: OBPReturnType[Box[List[MeetingCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetMeetings => InBound, OutBoundGetMeetings => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, user) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_meetings", req, callContext) + response.map(convertToTuple[List[MeetingCommons]](callContext)) } - - messageDocs += getMeetingDoc69 - private def getMeetingDoc69 = MessageDoc( + + messageDocs += getMeetingDoc + def getMeetingDoc = MessageDoc( process = "obp.getMeeting", messageFormat = messageFormat, - description = """ - |Get Meeting - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_meeting - """.stripMargin, + description = "Get Meeting", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetMeeting(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetMeeting(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=BankId(bankIdExample.value), user= UserCommons(userPrimaryKey=UserPrimaryKey(123), userId=userIdExample.value, @@ -11430,15 +5682,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { meetingId="string") ), exampleInboundMessage = ( - InBoundGetMeeting(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetMeeting(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= MeetingCommons(meetingId="string", providerId="string", purposeId="string", @@ -11459,55 +5704,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_meeting + override def getMeeting(bankId: BankId, user: User, meetingId: String, callContext: Option[CallContext]): OBPReturnType[Box[Meeting]] = { - import com.openbankproject.commons.dto.{OutBoundGetMeeting => OutBound, InBoundGetMeeting => InBound} - val procedureName = "get_meeting" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, user, meetingId) - val result: OBPReturnType[Box[MeetingCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetMeeting => InBound, OutBoundGetMeeting => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, user, meetingId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_meeting", req, callContext) + response.map(convertToTuple[MeetingCommons](callContext)) } - - messageDocs += createOrUpdateKycCheckDoc28 - private def createOrUpdateKycCheckDoc28 = MessageDoc( + + messageDocs += createOrUpdateKycCheckDoc + def createOrUpdateKycCheckDoc = MessageDoc( process = "obp.createOrUpdateKycCheck", messageFormat = messageFormat, - description = """ - |Create Or Update Kyc Check - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_or_update_kyc_check - """.stripMargin, + description = "Create Or Update Kyc Check", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateOrUpdateKycCheck(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateOrUpdateKycCheck(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=bankIdExample.value, customerId=customerIdExample.value, id="string", @@ -11520,15 +5733,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { comments="string") ), exampleInboundMessage = ( - InBoundCreateOrUpdateKycCheck(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreateOrUpdateKycCheck(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= KycCheckCommons(bankId=bankIdExample.value, customerId=customerIdExample.value, idKycCheck="string", @@ -11542,55 +5748,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_or_update_kyc_check + override def createOrUpdateKycCheck(bankId: String, customerId: String, id: String, customerNumber: String, date: Date, how: String, staffUserId: String, mStaffName: String, mSatisfied: Boolean, comments: String, callContext: Option[CallContext]): OBPReturnType[Box[KycCheck]] = { - import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateKycCheck => OutBound, InBoundCreateOrUpdateKycCheck => InBound} - val procedureName = "create_or_update_kyc_check" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, customerId, id, customerNumber, date, how, staffUserId, mStaffName, mSatisfied, comments) - val result: OBPReturnType[Box[KycCheckCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCreateOrUpdateKycCheck => InBound, OutBoundCreateOrUpdateKycCheck => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, customerId, id, customerNumber, date, how, staffUserId, mStaffName, mSatisfied, comments) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_or_update_kyc_check", req, callContext) + response.map(convertToTuple[KycCheckCommons](callContext)) } - - messageDocs += createOrUpdateKycDocumentDoc9 - private def createOrUpdateKycDocumentDoc9 = MessageDoc( + + messageDocs += createOrUpdateKycDocumentDoc + def createOrUpdateKycDocumentDoc = MessageDoc( process = "obp.createOrUpdateKycDocument", messageFormat = messageFormat, - description = """ - |Create Or Update Kyc Document - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_or_update_kyc_document - """.stripMargin, + description = "Create Or Update Kyc Document", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateOrUpdateKycDocument(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateOrUpdateKycDocument(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=bankIdExample.value, customerId=customerIdExample.value, id="string", @@ -11602,15 +5776,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { expiryDate=new Date()) ), exampleInboundMessage = ( - InBoundCreateOrUpdateKycDocument(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreateOrUpdateKycDocument(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= KycDocumentCommons(bankId=bankIdExample.value, customerId=customerIdExample.value, idKycDocument="string", @@ -11623,55 +5790,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_or_update_kyc_document + override def createOrUpdateKycDocument(bankId: String, customerId: String, id: String, customerNumber: String, `type`: String, number: String, issueDate: Date, issuePlace: String, expiryDate: Date, callContext: Option[CallContext]): OBPReturnType[Box[KycDocument]] = { - import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateKycDocument => OutBound, InBoundCreateOrUpdateKycDocument => InBound} - val procedureName = "create_or_update_kyc_document" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, customerId, id, customerNumber, `type`, number, issueDate, issuePlace, expiryDate) - val result: OBPReturnType[Box[KycDocument]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCreateOrUpdateKycDocument => InBound, OutBoundCreateOrUpdateKycDocument => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, customerId, id, customerNumber, `type`, number, issueDate, issuePlace, expiryDate) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_or_update_kyc_document", req, callContext) + response.map(convertToTuple[KycDocument](callContext)) } - - messageDocs += createOrUpdateKycMediaDoc17 - private def createOrUpdateKycMediaDoc17 = MessageDoc( + + messageDocs += createOrUpdateKycMediaDoc + def createOrUpdateKycMediaDoc = MessageDoc( process = "obp.createOrUpdateKycMedia", messageFormat = messageFormat, - description = """ - |Create Or Update Kyc Media - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_or_update_kyc_media - """.stripMargin, + description = "Create Or Update Kyc Media", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateOrUpdateKycMedia(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateOrUpdateKycMedia(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=bankIdExample.value, customerId=customerIdExample.value, id="string", @@ -11683,15 +5818,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { relatesToKycCheckId="string") ), exampleInboundMessage = ( - InBoundCreateOrUpdateKycMedia(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreateOrUpdateKycMedia(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= KycMediaCommons(bankId=bankIdExample.value, customerId=customerIdExample.value, idKycMedia="string", @@ -11704,55 +5832,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_or_update_kyc_media + override def createOrUpdateKycMedia(bankId: String, customerId: String, id: String, customerNumber: String, `type`: String, url: String, date: Date, relatesToKycDocumentId: String, relatesToKycCheckId: String, callContext: Option[CallContext]): OBPReturnType[Box[KycMedia]] = { - import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateKycMedia => OutBound, InBoundCreateOrUpdateKycMedia => InBound} - val procedureName = "create_or_update_kyc_media" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, customerId, id, customerNumber, `type`, url, date, relatesToKycDocumentId, relatesToKycCheckId) - val result: OBPReturnType[Box[KycMediaCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCreateOrUpdateKycMedia => InBound, OutBoundCreateOrUpdateKycMedia => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, customerId, id, customerNumber, `type`, url, date, relatesToKycDocumentId, relatesToKycCheckId) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_or_update_kyc_media", req, callContext) + response.map(convertToTuple[KycMediaCommons](callContext)) } - - messageDocs += createOrUpdateKycStatusDoc23 - private def createOrUpdateKycStatusDoc23 = MessageDoc( + + messageDocs += createOrUpdateKycStatusDoc + def createOrUpdateKycStatusDoc = MessageDoc( process = "obp.createOrUpdateKycStatus", messageFormat = messageFormat, - description = """ - |Create Or Update Kyc Status - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_or_update_kyc_status - """.stripMargin, + description = "Create Or Update Kyc Status", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateOrUpdateKycStatus(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateOrUpdateKycStatus(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, bankId=bankIdExample.value, customerId=customerIdExample.value, customerNumber=customerNumberExample.value, @@ -11760,15 +5856,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { date=new Date()) ), exampleInboundMessage = ( - InBoundCreateOrUpdateKycStatus(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreateOrUpdateKycStatus(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= KycStatusCommons(bankId=bankIdExample.value, customerId=customerIdExample.value, customerNumber=customerNumberExample.value, @@ -11777,67 +5866,28 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_or_update_kyc_status + override def createOrUpdateKycStatus(bankId: String, customerId: String, customerNumber: String, ok: Boolean, date: Date, callContext: Option[CallContext]): OBPReturnType[Box[KycStatus]] = { - import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateKycStatus => OutBound, InBoundCreateOrUpdateKycStatus => InBound} - val procedureName = "create_or_update_kyc_status" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, customerId, customerNumber, ok, date) - val result: OBPReturnType[Box[KycStatusCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCreateOrUpdateKycStatus => InBound, OutBoundCreateOrUpdateKycStatus => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, customerId, customerNumber, ok, date) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_or_update_kyc_status", req, callContext) + response.map(convertToTuple[KycStatusCommons](callContext)) } - - messageDocs += getKycChecksDoc63 - private def getKycChecksDoc63 = MessageDoc( + + messageDocs += getKycChecksDoc + def getKycChecksDoc = MessageDoc( process = "obp.getKycChecks", messageFormat = messageFormat, - description = """ - |Get Kyc Checks - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_kyc_checks - """.stripMargin, + description = "Get Kyc Checks", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetKycChecks(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetKycChecks(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, customerId=customerIdExample.value) ), exampleInboundMessage = ( - InBoundGetKycChecks(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetKycChecks(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( KycCheckCommons(bankId=bankIdExample.value, customerId=customerIdExample.value, idKycCheck="string", @@ -11851,67 +5901,28 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_kyc_checks + override def getKycChecks(customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[KycCheck]]] = { - import com.openbankproject.commons.dto.{OutBoundGetKycChecks => OutBound, InBoundGetKycChecks => InBound} - val procedureName = "get_kyc_checks" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , customerId) - val result: OBPReturnType[Box[List[KycCheckCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetKycChecks => InBound, OutBoundGetKycChecks => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_kyc_checks", req, callContext) + response.map(convertToTuple[List[KycCheckCommons]](callContext)) } - - messageDocs += getKycDocumentsDoc38 - private def getKycDocumentsDoc38 = MessageDoc( + + messageDocs += getKycDocumentsDoc + def getKycDocumentsDoc = MessageDoc( process = "obp.getKycDocuments", messageFormat = messageFormat, - description = """ - |Get Kyc Documents - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_kyc_documents - """.stripMargin, + description = "Get Kyc Documents", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetKycDocuments(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetKycDocuments(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, customerId=customerIdExample.value) ), exampleInboundMessage = ( - InBoundGetKycDocuments(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetKycDocuments(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( KycDocumentCommons(bankId=bankIdExample.value, customerId=customerIdExample.value, idKycDocument="string", @@ -11924,67 +5935,28 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_kyc_documents + override def getKycDocuments(customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[KycDocument]]] = { - import com.openbankproject.commons.dto.{OutBoundGetKycDocuments => OutBound, InBoundGetKycDocuments => InBound} - val procedureName = "get_kyc_documents" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , customerId) - val result: OBPReturnType[Box[List[KycDocumentCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetKycDocuments => InBound, OutBoundGetKycDocuments => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_kyc_documents", req, callContext) + response.map(convertToTuple[List[KycDocumentCommons]](callContext)) } - - messageDocs += getKycMediasDoc31 - private def getKycMediasDoc31 = MessageDoc( + + messageDocs += getKycMediasDoc + def getKycMediasDoc = MessageDoc( process = "obp.getKycMedias", messageFormat = messageFormat, - description = """ - |Get Kyc Medias - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_kyc_medias - """.stripMargin, + description = "Get Kyc Medias", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetKycMedias(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetKycMedias(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, customerId=customerIdExample.value) ), exampleInboundMessage = ( - InBoundGetKycMedias(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetKycMedias(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( KycMediaCommons(bankId=bankIdExample.value, customerId=customerIdExample.value, idKycMedia="string", @@ -11997,67 +5969,28 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_kyc_medias + override def getKycMedias(customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[KycMedia]]] = { - import com.openbankproject.commons.dto.{OutBoundGetKycMedias => OutBound, InBoundGetKycMedias => InBound} - val procedureName = "get_kyc_medias" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , customerId) - val result: OBPReturnType[Box[List[KycMediaCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetKycMedias => InBound, OutBoundGetKycMedias => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_kyc_medias", req, callContext) + response.map(convertToTuple[List[KycMediaCommons]](callContext)) } - - messageDocs += getKycStatusesDoc96 - private def getKycStatusesDoc96 = MessageDoc( + + messageDocs += getKycStatusesDoc + def getKycStatusesDoc = MessageDoc( process = "obp.getKycStatuses", messageFormat = messageFormat, - description = """ - |Get Kyc Statuses - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: get_kyc_statuses - """.stripMargin, + description = "Get Kyc Statuses", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundGetKycStatuses(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundGetKycStatuses(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, customerId=customerIdExample.value) ), exampleInboundMessage = ( - InBoundGetKycStatuses(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundGetKycStatuses(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=List( KycStatusCommons(bankId=bankIdExample.value, customerId=customerIdExample.value, customerNumber=customerNumberExample.value, @@ -12066,55 +5999,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: get_kyc_statuses + override def getKycStatuses(customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[KycStatus]]] = { - import com.openbankproject.commons.dto.{OutBoundGetKycStatuses => OutBound, InBoundGetKycStatuses => InBound} - val procedureName = "get_kyc_statuses" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , customerId) - val result: OBPReturnType[Box[List[KycStatusCommons]]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundGetKycStatuses => InBound, OutBoundGetKycStatuses => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId) + val response: Future[Box[InBound]] = sendRequest[InBound]("get_kyc_statuses", req, callContext) + response.map(convertToTuple[List[KycStatusCommons]](callContext)) } - - messageDocs += createMessageDoc72 - private def createMessageDoc72 = MessageDoc( + + messageDocs += createMessageDoc + def createMessageDoc = MessageDoc( process = "obp.createMessage", messageFormat = messageFormat, - description = """ - |Create Message - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: create_message - """.stripMargin, + description = "Create Message", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundCreateMessage(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundCreateMessage(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, user= UserCommons(userPrimaryKey=UserPrimaryKey(123), userId=userIdExample.value, idGivenByProvider="string", @@ -12127,15 +6028,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { fromPerson="string") ), exampleInboundMessage = ( - InBoundCreateMessage(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundCreateMessage(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data= CustomerMessageCommons(messageId="string", date=new Date(), message="string", @@ -12144,55 +6038,23 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: create_message + override def createMessage(user: User, bankId: BankId, message: String, fromDepartment: String, fromPerson: String, callContext: Option[CallContext]): OBPReturnType[Box[CustomerMessage]] = { - import com.openbankproject.commons.dto.{OutBoundCreateMessage => OutBound, InBoundCreateMessage => InBound} - val procedureName = "create_message" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , user, bankId, message, fromDepartment, fromPerson) - val result: OBPReturnType[Box[CustomerMessageCommons]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundCreateMessage => InBound, OutBoundCreateMessage => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, user, bankId, message, fromDepartment, fromPerson) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_message", req, callContext) + response.map(convertToTuple[CustomerMessageCommons](callContext)) } - - messageDocs += makeHistoricalPaymentDoc41 - private def makeHistoricalPaymentDoc41 = MessageDoc( + + messageDocs += makeHistoricalPaymentDoc + def makeHistoricalPaymentDoc = MessageDoc( process = "obp.makeHistoricalPayment", messageFormat = messageFormat, - description = """ - |Make Historical Payment - | - |The connector name is: stored_procedure_vDec2019 - |The MS SQL Server stored procedure name is: make_historical_payment - """.stripMargin, + description = "Make Historical Payment", outboundTopic = None, inboundTopic = None, exampleOutboundMessage = ( - OutBoundMakeHistoricalPayment(outboundAdapterCallContext= OutboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - consumerId=Some(consumerIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value))), - outboundAdapterAuthInfo=Some( OutboundAdapterAuthInfo(userId=Some(userIdExample.value), - username=Some(usernameExample.value), - linkedCustomers=Some(List( BasicLinkedCustomer(customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value))), - userAuthContext=Some(List( BasicUserAuthContext(key=keyExample.value, - value=valueExample.value))), - authViews=Some(List( AuthView(view= ViewBasic(id=viewIdExample.value, - name=viewNameExample.value, - description=viewDescriptionExample.value), - account= AccountBasic(id=accountIdExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - customerOwners=List( InternalBasicCustomer(bankId=bankIdExample.value, - customerId=customerIdExample.value, - customerNumber=customerNumberExample.value, - legalName=legalNameExample.value, - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))), - userOwners=List( InternalBasicUser(userId=userIdExample.value, - emailAddress=emailExample.value, - name=usernameExample.value))))))))), + OutBoundMakeHistoricalPayment(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), accountType=accountTypeExample.value, balance=BigDecimal(balanceAmountExample.value), @@ -12237,30 +6099,91 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { chargePolicy="string") ), exampleInboundMessage = ( - InBoundMakeHistoricalPayment(inboundAdapterCallContext= InboundAdapterCallContext(correlationId=correlationIdExample.value, - sessionId=Some(sessionIdExample.value), - generalContext=Some(List( BasicGeneralContext(key=keyExample.value, - value=valueExample.value)))), - status= Status(errorCode=statusErrorCodeExample.value, - backendMessages=List( InboundStatusMessage(source=sourceExample.value, - status=inboundStatusMessageStatusExample.value, - errorCode=inboundStatusMessageErrorCodeExample.value, - text=inboundStatusMessageTextExample.value))), + InBoundMakeHistoricalPayment(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, data=TransactionId(transactionIdExample.value)) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - // stored procedure name: make_historical_payment + override def makeHistoricalPayment(fromAccount: BankAccount, toAccount: BankAccount, posted: Date, completed: Date, amount: BigDecimal, description: String, transactionRequestType: String, chargePolicy: String, callContext: Option[CallContext]): OBPReturnType[Box[TransactionId]] = { - import com.openbankproject.commons.dto.{OutBoundMakeHistoricalPayment => OutBound, InBoundMakeHistoricalPayment => InBound} - val procedureName = "make_historical_payment" - - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , fromAccount, toAccount, posted, completed, amount, description, transactionRequestType, chargePolicy) - val result: OBPReturnType[Box[TransactionId]] = sendRequest[InBound](procedureName, req, callContext).map(convertToTuple(callContext)) - result + import com.openbankproject.commons.dto.{InBoundMakeHistoricalPayment => InBound, OutBoundMakeHistoricalPayment => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, fromAccount, toAccount, posted, completed, amount, description, transactionRequestType, chargePolicy) + val response: Future[Box[InBound]] = sendRequest[InBound]("make_historical_payment", req, callContext) + response.map(convertToTuple[TransactionId](callContext)) } + + messageDocs += createDirectDebitDoc + def createDirectDebitDoc = MessageDoc( + process = "obp.createDirectDebit", + messageFormat = messageFormat, + description = "Create Direct Debit", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateDirectDebit(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=bankIdExample.value, + accountId=accountIdExample.value, + customerId=customerIdExample.value, + userId=userIdExample.value, + counterpartyId=counterpartyIdExample.value, + dateSigned=new Date(), + dateStarts=new Date(), + dateExpires=Some(new Date())) + ), + exampleInboundMessage = ( + InBoundCreateDirectDebit(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= DirectDebitTraitCommons(directDebitId="string", + bankId=bankIdExample.value, + accountId=accountIdExample.value, + customerId=customerIdExample.value, + userId=userIdExample.value, + counterpartyId=counterpartyIdExample.value, + dateSigned=new Date(), + dateCancelled=new Date(), + dateStarts=new Date(), + dateExpires=new Date(), + active=true)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) -//---------------- dynamic end ---------------------please don't modify this line + override def createDirectDebit(bankId: String, accountId: String, customerId: String, userId: String, counterpartyId: String, dateSigned: Date, dateStarts: Date, dateExpires: Option[Date], callContext: Option[CallContext]): OBPReturnType[Box[DirectDebitTrait]] = { + import com.openbankproject.commons.dto.{InBoundCreateDirectDebit => InBound, OutBoundCreateDirectDebit => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, customerId, userId, counterpartyId, dateSigned, dateStarts, dateExpires) + val response: Future[Box[InBound]] = sendRequest[InBound]("create_direct_debit", req, callContext) + response.map(convertToTuple[DirectDebitTraitCommons](callContext)) + } + + messageDocs += deleteCustomerAttributeDoc + def deleteCustomerAttributeDoc = MessageDoc( + process = "obp.deleteCustomerAttribute", + messageFormat = messageFormat, + description = "Delete Customer Attribute", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundDeleteCustomerAttribute(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + customerAttributeId=customerAttributeIdExample.value) + ), + exampleInboundMessage = ( + InBoundDeleteCustomerAttribute(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=true) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def deleteCustomerAttribute(customerAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { + import com.openbankproject.commons.dto.{InBoundDeleteCustomerAttribute => InBound, OutBoundDeleteCustomerAttribute => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerAttributeId) + val response: Future[Box[InBound]] = sendRequest[InBound]("delete_customer_attribute", req, callContext) + response.map(convertToTuple[Boolean](callContext)) + } + +// ---------- create on Tue Jun 16 19:55:42 CST 2020 +//---------------- dynamic end ---------------------please don't modify this line private val availableOperation = DynamicEntityOperation.values.map(it => s""""$it"""").mkString("[", ", ", "]") @@ -12330,45 +6253,6 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { result } - private[this] def buildAdapterCallContext(callContext: Option[CallContext]): OutboundAdapterCallContext = callContext.map(_.toOutboundAdapterCallContext).orNull - - /** - * some methods return type is not future, this implicit method make these method have the same body, it facilitate to generate code. - * - * @param future - * @tparam T - * @return result of future - */ - // This result is accessed synchronously (blocking) - // TODO 1. Consider can be the result accessed asynchronously (non-blocking) - // TODO 2. Consider making the duration tweakable via props file at least - private[this] implicit def convertFuture[T](future: Future[T]): T = Await.result(future, 1.minute) - - /** - * convert return value of OBPReturnType[Box[T]] to Box[(T, Option[CallContext])], this can let all method have the same body even though return type is not match - * @param future - * @tparam T - * @return - */ - private[this] implicit def convertFutureToBoxTuple[T](future: OBPReturnType[Box[T]]): Box[(T, Option[CallContext])] = { - val (boxT, cc) = convertFuture(future) - boxT.map((_, cc)) - } - /** - * convert return value of OBPReturnType[Box[T]] to Box[T], this can let all method have the same body even though return type is not match - * @param future - * @tparam T - * @return - */ - private[this] implicit def convertFutureToBox[T](future: OBPReturnType[Box[T]]): Box[T] = convertFuture(future)._1 - /** - * convert return value of OBPReturnType[Box[T]] to Future[T], this can let all method have the same body even though return type is not match - * @param future - * @tparam T - * @return - */ - private[this] implicit def convertToIgnoreCC[T](future: OBPReturnType[T]): Future[T] = future.map(it => it._1) - private[this] def sendRequest[T <: InBoundTrait[_]: TypeTag : Manifest](procedureName: String, outBound: TopicTrait, callContext: Option[CallContext]): Future[Box[T]] = { //transfer accountId to accountReference and customerId to customerReference in outBound this.convertToReference(outBound) From 2283b0fefc5f78fd0adbc5d1bf699260e6911490 Mon Sep 17 00:00:00 2001 From: shuang Date: Tue, 16 Jun 2020 21:56:22 +0800 Subject: [PATCH 06/10] feature/create_ms_stored_procedure_script: generate simple script. --- .../MessageDocsSwaggerDefinitions.scala | 4 +- .../storedprocedure/MSsqlStoredProcedure.sql | 9099 +++++++++++++++++ .../MSsqlStoredProcedureBuilder.scala | 73 + 3 files changed, 9175 insertions(+), 1 deletion(-) create mode 100644 obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedure.sql create mode 100644 obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedureBuilder.scala diff --git a/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/MessageDocsSwaggerDefinitions.scala b/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/MessageDocsSwaggerDefinitions.scala index 5047aba20..60b67a942 100644 --- a/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/MessageDocsSwaggerDefinitions.scala +++ b/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/MessageDocsSwaggerDefinitions.scala @@ -106,6 +106,8 @@ object MessageDocsSwaggerDefinitions val inboundStatus = Status("Status errorCode", List(inboundStatusMessage)) + val successStatus = Status("", List(inboundStatusMessage.copy(errorCode = ""))) + val inboundAdapterInfoInternal = InboundAdapterInfoInternal( errorCode ="", backendMessages = List(inboundStatusMessage), @@ -114,7 +116,7 @@ object MessageDocsSwaggerDefinitions git_commit = "String", date = DateWithMsExampleString ) - + val bankCommons = BankCommons( bankId = BankId(bankIdExample.value), shortName = "The Royal Bank of Scotland", diff --git a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedure.sql b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedure.sql new file mode 100644 index 000000000..9f36df1d2 --- /dev/null +++ b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedure.sql @@ -0,0 +1,9099 @@ +-- auto generated MS sql server procedures script, create on 2020-06-16T21:52:22Z + +-- drop procedure get_adapter_info +DROP PROCEDURE IF EXISTS get_adapter_info; +GO +-- create procedure get_adapter_info +CREATE PROCEDURE get_adapter_info +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "errorCode":"error code", + "backendMessages":[ + { + "source":"", + "status":"Status string", + "errorCode":"errorCode string", + "text":"text string" + } + ], + "name":"NAME", + "version":"version string", + "git_commit":"git_commit", + "date":"date String" + } + }' + ); +GO + + + + + +-- drop procedure get_challenge_threshold +DROP PROCEDURE IF EXISTS get_challenge_threshold; +GO +-- create procedure get_challenge_threshold +CREATE PROCEDURE get_challenge_threshold +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "currency":"EUR", + "amount":"string" + } + }' + ); +GO + + + + + +-- drop procedure get_charge_level +DROP PROCEDURE IF EXISTS get_charge_level; +GO +-- create procedure get_charge_level +CREATE PROCEDURE get_charge_level +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "currency":"EUR", + "amount":"string" + } + }' + ); +GO + + + + + +-- drop procedure create_challenge +DROP PROCEDURE IF EXISTS create_challenge; +GO +-- create procedure create_challenge +CREATE PROCEDURE create_challenge +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":"string" + }' + ); +GO + + + + + +-- drop procedure create_challenges +DROP PROCEDURE IF EXISTS create_challenges; +GO +-- create procedure create_challenges +CREATE PROCEDURE create_challenges +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + "string" + ] + }' + ); +GO + + + + + +-- drop procedure validate_challenge_answer +DROP PROCEDURE IF EXISTS validate_challenge_answer; +GO +-- create procedure validate_challenge_answer +CREATE PROCEDURE validate_challenge_answer +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":true + }' + ); +GO + + + + + +-- drop procedure get_bank_legacy +DROP PROCEDURE IF EXISTS get_bank_legacy; +GO +-- create procedure get_bank_legacy +CREATE PROCEDURE get_bank_legacy +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "bankId":{ + "value":"gh.29.uk" + }, + "shortName":"bank shortName string", + "fullName":"bank fullName string", + "logoUrl":"bank logoUrl string", + "websiteUrl":"bank websiteUrl string", + "bankRoutingScheme":"BIC", + "bankRoutingAddress":"GENODEM1GLS", + "swiftBic":"bank swiftBic string", + "nationalIdentifier":"bank nationalIdentifier string" + } + }' + ); +GO + + + + + +-- drop procedure get_bank +DROP PROCEDURE IF EXISTS get_bank; +GO +-- create procedure get_bank +CREATE PROCEDURE get_bank +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "bankId":{ + "value":"gh.29.uk" + }, + "shortName":"bank shortName string", + "fullName":"bank fullName string", + "logoUrl":"bank logoUrl string", + "websiteUrl":"bank websiteUrl string", + "bankRoutingScheme":"BIC", + "bankRoutingAddress":"GENODEM1GLS", + "swiftBic":"bank swiftBic string", + "nationalIdentifier":"bank nationalIdentifier string" + } + }' + ); +GO + + + + + +-- drop procedure get_banks_legacy +DROP PROCEDURE IF EXISTS get_banks_legacy; +GO +-- create procedure get_banks_legacy +CREATE PROCEDURE get_banks_legacy +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "bankId":{ + "value":"gh.29.uk" + }, + "shortName":"bank shortName string", + "fullName":"bank fullName string", + "logoUrl":"bank logoUrl string", + "websiteUrl":"bank websiteUrl string", + "bankRoutingScheme":"BIC", + "bankRoutingAddress":"GENODEM1GLS", + "swiftBic":"bank swiftBic string", + "nationalIdentifier":"bank nationalIdentifier string" + } + ] + }' + ); +GO + + + + + +-- drop procedure get_banks +DROP PROCEDURE IF EXISTS get_banks; +GO +-- create procedure get_banks +CREATE PROCEDURE get_banks +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "bankId":{ + "value":"gh.29.uk" + }, + "shortName":"bank shortName string", + "fullName":"bank fullName string", + "logoUrl":"bank logoUrl string", + "websiteUrl":"bank websiteUrl string", + "bankRoutingScheme":"BIC", + "bankRoutingAddress":"GENODEM1GLS", + "swiftBic":"bank swiftBic string", + "nationalIdentifier":"bank nationalIdentifier string" + } + ] + }' + ); +GO + + + + + +-- drop procedure get_bank_accounts_for_user_legacy +DROP PROCEDURE IF EXISTS get_bank_accounts_for_user_legacy; +GO +-- create procedure get_bank_accounts_for_user_legacy +CREATE PROCEDURE get_bank_accounts_for_user_legacy +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "bankId":"gh.29.uk", + "branchId":"DERBY6", + "accountId":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountNumber":"546387432", + "accountType":"AC", + "balanceAmount":"50.89", + "balanceCurrency":"EUR", + "owners":[ + "InboundAccount", + "owners", + "list", + "string" + ], + "viewsToGenerate":[ + "Owner", + "Accountant", + "Auditor" + ], + "bankRoutingScheme":"BIC", + "bankRoutingAddress":"GENODEM1GLS", + "branchRoutingScheme":"BRANCH-CODE", + "branchRoutingAddress":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89" + } + ] + }' + ); +GO + + + + + +-- drop procedure get_bank_accounts_for_user +DROP PROCEDURE IF EXISTS get_bank_accounts_for_user; +GO +-- create procedure get_bank_accounts_for_user +CREATE PROCEDURE get_bank_accounts_for_user +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "bankId":"gh.29.uk", + "branchId":"DERBY6", + "accountId":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountNumber":"546387432", + "accountType":"AC", + "balanceAmount":"50.89", + "balanceCurrency":"EUR", + "owners":[ + "InboundAccount", + "owners", + "list", + "string" + ], + "viewsToGenerate":[ + "Owner", + "Accountant", + "Auditor" + ], + "bankRoutingScheme":"BIC", + "bankRoutingAddress":"GENODEM1GLS", + "branchRoutingScheme":"BRANCH-CODE", + "branchRoutingAddress":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89" + } + ] + }' + ); +GO + + + + + +-- drop procedure get_user +DROP PROCEDURE IF EXISTS get_user; +GO +-- create procedure get_user +CREATE PROCEDURE get_user +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "email":"eveline@example.com", + "password":"string", + "displayName":"string" + } + }' + ); +GO + + + + + +-- drop procedure get_bank_account_old +DROP PROCEDURE IF EXISTS get_bank_account_old; +GO +-- create procedure get_bank_account_old +CREATE PROCEDURE get_bank_account_old +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + } + }' + ); +GO + + + + + +-- drop procedure get_bank_account_legacy +DROP PROCEDURE IF EXISTS get_bank_account_legacy; +GO +-- create procedure get_bank_account_legacy +CREATE PROCEDURE get_bank_account_legacy +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + } + }' + ); +GO + + + + + +-- drop procedure get_bank_account +DROP PROCEDURE IF EXISTS get_bank_account; +GO +-- create procedure get_bank_account +CREATE PROCEDURE get_bank_account +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + } + }' + ); +GO + + + + + +-- drop procedure get_bank_account_by_iban +DROP PROCEDURE IF EXISTS get_bank_account_by_iban; +GO +-- create procedure get_bank_account_by_iban +CREATE PROCEDURE get_bank_account_by_iban +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + } + }' + ); +GO + + + + + +-- drop procedure get_bank_account_by_routing +DROP PROCEDURE IF EXISTS get_bank_account_by_routing; +GO +-- create procedure get_bank_account_by_routing +CREATE PROCEDURE get_bank_account_by_routing +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + } + }' + ); +GO + + + + + +-- drop procedure get_bank_accounts +DROP PROCEDURE IF EXISTS get_bank_accounts; +GO +-- create procedure get_bank_accounts +CREATE PROCEDURE get_bank_accounts +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + } + ] + }' + ); +GO + + + + + +-- drop procedure get_bank_accounts_balances +DROP PROCEDURE IF EXISTS get_bank_accounts_balances; +GO +-- create procedure get_bank_accounts_balances +CREATE PROCEDURE get_bank_accounts_balances +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "accounts":[ + { + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "label":"My Account", + "bankId":"gh.29.uk", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "balance":{ + "currency":"EUR", + "amount":"50.89" + } + } + ], + "overallBalance":{ + "currency":"EUR", + "amount":"string" + }, + "overallBalanceDate":"2020-06-16T13:52:22Z" + } + }' + ); +GO + + + + + +-- drop procedure get_core_bank_accounts_legacy +DROP PROCEDURE IF EXISTS get_core_bank_accounts_legacy; +GO +-- create procedure get_core_bank_accounts_legacy +CREATE PROCEDURE get_core_bank_accounts_legacy +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "label":"My Account", + "bankId":"gh.29.uk", + "accountType":"AC", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ] + } + ] + }' + ); +GO + + + + + +-- drop procedure get_core_bank_accounts +DROP PROCEDURE IF EXISTS get_core_bank_accounts; +GO +-- create procedure get_core_bank_accounts +CREATE PROCEDURE get_core_bank_accounts +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "label":"My Account", + "bankId":"gh.29.uk", + "accountType":"AC", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ] + } + ] + }' + ); +GO + + + + + +-- drop procedure get_bank_accounts_held_legacy +DROP PROCEDURE IF EXISTS get_bank_accounts_held_legacy; +GO +-- create procedure get_bank_accounts_held_legacy +CREATE PROCEDURE get_bank_accounts_held_legacy +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "id":"string", + "bankId":"gh.29.uk", + "number":"string", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ] + } + ] + }' + ); +GO + + + + + +-- drop procedure get_bank_accounts_held +DROP PROCEDURE IF EXISTS get_bank_accounts_held; +GO +-- create procedure get_bank_accounts_held +CREATE PROCEDURE get_bank_accounts_held +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "id":"string", + "bankId":"gh.29.uk", + "number":"string", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ] + } + ] + }' + ); +GO + + + + + +-- drop procedure check_bank_account_exists_legacy +DROP PROCEDURE IF EXISTS check_bank_account_exists_legacy; +GO +-- create procedure check_bank_account_exists_legacy +CREATE PROCEDURE check_bank_account_exists_legacy +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + } + }' + ); +GO + + + + + +-- drop procedure get_counterparty_trait +DROP PROCEDURE IF EXISTS get_counterparty_trait; +GO +-- create procedure get_counterparty_trait +CREATE PROCEDURE get_counterparty_trait +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "createdByUserId":"string", + "name":"string", + "description":"string", + "thisBankId":"string", + "thisAccountId":"string", + "thisViewId":"string", + "counterpartyId":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "otherAccountRoutingScheme":"IBAN", + "otherAccountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "otherAccountSecondaryRoutingScheme":"string", + "otherAccountSecondaryRoutingAddress":"string", + "otherBankRoutingScheme":"BIC", + "otherBankRoutingAddress":"GENODEM1GLS", + "otherBranchRoutingScheme":"BRANCH-CODE", + "otherBranchRoutingAddress":"DERBY6", + "isBeneficiary":true, + "bespoke":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + } + }' + ); +GO + + + + + +-- drop procedure get_counterparty_by_counterparty_id_legacy +DROP PROCEDURE IF EXISTS get_counterparty_by_counterparty_id_legacy; +GO +-- create procedure get_counterparty_by_counterparty_id_legacy +CREATE PROCEDURE get_counterparty_by_counterparty_id_legacy +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "createdByUserId":"string", + "name":"string", + "description":"string", + "thisBankId":"string", + "thisAccountId":"string", + "thisViewId":"string", + "counterpartyId":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "otherAccountRoutingScheme":"IBAN", + "otherAccountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "otherAccountSecondaryRoutingScheme":"string", + "otherAccountSecondaryRoutingAddress":"string", + "otherBankRoutingScheme":"BIC", + "otherBankRoutingAddress":"GENODEM1GLS", + "otherBranchRoutingScheme":"BRANCH-CODE", + "otherBranchRoutingAddress":"DERBY6", + "isBeneficiary":true, + "bespoke":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + } + }' + ); +GO + + + + + +-- drop procedure get_counterparty_by_counterparty_id +DROP PROCEDURE IF EXISTS get_counterparty_by_counterparty_id; +GO +-- create procedure get_counterparty_by_counterparty_id +CREATE PROCEDURE get_counterparty_by_counterparty_id +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "createdByUserId":"string", + "name":"string", + "description":"string", + "thisBankId":"string", + "thisAccountId":"string", + "thisViewId":"string", + "counterpartyId":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "otherAccountRoutingScheme":"IBAN", + "otherAccountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "otherAccountSecondaryRoutingScheme":"string", + "otherAccountSecondaryRoutingAddress":"string", + "otherBankRoutingScheme":"BIC", + "otherBankRoutingAddress":"GENODEM1GLS", + "otherBranchRoutingScheme":"BRANCH-CODE", + "otherBranchRoutingAddress":"DERBY6", + "isBeneficiary":true, + "bespoke":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + } + }' + ); +GO + + + + + +-- drop procedure get_counterparty_by_iban +DROP PROCEDURE IF EXISTS get_counterparty_by_iban; +GO +-- create procedure get_counterparty_by_iban +CREATE PROCEDURE get_counterparty_by_iban +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "createdByUserId":"string", + "name":"string", + "description":"string", + "thisBankId":"string", + "thisAccountId":"string", + "thisViewId":"string", + "counterpartyId":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "otherAccountRoutingScheme":"IBAN", + "otherAccountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "otherAccountSecondaryRoutingScheme":"string", + "otherAccountSecondaryRoutingAddress":"string", + "otherBankRoutingScheme":"BIC", + "otherBankRoutingAddress":"GENODEM1GLS", + "otherBranchRoutingScheme":"BRANCH-CODE", + "otherBranchRoutingAddress":"DERBY6", + "isBeneficiary":true, + "bespoke":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + } + }' + ); +GO + + + + + +-- drop procedure get_counterparties_legacy +DROP PROCEDURE IF EXISTS get_counterparties_legacy; +GO +-- create procedure get_counterparties_legacy +CREATE PROCEDURE get_counterparties_legacy +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "createdByUserId":"string", + "name":"string", + "description":"string", + "thisBankId":"string", + "thisAccountId":"string", + "thisViewId":"string", + "counterpartyId":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "otherAccountRoutingScheme":"IBAN", + "otherAccountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "otherAccountSecondaryRoutingScheme":"string", + "otherAccountSecondaryRoutingAddress":"string", + "otherBankRoutingScheme":"BIC", + "otherBankRoutingAddress":"GENODEM1GLS", + "otherBranchRoutingScheme":"BRANCH-CODE", + "otherBranchRoutingAddress":"DERBY6", + "isBeneficiary":true, + "bespoke":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + } + ] + }' + ); +GO + + + + + +-- drop procedure get_counterparties +DROP PROCEDURE IF EXISTS get_counterparties; +GO +-- create procedure get_counterparties +CREATE PROCEDURE get_counterparties +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "createdByUserId":"string", + "name":"string", + "description":"string", + "thisBankId":"string", + "thisAccountId":"string", + "thisViewId":"string", + "counterpartyId":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "otherAccountRoutingScheme":"IBAN", + "otherAccountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "otherAccountSecondaryRoutingScheme":"string", + "otherAccountSecondaryRoutingAddress":"string", + "otherBankRoutingScheme":"BIC", + "otherBankRoutingAddress":"GENODEM1GLS", + "otherBranchRoutingScheme":"BRANCH-CODE", + "otherBranchRoutingAddress":"DERBY6", + "isBeneficiary":true, + "bespoke":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + } + ] + }' + ); +GO + + + + + +-- drop procedure get_transactions_legacy +DROP PROCEDURE IF EXISTS get_transactions_legacy; +GO +-- create procedure get_transactions_legacy +CREATE PROCEDURE get_transactions_legacy +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + {} + ] + }' + ); +GO + + + + + +-- drop procedure get_transactions +DROP PROCEDURE IF EXISTS get_transactions; +GO +-- create procedure get_transactions +CREATE PROCEDURE get_transactions +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + {} + ] + }' + ); +GO + + + + + +-- drop procedure get_transactions_core +DROP PROCEDURE IF EXISTS get_transactions_core; +GO +-- create procedure get_transactions_core +CREATE PROCEDURE get_transactions_core +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "id":{ + "value":"2fg8a7e4-6d02-40e3-a129-0b2bf89de8ub" + }, + "thisAccount":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + }, + "otherAccount":{ + "kind":"string", + "counterpartyId":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "counterpartyName":"John Smith Ltd.", + "thisBankId":{ + "value":"gh.29.uk" + }, + "thisAccountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "otherBankRoutingScheme":"BIC", + "otherBankRoutingAddress":"GENODEM1GLS", + "otherAccountRoutingScheme":"IBAN", + "otherAccountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "otherAccountProvider":"", + "isBeneficiary":true + }, + "transactionType":"DEBIT", + "amount":"123.321", + "currency":"EUR", + "description":"string", + "startDate":"2020-06-16T13:52:22Z", + "finishDate":"2020-06-16T13:52:22Z", + "balance":"50.89" + } + ] + }' + ); +GO + + + + + +-- drop procedure get_transaction_legacy +DROP PROCEDURE IF EXISTS get_transaction_legacy; +GO +-- create procedure get_transaction_legacy +CREATE PROCEDURE get_transaction_legacy +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{} + }' + ); +GO + + + + + +-- drop procedure get_transaction +DROP PROCEDURE IF EXISTS get_transaction; +GO +-- create procedure get_transaction +CREATE PROCEDURE get_transaction +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{} + }' + ); +GO + + + + + +-- drop procedure get_physical_card_for_bank +DROP PROCEDURE IF EXISTS get_physical_card_for_bank; +GO +-- create procedure get_physical_card_for_bank +CREATE PROCEDURE get_physical_card_for_bank +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "cardId":"36f8a9e6-c2b1-407a-8bd0-421b7119307e ", + "bankId":"gh.29.uk", + "bankCardNumber":"364435172576215", + "cardType":"Credit", + "nameOnCard":"SusanSmith", + "issueNumber":"1", + "serialNumber":"1324234", + "validFrom":"2020-06-16T13:52:22Z", + "expires":"2020-06-16T13:52:22Z", + "enabled":true, + "cancelled":true, + "onHotList":true, + "technology":"string", + "networks":[ + "string" + ], + "allows":[ + {} + ], + "account":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"546387432", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + }, + "replacement":{ + "requestedDate":"2020-06-16T13:52:22Z", + "reasonRequested":{} + }, + "pinResets":[ + { + "requestedDate":"2020-06-16T13:52:22Z", + "reasonRequested":{} + } + ], + "collected":{ + "date":"2020-06-16T13:52:22Z" + }, + "posted":{ + "date":"2020-06-16T13:52:22Z" + }, + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" + } + }' + ); +GO + + + + + +-- drop procedure delete_physical_card_for_bank +DROP PROCEDURE IF EXISTS delete_physical_card_for_bank; +GO +-- create procedure delete_physical_card_for_bank +CREATE PROCEDURE delete_physical_card_for_bank +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":true + }' + ); +GO + + + + + +-- drop procedure get_physical_cards_for_bank +DROP PROCEDURE IF EXISTS get_physical_cards_for_bank; +GO +-- create procedure get_physical_cards_for_bank +CREATE PROCEDURE get_physical_cards_for_bank +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "cardId":"36f8a9e6-c2b1-407a-8bd0-421b7119307e ", + "bankId":"gh.29.uk", + "bankCardNumber":"364435172576215", + "cardType":"Credit", + "nameOnCard":"SusanSmith", + "issueNumber":"1", + "serialNumber":"1324234", + "validFrom":"2020-06-16T13:52:22Z", + "expires":"2020-06-16T13:52:22Z", + "enabled":true, + "cancelled":true, + "onHotList":true, + "technology":"string", + "networks":[ + "string" + ], + "allows":[ + {} + ], + "account":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"546387432", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + }, + "replacement":{ + "requestedDate":"2020-06-16T13:52:22Z", + "reasonRequested":{} + }, + "pinResets":[ + { + "requestedDate":"2020-06-16T13:52:22Z", + "reasonRequested":{} + } + ], + "collected":{ + "date":"2020-06-16T13:52:22Z" + }, + "posted":{ + "date":"2020-06-16T13:52:22Z" + }, + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" + } + ] + }' + ); +GO + + + + + +-- drop procedure create_physical_card_legacy +DROP PROCEDURE IF EXISTS create_physical_card_legacy; +GO +-- create procedure create_physical_card_legacy +CREATE PROCEDURE create_physical_card_legacy +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "cardId":"36f8a9e6-c2b1-407a-8bd0-421b7119307e ", + "bankId":"gh.29.uk", + "bankCardNumber":"364435172576215", + "cardType":"Credit", + "nameOnCard":"SusanSmith", + "issueNumber":"1", + "serialNumber":"1324234", + "validFrom":"2020-06-16T13:52:22Z", + "expires":"2020-06-16T13:52:22Z", + "enabled":true, + "cancelled":true, + "onHotList":true, + "technology":"string", + "networks":[ + "string" + ], + "allows":[ + {} + ], + "account":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"546387432", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + }, + "replacement":{ + "requestedDate":"2020-06-16T13:52:22Z", + "reasonRequested":{} + }, + "pinResets":[ + { + "requestedDate":"2020-06-16T13:52:22Z", + "reasonRequested":{} + } + ], + "collected":{ + "date":"2020-06-16T13:52:22Z" + }, + "posted":{ + "date":"2020-06-16T13:52:22Z" + }, + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" + } + }' + ); +GO + + + + + +-- drop procedure create_physical_card +DROP PROCEDURE IF EXISTS create_physical_card; +GO +-- create procedure create_physical_card +CREATE PROCEDURE create_physical_card +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "cardId":"36f8a9e6-c2b1-407a-8bd0-421b7119307e ", + "bankId":"gh.29.uk", + "bankCardNumber":"364435172576215", + "cardType":"Credit", + "nameOnCard":"SusanSmith", + "issueNumber":"1", + "serialNumber":"1324234", + "validFrom":"2020-06-16T13:52:22Z", + "expires":"2020-06-16T13:52:22Z", + "enabled":true, + "cancelled":true, + "onHotList":true, + "technology":"string", + "networks":[ + "string" + ], + "allows":[ + {} + ], + "account":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"546387432", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + }, + "replacement":{ + "requestedDate":"2020-06-16T13:52:22Z", + "reasonRequested":{} + }, + "pinResets":[ + { + "requestedDate":"2020-06-16T13:52:22Z", + "reasonRequested":{} + } + ], + "collected":{ + "date":"2020-06-16T13:52:22Z" + }, + "posted":{ + "date":"2020-06-16T13:52:22Z" + }, + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" + } + }' + ); +GO + + + + + +-- drop procedure update_physical_card +DROP PROCEDURE IF EXISTS update_physical_card; +GO +-- create procedure update_physical_card +CREATE PROCEDURE update_physical_card +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "cardId":"36f8a9e6-c2b1-407a-8bd0-421b7119307e ", + "bankId":"gh.29.uk", + "bankCardNumber":"364435172576215", + "cardType":"Credit", + "nameOnCard":"SusanSmith", + "issueNumber":"1", + "serialNumber":"1324234", + "validFrom":"2020-06-16T13:52:22Z", + "expires":"2020-06-16T13:52:22Z", + "enabled":true, + "cancelled":true, + "onHotList":true, + "technology":"string", + "networks":[ + "string" + ], + "allows":[ + {} + ], + "account":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"546387432", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + }, + "replacement":{ + "requestedDate":"2020-06-16T13:52:22Z", + "reasonRequested":{} + }, + "pinResets":[ + { + "requestedDate":"2020-06-16T13:52:22Z", + "reasonRequested":{} + } + ], + "collected":{ + "date":"2020-06-16T13:52:22Z" + }, + "posted":{ + "date":"2020-06-16T13:52:22Z" + }, + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" + } + }' + ); +GO + + + + + +-- drop procedure make_paymentv210 +DROP PROCEDURE IF EXISTS make_paymentv210; +GO +-- create procedure make_paymentv210 +CREATE PROCEDURE make_paymentv210 +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "value":"2fg8a7e4-6d02-40e3-a129-0b2bf89de8ub" + } + }' + ); +GO + + + + + +-- drop procedure create_transaction_requestv210 +DROP PROCEDURE IF EXISTS create_transaction_requestv210; +GO +-- create procedure create_transaction_requestv210 +CREATE PROCEDURE create_transaction_requestv210 +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "id":{ + "value":"string" + }, + "type":"SEPA", + "from":{ + "bank_id":"string", + "account_id":"string" + }, + "body":{ + "to_sandbox_tan":{ + "bank_id":"string", + "account_id":"string" + }, + "to_sepa":{ + "iban":"string" + }, + "to_counterparty":{ + "counterparty_id":"string" + }, + "to_transfer_to_phone":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string", + "message":"string", + "from":{ + "mobile_phone_number":"string", + "nickname":"string" + }, + "to":{ + "mobile_phone_number":"string" + } + }, + "to_transfer_to_atm":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string", + "message":"string", + "from":{ + "mobile_phone_number":"string", + "nickname":"string" + }, + "to":{ + "legal_name":"string", + "date_of_birth":"string", + "mobile_phone_number":"string", + "kyc_document":{ + "type":"string", + "number":"string" + } + } + }, + "to_transfer_to_account":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string", + "transfer_type":"string", + "future_date":"string", + "to":{ + "name":"string", + "bank_code":"string", + "branch_number":"string", + "account":{ + "number":"546387432", + "iban":"DE91 1000 0000 0123 4567 89" + } + } + }, + "to_sepa_credit_transfers":{ + "debtorAccount":{ + "iban":"string" + }, + "instructedAmount":{ + "currency":"EUR", + "amount":"string" + }, + "creditorAccount":{ + "iban":"string" + }, + "creditorName":"string" + }, + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string" + }, + "transaction_ids":"string", + "status":"string", + "start_date":"2020-06-16T13:52:22Z", + "end_date":"2020-06-16T13:52:22Z", + "challenge":{ + "id":"string", + "allowed_attempts":123, + "challenge_type":"string" + }, + "charge":{ + "summary":"string", + "value":{ + "currency":"EUR", + "amount":"string" + } + }, + "charge_policy":"string", + "counterparty_id":{ + "value":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }, + "name":"string", + "this_bank_id":{ + "value":"gh.29.uk" + }, + "this_account_id":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "this_view_id":{ + "value":"owner" + }, + "other_account_routing_scheme":"string", + "other_account_routing_address":"string", + "other_bank_routing_scheme":"string", + "other_bank_routing_address":"string", + "is_beneficiary":true, + "future_date":"string" + } + }' + ); +GO + + + + + +-- drop procedure create_transaction_requestv400 +DROP PROCEDURE IF EXISTS create_transaction_requestv400; +GO +-- create procedure create_transaction_requestv400 +CREATE PROCEDURE create_transaction_requestv400 +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "id":{ + "value":"string" + }, + "type":"SEPA", + "from":{ + "bank_id":"string", + "account_id":"string" + }, + "body":{ + "to_sandbox_tan":{ + "bank_id":"string", + "account_id":"string" + }, + "to_sepa":{ + "iban":"string" + }, + "to_counterparty":{ + "counterparty_id":"string" + }, + "to_transfer_to_phone":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string", + "message":"string", + "from":{ + "mobile_phone_number":"string", + "nickname":"string" + }, + "to":{ + "mobile_phone_number":"string" + } + }, + "to_transfer_to_atm":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string", + "message":"string", + "from":{ + "mobile_phone_number":"string", + "nickname":"string" + }, + "to":{ + "legal_name":"string", + "date_of_birth":"string", + "mobile_phone_number":"string", + "kyc_document":{ + "type":"string", + "number":"string" + } + } + }, + "to_transfer_to_account":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string", + "transfer_type":"string", + "future_date":"string", + "to":{ + "name":"string", + "bank_code":"string", + "branch_number":"string", + "account":{ + "number":"546387432", + "iban":"DE91 1000 0000 0123 4567 89" + } + } + }, + "to_sepa_credit_transfers":{ + "debtorAccount":{ + "iban":"string" + }, + "instructedAmount":{ + "currency":"EUR", + "amount":"string" + }, + "creditorAccount":{ + "iban":"string" + }, + "creditorName":"string" + }, + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string" + }, + "transaction_ids":"string", + "status":"string", + "start_date":"2020-06-16T13:52:22Z", + "end_date":"2020-06-16T13:52:22Z", + "challenge":{ + "id":"string", + "allowed_attempts":123, + "challenge_type":"string" + }, + "charge":{ + "summary":"string", + "value":{ + "currency":"EUR", + "amount":"string" + } + }, + "charge_policy":"string", + "counterparty_id":{ + "value":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }, + "name":"string", + "this_bank_id":{ + "value":"gh.29.uk" + }, + "this_account_id":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "this_view_id":{ + "value":"owner" + }, + "other_account_routing_scheme":"string", + "other_account_routing_address":"string", + "other_bank_routing_scheme":"string", + "other_bank_routing_address":"string", + "is_beneficiary":true, + "future_date":"string" + } + }' + ); +GO + + + + + +-- drop procedure get_transaction_requests210 +DROP PROCEDURE IF EXISTS get_transaction_requests210; +GO +-- create procedure get_transaction_requests210 +CREATE PROCEDURE get_transaction_requests210 +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "id":{ + "value":"string" + }, + "type":"SEPA", + "from":{ + "bank_id":"string", + "account_id":"string" + }, + "body":{ + "to_sandbox_tan":{ + "bank_id":"string", + "account_id":"string" + }, + "to_sepa":{ + "iban":"string" + }, + "to_counterparty":{ + "counterparty_id":"string" + }, + "to_transfer_to_phone":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string", + "message":"string", + "from":{ + "mobile_phone_number":"string", + "nickname":"string" + }, + "to":{ + "mobile_phone_number":"string" + } + }, + "to_transfer_to_atm":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string", + "message":"string", + "from":{ + "mobile_phone_number":"string", + "nickname":"string" + }, + "to":{ + "legal_name":"string", + "date_of_birth":"string", + "mobile_phone_number":"string", + "kyc_document":{ + "type":"string", + "number":"string" + } + } + }, + "to_transfer_to_account":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string", + "transfer_type":"string", + "future_date":"string", + "to":{ + "name":"string", + "bank_code":"string", + "branch_number":"string", + "account":{ + "number":"546387432", + "iban":"DE91 1000 0000 0123 4567 89" + } + } + }, + "to_sepa_credit_transfers":{ + "debtorAccount":{ + "iban":"string" + }, + "instructedAmount":{ + "currency":"EUR", + "amount":"string" + }, + "creditorAccount":{ + "iban":"string" + }, + "creditorName":"string" + }, + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string" + }, + "transaction_ids":"string", + "status":"string", + "start_date":"2020-06-16T13:52:22Z", + "end_date":"2020-06-16T13:52:22Z", + "challenge":{ + "id":"string", + "allowed_attempts":123, + "challenge_type":"string" + }, + "charge":{ + "summary":"string", + "value":{ + "currency":"EUR", + "amount":"string" + } + }, + "charge_policy":"string", + "counterparty_id":{ + "value":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }, + "name":"string", + "this_bank_id":{ + "value":"gh.29.uk" + }, + "this_account_id":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "this_view_id":{ + "value":"owner" + }, + "other_account_routing_scheme":"string", + "other_account_routing_address":"string", + "other_bank_routing_scheme":"string", + "other_bank_routing_address":"string", + "is_beneficiary":true, + "future_date":"string" + } + ] + }' + ); +GO + + + + + +-- drop procedure get_transaction_request_impl +DROP PROCEDURE IF EXISTS get_transaction_request_impl; +GO +-- create procedure get_transaction_request_impl +CREATE PROCEDURE get_transaction_request_impl +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "id":{ + "value":"string" + }, + "type":"SEPA", + "from":{ + "bank_id":"string", + "account_id":"string" + }, + "body":{ + "to_sandbox_tan":{ + "bank_id":"string", + "account_id":"string" + }, + "to_sepa":{ + "iban":"string" + }, + "to_counterparty":{ + "counterparty_id":"string" + }, + "to_transfer_to_phone":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string", + "message":"string", + "from":{ + "mobile_phone_number":"string", + "nickname":"string" + }, + "to":{ + "mobile_phone_number":"string" + } + }, + "to_transfer_to_atm":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string", + "message":"string", + "from":{ + "mobile_phone_number":"string", + "nickname":"string" + }, + "to":{ + "legal_name":"string", + "date_of_birth":"string", + "mobile_phone_number":"string", + "kyc_document":{ + "type":"string", + "number":"string" + } + } + }, + "to_transfer_to_account":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string", + "transfer_type":"string", + "future_date":"string", + "to":{ + "name":"string", + "bank_code":"string", + "branch_number":"string", + "account":{ + "number":"546387432", + "iban":"DE91 1000 0000 0123 4567 89" + } + } + }, + "to_sepa_credit_transfers":{ + "debtorAccount":{ + "iban":"string" + }, + "instructedAmount":{ + "currency":"EUR", + "amount":"string" + }, + "creditorAccount":{ + "iban":"string" + }, + "creditorName":"string" + }, + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string" + }, + "transaction_ids":"string", + "status":"string", + "start_date":"2020-06-16T13:52:22Z", + "end_date":"2020-06-16T13:52:22Z", + "challenge":{ + "id":"string", + "allowed_attempts":123, + "challenge_type":"string" + }, + "charge":{ + "summary":"string", + "value":{ + "currency":"EUR", + "amount":"string" + } + }, + "charge_policy":"string", + "counterparty_id":{ + "value":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }, + "name":"string", + "this_bank_id":{ + "value":"gh.29.uk" + }, + "this_account_id":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "this_view_id":{ + "value":"owner" + }, + "other_account_routing_scheme":"string", + "other_account_routing_address":"string", + "other_bank_routing_scheme":"string", + "other_bank_routing_address":"string", + "is_beneficiary":true, + "future_date":"string" + } + }' + ); +GO + + + + + +-- drop procedure create_transaction_after_challenge_v210 +DROP PROCEDURE IF EXISTS create_transaction_after_challenge_v210; +GO +-- create procedure create_transaction_after_challenge_v210 +CREATE PROCEDURE create_transaction_after_challenge_v210 +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "id":{ + "value":"string" + }, + "type":"SEPA", + "from":{ + "bank_id":"string", + "account_id":"string" + }, + "body":{ + "to_sandbox_tan":{ + "bank_id":"string", + "account_id":"string" + }, + "to_sepa":{ + "iban":"string" + }, + "to_counterparty":{ + "counterparty_id":"string" + }, + "to_transfer_to_phone":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string", + "message":"string", + "from":{ + "mobile_phone_number":"string", + "nickname":"string" + }, + "to":{ + "mobile_phone_number":"string" + } + }, + "to_transfer_to_atm":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string", + "message":"string", + "from":{ + "mobile_phone_number":"string", + "nickname":"string" + }, + "to":{ + "legal_name":"string", + "date_of_birth":"string", + "mobile_phone_number":"string", + "kyc_document":{ + "type":"string", + "number":"string" + } + } + }, + "to_transfer_to_account":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string", + "transfer_type":"string", + "future_date":"string", + "to":{ + "name":"string", + "bank_code":"string", + "branch_number":"string", + "account":{ + "number":"546387432", + "iban":"DE91 1000 0000 0123 4567 89" + } + } + }, + "to_sepa_credit_transfers":{ + "debtorAccount":{ + "iban":"string" + }, + "instructedAmount":{ + "currency":"EUR", + "amount":"string" + }, + "creditorAccount":{ + "iban":"string" + }, + "creditorName":"string" + }, + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string" + }, + "transaction_ids":"string", + "status":"string", + "start_date":"2020-06-16T13:52:22Z", + "end_date":"2020-06-16T13:52:22Z", + "challenge":{ + "id":"string", + "allowed_attempts":123, + "challenge_type":"string" + }, + "charge":{ + "summary":"string", + "value":{ + "currency":"EUR", + "amount":"string" + } + }, + "charge_policy":"string", + "counterparty_id":{ + "value":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }, + "name":"string", + "this_bank_id":{ + "value":"gh.29.uk" + }, + "this_account_id":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "this_view_id":{ + "value":"owner" + }, + "other_account_routing_scheme":"string", + "other_account_routing_address":"string", + "other_bank_routing_scheme":"string", + "other_bank_routing_address":"string", + "is_beneficiary":true, + "future_date":"string" + } + }' + ); +GO + + + + + +-- drop procedure update_bank_account +DROP PROCEDURE IF EXISTS update_bank_account; +GO +-- create procedure update_bank_account +CREATE PROCEDURE update_bank_account +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + } + }' + ); +GO + + + + + +-- drop procedure create_bank_account +DROP PROCEDURE IF EXISTS create_bank_account; +GO +-- create procedure create_bank_account +CREATE PROCEDURE create_bank_account +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + } + }' + ); +GO + + + + + +-- drop procedure account_exists +DROP PROCEDURE IF EXISTS account_exists; +GO +-- create procedure account_exists +CREATE PROCEDURE account_exists +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":true + }' + ); +GO + + + + + +-- drop procedure get_branch +DROP PROCEDURE IF EXISTS get_branch; +GO +-- create procedure get_branch +CREATE PROCEDURE get_branch +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "branchId":{ + "value":"DERBY6" + }, + "bankId":{ + "value":"gh.29.uk" + }, + "name":"string", + "address":{ + "line1":"string", + "line2":"string", + "line3":"string", + "city":"string", + "county":"string", + "state":"string", + "postCode":"string", + "countryCode":"string" + }, + "location":{ + "latitude":123.123, + "longitude":123.123, + "date":"2020-06-16T13:52:22Z", + "user":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "provider":"string", + "username":"felixsmith" + } + }, + "lobbyString":{ + "hours":"string" + }, + "driveUpString":{ + "hours":"string" + }, + "meta":{ + "license":{ + "id":"string", + "name":"string" + } + }, + "branchRouting":{ + "scheme":"BRANCH-CODE", + "address":"DERBY6" + }, + "lobby":{ + "monday":[ + { + "openingTime":"string", + "closingTime":"string" + } + ], + "tuesday":[ + { + "openingTime":"string", + "closingTime":"string" + } + ], + "wednesday":[ + { + "openingTime":"string", + "closingTime":"string" + } + ], + "thursday":[ + { + "openingTime":"string", + "closingTime":"string" + } + ], + "friday":[ + { + "openingTime":"string", + "closingTime":"string" + } + ], + "saturday":[ + { + "openingTime":"string", + "closingTime":"string" + } + ], + "sunday":[ + { + "openingTime":"string", + "closingTime":"string" + } + ] + }, + "driveUp":{ + "monday":{ + "openingTime":"string", + "closingTime":"string" + }, + "tuesday":{ + "openingTime":"string", + "closingTime":"string" + }, + "wednesday":{ + "openingTime":"string", + "closingTime":"string" + }, + "thursday":{ + "openingTime":"string", + "closingTime":"string" + }, + "friday":{ + "openingTime":"string", + "closingTime":"string" + }, + "saturday":{ + "openingTime":"string", + "closingTime":"string" + }, + "sunday":{ + "openingTime":"string", + "closingTime":"string" + } + }, + "isAccessible":true, + "accessibleFeatures":"string", + "branchType":"string", + "moreInfo":"string", + "phoneNumber":"string", + "isDeleted":true + } + }' + ); +GO + + + + + +-- drop procedure get_branches +DROP PROCEDURE IF EXISTS get_branches; +GO +-- create procedure get_branches +CREATE PROCEDURE get_branches +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "branchId":{ + "value":"DERBY6" + }, + "bankId":{ + "value":"gh.29.uk" + }, + "name":"string", + "address":{ + "line1":"string", + "line2":"string", + "line3":"string", + "city":"string", + "county":"string", + "state":"string", + "postCode":"string", + "countryCode":"string" + }, + "location":{ + "latitude":123.123, + "longitude":123.123, + "date":"2020-06-16T13:52:22Z", + "user":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "provider":"string", + "username":"felixsmith" + } + }, + "lobbyString":{ + "hours":"string" + }, + "driveUpString":{ + "hours":"string" + }, + "meta":{ + "license":{ + "id":"string", + "name":"string" + } + }, + "branchRouting":{ + "scheme":"BRANCH-CODE", + "address":"DERBY6" + }, + "lobby":{ + "monday":[ + { + "openingTime":"string", + "closingTime":"string" + } + ], + "tuesday":[ + { + "openingTime":"string", + "closingTime":"string" + } + ], + "wednesday":[ + { + "openingTime":"string", + "closingTime":"string" + } + ], + "thursday":[ + { + "openingTime":"string", + "closingTime":"string" + } + ], + "friday":[ + { + "openingTime":"string", + "closingTime":"string" + } + ], + "saturday":[ + { + "openingTime":"string", + "closingTime":"string" + } + ], + "sunday":[ + { + "openingTime":"string", + "closingTime":"string" + } + ] + }, + "driveUp":{ + "monday":{ + "openingTime":"string", + "closingTime":"string" + }, + "tuesday":{ + "openingTime":"string", + "closingTime":"string" + }, + "wednesday":{ + "openingTime":"string", + "closingTime":"string" + }, + "thursday":{ + "openingTime":"string", + "closingTime":"string" + }, + "friday":{ + "openingTime":"string", + "closingTime":"string" + }, + "saturday":{ + "openingTime":"string", + "closingTime":"string" + }, + "sunday":{ + "openingTime":"string", + "closingTime":"string" + } + }, + "isAccessible":true, + "accessibleFeatures":"string", + "branchType":"string", + "moreInfo":"string", + "phoneNumber":"string", + "isDeleted":true + } + ] + }' + ); +GO + + + + + +-- drop procedure get_atm +DROP PROCEDURE IF EXISTS get_atm; +GO +-- create procedure get_atm +CREATE PROCEDURE get_atm +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "atmId":{ + "value":"string" + }, + "bankId":{ + "value":"gh.29.uk" + }, + "name":"string", + "address":{ + "line1":"string", + "line2":"string", + "line3":"string", + "city":"string", + "county":"string", + "state":"string", + "postCode":"string", + "countryCode":"string" + }, + "location":{ + "latitude":123.123, + "longitude":123.123, + "date":"2020-06-16T13:52:22Z", + "user":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "provider":"string", + "username":"felixsmith" + } + }, + "meta":{ + "license":{ + "id":"string", + "name":"string" + } + }, + "OpeningTimeOnMonday":"string", + "ClosingTimeOnMonday":"string", + "OpeningTimeOnTuesday":"string", + "ClosingTimeOnTuesday":"string", + "OpeningTimeOnWednesday":"string", + "ClosingTimeOnWednesday":"string", + "OpeningTimeOnThursday":"string", + "ClosingTimeOnThursday":"string", + "OpeningTimeOnFriday":"string", + "ClosingTimeOnFriday":"string", + "OpeningTimeOnSaturday":"string", + "ClosingTimeOnSaturday":"string", + "OpeningTimeOnSunday":"string", + "ClosingTimeOnSunday":"string", + "isAccessible":true, + "locatedAt":"string", + "moreInfo":"string", + "hasDepositCapability":true + } + }' + ); +GO + + + + + +-- drop procedure get_atms +DROP PROCEDURE IF EXISTS get_atms; +GO +-- create procedure get_atms +CREATE PROCEDURE get_atms +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "atmId":{ + "value":"string" + }, + "bankId":{ + "value":"gh.29.uk" + }, + "name":"string", + "address":{ + "line1":"string", + "line2":"string", + "line3":"string", + "city":"string", + "county":"string", + "state":"string", + "postCode":"string", + "countryCode":"string" + }, + "location":{ + "latitude":123.123, + "longitude":123.123, + "date":"2020-06-16T13:52:22Z", + "user":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "provider":"string", + "username":"felixsmith" + } + }, + "meta":{ + "license":{ + "id":"string", + "name":"string" + } + }, + "OpeningTimeOnMonday":"string", + "ClosingTimeOnMonday":"string", + "OpeningTimeOnTuesday":"string", + "ClosingTimeOnTuesday":"string", + "OpeningTimeOnWednesday":"string", + "ClosingTimeOnWednesday":"string", + "OpeningTimeOnThursday":"string", + "ClosingTimeOnThursday":"string", + "OpeningTimeOnFriday":"string", + "ClosingTimeOnFriday":"string", + "OpeningTimeOnSaturday":"string", + "ClosingTimeOnSaturday":"string", + "OpeningTimeOnSunday":"string", + "ClosingTimeOnSunday":"string", + "isAccessible":true, + "locatedAt":"string", + "moreInfo":"string", + "hasDepositCapability":true + } + ] + }' + ); +GO + + + + + +-- drop procedure create_transaction_after_challengev300 +DROP PROCEDURE IF EXISTS create_transaction_after_challengev300; +GO +-- create procedure create_transaction_after_challengev300 +CREATE PROCEDURE create_transaction_after_challengev300 +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "id":{ + "value":"string" + }, + "type":"SEPA", + "from":{ + "bank_id":"string", + "account_id":"string" + }, + "body":{ + "to_sandbox_tan":{ + "bank_id":"string", + "account_id":"string" + }, + "to_sepa":{ + "iban":"string" + }, + "to_counterparty":{ + "counterparty_id":"string" + }, + "to_transfer_to_phone":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string", + "message":"string", + "from":{ + "mobile_phone_number":"string", + "nickname":"string" + }, + "to":{ + "mobile_phone_number":"string" + } + }, + "to_transfer_to_atm":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string", + "message":"string", + "from":{ + "mobile_phone_number":"string", + "nickname":"string" + }, + "to":{ + "legal_name":"string", + "date_of_birth":"string", + "mobile_phone_number":"string", + "kyc_document":{ + "type":"string", + "number":"string" + } + } + }, + "to_transfer_to_account":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string", + "transfer_type":"string", + "future_date":"string", + "to":{ + "name":"string", + "bank_code":"string", + "branch_number":"string", + "account":{ + "number":"546387432", + "iban":"DE91 1000 0000 0123 4567 89" + } + } + }, + "to_sepa_credit_transfers":{ + "debtorAccount":{ + "iban":"string" + }, + "instructedAmount":{ + "currency":"EUR", + "amount":"string" + }, + "creditorAccount":{ + "iban":"string" + }, + "creditorName":"string" + }, + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string" + }, + "transaction_ids":"string", + "status":"string", + "start_date":"2020-06-16T13:52:22Z", + "end_date":"2020-06-16T13:52:22Z", + "challenge":{ + "id":"string", + "allowed_attempts":123, + "challenge_type":"string" + }, + "charge":{ + "summary":"string", + "value":{ + "currency":"EUR", + "amount":"string" + } + }, + "charge_policy":"string", + "counterparty_id":{ + "value":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }, + "name":"string", + "this_bank_id":{ + "value":"gh.29.uk" + }, + "this_account_id":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "this_view_id":{ + "value":"owner" + }, + "other_account_routing_scheme":"string", + "other_account_routing_address":"string", + "other_bank_routing_scheme":"string", + "other_bank_routing_address":"string", + "is_beneficiary":true, + "future_date":"string" + } + }' + ); +GO + + + + + +-- drop procedure make_paymentv300 +DROP PROCEDURE IF EXISTS make_paymentv300; +GO +-- create procedure make_paymentv300 +CREATE PROCEDURE make_paymentv300 +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "value":"2fg8a7e4-6d02-40e3-a129-0b2bf89de8ub" + } + }' + ); +GO + + + + + +-- drop procedure create_transaction_requestv300 +DROP PROCEDURE IF EXISTS create_transaction_requestv300; +GO +-- create procedure create_transaction_requestv300 +CREATE PROCEDURE create_transaction_requestv300 +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "id":{ + "value":"string" + }, + "type":"SEPA", + "from":{ + "bank_id":"string", + "account_id":"string" + }, + "body":{ + "to_sandbox_tan":{ + "bank_id":"string", + "account_id":"string" + }, + "to_sepa":{ + "iban":"string" + }, + "to_counterparty":{ + "counterparty_id":"string" + }, + "to_transfer_to_phone":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string", + "message":"string", + "from":{ + "mobile_phone_number":"string", + "nickname":"string" + }, + "to":{ + "mobile_phone_number":"string" + } + }, + "to_transfer_to_atm":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string", + "message":"string", + "from":{ + "mobile_phone_number":"string", + "nickname":"string" + }, + "to":{ + "legal_name":"string", + "date_of_birth":"string", + "mobile_phone_number":"string", + "kyc_document":{ + "type":"string", + "number":"string" + } + } + }, + "to_transfer_to_account":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string", + "transfer_type":"string", + "future_date":"string", + "to":{ + "name":"string", + "bank_code":"string", + "branch_number":"string", + "account":{ + "number":"546387432", + "iban":"DE91 1000 0000 0123 4567 89" + } + } + }, + "to_sepa_credit_transfers":{ + "debtorAccount":{ + "iban":"string" + }, + "instructedAmount":{ + "currency":"EUR", + "amount":"string" + }, + "creditorAccount":{ + "iban":"string" + }, + "creditorName":"string" + }, + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string" + }, + "transaction_ids":"string", + "status":"string", + "start_date":"2020-06-16T13:52:22Z", + "end_date":"2020-06-16T13:52:22Z", + "challenge":{ + "id":"string", + "allowed_attempts":123, + "challenge_type":"string" + }, + "charge":{ + "summary":"string", + "value":{ + "currency":"EUR", + "amount":"string" + } + }, + "charge_policy":"string", + "counterparty_id":{ + "value":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }, + "name":"string", + "this_bank_id":{ + "value":"gh.29.uk" + }, + "this_account_id":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "this_view_id":{ + "value":"owner" + }, + "other_account_routing_scheme":"string", + "other_account_routing_address":"string", + "other_bank_routing_scheme":"string", + "other_bank_routing_address":"string", + "is_beneficiary":true, + "future_date":"string" + } + }' + ); +GO + + + + + +-- drop procedure create_counterparty +DROP PROCEDURE IF EXISTS create_counterparty; +GO +-- create procedure create_counterparty +CREATE PROCEDURE create_counterparty +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "createdByUserId":"string", + "name":"string", + "description":"string", + "thisBankId":"string", + "thisAccountId":"string", + "thisViewId":"string", + "counterpartyId":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "otherAccountRoutingScheme":"IBAN", + "otherAccountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "otherAccountSecondaryRoutingScheme":"string", + "otherAccountSecondaryRoutingAddress":"string", + "otherBankRoutingScheme":"BIC", + "otherBankRoutingAddress":"GENODEM1GLS", + "otherBranchRoutingScheme":"BRANCH-CODE", + "otherBranchRoutingAddress":"DERBY6", + "isBeneficiary":true, + "bespoke":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + } + }' + ); +GO + + + + + +-- drop procedure check_customer_number_available +DROP PROCEDURE IF EXISTS check_customer_number_available; +GO +-- create procedure check_customer_number_available +CREATE PROCEDURE check_customer_number_available +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":true + }' + ); +GO + + + + + +-- drop procedure create_customer +DROP PROCEDURE IF EXISTS create_customer; +GO +-- create procedure create_customer +CREATE PROCEDURE create_customer +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "bankId":"gh.29.uk", + "number":"5987953", + "legalName":"Eveline Tripman", + "mobileNumber":"+44 07972 444 876", + "email":"eveline@example.com", + "faceImage":{ + "date":"2019-09-07T16:00:00Z", + "url":"http://www.example.com/id-docs/123/image.png" + }, + "dateOfBirth":"2018-03-08T16:00:00Z", + "relationshipStatus":"single", + "dependents":1, + "dobOfDependents":[ + "2019-09-07T16:00:00Z", + "2019-01-02T16:00:00Z" + ], + "highestEducationAttained":"Master", + "employmentStatus":"worker", + "creditRating":{ + "rating":"", + "source":"" + }, + "creditLimit":{ + "currency":"EUR", + "amount":"1000.00" + }, + "kycStatus":true, + "lastOkDate":"2019-09-07T16:00:00Z", + "title":"title of customer", + "branchId":"DERBY6", + "nameSuffix":"Sr" + } + }' + ); +GO + + + + + +-- drop procedure update_customer_sca_data +DROP PROCEDURE IF EXISTS update_customer_sca_data; +GO +-- create procedure update_customer_sca_data +CREATE PROCEDURE update_customer_sca_data +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "bankId":"gh.29.uk", + "number":"5987953", + "legalName":"Eveline Tripman", + "mobileNumber":"+44 07972 444 876", + "email":"eveline@example.com", + "faceImage":{ + "date":"2019-09-07T16:00:00Z", + "url":"http://www.example.com/id-docs/123/image.png" + }, + "dateOfBirth":"2018-03-08T16:00:00Z", + "relationshipStatus":"single", + "dependents":1, + "dobOfDependents":[ + "2019-09-07T16:00:00Z", + "2019-01-02T16:00:00Z" + ], + "highestEducationAttained":"Master", + "employmentStatus":"worker", + "creditRating":{ + "rating":"", + "source":"" + }, + "creditLimit":{ + "currency":"EUR", + "amount":"1000.00" + }, + "kycStatus":true, + "lastOkDate":"2019-09-07T16:00:00Z", + "title":"title of customer", + "branchId":"DERBY6", + "nameSuffix":"Sr" + } + }' + ); +GO + + + + + +-- drop procedure update_customer_credit_data +DROP PROCEDURE IF EXISTS update_customer_credit_data; +GO +-- create procedure update_customer_credit_data +CREATE PROCEDURE update_customer_credit_data +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "bankId":"gh.29.uk", + "number":"5987953", + "legalName":"Eveline Tripman", + "mobileNumber":"+44 07972 444 876", + "email":"eveline@example.com", + "faceImage":{ + "date":"2019-09-07T16:00:00Z", + "url":"http://www.example.com/id-docs/123/image.png" + }, + "dateOfBirth":"2018-03-08T16:00:00Z", + "relationshipStatus":"single", + "dependents":1, + "dobOfDependents":[ + "2019-09-07T16:00:00Z", + "2019-01-02T16:00:00Z" + ], + "highestEducationAttained":"Master", + "employmentStatus":"worker", + "creditRating":{ + "rating":"", + "source":"" + }, + "creditLimit":{ + "currency":"EUR", + "amount":"1000.00" + }, + "kycStatus":true, + "lastOkDate":"2019-09-07T16:00:00Z", + "title":"title of customer", + "branchId":"DERBY6", + "nameSuffix":"Sr" + } + }' + ); +GO + + + + + +-- drop procedure update_customer_general_data +DROP PROCEDURE IF EXISTS update_customer_general_data; +GO +-- create procedure update_customer_general_data +CREATE PROCEDURE update_customer_general_data +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "bankId":"gh.29.uk", + "number":"5987953", + "legalName":"Eveline Tripman", + "mobileNumber":"+44 07972 444 876", + "email":"eveline@example.com", + "faceImage":{ + "date":"2019-09-07T16:00:00Z", + "url":"http://www.example.com/id-docs/123/image.png" + }, + "dateOfBirth":"2018-03-08T16:00:00Z", + "relationshipStatus":"single", + "dependents":1, + "dobOfDependents":[ + "2019-09-07T16:00:00Z", + "2019-01-02T16:00:00Z" + ], + "highestEducationAttained":"Master", + "employmentStatus":"worker", + "creditRating":{ + "rating":"", + "source":"" + }, + "creditLimit":{ + "currency":"EUR", + "amount":"1000.00" + }, + "kycStatus":true, + "lastOkDate":"2019-09-07T16:00:00Z", + "title":"title of customer", + "branchId":"DERBY6", + "nameSuffix":"Sr" + } + }' + ); +GO + + + + + +-- drop procedure get_customers_by_user_id +DROP PROCEDURE IF EXISTS get_customers_by_user_id; +GO +-- create procedure get_customers_by_user_id +CREATE PROCEDURE get_customers_by_user_id +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "bankId":"gh.29.uk", + "number":"5987953", + "legalName":"Eveline Tripman", + "mobileNumber":"+44 07972 444 876", + "email":"eveline@example.com", + "faceImage":{ + "date":"2019-09-07T16:00:00Z", + "url":"http://www.example.com/id-docs/123/image.png" + }, + "dateOfBirth":"2018-03-08T16:00:00Z", + "relationshipStatus":"single", + "dependents":1, + "dobOfDependents":[ + "2019-09-07T16:00:00Z", + "2019-01-02T16:00:00Z" + ], + "highestEducationAttained":"Master", + "employmentStatus":"worker", + "creditRating":{ + "rating":"", + "source":"" + }, + "creditLimit":{ + "currency":"EUR", + "amount":"1000.00" + }, + "kycStatus":true, + "lastOkDate":"2019-09-07T16:00:00Z", + "title":"title of customer", + "branchId":"DERBY6", + "nameSuffix":"Sr" + } + ] + }' + ); +GO + + + + + +-- drop procedure get_customer_by_customer_id_legacy +DROP PROCEDURE IF EXISTS get_customer_by_customer_id_legacy; +GO +-- create procedure get_customer_by_customer_id_legacy +CREATE PROCEDURE get_customer_by_customer_id_legacy +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "bankId":"gh.29.uk", + "number":"5987953", + "legalName":"Eveline Tripman", + "mobileNumber":"+44 07972 444 876", + "email":"eveline@example.com", + "faceImage":{ + "date":"2019-09-07T16:00:00Z", + "url":"http://www.example.com/id-docs/123/image.png" + }, + "dateOfBirth":"2018-03-08T16:00:00Z", + "relationshipStatus":"single", + "dependents":1, + "dobOfDependents":[ + "2019-09-07T16:00:00Z", + "2019-01-02T16:00:00Z" + ], + "highestEducationAttained":"Master", + "employmentStatus":"worker", + "creditRating":{ + "rating":"", + "source":"" + }, + "creditLimit":{ + "currency":"EUR", + "amount":"1000.00" + }, + "kycStatus":true, + "lastOkDate":"2019-09-07T16:00:00Z", + "title":"title of customer", + "branchId":"DERBY6", + "nameSuffix":"Sr" + } + }' + ); +GO + + + + + +-- drop procedure get_customer_by_customer_id +DROP PROCEDURE IF EXISTS get_customer_by_customer_id; +GO +-- create procedure get_customer_by_customer_id +CREATE PROCEDURE get_customer_by_customer_id +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "bankId":"gh.29.uk", + "number":"5987953", + "legalName":"Eveline Tripman", + "mobileNumber":"+44 07972 444 876", + "email":"eveline@example.com", + "faceImage":{ + "date":"2019-09-07T16:00:00Z", + "url":"http://www.example.com/id-docs/123/image.png" + }, + "dateOfBirth":"2018-03-08T16:00:00Z", + "relationshipStatus":"single", + "dependents":1, + "dobOfDependents":[ + "2019-09-07T16:00:00Z", + "2019-01-02T16:00:00Z" + ], + "highestEducationAttained":"Master", + "employmentStatus":"worker", + "creditRating":{ + "rating":"", + "source":"" + }, + "creditLimit":{ + "currency":"EUR", + "amount":"1000.00" + }, + "kycStatus":true, + "lastOkDate":"2019-09-07T16:00:00Z", + "title":"title of customer", + "branchId":"DERBY6", + "nameSuffix":"Sr" + } + }' + ); +GO + + + + + +-- drop procedure get_customer_by_customer_number +DROP PROCEDURE IF EXISTS get_customer_by_customer_number; +GO +-- create procedure get_customer_by_customer_number +CREATE PROCEDURE get_customer_by_customer_number +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "bankId":"gh.29.uk", + "number":"5987953", + "legalName":"Eveline Tripman", + "mobileNumber":"+44 07972 444 876", + "email":"eveline@example.com", + "faceImage":{ + "date":"2019-09-07T16:00:00Z", + "url":"http://www.example.com/id-docs/123/image.png" + }, + "dateOfBirth":"2018-03-08T16:00:00Z", + "relationshipStatus":"single", + "dependents":1, + "dobOfDependents":[ + "2019-09-07T16:00:00Z", + "2019-01-02T16:00:00Z" + ], + "highestEducationAttained":"Master", + "employmentStatus":"worker", + "creditRating":{ + "rating":"", + "source":"" + }, + "creditLimit":{ + "currency":"EUR", + "amount":"1000.00" + }, + "kycStatus":true, + "lastOkDate":"2019-09-07T16:00:00Z", + "title":"title of customer", + "branchId":"DERBY6", + "nameSuffix":"Sr" + } + }' + ); +GO + + + + + +-- drop procedure get_customer_address +DROP PROCEDURE IF EXISTS get_customer_address; +GO +-- create procedure get_customer_address +CREATE PROCEDURE get_customer_address +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerAddressId":"string", + "line1":"string", + "line2":"string", + "line3":"string", + "city":"string", + "county":"string", + "state":"string", + "postcode":"string", + "countryCode":"string", + "status":"string", + "tags":"string", + "insertDate":"2020-06-16T13:52:22Z" + } + ] + }' + ); +GO + + + + + +-- drop procedure create_customer_address +DROP PROCEDURE IF EXISTS create_customer_address; +GO +-- create procedure create_customer_address +CREATE PROCEDURE create_customer_address +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerAddressId":"string", + "line1":"string", + "line2":"string", + "line3":"string", + "city":"string", + "county":"string", + "state":"string", + "postcode":"string", + "countryCode":"string", + "status":"string", + "tags":"string", + "insertDate":"2020-06-16T13:52:22Z" + } + }' + ); +GO + + + + + +-- drop procedure update_customer_address +DROP PROCEDURE IF EXISTS update_customer_address; +GO +-- create procedure update_customer_address +CREATE PROCEDURE update_customer_address +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerAddressId":"string", + "line1":"string", + "line2":"string", + "line3":"string", + "city":"string", + "county":"string", + "state":"string", + "postcode":"string", + "countryCode":"string", + "status":"string", + "tags":"string", + "insertDate":"2020-06-16T13:52:22Z" + } + }' + ); +GO + + + + + +-- drop procedure delete_customer_address +DROP PROCEDURE IF EXISTS delete_customer_address; +GO +-- create procedure delete_customer_address +CREATE PROCEDURE delete_customer_address +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":true + }' + ); +GO + + + + + +-- drop procedure create_tax_residence +DROP PROCEDURE IF EXISTS create_tax_residence; +GO +-- create procedure create_tax_residence +CREATE PROCEDURE create_tax_residence +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "taxResidenceId":"string", + "domain":"string", + "taxNumber":"string" + } + }' + ); +GO + + + + + +-- drop procedure get_tax_residence +DROP PROCEDURE IF EXISTS get_tax_residence; +GO +-- create procedure get_tax_residence +CREATE PROCEDURE get_tax_residence +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "taxResidenceId":"string", + "domain":"string", + "taxNumber":"string" + } + ] + }' + ); +GO + + + + + +-- drop procedure delete_tax_residence +DROP PROCEDURE IF EXISTS delete_tax_residence; +GO +-- create procedure delete_tax_residence +CREATE PROCEDURE delete_tax_residence +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":true + }' + ); +GO + + + + + +-- drop procedure get_customers +DROP PROCEDURE IF EXISTS get_customers; +GO +-- create procedure get_customers +CREATE PROCEDURE get_customers +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "bankId":"gh.29.uk", + "number":"5987953", + "legalName":"Eveline Tripman", + "mobileNumber":"+44 07972 444 876", + "email":"eveline@example.com", + "faceImage":{ + "date":"2019-09-07T16:00:00Z", + "url":"http://www.example.com/id-docs/123/image.png" + }, + "dateOfBirth":"2018-03-08T16:00:00Z", + "relationshipStatus":"single", + "dependents":1, + "dobOfDependents":[ + "2019-09-07T16:00:00Z", + "2019-01-02T16:00:00Z" + ], + "highestEducationAttained":"Master", + "employmentStatus":"worker", + "creditRating":{ + "rating":"", + "source":"" + }, + "creditLimit":{ + "currency":"EUR", + "amount":"1000.00" + }, + "kycStatus":true, + "lastOkDate":"2019-09-07T16:00:00Z", + "title":"title of customer", + "branchId":"DERBY6", + "nameSuffix":"Sr" + } + ] + }' + ); +GO + + + + + +-- drop procedure get_customers_by_customer_phone_number +DROP PROCEDURE IF EXISTS get_customers_by_customer_phone_number; +GO +-- create procedure get_customers_by_customer_phone_number +CREATE PROCEDURE get_customers_by_customer_phone_number +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "bankId":"gh.29.uk", + "number":"5987953", + "legalName":"Eveline Tripman", + "mobileNumber":"+44 07972 444 876", + "email":"eveline@example.com", + "faceImage":{ + "date":"2019-09-07T16:00:00Z", + "url":"http://www.example.com/id-docs/123/image.png" + }, + "dateOfBirth":"2018-03-08T16:00:00Z", + "relationshipStatus":"single", + "dependents":1, + "dobOfDependents":[ + "2019-09-07T16:00:00Z", + "2019-01-02T16:00:00Z" + ], + "highestEducationAttained":"Master", + "employmentStatus":"worker", + "creditRating":{ + "rating":"", + "source":"" + }, + "creditLimit":{ + "currency":"EUR", + "amount":"1000.00" + }, + "kycStatus":true, + "lastOkDate":"2019-09-07T16:00:00Z", + "title":"title of customer", + "branchId":"DERBY6", + "nameSuffix":"Sr" + } + ] + }' + ); +GO + + + + + +-- drop procedure get_checkbook_orders +DROP PROCEDURE IF EXISTS get_checkbook_orders; +GO +-- create procedure get_checkbook_orders +CREATE PROCEDURE get_checkbook_orders +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "account":{ + "bank_id":"string", + "account_id":"string", + "account_type":"string", + "account_routings":[ + { + "scheme":"string", + "address":"string" + } + ], + "branch_routings":[ + { + "scheme":"string", + "address":"string" + } + ] + }, + "orders":[ + { + "order":{ + "order_id":"string", + "order_date":"string", + "number_of_checkbooks":"string", + "distribution_channel":"string", + "status":"string", + "first_check_number":"string", + "shipping_code":"string" + } + } + ] + } + }' + ); +GO + + + + + +-- drop procedure get_status_of_credit_card_order +DROP PROCEDURE IF EXISTS get_status_of_credit_card_order; +GO +-- create procedure get_status_of_credit_card_order +CREATE PROCEDURE get_status_of_credit_card_order +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "card_type":"string", + "card_description":"string", + "use_type":"string" + } + ] + }' + ); +GO + + + + + +-- drop procedure create_user_auth_context +DROP PROCEDURE IF EXISTS create_user_auth_context; +GO +-- create procedure create_user_auth_context +CREATE PROCEDURE create_user_auth_context +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "userAuthContextId":"string", + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + }' + ); +GO + + + + + +-- drop procedure create_user_auth_context_update +DROP PROCEDURE IF EXISTS create_user_auth_context_update; +GO +-- create procedure create_user_auth_context_update +CREATE PROCEDURE create_user_auth_context_update +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "userAuthContextUpdateId":"string", + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "key":"5987953", + "value":"FYIUYF6SUYFSD", + "challenge":"string", + "status":"string" + } + }' + ); +GO + + + + + +-- drop procedure delete_user_auth_contexts +DROP PROCEDURE IF EXISTS delete_user_auth_contexts; +GO +-- create procedure delete_user_auth_contexts +CREATE PROCEDURE delete_user_auth_contexts +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":true + }' + ); +GO + + + + + +-- drop procedure delete_user_auth_context_by_id +DROP PROCEDURE IF EXISTS delete_user_auth_context_by_id; +GO +-- create procedure delete_user_auth_context_by_id +CREATE PROCEDURE delete_user_auth_context_by_id +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":true + }' + ); +GO + + + + + +-- drop procedure get_user_auth_contexts +DROP PROCEDURE IF EXISTS get_user_auth_contexts; +GO +-- create procedure get_user_auth_contexts +CREATE PROCEDURE get_user_auth_contexts +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "userAuthContextId":"string", + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }' + ); +GO + + + + + +-- drop procedure create_or_update_product_attribute +DROP PROCEDURE IF EXISTS create_or_update_product_attribute; +GO +-- create procedure create_or_update_product_attribute +CREATE PROCEDURE create_or_update_product_attribute +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "bankId":{ + "value":"gh.29.uk" + }, + "productCode":{ + "value":"string" + }, + "productAttributeId":"string", + "name":"string", + "attributeType":"STRING", + "value":"FYIUYF6SUYFSD" + } + }' + ); +GO + + + + + +-- drop procedure get_product_attribute_by_id +DROP PROCEDURE IF EXISTS get_product_attribute_by_id; +GO +-- create procedure get_product_attribute_by_id +CREATE PROCEDURE get_product_attribute_by_id +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "bankId":{ + "value":"gh.29.uk" + }, + "productCode":{ + "value":"string" + }, + "productAttributeId":"string", + "name":"string", + "attributeType":"STRING", + "value":"FYIUYF6SUYFSD" + } + }' + ); +GO + + + + + +-- drop procedure get_product_attributes_by_bank_and_code +DROP PROCEDURE IF EXISTS get_product_attributes_by_bank_and_code; +GO +-- create procedure get_product_attributes_by_bank_and_code +CREATE PROCEDURE get_product_attributes_by_bank_and_code +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "bankId":{ + "value":"gh.29.uk" + }, + "productCode":{ + "value":"string" + }, + "productAttributeId":"string", + "name":"string", + "attributeType":"STRING", + "value":"FYIUYF6SUYFSD" + } + ] + }' + ); +GO + + + + + +-- drop procedure delete_product_attribute +DROP PROCEDURE IF EXISTS delete_product_attribute; +GO +-- create procedure delete_product_attribute +CREATE PROCEDURE delete_product_attribute +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":true + }' + ); +GO + + + + + +-- drop procedure get_account_attribute_by_id +DROP PROCEDURE IF EXISTS get_account_attribute_by_id; +GO +-- create procedure get_account_attribute_by_id +CREATE PROCEDURE get_account_attribute_by_id +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "bankId":{ + "value":"gh.29.uk" + }, + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "productCode":{ + "value":"string" + }, + "accountAttributeId":"string", + "name":"string", + "attributeType":"STRING", + "value":"FYIUYF6SUYFSD" + } + }' + ); +GO + + + + + +-- drop procedure get_transaction_attribute_by_id +DROP PROCEDURE IF EXISTS get_transaction_attribute_by_id; +GO +-- create procedure get_transaction_attribute_by_id +CREATE PROCEDURE get_transaction_attribute_by_id +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "bankId":{ + "value":"gh.29.uk" + }, + "transactionId":{ + "value":"2fg8a7e4-6d02-40e3-a129-0b2bf89de8ub" + }, + "transactionAttributeId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "attributeType":"STRING", + "name":"HOUSE_RENT", + "value":"123456789" + } + }' + ); +GO + + + + + +-- drop procedure create_or_update_account_attribute +DROP PROCEDURE IF EXISTS create_or_update_account_attribute; +GO +-- create procedure create_or_update_account_attribute +CREATE PROCEDURE create_or_update_account_attribute +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "bankId":{ + "value":"gh.29.uk" + }, + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "productCode":{ + "value":"string" + }, + "accountAttributeId":"string", + "name":"string", + "attributeType":"STRING", + "value":"FYIUYF6SUYFSD" + } + }' + ); +GO + + + + + +-- drop procedure create_or_update_customer_attribute +DROP PROCEDURE IF EXISTS create_or_update_customer_attribute; +GO +-- create procedure create_or_update_customer_attribute +CREATE PROCEDURE create_or_update_customer_attribute +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "bankId":{ + "value":"gh.29.uk" + }, + "customerId":{ + "value":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }, + "customerAttributeId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "attributeType":"STRING", + "name":"SPECIAL_TAX_NUMBER", + "value":"123456789" + } + }' + ); +GO + + + + + +-- drop procedure create_or_update_transaction_attribute +DROP PROCEDURE IF EXISTS create_or_update_transaction_attribute; +GO +-- create procedure create_or_update_transaction_attribute +CREATE PROCEDURE create_or_update_transaction_attribute +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "bankId":{ + "value":"gh.29.uk" + }, + "transactionId":{ + "value":"2fg8a7e4-6d02-40e3-a129-0b2bf89de8ub" + }, + "transactionAttributeId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "attributeType":"STRING", + "name":"HOUSE_RENT", + "value":"123456789" + } + }' + ); +GO + + + + + +-- drop procedure create_account_attributes +DROP PROCEDURE IF EXISTS create_account_attributes; +GO +-- create procedure create_account_attributes +CREATE PROCEDURE create_account_attributes +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "bankId":{ + "value":"gh.29.uk" + }, + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "productCode":{ + "value":"string" + }, + "accountAttributeId":"string", + "name":"string", + "attributeType":"STRING", + "value":"FYIUYF6SUYFSD" + } + ] + }' + ); +GO + + + + + +-- drop procedure get_account_attributes_by_account +DROP PROCEDURE IF EXISTS get_account_attributes_by_account; +GO +-- create procedure get_account_attributes_by_account +CREATE PROCEDURE get_account_attributes_by_account +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "bankId":{ + "value":"gh.29.uk" + }, + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "productCode":{ + "value":"string" + }, + "accountAttributeId":"string", + "name":"string", + "attributeType":"STRING", + "value":"FYIUYF6SUYFSD" + } + ] + }' + ); +GO + + + + + +-- drop procedure get_customer_attributes +DROP PROCEDURE IF EXISTS get_customer_attributes; +GO +-- create procedure get_customer_attributes +CREATE PROCEDURE get_customer_attributes +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "bankId":{ + "value":"gh.29.uk" + }, + "customerId":{ + "value":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }, + "customerAttributeId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "attributeType":"STRING", + "name":"SPECIAL_TAX_NUMBER", + "value":"123456789" + } + ] + }' + ); +GO + + + + + +-- drop procedure get_customer_ids_by_attribute_name_values +DROP PROCEDURE IF EXISTS get_customer_ids_by_attribute_name_values; +GO +-- create procedure get_customer_ids_by_attribute_name_values +CREATE PROCEDURE get_customer_ids_by_attribute_name_values +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + "string" + ] + }' + ); +GO + + + + + +-- drop procedure get_customer_attributes_for_customers +DROP PROCEDURE IF EXISTS get_customer_attributes_for_customers; +GO +-- create procedure get_customer_attributes_for_customers +CREATE PROCEDURE get_customer_attributes_for_customers +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "value":[ + { + "customer":{ + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "bankId":"gh.29.uk", + "number":"546387432", + "legalName":"Eveline Tripman", + "mobileNumber":"+44 07972 444 876", + "email":"eveline@example.com", + "faceImage":{ + "date":"2017-09-18T16:00:00Z", + "url":"http://www.example.com/id-docs/123/image.png" + }, + "dateOfBirth":"2017-09-18T16:00:00Z", + "relationshipStatus":"single", + "dependents":1, + "dobOfDependents":[ + "2017-09-18T16:00:00Z" + ], + "highestEducationAttained":"Master", + "employmentStatus":"worker", + "creditRating":{ + "rating":"", + "source":"" + }, + "creditLimit":{ + "currency":"EUR", + "amount":"50.89" + }, + "kycStatus":true, + "lastOkDate":"2017-09-18T16:00:00Z", + "title":"Dr.", + "branchId":"DERBY6", + "nameSuffix":"Sr" + }, + "attributes":[ + { + "bankId":{ + "value":"gh.29.uk" + }, + "customerId":{ + "value":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }, + "customerAttributeId":"some_customer_attributeId_value", + "attributeType":"INTEGER", + "name":"customer_attribute_field", + "value":"example_value" + } + ] + } + ] + }' + ); +GO + + + + + +-- drop procedure get_transaction_ids_by_attribute_name_values +DROP PROCEDURE IF EXISTS get_transaction_ids_by_attribute_name_values; +GO +-- create procedure get_transaction_ids_by_attribute_name_values +CREATE PROCEDURE get_transaction_ids_by_attribute_name_values +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + "string" + ] + }' + ); +GO + + + + + +-- drop procedure get_transaction_attributes +DROP PROCEDURE IF EXISTS get_transaction_attributes; +GO +-- create procedure get_transaction_attributes +CREATE PROCEDURE get_transaction_attributes +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "bankId":{ + "value":"gh.29.uk" + }, + "transactionId":{ + "value":"2fg8a7e4-6d02-40e3-a129-0b2bf89de8ub" + }, + "transactionAttributeId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "attributeType":"STRING", + "name":"HOUSE_RENT", + "value":"123456789" + } + ] + }' + ); +GO + + + + + +-- drop procedure get_customer_attribute_by_id +DROP PROCEDURE IF EXISTS get_customer_attribute_by_id; +GO +-- create procedure get_customer_attribute_by_id +CREATE PROCEDURE get_customer_attribute_by_id +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "bankId":{ + "value":"gh.29.uk" + }, + "customerId":{ + "value":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }, + "customerAttributeId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "attributeType":"STRING", + "name":"SPECIAL_TAX_NUMBER", + "value":"123456789" + } + }' + ); +GO + + + + + +-- drop procedure create_or_update_card_attribute +DROP PROCEDURE IF EXISTS create_or_update_card_attribute; +GO +-- create procedure create_or_update_card_attribute +CREATE PROCEDURE create_or_update_card_attribute +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "name":"OVERDRAFT_START_DATE", + "card_id":"36f8a9e6-c2b1-407a-8bd0-421b7119307e ", + "attribute_type":"STRING", + "bank_id":{ + "value":"gh.29.uk" + }, + "value":"2012-04-23", + "card_attribute_id":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50" + } + }' + ); +GO + + + + + +-- drop procedure get_card_attribute_by_id +DROP PROCEDURE IF EXISTS get_card_attribute_by_id; +GO +-- create procedure get_card_attribute_by_id +CREATE PROCEDURE get_card_attribute_by_id +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "name":"OVERDRAFT_START_DATE", + "card_id":"36f8a9e6-c2b1-407a-8bd0-421b7119307e ", + "attribute_type":"STRING", + "bank_id":{ + "value":"gh.29.uk" + }, + "value":"2012-04-23", + "card_attribute_id":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50" + } + }' + ); +GO + + + + + +-- drop procedure get_card_attributes_from_provider +DROP PROCEDURE IF EXISTS get_card_attributes_from_provider; +GO +-- create procedure get_card_attributes_from_provider +CREATE PROCEDURE get_card_attributes_from_provider +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "name":"OVERDRAFT_START_DATE", + "card_id":"36f8a9e6-c2b1-407a-8bd0-421b7119307e ", + "attribute_type":"STRING", + "bank_id":{ + "value":"gh.29.uk" + }, + "value":"2012-04-23", + "card_attribute_id":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50" + } + ] + }' + ); +GO + + + + + +-- drop procedure create_account_application +DROP PROCEDURE IF EXISTS create_account_application; +GO +-- create procedure create_account_application +CREATE PROCEDURE create_account_application +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "accountApplicationId":"string", + "productCode":{ + "value":"string" + }, + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "dateOfApplication":"2020-06-16T13:52:22Z", + "status":"string" + } + }' + ); +GO + + + + + +-- drop procedure get_all_account_application +DROP PROCEDURE IF EXISTS get_all_account_application; +GO +-- create procedure get_all_account_application +CREATE PROCEDURE get_all_account_application +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "accountApplicationId":"string", + "productCode":{ + "value":"string" + }, + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "dateOfApplication":"2020-06-16T13:52:22Z", + "status":"string" + } + ] + }' + ); +GO + + + + + +-- drop procedure get_account_application_by_id +DROP PROCEDURE IF EXISTS get_account_application_by_id; +GO +-- create procedure get_account_application_by_id +CREATE PROCEDURE get_account_application_by_id +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "accountApplicationId":"string", + "productCode":{ + "value":"string" + }, + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "dateOfApplication":"2020-06-16T13:52:22Z", + "status":"string" + } + }' + ); +GO + + + + + +-- drop procedure update_account_application_status +DROP PROCEDURE IF EXISTS update_account_application_status; +GO +-- create procedure update_account_application_status +CREATE PROCEDURE update_account_application_status +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "accountApplicationId":"string", + "productCode":{ + "value":"string" + }, + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "dateOfApplication":"2020-06-16T13:52:22Z", + "status":"string" + } + }' + ); +GO + + + + + +-- drop procedure get_or_create_product_collection +DROP PROCEDURE IF EXISTS get_or_create_product_collection; +GO +-- create procedure get_or_create_product_collection +CREATE PROCEDURE get_or_create_product_collection +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "collectionCode":"string", + "productCode":"string" + } + ] + }' + ); +GO + + + + + +-- drop procedure get_product_collection +DROP PROCEDURE IF EXISTS get_product_collection; +GO +-- create procedure get_product_collection +CREATE PROCEDURE get_product_collection +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "collectionCode":"string", + "productCode":"string" + } + ] + }' + ); +GO + + + + + +-- drop procedure get_or_create_product_collection_item +DROP PROCEDURE IF EXISTS get_or_create_product_collection_item; +GO +-- create procedure get_or_create_product_collection_item +CREATE PROCEDURE get_or_create_product_collection_item +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "collectionCode":"string", + "memberProductCode":"string" + } + ] + }' + ); +GO + + + + + +-- drop procedure get_product_collection_item +DROP PROCEDURE IF EXISTS get_product_collection_item; +GO +-- create procedure get_product_collection_item +CREATE PROCEDURE get_product_collection_item +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "collectionCode":"string", + "memberProductCode":"string" + } + ] + }' + ); +GO + + + + + +-- drop procedure get_product_collection_items_tree +DROP PROCEDURE IF EXISTS get_product_collection_items_tree; +GO +-- create procedure get_product_collection_items_tree +CREATE PROCEDURE get_product_collection_items_tree +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "_1":{ + "collectionCode":"string", + "memberProductCode":"string" + }, + "_2":{ + "bankId":{ + "value":"gh.29.uk" + }, + "code":{ + "value":"string" + }, + "parentProductCode":{ + "value":"string" + }, + "name":"string", + "category":"string", + "family":"string", + "superFamily":"string", + "moreInfoUrl":"string", + "details":"string", + "description":"string", + "meta":{ + "license":{ + "id":"string", + "name":"string" + } + } + }, + "_3":[ + { + "bankId":{ + "value":"gh.29.uk" + }, + "productCode":{ + "value":"string" + }, + "productAttributeId":"string", + "name":"string", + "attributeType":"STRING", + "value":"FYIUYF6SUYFSD" + } + ] + } + ] + }' + ); +GO + + + + + +-- drop procedure create_meeting +DROP PROCEDURE IF EXISTS create_meeting; +GO +-- create procedure create_meeting +CREATE PROCEDURE create_meeting +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "meetingId":"string", + "providerId":"string", + "purposeId":"string", + "bankId":"gh.29.uk", + "present":{ + "staffUserId":"string", + "customerUserId":"string" + }, + "keys":{ + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "customerToken":"string", + "staffToken":"string" + }, + "when":"2020-06-16T13:52:22Z", + "creator":{ + "name":"string", + "phone":"string", + "email":"eveline@example.com" + }, + "invitees":[ + { + "contactDetails":{ + "name":"string", + "phone":"string", + "email":"eveline@example.com" + }, + "status":"string" + } + ] + } + }' + ); +GO + + + + + +-- drop procedure get_meetings +DROP PROCEDURE IF EXISTS get_meetings; +GO +-- create procedure get_meetings +CREATE PROCEDURE get_meetings +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "meetingId":"string", + "providerId":"string", + "purposeId":"string", + "bankId":"gh.29.uk", + "present":{ + "staffUserId":"string", + "customerUserId":"string" + }, + "keys":{ + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "customerToken":"string", + "staffToken":"string" + }, + "when":"2020-06-16T13:52:22Z", + "creator":{ + "name":"string", + "phone":"string", + "email":"eveline@example.com" + }, + "invitees":[ + { + "contactDetails":{ + "name":"string", + "phone":"string", + "email":"eveline@example.com" + }, + "status":"string" + } + ] + } + ] + }' + ); +GO + + + + + +-- drop procedure get_meeting +DROP PROCEDURE IF EXISTS get_meeting; +GO +-- create procedure get_meeting +CREATE PROCEDURE get_meeting +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "meetingId":"string", + "providerId":"string", + "purposeId":"string", + "bankId":"gh.29.uk", + "present":{ + "staffUserId":"string", + "customerUserId":"string" + }, + "keys":{ + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "customerToken":"string", + "staffToken":"string" + }, + "when":"2020-06-16T13:52:22Z", + "creator":{ + "name":"string", + "phone":"string", + "email":"eveline@example.com" + }, + "invitees":[ + { + "contactDetails":{ + "name":"string", + "phone":"string", + "email":"eveline@example.com" + }, + "status":"string" + } + ] + } + }' + ); +GO + + + + + +-- drop procedure create_or_update_kyc_check +DROP PROCEDURE IF EXISTS create_or_update_kyc_check; +GO +-- create procedure create_or_update_kyc_check +CREATE PROCEDURE create_or_update_kyc_check +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "idKycCheck":"string", + "customerNumber":"5987953", + "date":"2020-06-16T13:52:22Z", + "how":"string", + "staffUserId":"string", + "staffName":"string", + "satisfied":true, + "comments":"string" + } + }' + ); +GO + + + + + +-- drop procedure create_or_update_kyc_document +DROP PROCEDURE IF EXISTS create_or_update_kyc_document; +GO +-- create procedure create_or_update_kyc_document +CREATE PROCEDURE create_or_update_kyc_document +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "idKycDocument":"string", + "customerNumber":"5987953", + "type":"string", + "number":"string", + "issueDate":"2020-06-16T13:52:22Z", + "issuePlace":"string", + "expiryDate":"2020-06-16T13:52:22Z" + } + }' + ); +GO + + + + + +-- drop procedure create_or_update_kyc_media +DROP PROCEDURE IF EXISTS create_or_update_kyc_media; +GO +-- create procedure create_or_update_kyc_media +CREATE PROCEDURE create_or_update_kyc_media +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "idKycMedia":"string", + "customerNumber":"5987953", + "type":"string", + "url":"http://www.example.com/id-docs/123/image.png", + "date":"2020-06-16T13:52:22Z", + "relatesToKycDocumentId":"string", + "relatesToKycCheckId":"string" + } + }' + ); +GO + + + + + +-- drop procedure create_or_update_kyc_status +DROP PROCEDURE IF EXISTS create_or_update_kyc_status; +GO +-- create procedure create_or_update_kyc_status +CREATE PROCEDURE create_or_update_kyc_status +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "ok":true, + "date":"2020-06-16T13:52:22Z" + } + }' + ); +GO + + + + + +-- drop procedure get_kyc_checks +DROP PROCEDURE IF EXISTS get_kyc_checks; +GO +-- create procedure get_kyc_checks +CREATE PROCEDURE get_kyc_checks +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "idKycCheck":"string", + "customerNumber":"5987953", + "date":"2020-06-16T13:52:22Z", + "how":"string", + "staffUserId":"string", + "staffName":"string", + "satisfied":true, + "comments":"string" + } + ] + }' + ); +GO + + + + + +-- drop procedure get_kyc_documents +DROP PROCEDURE IF EXISTS get_kyc_documents; +GO +-- create procedure get_kyc_documents +CREATE PROCEDURE get_kyc_documents +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "idKycDocument":"string", + "customerNumber":"5987953", + "type":"string", + "number":"string", + "issueDate":"2020-06-16T13:52:22Z", + "issuePlace":"string", + "expiryDate":"2020-06-16T13:52:22Z" + } + ] + }' + ); +GO + + + + + +-- drop procedure get_kyc_medias +DROP PROCEDURE IF EXISTS get_kyc_medias; +GO +-- create procedure get_kyc_medias +CREATE PROCEDURE get_kyc_medias +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "idKycMedia":"string", + "customerNumber":"5987953", + "type":"string", + "url":"http://www.example.com/id-docs/123/image.png", + "date":"2020-06-16T13:52:22Z", + "relatesToKycDocumentId":"string", + "relatesToKycCheckId":"string" + } + ] + }' + ); +GO + + + + + +-- drop procedure get_kyc_statuses +DROP PROCEDURE IF EXISTS get_kyc_statuses; +GO +-- create procedure get_kyc_statuses +CREATE PROCEDURE get_kyc_statuses +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "ok":true, + "date":"2020-06-16T13:52:22Z" + } + ] + }' + ); +GO + + + + + +-- drop procedure create_message +DROP PROCEDURE IF EXISTS create_message; +GO +-- create procedure create_message +CREATE PROCEDURE create_message +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "messageId":"string", + "date":"2020-06-16T13:52:22Z", + "message":"string", + "fromDepartment":"string", + "fromPerson":"string" + } + }' + ); +GO + + + + + +-- drop procedure make_historical_payment +DROP PROCEDURE IF EXISTS make_historical_payment; +GO +-- create procedure make_historical_payment +CREATE PROCEDURE make_historical_payment +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "value":"2fg8a7e4-6d02-40e3-a129-0b2bf89de8ub" + } + }' + ); +GO + + + + + +-- drop procedure create_direct_debit +DROP PROCEDURE IF EXISTS create_direct_debit; +GO +-- create procedure create_direct_debit +CREATE PROCEDURE create_direct_debit +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "directDebitId":"string", + "bankId":"gh.29.uk", + "accountId":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "counterpartyId":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "dateSigned":"2020-06-16T13:52:22Z", + "dateCancelled":"2020-06-16T13:52:22Z", + "dateStarts":"2020-06-16T13:52:22Z", + "dateExpires":"2020-06-16T13:52:22Z", + "active":true + } + }' + ); +GO + + + + + +-- drop procedure delete_customer_attribute +DROP PROCEDURE IF EXISTS delete_customer_attribute; +GO +-- create procedure delete_customer_attribute +CREATE PROCEDURE delete_customer_attribute +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":true + }' + ); +GO + + + + + +-- drop procedure dynamic_entity_process +DROP PROCEDURE IF EXISTS dynamic_entity_process; +GO +-- create procedure dynamic_entity_process +CREATE PROCEDURE dynamic_entity_process +@out_bound_json NVARCHAR(MAX), +@in_bound_json NVARCHAR(MAX) OUT +AS + SET nocount on + +-- replace the follow example to real logic + + SELECT @in_bound_json = ( + SELECT + N'{ + "inboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "status":{ + "errorCode":"", + "backendMessages":[ + { + "source":"String", + "status":"String", + "errorCode":"", + "text":"String" + } + ] + }, + "data":{ + "name":"James Brown", + "number":1234567890, + "fooBarId":"foobar-id-value" + } + }' + ); +GO + diff --git a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedureBuilder.scala b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedureBuilder.scala new file mode 100644 index 000000000..3b7f5778a --- /dev/null +++ b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedureBuilder.scala @@ -0,0 +1,73 @@ +package code.bankconnectors.storedprocedure + +import java.io.File +import java.util.Date + +import code.api.util.APIUtil.MessageDoc +import code.bankconnectors.ConnectorBuilderUtil.{getClass, _} +import com.openbankproject.commons.model.Status +import com.openbankproject.commons.util.Functions +import net.liftweb.json +import net.liftweb.json.JsonAST.JValue +import net.liftweb.json.{Formats, JString, MappingException, Serializer, TypeInfo} +import code.api.ResourceDocs1_4_0.MessageDocsSwaggerDefinitions.successStatus +import code.api.util.APIUtil +import code.api.util.CustomJsonFormats.formats +import com.openbankproject.commons.model.Status +import net.liftweb.util.StringHelpers +import org.apache.commons.io.FileUtils + +import scala.collection.mutable.ArrayBuffer + +object MSsqlStoredProcedureBuilder { + specialMethods // this line just for modify "MappedWebUiPropsProvider" + object StatusSerializer extends Serializer[Status] { + + override def deserialize(implicit format: Formats): PartialFunction[(TypeInfo, JValue), Status] = Functions.doNothing + + override def serialize(implicit format: Formats): PartialFunction[Any, JValue] = { + case x: Status => json.Extraction.decompose(successStatus)(formats) + } + } + + def main(args: Array[String]): Unit = { + implicit val customFormats = formats + StatusSerializer + val messageDocs: ArrayBuffer[MessageDoc] = StoredProcedureConnector_vDec2019.messageDocs + def toProcedureName(processName: String) = StringHelpers.snakify(processName.replace("obp.", "")) + def inboundToJson(any: Any) = json.prettyRender(json.Extraction.decompose(any)) + val procedureNameToInbound = messageDocs.map(doc => { + val procedureName = toProcedureName(doc.process) + val inBoundExample = inboundToJson(doc.exampleInboundMessage) + buildProcedure(procedureName, inBoundExample) + }).mkString(s"-- auto generated MS sql server procedures script, create on ${APIUtil.DateWithSecondsFormat.format(new Date())}", " \n \n", "") + + val path = new File(getClass.getResource("").toURI.toString.replaceFirst("target/.*", "").replace("file:", ""), + "src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedure.sql") + val source = FileUtils.write(path, procedureNameToInbound, "utf-8") + } + + def buildProcedure(processName: String, inBoundExample: String) = { + s""" + | + |-- drop procedure $processName + |DROP PROCEDURE IF EXISTS $processName; + |GO + |-- create procedure $processName + |CREATE PROCEDURE $processName + |@out_bound_json NVARCHAR(MAX), + |@in_bound_json NVARCHAR(MAX) OUT + |AS + | SET nocount on + | + |-- replace the follow example to real logic + | + | SELECT @in_bound_json = ( + | SELECT + | N'${inBoundExample.replaceAll("(?m)^", " ").trim()}' + | ); + |GO + | + |""".stripMargin + } + +} From 29804142dd16198b157ac228b88ffb0acbb99c93 Mon Sep 17 00:00:00 2001 From: shuang Date: Tue, 16 Jun 2020 22:04:23 +0800 Subject: [PATCH 07/10] feature/create_ms_stored_procedure_script: fix typo and add comment. --- .../MSsqlStoredProcedureBuilder.scala | 3 ++ .../test/scala/code/util/JsonUtilsTest.scala | 34 +++++++++---------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedureBuilder.scala b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedureBuilder.scala index 3b7f5778a..90424df90 100644 --- a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedureBuilder.scala +++ b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedureBuilder.scala @@ -19,6 +19,9 @@ import org.apache.commons.io.FileUtils import scala.collection.mutable.ArrayBuffer +/** + * create ms sql server stored procedure according messageDocs. + */ object MSsqlStoredProcedureBuilder { specialMethods // this line just for modify "MappedWebUiPropsProvider" object StatusSerializer extends Serializer[Status] { diff --git a/obp-api/src/test/scala/code/util/JsonUtilsTest.scala b/obp-api/src/test/scala/code/util/JsonUtilsTest.scala index 558392132..d46a57ac2 100644 --- a/obp-api/src/test/scala/code/util/JsonUtilsTest.scala +++ b/obp-api/src/test/scala/code/util/JsonUtilsTest.scala @@ -149,29 +149,29 @@ class JsonUtilsTest extends FlatSpec with Matchers { | "noPerson": "[3]", |} |""".stripMargin) - - val expectedZson = json.parse( - """ - |{ - | "firstPerson":{ - | "name":"Shuang", - | "age":10 - | }, - | "secondName":"Sean", - | "secondHobby":"coding" - |} - |""".stripMargin) - "get Array type json given index, when exists" should "get given item" taggedAs JsonUtilsTag in { val resultJson = buildJson(arrayRoot, arrayRootSchema) val str1 = json.prettyRender(resultJson) println(str1) - val str2 = json.prettyRender(expectedZson) + + val expectedJson = json.parse( + """ + |{ + | "firstPerson":{ + | "name":"Shuang", + | "age":10 + | }, + | "secondName":"Sean", + | "secondHobby":"coding" + |} + |""".stripMargin) + + val str2 = json.prettyRender(expectedJson) str1 shouldEqual str2 } - val zsonList = json.parse( + val jsonList = json.parse( """ |[ | { @@ -202,7 +202,7 @@ class JsonUtilsTest extends FlatSpec with Matchers { | } |] |""".stripMargin) - val zsonListSchema = json.parse( + val jsonListSchema = json.parse( """ |{ | "inboundAdapterCallContext$default":{ @@ -292,7 +292,7 @@ class JsonUtilsTest extends FlatSpec with Matchers { |} |""".stripMargin) "list type fields" should "properly be convert" taggedAs JsonUtilsTag in { - val resultJson = buildJson(zsonList, zsonListSchema) + val resultJson = buildJson(jsonList, jsonListSchema) val str1 = json.prettyRender(resultJson) val str2 = json.prettyRender(expectListResult) From 88499835f9d1db26c79fb7e2b247b2fa02793db0 Mon Sep 17 00:00:00 2001 From: shuang Date: Tue, 16 Jun 2020 23:00:49 +0800 Subject: [PATCH 08/10] feature/create_ms_stored_procedure_script: omit Legacy connector methods. --- .../bankconnectors/ConnectorBuilderUtil.scala | 34 +- .../storedprocedure/MSsqlStoredProcedure.sql | 1019 ++--------------- .../StoredProcedureConnector_vDec2019.scala | 851 ++------------ 3 files changed, 206 insertions(+), 1698 deletions(-) diff --git a/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala b/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala index 69a7651e4..40a01cc32 100644 --- a/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala +++ b/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala @@ -318,22 +318,22 @@ object ConnectorBuilderUtil { "createMessage", "makeHistoricalPayment", "validateChallengeAnswer", - "getBankLegacy", - "getBanksLegacy", - "getBankAccountsForUserLegacy", - "getBankAccountLegacy", + //"getBankLegacy", // should not generate for Legacy methods + //"getBanksLegacy", // should not generate for Legacy methods + //"getBankAccountsForUserLegacy", // should not generate for Legacy methods + //"getBankAccountLegacy", // should not generate for Legacy methods "getBankAccountByIban", "getBankAccountByRouting", "getBankAccounts", - "getCoreBankAccountsLegacy", - "getBankAccountsHeldLegacy", - "checkBankAccountExistsLegacy", - "getCounterpartyByCounterpartyIdLegacy", - "getCounterpartiesLegacy", - "getTransactionsLegacy", - "getTransactionLegacy", - "createPhysicalCardLegacy", - "getCustomerByCustomerIdLegacy", + //"getCoreBankAccountsLegacy", // should not generate for Legacy methods + //"getBankAccountsHeldLegacy", // should not generate for Legacy methods + //"checkBankAccountExistsLegacy", // should not generate for Legacy methods + //"getCounterpartyByCounterpartyIdLegacy", // should not generate for Legacy methods + //"getCounterpartiesLegacy", // should not generate for Legacy methods + //"getTransactionsLegacy", // should not generate for Legacy methods + //"getTransactionLegacy", // should not generate for Legacy methods + //"createPhysicalCardLegacy", // should not generate for Legacy methods + //"getCustomerByCustomerIdLegacy", // should not generate for Legacy methods "createChallenges", "createTransactionRequestv400", @@ -393,9 +393,9 @@ object ConnectorBuilderUtil { "getCurrentFxRateCached", "getTransactionRequestTypeCharge", "getTransactionRequestTypeCharges", - "getPhysicalCardsForBankLegacy", - "getBranchLegacy", - "getAtmLegacy", + //"getPhysicalCardsForBankLegacy", // should not generate for Legacy methods + //"getBranchLegacy", // should not generate for Legacy methods + //"getAtmLegacy", // should not generate for Legacy methods "getEmptyBankAccount", "getCounterpartyFromTransaction", "getCounterpartiesFromTransaction", @@ -424,7 +424,7 @@ object ConnectorBuilderUtil { // "createViews", // should not be auto generated // "UpdateUserAccoutViewsByUsername", // a helper function should not be auto generated // "updateUserAccountViewsOld", // deprecated - // "createBankAccountLegacy", //deprecated + //"createBankAccountLegacy", // should not generate for Legacy methods //deprecated // "createOrUpdateAttributeDefinition", // should not be auto generated // "deleteAttributeDefinition", // should not be auto generated diff --git a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedure.sql b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedure.sql index 9f36df1d2..930cdb478 100644 --- a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedure.sql +++ b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedure.sql @@ -1,4 +1,4 @@ --- auto generated MS sql server procedures script, create on 2020-06-16T21:52:22Z +-- auto generated MS sql server procedures script, create on 2020-06-16T22:59:24Z -- drop procedure get_adapter_info DROP PROCEDURE IF EXISTS get_adapter_info; @@ -292,63 +292,6 @@ GO --- drop procedure get_bank_legacy -DROP PROCEDURE IF EXISTS get_bank_legacy; -GO --- create procedure get_bank_legacy -CREATE PROCEDURE get_bank_legacy -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on - --- replace the follow example to real logic - - SELECT @in_bound_json = ( - SELECT - N'{ - "inboundAdapterCallContext":{ - "correlationId":"1flssoftxq0cr1nssr68u0mioj", - "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", - "generalContext":[ - { - "key":"5987953", - "value":"FYIUYF6SUYFSD" - } - ] - }, - "status":{ - "errorCode":"", - "backendMessages":[ - { - "source":"String", - "status":"String", - "errorCode":"", - "text":"String" - } - ] - }, - "data":{ - "bankId":{ - "value":"gh.29.uk" - }, - "shortName":"bank shortName string", - "fullName":"bank fullName string", - "logoUrl":"bank logoUrl string", - "websiteUrl":"bank websiteUrl string", - "bankRoutingScheme":"BIC", - "bankRoutingAddress":"GENODEM1GLS", - "swiftBic":"bank swiftBic string", - "nationalIdentifier":"bank nationalIdentifier string" - } - }' - ); -GO - - - - - -- drop procedure get_bank DROP PROCEDURE IF EXISTS get_bank; GO @@ -406,65 +349,6 @@ GO --- drop procedure get_banks_legacy -DROP PROCEDURE IF EXISTS get_banks_legacy; -GO --- create procedure get_banks_legacy -CREATE PROCEDURE get_banks_legacy -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on - --- replace the follow example to real logic - - SELECT @in_bound_json = ( - SELECT - N'{ - "inboundAdapterCallContext":{ - "correlationId":"1flssoftxq0cr1nssr68u0mioj", - "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", - "generalContext":[ - { - "key":"5987953", - "value":"FYIUYF6SUYFSD" - } - ] - }, - "status":{ - "errorCode":"", - "backendMessages":[ - { - "source":"String", - "status":"String", - "errorCode":"", - "text":"String" - } - ] - }, - "data":[ - { - "bankId":{ - "value":"gh.29.uk" - }, - "shortName":"bank shortName string", - "fullName":"bank fullName string", - "logoUrl":"bank logoUrl string", - "websiteUrl":"bank websiteUrl string", - "bankRoutingScheme":"BIC", - "bankRoutingAddress":"GENODEM1GLS", - "swiftBic":"bank swiftBic string", - "nationalIdentifier":"bank nationalIdentifier string" - } - ] - }' - ); -GO - - - - - -- drop procedure get_banks DROP PROCEDURE IF EXISTS get_banks; GO @@ -524,78 +408,6 @@ GO --- drop procedure get_bank_accounts_for_user_legacy -DROP PROCEDURE IF EXISTS get_bank_accounts_for_user_legacy; -GO --- create procedure get_bank_accounts_for_user_legacy -CREATE PROCEDURE get_bank_accounts_for_user_legacy -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on - --- replace the follow example to real logic - - SELECT @in_bound_json = ( - SELECT - N'{ - "inboundAdapterCallContext":{ - "correlationId":"1flssoftxq0cr1nssr68u0mioj", - "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", - "generalContext":[ - { - "key":"5987953", - "value":"FYIUYF6SUYFSD" - } - ] - }, - "status":{ - "errorCode":"", - "backendMessages":[ - { - "source":"String", - "status":"String", - "errorCode":"", - "text":"String" - } - ] - }, - "data":[ - { - "bankId":"gh.29.uk", - "branchId":"DERBY6", - "accountId":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", - "accountNumber":"546387432", - "accountType":"AC", - "balanceAmount":"50.89", - "balanceCurrency":"EUR", - "owners":[ - "InboundAccount", - "owners", - "list", - "string" - ], - "viewsToGenerate":[ - "Owner", - "Accountant", - "Auditor" - ], - "bankRoutingScheme":"BIC", - "bankRoutingAddress":"GENODEM1GLS", - "branchRoutingScheme":"BRANCH-CODE", - "branchRoutingAddress":"DERBY6", - "accountRoutingScheme":"IBAN", - "accountRoutingAddress":"DE91 1000 0000 0123 4567 89" - } - ] - }' - ); -GO - - - - - -- drop procedure get_bank_accounts_for_user DROP PROCEDURE IF EXISTS get_bank_accounts_for_user; GO @@ -773,82 +585,6 @@ GO --- drop procedure get_bank_account_legacy -DROP PROCEDURE IF EXISTS get_bank_account_legacy; -GO --- create procedure get_bank_account_legacy -CREATE PROCEDURE get_bank_account_legacy -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on - --- replace the follow example to real logic - - SELECT @in_bound_json = ( - SELECT - N'{ - "inboundAdapterCallContext":{ - "correlationId":"1flssoftxq0cr1nssr68u0mioj", - "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", - "generalContext":[ - { - "key":"5987953", - "value":"FYIUYF6SUYFSD" - } - ] - }, - "status":{ - "errorCode":"", - "backendMessages":[ - { - "source":"String", - "status":"String", - "errorCode":"", - "text":"String" - } - ] - }, - "data":{ - "accountId":{ - "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" - }, - "accountType":"AC", - "balance":"50.89", - "currency":"EUR", - "name":"bankAccount name string", - "label":"My Account", - "iban":"DE91 1000 0000 0123 4567 89", - "number":"bankAccount number string", - "bankId":{ - "value":"gh.29.uk" - }, - "lastUpdate":"2018-03-08T16:00:00Z", - "branchId":"DERBY6", - "accountRoutingScheme":"IBAN", - "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", - "accountRoutings":[ - { - "scheme":"IBAN", - "address":"DE91 1000 0000 0123 4567 89" - } - ], - "accountRules":[ - { - "scheme":"AccountRule scheme string", - "value":"AccountRule value string" - } - ], - "accountHolder":"bankAccount accountHolder string" - } - }' - ); -GO - - - - - -- drop procedure get_bank_account DROP PROCEDURE IF EXISTS get_bank_account; GO @@ -1213,7 +949,7 @@ AS "currency":"EUR", "amount":"string" }, - "overallBalanceDate":"2020-06-16T13:52:22Z" + "overallBalanceDate":"2020-06-16T14:59:20Z" } }' ); @@ -1223,64 +959,6 @@ GO --- drop procedure get_core_bank_accounts_legacy -DROP PROCEDURE IF EXISTS get_core_bank_accounts_legacy; -GO --- create procedure get_core_bank_accounts_legacy -CREATE PROCEDURE get_core_bank_accounts_legacy -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on - --- replace the follow example to real logic - - SELECT @in_bound_json = ( - SELECT - N'{ - "inboundAdapterCallContext":{ - "correlationId":"1flssoftxq0cr1nssr68u0mioj", - "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", - "generalContext":[ - { - "key":"5987953", - "value":"FYIUYF6SUYFSD" - } - ] - }, - "status":{ - "errorCode":"", - "backendMessages":[ - { - "source":"String", - "status":"String", - "errorCode":"", - "text":"String" - } - ] - }, - "data":[ - { - "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", - "label":"My Account", - "bankId":"gh.29.uk", - "accountType":"AC", - "accountRoutings":[ - { - "scheme":"IBAN", - "address":"DE91 1000 0000 0123 4567 89" - } - ] - } - ] - }' - ); -GO - - - - - -- drop procedure get_core_bank_accounts DROP PROCEDURE IF EXISTS get_core_bank_accounts; GO @@ -1339,63 +1017,6 @@ GO --- drop procedure get_bank_accounts_held_legacy -DROP PROCEDURE IF EXISTS get_bank_accounts_held_legacy; -GO --- create procedure get_bank_accounts_held_legacy -CREATE PROCEDURE get_bank_accounts_held_legacy -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on - --- replace the follow example to real logic - - SELECT @in_bound_json = ( - SELECT - N'{ - "inboundAdapterCallContext":{ - "correlationId":"1flssoftxq0cr1nssr68u0mioj", - "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", - "generalContext":[ - { - "key":"5987953", - "value":"FYIUYF6SUYFSD" - } - ] - }, - "status":{ - "errorCode":"", - "backendMessages":[ - { - "source":"String", - "status":"String", - "errorCode":"", - "text":"String" - } - ] - }, - "data":[ - { - "id":"string", - "bankId":"gh.29.uk", - "number":"string", - "accountRoutings":[ - { - "scheme":"IBAN", - "address":"DE91 1000 0000 0123 4567 89" - } - ] - } - ] - }' - ); -GO - - - - - -- drop procedure get_bank_accounts_held DROP PROCEDURE IF EXISTS get_bank_accounts_held; GO @@ -1453,82 +1074,6 @@ GO --- drop procedure check_bank_account_exists_legacy -DROP PROCEDURE IF EXISTS check_bank_account_exists_legacy; -GO --- create procedure check_bank_account_exists_legacy -CREATE PROCEDURE check_bank_account_exists_legacy -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on - --- replace the follow example to real logic - - SELECT @in_bound_json = ( - SELECT - N'{ - "inboundAdapterCallContext":{ - "correlationId":"1flssoftxq0cr1nssr68u0mioj", - "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", - "generalContext":[ - { - "key":"5987953", - "value":"FYIUYF6SUYFSD" - } - ] - }, - "status":{ - "errorCode":"", - "backendMessages":[ - { - "source":"String", - "status":"String", - "errorCode":"", - "text":"String" - } - ] - }, - "data":{ - "accountId":{ - "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" - }, - "accountType":"AC", - "balance":"50.89", - "currency":"EUR", - "name":"bankAccount name string", - "label":"My Account", - "iban":"DE91 1000 0000 0123 4567 89", - "number":"bankAccount number string", - "bankId":{ - "value":"gh.29.uk" - }, - "lastUpdate":"2018-03-08T16:00:00Z", - "branchId":"DERBY6", - "accountRoutingScheme":"IBAN", - "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", - "accountRoutings":[ - { - "scheme":"IBAN", - "address":"DE91 1000 0000 0123 4567 89" - } - ], - "accountRules":[ - { - "scheme":"AccountRule scheme string", - "value":"AccountRule value string" - } - ], - "accountHolder":"bankAccount accountHolder string" - } - }' - ); -GO - - - - - -- drop procedure get_counterparty_trait DROP PROCEDURE IF EXISTS get_counterparty_trait; GO @@ -1597,74 +1142,6 @@ GO --- drop procedure get_counterparty_by_counterparty_id_legacy -DROP PROCEDURE IF EXISTS get_counterparty_by_counterparty_id_legacy; -GO --- create procedure get_counterparty_by_counterparty_id_legacy -CREATE PROCEDURE get_counterparty_by_counterparty_id_legacy -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on - --- replace the follow example to real logic - - SELECT @in_bound_json = ( - SELECT - N'{ - "inboundAdapterCallContext":{ - "correlationId":"1flssoftxq0cr1nssr68u0mioj", - "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", - "generalContext":[ - { - "key":"5987953", - "value":"FYIUYF6SUYFSD" - } - ] - }, - "status":{ - "errorCode":"", - "backendMessages":[ - { - "source":"String", - "status":"String", - "errorCode":"", - "text":"String" - } - ] - }, - "data":{ - "createdByUserId":"string", - "name":"string", - "description":"string", - "thisBankId":"string", - "thisAccountId":"string", - "thisViewId":"string", - "counterpartyId":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh", - "otherAccountRoutingScheme":"IBAN", - "otherAccountRoutingAddress":"DE91 1000 0000 0123 4567 89", - "otherAccountSecondaryRoutingScheme":"string", - "otherAccountSecondaryRoutingAddress":"string", - "otherBankRoutingScheme":"BIC", - "otherBankRoutingAddress":"GENODEM1GLS", - "otherBranchRoutingScheme":"BRANCH-CODE", - "otherBranchRoutingAddress":"DERBY6", - "isBeneficiary":true, - "bespoke":[ - { - "key":"5987953", - "value":"FYIUYF6SUYFSD" - } - ] - } - }' - ); -GO - - - - - -- drop procedure get_counterparty_by_counterparty_id DROP PROCEDURE IF EXISTS get_counterparty_by_counterparty_id; GO @@ -1801,76 +1278,6 @@ GO --- drop procedure get_counterparties_legacy -DROP PROCEDURE IF EXISTS get_counterparties_legacy; -GO --- create procedure get_counterparties_legacy -CREATE PROCEDURE get_counterparties_legacy -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on - --- replace the follow example to real logic - - SELECT @in_bound_json = ( - SELECT - N'{ - "inboundAdapterCallContext":{ - "correlationId":"1flssoftxq0cr1nssr68u0mioj", - "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", - "generalContext":[ - { - "key":"5987953", - "value":"FYIUYF6SUYFSD" - } - ] - }, - "status":{ - "errorCode":"", - "backendMessages":[ - { - "source":"String", - "status":"String", - "errorCode":"", - "text":"String" - } - ] - }, - "data":[ - { - "createdByUserId":"string", - "name":"string", - "description":"string", - "thisBankId":"string", - "thisAccountId":"string", - "thisViewId":"string", - "counterpartyId":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh", - "otherAccountRoutingScheme":"IBAN", - "otherAccountRoutingAddress":"DE91 1000 0000 0123 4567 89", - "otherAccountSecondaryRoutingScheme":"string", - "otherAccountSecondaryRoutingAddress":"string", - "otherBankRoutingScheme":"BIC", - "otherBankRoutingAddress":"GENODEM1GLS", - "otherBranchRoutingScheme":"BRANCH-CODE", - "otherBranchRoutingAddress":"DERBY6", - "isBeneficiary":true, - "bespoke":[ - { - "key":"5987953", - "value":"FYIUYF6SUYFSD" - } - ] - } - ] - }' - ); -GO - - - - - -- drop procedure get_counterparties DROP PROCEDURE IF EXISTS get_counterparties; GO @@ -1941,53 +1348,6 @@ GO --- drop procedure get_transactions_legacy -DROP PROCEDURE IF EXISTS get_transactions_legacy; -GO --- create procedure get_transactions_legacy -CREATE PROCEDURE get_transactions_legacy -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on - --- replace the follow example to real logic - - SELECT @in_bound_json = ( - SELECT - N'{ - "inboundAdapterCallContext":{ - "correlationId":"1flssoftxq0cr1nssr68u0mioj", - "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", - "generalContext":[ - { - "key":"5987953", - "value":"FYIUYF6SUYFSD" - } - ] - }, - "status":{ - "errorCode":"", - "backendMessages":[ - { - "source":"String", - "status":"String", - "errorCode":"", - "text":"String" - } - ] - }, - "data":[ - {} - ] - }' - ); -GO - - - - - -- drop procedure get_transactions DROP PROCEDURE IF EXISTS get_transactions; GO @@ -2129,8 +1489,8 @@ AS "amount":"123.321", "currency":"EUR", "description":"string", - "startDate":"2020-06-16T13:52:22Z", - "finishDate":"2020-06-16T13:52:22Z", + "startDate":"2020-06-16T14:59:20Z", + "finishDate":"2020-06-16T14:59:20Z", "balance":"50.89" } ] @@ -2142,51 +1502,6 @@ GO --- drop procedure get_transaction_legacy -DROP PROCEDURE IF EXISTS get_transaction_legacy; -GO --- create procedure get_transaction_legacy -CREATE PROCEDURE get_transaction_legacy -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on - --- replace the follow example to real logic - - SELECT @in_bound_json = ( - SELECT - N'{ - "inboundAdapterCallContext":{ - "correlationId":"1flssoftxq0cr1nssr68u0mioj", - "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", - "generalContext":[ - { - "key":"5987953", - "value":"FYIUYF6SUYFSD" - } - ] - }, - "status":{ - "errorCode":"", - "backendMessages":[ - { - "source":"String", - "status":"String", - "errorCode":"", - "text":"String" - } - ] - }, - "data":{} - }' - ); -GO - - - - - -- drop procedure get_transaction DROP PROCEDURE IF EXISTS get_transaction; GO @@ -2276,8 +1591,8 @@ AS "nameOnCard":"SusanSmith", "issueNumber":"1", "serialNumber":"1324234", - "validFrom":"2020-06-16T13:52:22Z", - "expires":"2020-06-16T13:52:22Z", + "validFrom":"2020-06-16T14:59:20Z", + "expires":"2020-06-16T14:59:20Z", "enabled":true, "cancelled":true, "onHotList":true, @@ -2321,20 +1636,20 @@ AS "accountHolder":"bankAccount accountHolder string" }, "replacement":{ - "requestedDate":"2020-06-16T13:52:22Z", + "requestedDate":"2020-06-16T14:59:20Z", "reasonRequested":{} }, "pinResets":[ { - "requestedDate":"2020-06-16T13:52:22Z", + "requestedDate":"2020-06-16T14:59:20Z", "reasonRequested":{} } ], "collected":{ - "date":"2020-06-16T13:52:22Z" + "date":"2020-06-16T14:59:20Z" }, "posted":{ - "date":"2020-06-16T13:52:22Z" + "date":"2020-06-16T14:59:20Z" }, "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" } @@ -2436,8 +1751,8 @@ AS "nameOnCard":"SusanSmith", "issueNumber":"1", "serialNumber":"1324234", - "validFrom":"2020-06-16T13:52:22Z", - "expires":"2020-06-16T13:52:22Z", + "validFrom":"2020-06-16T14:59:20Z", + "expires":"2020-06-16T14:59:20Z", "enabled":true, "cancelled":true, "onHotList":true, @@ -2481,20 +1796,20 @@ AS "accountHolder":"bankAccount accountHolder string" }, "replacement":{ - "requestedDate":"2020-06-16T13:52:22Z", + "requestedDate":"2020-06-16T14:59:20Z", "reasonRequested":{} }, "pinResets":[ { - "requestedDate":"2020-06-16T13:52:22Z", + "requestedDate":"2020-06-16T14:59:20Z", "reasonRequested":{} } ], "collected":{ - "date":"2020-06-16T13:52:22Z" + "date":"2020-06-16T14:59:20Z" }, "posted":{ - "date":"2020-06-16T13:52:22Z" + "date":"2020-06-16T14:59:20Z" }, "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" } @@ -2507,120 +1822,6 @@ GO --- drop procedure create_physical_card_legacy -DROP PROCEDURE IF EXISTS create_physical_card_legacy; -GO --- create procedure create_physical_card_legacy -CREATE PROCEDURE create_physical_card_legacy -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on - --- replace the follow example to real logic - - SELECT @in_bound_json = ( - SELECT - N'{ - "inboundAdapterCallContext":{ - "correlationId":"1flssoftxq0cr1nssr68u0mioj", - "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", - "generalContext":[ - { - "key":"5987953", - "value":"FYIUYF6SUYFSD" - } - ] - }, - "status":{ - "errorCode":"", - "backendMessages":[ - { - "source":"String", - "status":"String", - "errorCode":"", - "text":"String" - } - ] - }, - "data":{ - "cardId":"36f8a9e6-c2b1-407a-8bd0-421b7119307e ", - "bankId":"gh.29.uk", - "bankCardNumber":"364435172576215", - "cardType":"Credit", - "nameOnCard":"SusanSmith", - "issueNumber":"1", - "serialNumber":"1324234", - "validFrom":"2020-06-16T13:52:22Z", - "expires":"2020-06-16T13:52:22Z", - "enabled":true, - "cancelled":true, - "onHotList":true, - "technology":"string", - "networks":[ - "string" - ], - "allows":[ - {} - ], - "account":{ - "accountId":{ - "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" - }, - "accountType":"AC", - "balance":"50.89", - "currency":"EUR", - "name":"bankAccount name string", - "label":"My Account", - "iban":"DE91 1000 0000 0123 4567 89", - "number":"546387432", - "bankId":{ - "value":"gh.29.uk" - }, - "lastUpdate":"2018-03-08T16:00:00Z", - "branchId":"DERBY6", - "accountRoutingScheme":"IBAN", - "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", - "accountRoutings":[ - { - "scheme":"IBAN", - "address":"DE91 1000 0000 0123 4567 89" - } - ], - "accountRules":[ - { - "scheme":"AccountRule scheme string", - "value":"AccountRule value string" - } - ], - "accountHolder":"bankAccount accountHolder string" - }, - "replacement":{ - "requestedDate":"2020-06-16T13:52:22Z", - "reasonRequested":{} - }, - "pinResets":[ - { - "requestedDate":"2020-06-16T13:52:22Z", - "reasonRequested":{} - } - ], - "collected":{ - "date":"2020-06-16T13:52:22Z" - }, - "posted":{ - "date":"2020-06-16T13:52:22Z" - }, - "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" - } - }' - ); -GO - - - - - -- drop procedure create_physical_card DROP PROCEDURE IF EXISTS create_physical_card; GO @@ -2665,8 +1866,8 @@ AS "nameOnCard":"SusanSmith", "issueNumber":"1", "serialNumber":"1324234", - "validFrom":"2020-06-16T13:52:22Z", - "expires":"2020-06-16T13:52:22Z", + "validFrom":"2020-06-16T14:59:20Z", + "expires":"2020-06-16T14:59:20Z", "enabled":true, "cancelled":true, "onHotList":true, @@ -2710,20 +1911,20 @@ AS "accountHolder":"bankAccount accountHolder string" }, "replacement":{ - "requestedDate":"2020-06-16T13:52:22Z", + "requestedDate":"2020-06-16T14:59:20Z", "reasonRequested":{} }, "pinResets":[ { - "requestedDate":"2020-06-16T13:52:22Z", + "requestedDate":"2020-06-16T14:59:20Z", "reasonRequested":{} } ], "collected":{ - "date":"2020-06-16T13:52:22Z" + "date":"2020-06-16T14:59:20Z" }, "posted":{ - "date":"2020-06-16T13:52:22Z" + "date":"2020-06-16T14:59:20Z" }, "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" } @@ -2779,8 +1980,8 @@ AS "nameOnCard":"SusanSmith", "issueNumber":"1", "serialNumber":"1324234", - "validFrom":"2020-06-16T13:52:22Z", - "expires":"2020-06-16T13:52:22Z", + "validFrom":"2020-06-16T14:59:20Z", + "expires":"2020-06-16T14:59:20Z", "enabled":true, "cancelled":true, "onHotList":true, @@ -2824,20 +2025,20 @@ AS "accountHolder":"bankAccount accountHolder string" }, "replacement":{ - "requestedDate":"2020-06-16T13:52:22Z", + "requestedDate":"2020-06-16T14:59:20Z", "reasonRequested":{} }, "pinResets":[ { - "requestedDate":"2020-06-16T13:52:22Z", + "requestedDate":"2020-06-16T14:59:20Z", "reasonRequested":{} } ], "collected":{ - "date":"2020-06-16T13:52:22Z" + "date":"2020-06-16T14:59:20Z" }, "posted":{ - "date":"2020-06-16T13:52:22Z" + "date":"2020-06-16T14:59:20Z" }, "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" } @@ -3027,8 +2228,8 @@ AS }, "transaction_ids":"string", "status":"string", - "start_date":"2020-06-16T13:52:22Z", - "end_date":"2020-06-16T13:52:22Z", + "start_date":"2020-06-16T14:59:21Z", + "end_date":"2020-06-16T14:59:21Z", "challenge":{ "id":"string", "allowed_attempts":123, @@ -3201,8 +2402,8 @@ AS }, "transaction_ids":"string", "status":"string", - "start_date":"2020-06-16T13:52:22Z", - "end_date":"2020-06-16T13:52:22Z", + "start_date":"2020-06-16T14:59:21Z", + "end_date":"2020-06-16T14:59:21Z", "challenge":{ "id":"string", "allowed_attempts":123, @@ -3376,8 +2577,8 @@ AS }, "transaction_ids":"string", "status":"string", - "start_date":"2020-06-16T13:52:22Z", - "end_date":"2020-06-16T13:52:22Z", + "start_date":"2020-06-16T14:59:21Z", + "end_date":"2020-06-16T14:59:21Z", "challenge":{ "id":"string", "allowed_attempts":123, @@ -3551,8 +2752,8 @@ AS }, "transaction_ids":"string", "status":"string", - "start_date":"2020-06-16T13:52:22Z", - "end_date":"2020-06-16T13:52:22Z", + "start_date":"2020-06-16T14:59:21Z", + "end_date":"2020-06-16T14:59:21Z", "challenge":{ "id":"string", "allowed_attempts":123, @@ -3725,8 +2926,8 @@ AS }, "transaction_ids":"string", "status":"string", - "start_date":"2020-06-16T13:52:22Z", - "end_date":"2020-06-16T13:52:22Z", + "start_date":"2020-06-16T14:59:21Z", + "end_date":"2020-06-16T14:59:21Z", "challenge":{ "id":"string", "allowed_attempts":123, @@ -4012,7 +3213,7 @@ AS "location":{ "latitude":123.123, "longitude":123.123, - "date":"2020-06-16T13:52:22Z", + "date":"2020-06-16T14:59:21Z", "user":{ "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", "provider":"string", @@ -4182,7 +3383,7 @@ AS "location":{ "latitude":123.123, "longitude":123.123, - "date":"2020-06-16T13:52:22Z", + "date":"2020-06-16T14:59:21Z", "user":{ "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", "provider":"string", @@ -4352,7 +3553,7 @@ AS "location":{ "latitude":123.123, "longitude":123.123, - "date":"2020-06-16T13:52:22Z", + "date":"2020-06-16T14:59:21Z", "user":{ "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", "provider":"string", @@ -4450,7 +3651,7 @@ AS "location":{ "latitude":123.123, "longitude":123.123, - "date":"2020-06-16T13:52:22Z", + "date":"2020-06-16T14:59:21Z", "user":{ "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", "provider":"string", @@ -4622,8 +3823,8 @@ AS }, "transaction_ids":"string", "status":"string", - "start_date":"2020-06-16T13:52:22Z", - "end_date":"2020-06-16T13:52:22Z", + "start_date":"2020-06-16T14:59:21Z", + "end_date":"2020-06-16T14:59:21Z", "challenge":{ "id":"string", "allowed_attempts":123, @@ -4843,8 +4044,8 @@ AS }, "transaction_ids":"string", "status":"string", - "start_date":"2020-06-16T13:52:22Z", - "end_date":"2020-06-16T13:52:22Z", + "start_date":"2020-06-16T14:59:21Z", + "end_date":"2020-06-16T14:59:21Z", "challenge":{ "id":"string", "allowed_attempts":123, @@ -5391,84 +4592,6 @@ GO --- drop procedure get_customer_by_customer_id_legacy -DROP PROCEDURE IF EXISTS get_customer_by_customer_id_legacy; -GO --- create procedure get_customer_by_customer_id_legacy -CREATE PROCEDURE get_customer_by_customer_id_legacy -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on - --- replace the follow example to real logic - - SELECT @in_bound_json = ( - SELECT - N'{ - "inboundAdapterCallContext":{ - "correlationId":"1flssoftxq0cr1nssr68u0mioj", - "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", - "generalContext":[ - { - "key":"5987953", - "value":"FYIUYF6SUYFSD" - } - ] - }, - "status":{ - "errorCode":"", - "backendMessages":[ - { - "source":"String", - "status":"String", - "errorCode":"", - "text":"String" - } - ] - }, - "data":{ - "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", - "bankId":"gh.29.uk", - "number":"5987953", - "legalName":"Eveline Tripman", - "mobileNumber":"+44 07972 444 876", - "email":"eveline@example.com", - "faceImage":{ - "date":"2019-09-07T16:00:00Z", - "url":"http://www.example.com/id-docs/123/image.png" - }, - "dateOfBirth":"2018-03-08T16:00:00Z", - "relationshipStatus":"single", - "dependents":1, - "dobOfDependents":[ - "2019-09-07T16:00:00Z", - "2019-01-02T16:00:00Z" - ], - "highestEducationAttained":"Master", - "employmentStatus":"worker", - "creditRating":{ - "rating":"", - "source":"" - }, - "creditLimit":{ - "currency":"EUR", - "amount":"1000.00" - }, - "kycStatus":true, - "lastOkDate":"2019-09-07T16:00:00Z", - "title":"title of customer", - "branchId":"DERBY6", - "nameSuffix":"Sr" - } - }' - ); -GO - - - - - -- drop procedure get_customer_by_customer_id DROP PROCEDURE IF EXISTS get_customer_by_customer_id; GO @@ -5675,7 +4798,7 @@ AS "countryCode":"string", "status":"string", "tags":"string", - "insertDate":"2020-06-16T13:52:22Z" + "insertDate":"2020-06-16T14:59:21Z" } ] }' @@ -5735,7 +4858,7 @@ AS "countryCode":"string", "status":"string", "tags":"string", - "insertDate":"2020-06-16T13:52:22Z" + "insertDate":"2020-06-16T14:59:21Z" } }' ); @@ -5794,7 +4917,7 @@ AS "countryCode":"string", "status":"string", "tags":"string", - "insertDate":"2020-06-16T13:52:22Z" + "insertDate":"2020-06-16T14:59:21Z" } }' ); @@ -7718,7 +6841,7 @@ AS }, "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", - "dateOfApplication":"2020-06-16T13:52:22Z", + "dateOfApplication":"2020-06-16T14:59:22Z", "status":"string" } }' @@ -7773,7 +6896,7 @@ AS }, "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", - "dateOfApplication":"2020-06-16T13:52:22Z", + "dateOfApplication":"2020-06-16T14:59:22Z", "status":"string" } ] @@ -7828,7 +6951,7 @@ AS }, "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", - "dateOfApplication":"2020-06-16T13:52:22Z", + "dateOfApplication":"2020-06-16T14:59:22Z", "status":"string" } }' @@ -7882,7 +7005,7 @@ AS }, "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", - "dateOfApplication":"2020-06-16T13:52:22Z", + "dateOfApplication":"2020-06-16T14:59:22Z", "status":"string" } }' @@ -8233,7 +7356,7 @@ AS "customerToken":"string", "staffToken":"string" }, - "when":"2020-06-16T13:52:22Z", + "when":"2020-06-16T14:59:22Z", "creator":{ "name":"string", "phone":"string", @@ -8309,7 +7432,7 @@ AS "customerToken":"string", "staffToken":"string" }, - "when":"2020-06-16T13:52:22Z", + "when":"2020-06-16T14:59:22Z", "creator":{ "name":"string", "phone":"string", @@ -8385,7 +7508,7 @@ AS "customerToken":"string", "staffToken":"string" }, - "when":"2020-06-16T13:52:22Z", + "when":"2020-06-16T14:59:22Z", "creator":{ "name":"string", "phone":"string", @@ -8451,7 +7574,7 @@ AS "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", "idKycCheck":"string", "customerNumber":"5987953", - "date":"2020-06-16T13:52:22Z", + "date":"2020-06-16T14:59:22Z", "how":"string", "staffUserId":"string", "staffName":"string", @@ -8509,9 +7632,9 @@ AS "customerNumber":"5987953", "type":"string", "number":"string", - "issueDate":"2020-06-16T13:52:22Z", + "issueDate":"2020-06-16T14:59:22Z", "issuePlace":"string", - "expiryDate":"2020-06-16T13:52:22Z" + "expiryDate":"2020-06-16T14:59:22Z" } }' ); @@ -8564,7 +7687,7 @@ AS "customerNumber":"5987953", "type":"string", "url":"http://www.example.com/id-docs/123/image.png", - "date":"2020-06-16T13:52:22Z", + "date":"2020-06-16T14:59:22Z", "relatesToKycDocumentId":"string", "relatesToKycCheckId":"string" } @@ -8617,7 +7740,7 @@ AS "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", "customerNumber":"5987953", "ok":true, - "date":"2020-06-16T13:52:22Z" + "date":"2020-06-16T14:59:22Z" } }' ); @@ -8669,7 +7792,7 @@ AS "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", "idKycCheck":"string", "customerNumber":"5987953", - "date":"2020-06-16T13:52:22Z", + "date":"2020-06-16T14:59:22Z", "how":"string", "staffUserId":"string", "staffName":"string", @@ -8729,9 +7852,9 @@ AS "customerNumber":"5987953", "type":"string", "number":"string", - "issueDate":"2020-06-16T13:52:22Z", + "issueDate":"2020-06-16T14:59:22Z", "issuePlace":"string", - "expiryDate":"2020-06-16T13:52:22Z" + "expiryDate":"2020-06-16T14:59:22Z" } ] }' @@ -8786,7 +7909,7 @@ AS "customerNumber":"5987953", "type":"string", "url":"http://www.example.com/id-docs/123/image.png", - "date":"2020-06-16T13:52:22Z", + "date":"2020-06-16T14:59:22Z", "relatesToKycDocumentId":"string", "relatesToKycCheckId":"string" } @@ -8841,7 +7964,7 @@ AS "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", "customerNumber":"5987953", "ok":true, - "date":"2020-06-16T13:52:22Z" + "date":"2020-06-16T14:59:22Z" } ] }' @@ -8890,7 +8013,7 @@ AS }, "data":{ "messageId":"string", - "date":"2020-06-16T13:52:22Z", + "date":"2020-06-16T14:59:22Z", "message":"string", "fromDepartment":"string", "fromPerson":"string" @@ -8993,10 +8116,10 @@ AS "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", "counterpartyId":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh", - "dateSigned":"2020-06-16T13:52:22Z", - "dateCancelled":"2020-06-16T13:52:22Z", - "dateStarts":"2020-06-16T13:52:22Z", - "dateExpires":"2020-06-16T13:52:22Z", + "dateSigned":"2020-06-16T14:59:22Z", + "dateCancelled":"2020-06-16T14:59:22Z", + "dateStarts":"2020-06-16T14:59:22Z", + "dateExpires":"2020-06-16T14:59:22Z", "active":true } }' 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 4c6325bbe..067c2e963 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 @@ -73,7 +73,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { val connectorName = "stored_procedure_vDec2019" //---------------- dynamic start -------------------please don't modify this line -// ---------- create on Tue Jun 16 19:55:42 CST 2020 +// ---------- create on Tue Jun 16 22:58:26 CST 2020 messageDocs += getAdapterInfoDoc def getAdapterInfoDoc = MessageDoc( @@ -102,7 +102,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getAdapterInfo(callContext: Option[CallContext]): Future[Box[(InboundAdapterInfoInternal, Option[CallContext])]] = { - import com.openbankproject.commons.dto.{InBoundGetAdapterInfo => InBound, OutBoundGetAdapterInfo => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetAdapterInfo => OutBound, InBoundGetAdapterInfo => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull) val response: Future[Box[InBound]] = sendRequest[InBound]("get_adapter_info", req, callContext) response.map(convertToTuple[InboundAdapterInfoInternal](callContext)) @@ -135,7 +135,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getChallengeThreshold(bankId: String, accountId: String, viewId: String, transactionRequestType: String, currency: String, userId: String, userName: String, callContext: Option[CallContext]): OBPReturnType[Box[AmountOfMoney]] = { - import com.openbankproject.commons.dto.{InBoundGetChallengeThreshold => InBound, OutBoundGetChallengeThreshold => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetChallengeThreshold => OutBound, InBoundGetChallengeThreshold => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, viewId, transactionRequestType, currency, userId, userName) val response: Future[Box[InBound]] = sendRequest[InBound]("get_challenge_threshold", req, callContext) response.map(convertToTuple[AmountOfMoney](callContext)) @@ -168,7 +168,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getChargeLevel(bankId: BankId, accountId: AccountId, viewId: ViewId, userId: String, userName: String, transactionRequestType: String, currency: String, callContext: Option[CallContext]): OBPReturnType[Box[AmountOfMoney]] = { - import com.openbankproject.commons.dto.{InBoundGetChargeLevel => InBound, OutBoundGetChargeLevel => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetChargeLevel => OutBound, InBoundGetChargeLevel => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, viewId, userId, userName, transactionRequestType, currency) val response: Future[Box[InBound]] = sendRequest[InBound]("get_charge_level", req, callContext) response.map(convertToTuple[AmountOfMoney](callContext)) @@ -199,7 +199,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createChallenge(bankId: BankId, accountId: AccountId, userId: String, transactionRequestType: TransactionRequestType, transactionRequestId: String, scaMethod: Option[StrongCustomerAuthentication.SCA], callContext: Option[CallContext]): OBPReturnType[Box[String]] = { - import com.openbankproject.commons.dto.{InBoundCreateChallenge => InBound, OutBoundCreateChallenge => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateChallenge => OutBound, InBoundCreateChallenge => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, userId, transactionRequestType, transactionRequestId, scaMethod) val response: Future[Box[InBound]] = sendRequest[InBound]("create_challenge", req, callContext) response.map(convertToTuple[String](callContext)) @@ -230,7 +230,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createChallenges(bankId: BankId, accountId: AccountId, userIds: List[String], transactionRequestType: TransactionRequestType, transactionRequestId: String, scaMethod: Option[StrongCustomerAuthentication.SCA], callContext: Option[CallContext]): OBPReturnType[Box[List[String]]] = { - import com.openbankproject.commons.dto.{InBoundCreateChallenges => InBound, OutBoundCreateChallenges => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateChallenges => OutBound, InBoundCreateChallenges => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, userIds, transactionRequestType, transactionRequestId, scaMethod) val response: Future[Box[InBound]] = sendRequest[InBound]("create_challenges", req, callContext) response.map(convertToTuple[List[String]](callContext)) @@ -257,46 +257,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def validateChallengeAnswer(challengeId: String, hashOfSuppliedAnswer: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { - import com.openbankproject.commons.dto.{InBoundValidateChallengeAnswer => InBound, OutBoundValidateChallengeAnswer => OutBound} + import com.openbankproject.commons.dto.{OutBoundValidateChallengeAnswer => OutBound, InBoundValidateChallengeAnswer => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, challengeId, hashOfSuppliedAnswer) val response: Future[Box[InBound]] = sendRequest[InBound]("validate_challenge_answer", req, callContext) response.map(convertToTuple[Boolean](callContext)) } - messageDocs += getBankLegacyDoc - def getBankLegacyDoc = MessageDoc( - process = "obp.getBankLegacy", - messageFormat = messageFormat, - description = "Get Bank Legacy", - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundGetBankLegacy(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, - bankId=BankId(bankIdExample.value)) - ), - exampleInboundMessage = ( - InBoundGetBankLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, - status=MessageDocsSwaggerDefinitions.inboundStatus, - data= BankCommons(bankId=BankId(bankIdExample.value), - shortName=bankShortNameExample.value, - fullName=bankFullNameExample.value, - logoUrl=bankLogoUrlExample.value, - websiteUrl=bankWebsiteUrlExample.value, - bankRoutingScheme=bankRoutingSchemeExample.value, - bankRoutingAddress=bankRoutingAddressExample.value, - swiftBic=bankSwiftBicExample.value, - nationalIdentifier=bankNationalIdentifierExample.value)) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - - override def getBankLegacy(bankId: BankId, callContext: Option[CallContext]): Box[(Bank, Option[CallContext])] = { - import com.openbankproject.commons.dto.{InBoundGetBankLegacy => InBound, OutBoundGetBankLegacy => OutBound} - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId) - val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank_legacy", req, callContext) - response.map(convertToTuple[BankCommons](callContext)) - } - messageDocs += getBankDoc def getBankDoc = MessageDoc( process = "obp.getBank", @@ -325,45 +291,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getBank(bankId: BankId, callContext: Option[CallContext]): Future[Box[(Bank, Option[CallContext])]] = { - import com.openbankproject.commons.dto.{InBoundGetBank => InBound, OutBoundGetBank => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetBank => OutBound, InBoundGetBank => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank", req, callContext) response.map(convertToTuple[BankCommons](callContext)) } - messageDocs += getBanksLegacyDoc - def getBanksLegacyDoc = MessageDoc( - process = "obp.getBanksLegacy", - messageFormat = messageFormat, - description = "Get Banks Legacy", - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundGetBanksLegacy(MessageDocsSwaggerDefinitions.outboundAdapterCallContext) - ), - exampleInboundMessage = ( - InBoundGetBanksLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, - status=MessageDocsSwaggerDefinitions.inboundStatus, - data=List( BankCommons(bankId=BankId(bankIdExample.value), - shortName=bankShortNameExample.value, - fullName=bankFullNameExample.value, - logoUrl=bankLogoUrlExample.value, - websiteUrl=bankWebsiteUrlExample.value, - bankRoutingScheme=bankRoutingSchemeExample.value, - bankRoutingAddress=bankRoutingAddressExample.value, - swiftBic=bankSwiftBicExample.value, - nationalIdentifier=bankNationalIdentifierExample.value))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - - override def getBanksLegacy(callContext: Option[CallContext]): Box[(List[Bank], Option[CallContext])] = { - import com.openbankproject.commons.dto.{InBoundGetBanksLegacy => InBound, OutBoundGetBanksLegacy => OutBound} - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull) - val response: Future[Box[InBound]] = sendRequest[InBound]("get_banks_legacy", req, callContext) - response.map(convertToTuple[List[BankCommons]](callContext)) - } - messageDocs += getBanksDoc def getBanksDoc = MessageDoc( process = "obp.getBanks", @@ -391,52 +324,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getBanks(callContext: Option[CallContext]): Future[Box[(List[Bank], Option[CallContext])]] = { - import com.openbankproject.commons.dto.{InBoundGetBanks => InBound, OutBoundGetBanks => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetBanks => OutBound, InBoundGetBanks => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull) val response: Future[Box[InBound]] = sendRequest[InBound]("get_banks", req, callContext) response.map(convertToTuple[List[BankCommons]](callContext)) } - messageDocs += getBankAccountsForUserLegacyDoc - def getBankAccountsForUserLegacyDoc = MessageDoc( - process = "obp.getBankAccountsForUserLegacy", - messageFormat = messageFormat, - description = "Get Bank Accounts For User Legacy", - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundGetBankAccountsForUserLegacy(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, - username=usernameExample.value) - ), - exampleInboundMessage = ( - InBoundGetBankAccountsForUserLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, - status=MessageDocsSwaggerDefinitions.inboundStatus, - data=List( InboundAccountCommons(bankId=bankIdExample.value, - branchId=branchIdExample.value, - accountId=accountIdExample.value, - accountNumber=accountNumberExample.value, - accountType=accountTypeExample.value, - balanceAmount=balanceAmountExample.value, - balanceCurrency=balanceCurrencyExample.value, - owners=inboundAccountOwnersExample.value.split("[,;]").toList, - viewsToGenerate=inboundAccountViewsToGenerateExample.value.split("[,;]").toList, - bankRoutingScheme=bankRoutingSchemeExample.value, - bankRoutingAddress=bankRoutingAddressExample.value, - branchRoutingScheme=branchRoutingSchemeExample.value, - branchRoutingAddress=branchRoutingAddressExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - - override def getBankAccountsForUserLegacy(username: String, callContext: Option[CallContext]): Box[(List[InboundAccount], Option[CallContext])] = { - import com.openbankproject.commons.dto.{InBoundGetBankAccountsForUserLegacy => InBound, OutBoundGetBankAccountsForUserLegacy => OutBound} - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, username) - val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank_accounts_for_user_legacy", req, callContext) - response.map(convertToTuple[List[InboundAccountCommons]](callContext)) - } - messageDocs += getBankAccountsForUserDoc def getBankAccountsForUserDoc = MessageDoc( process = "obp.getBankAccountsForUser", @@ -471,7 +364,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getBankAccountsForUser(username: String, callContext: Option[CallContext]): Future[Box[(List[InboundAccount], Option[CallContext])]] = { - import com.openbankproject.commons.dto.{InBoundGetBankAccountsForUser => InBound, OutBoundGetBankAccountsForUser => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetBankAccountsForUser => OutBound, InBoundGetBankAccountsForUser => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, username) val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank_accounts_for_user", req, callContext) response.map(convertToTuple[List[InboundAccountCommons]](callContext)) @@ -498,7 +391,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getUser(name: String, password: String): Box[InboundUser] = { - import com.openbankproject.commons.dto.{InBoundGetUser => InBound, OutBoundGetUser => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetUser => OutBound, InBoundGetUser => InBound} val callContext: Option[CallContext] = None val req = OutBound(name, password) val response: Future[Box[InBound]] = sendRequest[InBound]("get_user", req, callContext) @@ -541,57 +434,13 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getBankAccountOld(bankId: BankId, accountId: AccountId): Box[BankAccount] = { - import com.openbankproject.commons.dto.{InBoundGetBankAccountOld => InBound, OutBoundGetBankAccountOld => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetBankAccountOld => OutBound, InBoundGetBankAccountOld => InBound} val callContext: Option[CallContext] = None val req = OutBound(bankId, accountId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank_account_old", req, callContext) response.map(convertToTuple[BankAccountCommons](callContext)) } - messageDocs += getBankAccountLegacyDoc - def getBankAccountLegacyDoc = MessageDoc( - process = "obp.getBankAccountLegacy", - messageFormat = messageFormat, - description = "Get Bank Account Legacy", - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundGetBankAccountLegacy(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, - bankId=BankId(bankIdExample.value), - accountId=AccountId(accountIdExample.value)) - ), - exampleInboundMessage = ( - InBoundGetBankAccountLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, - status=MessageDocsSwaggerDefinitions.inboundStatus, - data= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=bankAccountNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=bankAccountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value)) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - - override def getBankAccountLegacy(bankId: BankId, accountId: AccountId, callContext: Option[CallContext]): Box[(BankAccount, Option[CallContext])] = { - import com.openbankproject.commons.dto.{InBoundGetBankAccountLegacy => InBound, OutBoundGetBankAccountLegacy => OutBound} - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId) - val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank_account_legacy", req, callContext) - response.map(convertToTuple[BankAccountCommons](callContext)) - } - messageDocs += getBankAccountDoc def getBankAccountDoc = MessageDoc( process = "obp.getBankAccount", @@ -630,7 +479,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getBankAccount(bankId: BankId, accountId: AccountId, callContext: Option[CallContext]): OBPReturnType[Box[BankAccount]] = { - import com.openbankproject.commons.dto.{InBoundGetBankAccount => InBound, OutBoundGetBankAccount => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetBankAccount => OutBound, InBoundGetBankAccount => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank_account", req, callContext) response.map(convertToTuple[BankAccountCommons](callContext)) @@ -673,7 +522,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getBankAccountByIban(iban: String, callContext: Option[CallContext]): OBPReturnType[Box[BankAccount]] = { - import com.openbankproject.commons.dto.{InBoundGetBankAccountByIban => InBound, OutBoundGetBankAccountByIban => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetBankAccountByIban => OutBound, InBoundGetBankAccountByIban => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, iban) val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank_account_by_iban", req, callContext) response.map(convertToTuple[BankAccountCommons](callContext)) @@ -717,7 +566,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getBankAccountByRouting(scheme: String, address: String, callContext: Option[CallContext]): Box[(BankAccount, Option[CallContext])] = { - import com.openbankproject.commons.dto.{InBoundGetBankAccountByRouting => InBound, OutBoundGetBankAccountByRouting => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetBankAccountByRouting => OutBound, InBoundGetBankAccountByRouting => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, scheme, address) val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank_account_by_routing", req, callContext) response.map(convertToTuple[BankAccountCommons](callContext)) @@ -761,7 +610,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getBankAccounts(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]): OBPReturnType[Box[List[BankAccount]]] = { - import com.openbankproject.commons.dto.{InBoundGetBankAccounts => InBound, OutBoundGetBankAccounts => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetBankAccounts => OutBound, InBoundGetBankAccounts => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankIdAccountIds) val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank_accounts", req, callContext) response.map(convertToTuple[List[BankAccountCommons]](callContext)) @@ -797,44 +646,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getBankAccountsBalances(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]): OBPReturnType[Box[AccountsBalances]] = { - import com.openbankproject.commons.dto.{InBoundGetBankAccountsBalances => InBound, OutBoundGetBankAccountsBalances => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetBankAccountsBalances => OutBound, InBoundGetBankAccountsBalances => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankIdAccountIds) val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank_accounts_balances", req, callContext) response.map(convertToTuple[AccountsBalances](callContext)) } - messageDocs += getCoreBankAccountsLegacyDoc - def getCoreBankAccountsLegacyDoc = MessageDoc( - process = "obp.getCoreBankAccountsLegacy", - messageFormat = messageFormat, - description = "Get Core Bank Accounts Legacy", - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundGetCoreBankAccountsLegacy(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, - bankIdAccountIds=List( BankIdAccountId(bankId=BankId(bankIdExample.value), - accountId=AccountId(accountIdExample.value)))) - ), - exampleInboundMessage = ( - InBoundGetCoreBankAccountsLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, - status=MessageDocsSwaggerDefinitions.inboundStatus, - data=List( CoreAccount(id=accountIdExample.value, - label=labelExample.value, - bankId=bankIdExample.value, - accountType=accountTypeExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value))))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - - override def getCoreBankAccountsLegacy(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]): Box[(List[CoreAccount], Option[CallContext])] = { - import com.openbankproject.commons.dto.{InBoundGetCoreBankAccountsLegacy => InBound, OutBoundGetCoreBankAccountsLegacy => OutBound} - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankIdAccountIds) - val response: Future[Box[InBound]] = sendRequest[InBound]("get_core_bank_accounts_legacy", req, callContext) - response.map(convertToTuple[List[CoreAccount]](callContext)) - } - messageDocs += getCoreBankAccountsDoc def getCoreBankAccountsDoc = MessageDoc( process = "obp.getCoreBankAccounts", @@ -861,43 +678,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getCoreBankAccounts(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]): Future[Box[(List[CoreAccount], Option[CallContext])]] = { - import com.openbankproject.commons.dto.{InBoundGetCoreBankAccounts => InBound, OutBoundGetCoreBankAccounts => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetCoreBankAccounts => OutBound, InBoundGetCoreBankAccounts => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankIdAccountIds) val response: Future[Box[InBound]] = sendRequest[InBound]("get_core_bank_accounts", req, callContext) response.map(convertToTuple[List[CoreAccount]](callContext)) } - messageDocs += getBankAccountsHeldLegacyDoc - def getBankAccountsHeldLegacyDoc = MessageDoc( - process = "obp.getBankAccountsHeldLegacy", - messageFormat = messageFormat, - description = "Get Bank Accounts Held Legacy", - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundGetBankAccountsHeldLegacy(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, - bankIdAccountIds=List( BankIdAccountId(bankId=BankId(bankIdExample.value), - accountId=AccountId(accountIdExample.value)))) - ), - exampleInboundMessage = ( - InBoundGetBankAccountsHeldLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, - status=MessageDocsSwaggerDefinitions.inboundStatus, - data=List( AccountHeld(id="string", - bankId=bankIdExample.value, - number="string", - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value))))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - - override def getBankAccountsHeldLegacy(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]): Box[List[AccountHeld]] = { - import com.openbankproject.commons.dto.{InBoundGetBankAccountsHeldLegacy => InBound, OutBoundGetBankAccountsHeldLegacy => OutBound} - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankIdAccountIds) - val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank_accounts_held_legacy", req, callContext) - response.map(convertToTuple[List[AccountHeld]](callContext)) - } - messageDocs += getBankAccountsHeldDoc def getBankAccountsHeldDoc = MessageDoc( process = "obp.getBankAccountsHeld", @@ -923,56 +709,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getBankAccountsHeld(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]): OBPReturnType[Box[List[AccountHeld]]] = { - import com.openbankproject.commons.dto.{InBoundGetBankAccountsHeld => InBound, OutBoundGetBankAccountsHeld => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetBankAccountsHeld => OutBound, InBoundGetBankAccountsHeld => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankIdAccountIds) val response: Future[Box[InBound]] = sendRequest[InBound]("get_bank_accounts_held", req, callContext) response.map(convertToTuple[List[AccountHeld]](callContext)) } - messageDocs += checkBankAccountExistsLegacyDoc - def checkBankAccountExistsLegacyDoc = MessageDoc( - process = "obp.checkBankAccountExistsLegacy", - messageFormat = messageFormat, - description = "Check Bank Account Exists Legacy", - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundCheckBankAccountExistsLegacy(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, - bankId=BankId(bankIdExample.value), - accountId=AccountId(accountIdExample.value)) - ), - exampleInboundMessage = ( - InBoundCheckBankAccountExistsLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, - status=MessageDocsSwaggerDefinitions.inboundStatus, - data= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=bankAccountNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=bankAccountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value)) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - - override def checkBankAccountExistsLegacy(bankId: BankId, accountId: AccountId, callContext: Option[CallContext]): Box[(BankAccount, Option[CallContext])] = { - import com.openbankproject.commons.dto.{InBoundCheckBankAccountExistsLegacy => InBound, OutBoundCheckBankAccountExistsLegacy => OutBound} - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId) - val response: Future[Box[InBound]] = sendRequest[InBound]("check_bank_account_exists_legacy", req, callContext) - response.map(convertToTuple[BankAccountCommons](callContext)) - } - messageDocs += getCounterpartyTraitDoc def getCounterpartyTraitDoc = MessageDoc( process = "obp.getCounterpartyTrait", @@ -1012,55 +754,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getCounterpartyTrait(bankId: BankId, accountId: AccountId, couterpartyId: String, callContext: Option[CallContext]): OBPReturnType[Box[CounterpartyTrait]] = { - import com.openbankproject.commons.dto.{InBoundGetCounterpartyTrait => InBound, OutBoundGetCounterpartyTrait => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetCounterpartyTrait => OutBound, InBoundGetCounterpartyTrait => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, couterpartyId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_counterparty_trait", req, callContext) response.map(convertToTuple[CounterpartyTraitCommons](callContext)) } - messageDocs += getCounterpartyByCounterpartyIdLegacyDoc - def getCounterpartyByCounterpartyIdLegacyDoc = MessageDoc( - process = "obp.getCounterpartyByCounterpartyIdLegacy", - messageFormat = messageFormat, - description = "Get Counterparty By Counterparty Id Legacy", - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundGetCounterpartyByCounterpartyIdLegacy(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, - counterpartyId=CounterpartyId(counterpartyIdExample.value)) - ), - exampleInboundMessage = ( - InBoundGetCounterpartyByCounterpartyIdLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, - status=MessageDocsSwaggerDefinitions.inboundStatus, - data= CounterpartyTraitCommons(createdByUserId="string", - name="string", - description="string", - thisBankId="string", - thisAccountId="string", - thisViewId="string", - counterpartyId=counterpartyIdExample.value, - otherAccountRoutingScheme=accountRoutingSchemeExample.value, - otherAccountRoutingAddress=accountRoutingAddressExample.value, - otherAccountSecondaryRoutingScheme="string", - otherAccountSecondaryRoutingAddress="string", - otherBankRoutingScheme=bankRoutingSchemeExample.value, - otherBankRoutingAddress=bankRoutingAddressExample.value, - otherBranchRoutingScheme=branchRoutingSchemeExample.value, - otherBranchRoutingAddress=branchRoutingAddressExample.value, - isBeneficiary=isBeneficiaryExample.value.toBoolean, - bespoke=List( CounterpartyBespoke(key=keyExample.value, - value=valueExample.value)))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - - override def getCounterpartyByCounterpartyIdLegacy(counterpartyId: CounterpartyId, callContext: Option[CallContext]): Box[(CounterpartyTrait, Option[CallContext])] = { - import com.openbankproject.commons.dto.{InBoundGetCounterpartyByCounterpartyIdLegacy => InBound, OutBoundGetCounterpartyByCounterpartyIdLegacy => OutBound} - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, counterpartyId) - val response: Future[Box[InBound]] = sendRequest[InBound]("get_counterparty_by_counterparty_id_legacy", req, callContext) - response.map(convertToTuple[CounterpartyTraitCommons](callContext)) - } - messageDocs += getCounterpartyByCounterpartyIdDoc def getCounterpartyByCounterpartyIdDoc = MessageDoc( process = "obp.getCounterpartyByCounterpartyId", @@ -1098,7 +797,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getCounterpartyByCounterpartyId(counterpartyId: CounterpartyId, callContext: Option[CallContext]): OBPReturnType[Box[CounterpartyTrait]] = { - import com.openbankproject.commons.dto.{InBoundGetCounterpartyByCounterpartyId => InBound, OutBoundGetCounterpartyByCounterpartyId => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetCounterpartyByCounterpartyId => OutBound, InBoundGetCounterpartyByCounterpartyId => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, counterpartyId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_counterparty_by_counterparty_id", req, callContext) response.map(convertToTuple[CounterpartyTraitCommons](callContext)) @@ -1141,57 +840,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getCounterpartyByIban(iban: String, callContext: Option[CallContext]): OBPReturnType[Box[CounterpartyTrait]] = { - import com.openbankproject.commons.dto.{InBoundGetCounterpartyByIban => InBound, OutBoundGetCounterpartyByIban => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetCounterpartyByIban => OutBound, InBoundGetCounterpartyByIban => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, iban) val response: Future[Box[InBound]] = sendRequest[InBound]("get_counterparty_by_iban", req, callContext) response.map(convertToTuple[CounterpartyTraitCommons](callContext)) } - messageDocs += getCounterpartiesLegacyDoc - def getCounterpartiesLegacyDoc = MessageDoc( - process = "obp.getCounterpartiesLegacy", - messageFormat = messageFormat, - description = "Get Counterparties Legacy", - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundGetCounterpartiesLegacy(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, - thisBankId=BankId(bankIdExample.value), - thisAccountId=AccountId(accountIdExample.value), - viewId=ViewId(viewIdExample.value)) - ), - exampleInboundMessage = ( - InBoundGetCounterpartiesLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, - status=MessageDocsSwaggerDefinitions.inboundStatus, - data=List( CounterpartyTraitCommons(createdByUserId="string", - name="string", - description="string", - thisBankId="string", - thisAccountId="string", - thisViewId="string", - counterpartyId=counterpartyIdExample.value, - otherAccountRoutingScheme=accountRoutingSchemeExample.value, - otherAccountRoutingAddress=accountRoutingAddressExample.value, - otherAccountSecondaryRoutingScheme="string", - otherAccountSecondaryRoutingAddress="string", - otherBankRoutingScheme=bankRoutingSchemeExample.value, - otherBankRoutingAddress=bankRoutingAddressExample.value, - otherBranchRoutingScheme=branchRoutingSchemeExample.value, - otherBranchRoutingAddress=branchRoutingAddressExample.value, - isBeneficiary=isBeneficiaryExample.value.toBoolean, - bespoke=List( CounterpartyBespoke(key=keyExample.value, - value=valueExample.value))))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - - override def getCounterpartiesLegacy(thisBankId: BankId, thisAccountId: AccountId, viewId: ViewId, callContext: Option[CallContext]): Box[(List[CounterpartyTrait], Option[CallContext])] = { - import com.openbankproject.commons.dto.{InBoundGetCounterpartiesLegacy => InBound, OutBoundGetCounterpartiesLegacy => OutBound} - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, thisBankId, thisAccountId, viewId) - val response: Future[Box[InBound]] = sendRequest[InBound]("get_counterparties_legacy", req, callContext) - response.map(convertToTuple[List[CounterpartyTraitCommons]](callContext)) - } - messageDocs += getCounterpartiesDoc def getCounterpartiesDoc = MessageDoc( process = "obp.getCounterparties", @@ -1231,81 +885,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getCounterparties(thisBankId: BankId, thisAccountId: AccountId, viewId: ViewId, callContext: Option[CallContext]): OBPReturnType[Box[List[CounterpartyTrait]]] = { - import com.openbankproject.commons.dto.{InBoundGetCounterparties => InBound, OutBoundGetCounterparties => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetCounterparties => OutBound, InBoundGetCounterparties => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, thisBankId, thisAccountId, viewId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_counterparties", req, callContext) response.map(convertToTuple[List[CounterpartyTraitCommons]](callContext)) } - messageDocs += getTransactionsLegacyDoc - def getTransactionsLegacyDoc = MessageDoc( - process = "obp.getTransactionsLegacy", - messageFormat = messageFormat, - description = "Get Transactions Legacy", - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundGetTransactionsLegacy(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, - bankId=BankId(bankIdExample.value), - accountID=AccountId(accountIdExample.value), - limit=limitExample.value.toInt, - offset=offsetExample.value.toInt, - fromDate="string", - toDate="string") - ), - exampleInboundMessage = ( - InBoundGetTransactionsLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, - status=MessageDocsSwaggerDefinitions.inboundStatus, - data=List( TransactionCommons(uuid=transactionUuidExample.value, - id=TransactionId(transactionIdExample.value), - thisAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=bankAccountNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=bankAccountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value), - otherAccount= Counterparty(nationalIdentifier=counterpartyNationalIdentifierExample.value, - kind=counterpartyKindExample.value, - counterpartyId=counterpartyIdExample.value, - counterpartyName=counterpartyNameExample.value, - thisBankId=BankId(bankIdExample.value), - thisAccountId=AccountId(accountIdExample.value), - otherBankRoutingScheme=counterpartyOtherBankRoutingSchemeExample.value, - otherBankRoutingAddress=Some(counterpartyOtherBankRoutingAddressExample.value), - otherAccountRoutingScheme=counterpartyOtherAccountRoutingSchemeExample.value, - otherAccountRoutingAddress=Some(counterpartyOtherAccountRoutingAddressExample.value), - otherAccountProvider=counterpartyOtherAccountProviderExample.value, - isBeneficiary=isBeneficiaryExample.value.toBoolean), - transactionType=transactionTypeExample.value, - amount=BigDecimal(transactionAmountExample.value), - currency=currencyExample.value, - description=Some(transactionDescriptionExample.value), - startDate=parseDate(transactionStartDateExample.value).getOrElse(sys.error("transactionStartDateExample.value is not validate date format.")), - finishDate=parseDate(transactionFinishDateExample.value).getOrElse(sys.error("transactionFinishDateExample.value is not validate date format.")), - balance=BigDecimal(balanceAmountExample.value)))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - - override def getTransactionsLegacy(bankId: BankId, accountID: AccountId, callContext: Option[CallContext], queryParams: List[OBPQueryParam]): Box[(List[Transaction], Option[CallContext])] = { - import com.openbankproject.commons.dto.{InBoundGetTransactionsLegacy => InBound, OutBoundGetTransactionsLegacy => OutBound} - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountID, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) - val response: Future[Box[InBound]] = sendRequest[InBound]("get_transactions_legacy", req, callContext) - response.map(convertToTuple[List[TransactionCommons]](callContext)) - } - messageDocs += getTransactionsDoc def getTransactionsDoc = MessageDoc( process = "obp.getTransactions", @@ -1369,7 +954,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getTransactions(bankId: BankId, accountID: AccountId, callContext: Option[CallContext], queryParams: List[OBPQueryParam]): OBPReturnType[Box[List[Transaction]]] = { - import com.openbankproject.commons.dto.{InBoundGetTransactions => InBound, OutBoundGetTransactions => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetTransactions => OutBound, InBoundGetTransactions => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountID, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) val response: Future[Box[InBound]] = sendRequest[InBound]("get_transactions", req, callContext) response.map(convertToTuple[List[TransactionCommons]](callContext)) @@ -1436,78 +1021,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getTransactionsCore(bankId: BankId, accountID: AccountId, queryParams: List[OBPQueryParam], callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionCore]]] = { - import com.openbankproject.commons.dto.{InBoundGetTransactionsCore => InBound, OutBoundGetTransactionsCore => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetTransactionsCore => OutBound, InBoundGetTransactionsCore => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountID, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) val response: Future[Box[InBound]] = sendRequest[InBound]("get_transactions_core", req, callContext) response.map(convertToTuple[List[TransactionCore]](callContext)) } - messageDocs += getTransactionLegacyDoc - def getTransactionLegacyDoc = MessageDoc( - process = "obp.getTransactionLegacy", - messageFormat = messageFormat, - description = "Get Transaction Legacy", - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundGetTransactionLegacy(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, - bankId=BankId(bankIdExample.value), - accountID=AccountId(accountIdExample.value), - transactionId=TransactionId(transactionIdExample.value)) - ), - exampleInboundMessage = ( - InBoundGetTransactionLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, - status=MessageDocsSwaggerDefinitions.inboundStatus, - data= TransactionCommons(uuid=transactionUuidExample.value, - id=TransactionId(transactionIdExample.value), - thisAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=bankAccountNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=bankAccountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value), - otherAccount= Counterparty(nationalIdentifier=counterpartyNationalIdentifierExample.value, - kind=counterpartyKindExample.value, - counterpartyId=counterpartyIdExample.value, - counterpartyName=counterpartyNameExample.value, - thisBankId=BankId(bankIdExample.value), - thisAccountId=AccountId(accountIdExample.value), - otherBankRoutingScheme=counterpartyOtherBankRoutingSchemeExample.value, - otherBankRoutingAddress=Some(counterpartyOtherBankRoutingAddressExample.value), - otherAccountRoutingScheme=counterpartyOtherAccountRoutingSchemeExample.value, - otherAccountRoutingAddress=Some(counterpartyOtherAccountRoutingAddressExample.value), - otherAccountProvider=counterpartyOtherAccountProviderExample.value, - isBeneficiary=isBeneficiaryExample.value.toBoolean), - transactionType=transactionTypeExample.value, - amount=BigDecimal(transactionAmountExample.value), - currency=currencyExample.value, - description=Some(transactionDescriptionExample.value), - startDate=parseDate(transactionStartDateExample.value).getOrElse(sys.error("transactionStartDateExample.value is not validate date format.")), - finishDate=parseDate(transactionFinishDateExample.value).getOrElse(sys.error("transactionFinishDateExample.value is not validate date format.")), - balance=BigDecimal(balanceAmountExample.value))) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - - override def getTransactionLegacy(bankId: BankId, accountID: AccountId, transactionId: TransactionId, callContext: Option[CallContext]): Box[(Transaction, Option[CallContext])] = { - import com.openbankproject.commons.dto.{InBoundGetTransactionLegacy => InBound, OutBoundGetTransactionLegacy => OutBound} - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountID, transactionId) - val response: Future[Box[InBound]] = sendRequest[InBound]("get_transaction_legacy", req, callContext) - response.map(convertToTuple[TransactionCommons](callContext)) - } - messageDocs += getTransactionDoc def getTransactionDoc = MessageDoc( process = "obp.getTransaction", @@ -1568,7 +1087,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getTransaction(bankId: BankId, accountID: AccountId, transactionId: TransactionId, callContext: Option[CallContext]): OBPReturnType[Box[Transaction]] = { - import com.openbankproject.commons.dto.{InBoundGetTransaction => InBound, OutBoundGetTransaction => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetTransaction => OutBound, InBoundGetTransaction => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountID, transactionId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_transaction", req, callContext) response.map(convertToTuple[TransactionCommons](callContext)) @@ -1634,7 +1153,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getPhysicalCardForBank(bankId: BankId, cardId: String, callContext: Option[CallContext]): OBPReturnType[Box[PhysicalCardTrait]] = { - import com.openbankproject.commons.dto.{InBoundGetPhysicalCardForBank => InBound, OutBoundGetPhysicalCardForBank => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetPhysicalCardForBank => OutBound, InBoundGetPhysicalCardForBank => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, cardId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_physical_card_for_bank", req, callContext) response.map(convertToTuple[PhysicalCard](callContext)) @@ -1661,7 +1180,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def deletePhysicalCardForBank(bankId: BankId, cardId: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { - import com.openbankproject.commons.dto.{InBoundDeletePhysicalCardForBank => InBound, OutBoundDeletePhysicalCardForBank => OutBound} + import com.openbankproject.commons.dto.{OutBoundDeletePhysicalCardForBank => OutBound, InBoundDeletePhysicalCardForBank => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, cardId) val response: Future[Box[InBound]] = sendRequest[InBound]("delete_physical_card_for_bank", req, callContext) response.map(convertToTuple[Boolean](callContext)) @@ -1744,98 +1263,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getPhysicalCardsForBank(bank: Bank, user: User, queryParams: List[OBPQueryParam], callContext: Option[CallContext]): OBPReturnType[Box[List[PhysicalCard]]] = { - import com.openbankproject.commons.dto.{InBoundGetPhysicalCardsForBank => InBound, OutBoundGetPhysicalCardsForBank => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetPhysicalCardsForBank => OutBound, InBoundGetPhysicalCardsForBank => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bank, user, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) val response: Future[Box[InBound]] = sendRequest[InBound]("get_physical_cards_for_bank", req, callContext) response.map(convertToTuple[List[PhysicalCard]](callContext)) } - messageDocs += createPhysicalCardLegacyDoc - def createPhysicalCardLegacyDoc = MessageDoc( - process = "obp.createPhysicalCardLegacy", - messageFormat = messageFormat, - description = "Create Physical Card Legacy", - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundCreatePhysicalCardLegacy(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, - bankCardNumber=bankCardNumberExample.value, - nameOnCard=nameOnCardExample.value, - cardType=cardTypeExample.value, - issueNumber=issueNumberExample.value, - serialNumber=serialNumberExample.value, - validFrom=new Date(), - expires=new Date(), - enabled=true, - cancelled=true, - onHotList=true, - technology="string", - networks=List("string"), - allows=List("string"), - accountId=accountIdExample.value, - bankId=bankIdExample.value, - replacement=Some( CardReplacementInfo(requestedDate=new Date(), - reasonRequested=com.openbankproject.commons.model.CardReplacementReason.FIRST)), - pinResets=List( PinResetInfo(requestedDate=new Date(), - reasonRequested=com.openbankproject.commons.model.PinResetReason.FORGOT)), - collected=Some(CardCollectionInfo(new Date())), - posted=Some(CardPostedInfo(new Date())), - customerId=customerIdExample.value) - ), - exampleInboundMessage = ( - InBoundCreatePhysicalCardLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, - status=MessageDocsSwaggerDefinitions.inboundStatus, - data= PhysicalCard(cardId=cardIdExample.value, - bankId=bankIdExample.value, - bankCardNumber=bankCardNumberExample.value, - cardType=cardTypeExample.value, - nameOnCard=nameOnCardExample.value, - issueNumber=issueNumberExample.value, - serialNumber=serialNumberExample.value, - validFrom=new Date(), - expires=new Date(), - enabled=true, - cancelled=true, - onHotList=true, - technology="string", - networks=List("string"), - allows=List(com.openbankproject.commons.model.CardAction.DEBIT), - account= BankAccountCommons(accountId=AccountId(accountIdExample.value), - accountType=accountTypeExample.value, - balance=BigDecimal(balanceAmountExample.value), - currency=currencyExample.value, - name=bankAccountNameExample.value, - label=labelExample.value, - iban=Some(ibanExample.value), - number=accountNumberExample.value, - bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), - branchId=branchIdExample.value, - accountRoutingScheme=accountRoutingSchemeExample.value, - accountRoutingAddress=accountRoutingAddressExample.value, - accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, - address=accountRoutingAddressExample.value)), - accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, - value=accountRuleValueExample.value)), - accountHolder=bankAccountAccountHolderExample.value), - replacement=Some( CardReplacementInfo(requestedDate=new Date(), - reasonRequested=com.openbankproject.commons.model.CardReplacementReason.FIRST)), - pinResets=List( PinResetInfo(requestedDate=new Date(), - reasonRequested=com.openbankproject.commons.model.PinResetReason.FORGOT)), - collected=Some(CardCollectionInfo(new Date())), - posted=Some(CardPostedInfo(new Date())), - customerId=customerIdExample.value)) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - - override def createPhysicalCardLegacy(bankCardNumber: String, nameOnCard: String, cardType: String, issueNumber: String, serialNumber: String, validFrom: Date, expires: Date, enabled: Boolean, cancelled: Boolean, onHotList: Boolean, technology: String, networks: List[String], allows: List[String], accountId: String, bankId: String, replacement: Option[CardReplacementInfo], pinResets: List[PinResetInfo], collected: Option[CardCollectionInfo], posted: Option[CardPostedInfo], customerId: String, callContext: Option[CallContext]): Box[PhysicalCard] = { - import com.openbankproject.commons.dto.{InBoundCreatePhysicalCardLegacy => InBound, OutBoundCreatePhysicalCardLegacy => OutBound} - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankCardNumber, nameOnCard, cardType, issueNumber, serialNumber, validFrom, expires, enabled, cancelled, onHotList, technology, networks, allows, accountId, bankId, replacement, pinResets, collected, posted, customerId) - val response: Future[Box[InBound]] = sendRequest[InBound]("create_physical_card_legacy", req, callContext) - response.map(convertToTuple[PhysicalCard](callContext)) - } - messageDocs += createPhysicalCardDoc def createPhysicalCardDoc = MessageDoc( process = "obp.createPhysicalCard", @@ -1916,7 +1349,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createPhysicalCard(bankCardNumber: String, nameOnCard: String, cardType: String, issueNumber: String, serialNumber: String, validFrom: Date, expires: Date, enabled: Boolean, cancelled: Boolean, onHotList: Boolean, technology: String, networks: List[String], allows: List[String], accountId: String, bankId: String, replacement: Option[CardReplacementInfo], pinResets: List[PinResetInfo], collected: Option[CardCollectionInfo], posted: Option[CardPostedInfo], customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[PhysicalCard]] = { - import com.openbankproject.commons.dto.{InBoundCreatePhysicalCard => InBound, OutBoundCreatePhysicalCard => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreatePhysicalCard => OutBound, InBoundCreatePhysicalCard => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankCardNumber, nameOnCard, cardType, issueNumber, serialNumber, validFrom, expires, enabled, cancelled, onHotList, technology, networks, allows, accountId, bankId, replacement, pinResets, collected, posted, customerId) val response: Future[Box[InBound]] = sendRequest[InBound]("create_physical_card", req, callContext) response.map(convertToTuple[PhysicalCard](callContext)) @@ -2003,7 +1436,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def updatePhysicalCard(cardId: String, bankCardNumber: String, nameOnCard: String, cardType: String, issueNumber: String, serialNumber: String, validFrom: Date, expires: Date, enabled: Boolean, cancelled: Boolean, onHotList: Boolean, technology: String, networks: List[String], allows: List[String], accountId: String, bankId: String, replacement: Option[CardReplacementInfo], pinResets: List[PinResetInfo], collected: Option[CardCollectionInfo], posted: Option[CardPostedInfo], customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[PhysicalCardTrait]] = { - import com.openbankproject.commons.dto.{InBoundUpdatePhysicalCard => InBound, OutBoundUpdatePhysicalCard => OutBound} + import com.openbankproject.commons.dto.{OutBoundUpdatePhysicalCard => OutBound, InBoundUpdatePhysicalCard => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, cardId, bankCardNumber, nameOnCard, cardType, issueNumber, serialNumber, validFrom, expires, enabled, cancelled, onHotList, technology, networks, allows, accountId, bankId, replacement, pinResets, collected, posted, customerId) val response: Future[Box[InBound]] = sendRequest[InBound]("update_physical_card", req, callContext) response.map(convertToTuple[PhysicalCard](callContext)) @@ -2071,7 +1504,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def makePaymentv210(fromAccount: BankAccount, toAccount: BankAccount, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, amount: BigDecimal, description: String, transactionRequestType: TransactionRequestType, chargePolicy: String, callContext: Option[CallContext]): OBPReturnType[Box[TransactionId]] = { - import com.openbankproject.commons.dto.{InBoundMakePaymentv210 => InBound, OutBoundMakePaymentv210 => OutBound} + import com.openbankproject.commons.dto.{OutBoundMakePaymentv210 => OutBound, InBoundMakePaymentv210 => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, fromAccount, toAccount, transactionRequestCommonBody, amount, description, transactionRequestType, chargePolicy) val response: Future[Box[InBound]] = sendRequest[InBound]("make_paymentv210", req, callContext) response.map(convertToTuple[TransactionId](callContext)) @@ -2212,7 +1645,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createTransactionRequestv210(initiator: User, viewId: ViewId, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, detailsPlain: String, chargePolicy: String, challengeType: Option[String], scaMethod: Option[StrongCustomerAuthentication.SCA], callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = { - import com.openbankproject.commons.dto.{InBoundCreateTransactionRequestv210 => InBound, OutBoundCreateTransactionRequestv210 => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateTransactionRequestv210 => OutBound, InBoundCreateTransactionRequestv210 => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, viewId, fromAccount, toAccount, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy, challengeType, scaMethod) val response: Future[Box[InBound]] = sendRequest[InBound]("create_transaction_requestv210", req, callContext) response.map(convertToTuple[TransactionRequest](callContext)) @@ -2353,7 +1786,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createTransactionRequestv400(initiator: User, viewId: ViewId, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, detailsPlain: String, chargePolicy: String, challengeType: Option[String], scaMethod: Option[StrongCustomerAuthentication.SCA], callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = { - import com.openbankproject.commons.dto.{InBoundCreateTransactionRequestv400 => InBound, OutBoundCreateTransactionRequestv400 => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateTransactionRequestv400 => OutBound, InBoundCreateTransactionRequestv400 => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, viewId, fromAccount, toAccount, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy, challengeType, scaMethod) val response: Future[Box[InBound]] = sendRequest[InBound]("create_transaction_requestv400", req, callContext) response.map(convertToTuple[TransactionRequest](callContext)) @@ -2467,7 +1900,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getTransactionRequests210(initiator: User, fromAccount: BankAccount, callContext: Option[CallContext]): Box[(List[TransactionRequest], Option[CallContext])] = { - import com.openbankproject.commons.dto.{InBoundGetTransactionRequests210 => InBound, OutBoundGetTransactionRequests210 => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetTransactionRequests210 => OutBound, InBoundGetTransactionRequests210 => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, fromAccount) val response: Future[Box[InBound]] = sendRequest[InBound]("get_transaction_requests210", req, callContext) response.map(convertToTuple[List[TransactionRequest]](callContext)) @@ -2558,7 +1991,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getTransactionRequestImpl(transactionRequestId: TransactionRequestId, callContext: Option[CallContext]): Box[(TransactionRequest, Option[CallContext])] = { - import com.openbankproject.commons.dto.{InBoundGetTransactionRequestImpl => InBound, OutBoundGetTransactionRequestImpl => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetTransactionRequestImpl => OutBound, InBoundGetTransactionRequestImpl => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, transactionRequestId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_transaction_request_impl", req, callContext) response.map(convertToTuple[TransactionRequest](callContext)) @@ -2732,7 +2165,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createTransactionAfterChallengeV210(fromAccount: BankAccount, transactionRequest: TransactionRequest, callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = { - import com.openbankproject.commons.dto.{InBoundCreateTransactionAfterChallengeV210 => InBound, OutBoundCreateTransactionAfterChallengeV210 => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateTransactionAfterChallengeV210 => OutBound, InBoundCreateTransactionAfterChallengeV210 => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, fromAccount, transactionRequest) val response: Future[Box[InBound]] = sendRequest[InBound]("create_transaction_after_challenge_v210", req, callContext) response.map(convertToTuple[TransactionRequest](callContext)) @@ -2781,7 +2214,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def updateBankAccount(bankId: BankId, accountId: AccountId, accountType: String, accountLabel: String, branchId: String, accountRoutingScheme: String, accountRoutingAddress: String, callContext: Option[CallContext]): OBPReturnType[Box[BankAccount]] = { - import com.openbankproject.commons.dto.{InBoundUpdateBankAccount => InBound, OutBoundUpdateBankAccount => OutBound} + import com.openbankproject.commons.dto.{OutBoundUpdateBankAccount => OutBound, InBoundUpdateBankAccount => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, accountType, accountLabel, branchId, accountRoutingScheme, accountRoutingAddress) val response: Future[Box[InBound]] = sendRequest[InBound]("update_bank_account", req, callContext) response.map(convertToTuple[BankAccountCommons](callContext)) @@ -2833,7 +2266,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createBankAccount(bankId: BankId, accountId: AccountId, accountType: String, accountLabel: String, currency: String, initialBalance: BigDecimal, accountHolderName: String, branchId: String, accountRoutingScheme: String, accountRoutingAddress: String, callContext: Option[CallContext]): OBPReturnType[Box[BankAccount]] = { - import com.openbankproject.commons.dto.{InBoundCreateBankAccount => InBound, OutBoundCreateBankAccount => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateBankAccount => OutBound, InBoundCreateBankAccount => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, accountType, accountLabel, currency, initialBalance, accountHolderName, branchId, accountRoutingScheme, accountRoutingAddress) val response: Future[Box[InBound]] = sendRequest[InBound]("create_bank_account", req, callContext) response.map(convertToTuple[BankAccountCommons](callContext)) @@ -2858,7 +2291,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def accountExists(bankId: BankId, accountNumber: String): Box[Boolean] = { - import com.openbankproject.commons.dto.{InBoundAccountExists => InBound, OutBoundAccountExists => OutBound} + import com.openbankproject.commons.dto.{OutBoundAccountExists => OutBound, InBoundAccountExists => InBound} val callContext: Option[CallContext] = None val req = OutBound(bankId, accountNumber) val response: Future[Box[InBound]] = sendRequest[InBound]("account_exists", req, callContext) @@ -2942,7 +2375,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getBranch(bankId: BankId, branchId: BranchId, callContext: Option[CallContext]): Future[Box[(BranchT, Option[CallContext])]] = { - import com.openbankproject.commons.dto.{InBoundGetBranch => InBound, OutBoundGetBranch => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetBranch => OutBound, InBoundGetBranch => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, branchId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_branch", req, callContext) response.map(convertToTuple[BranchTCommons](callContext)) @@ -3028,7 +2461,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getBranches(bankId: BankId, callContext: Option[CallContext], queryParams: List[OBPQueryParam]): Future[Box[(List[BranchT], Option[CallContext])]] = { - import com.openbankproject.commons.dto.{InBoundGetBranches => InBound, OutBoundGetBranches => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetBranches => OutBound, InBoundGetBranches => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) val response: Future[Box[InBound]] = sendRequest[InBound]("get_branches", req, callContext) response.map(convertToTuple[List[BranchTCommons]](callContext)) @@ -3091,7 +2524,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getAtm(bankId: BankId, atmId: AtmId, callContext: Option[CallContext]): Future[Box[(AtmT, Option[CallContext])]] = { - import com.openbankproject.commons.dto.{InBoundGetAtm => InBound, OutBoundGetAtm => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetAtm => OutBound, InBoundGetAtm => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, atmId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_atm", req, callContext) response.map(convertToTuple[AtmTCommons](callContext)) @@ -3157,7 +2590,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getAtms(bankId: BankId, callContext: Option[CallContext], queryParams: List[OBPQueryParam]): Future[Box[(List[AtmT], Option[CallContext])]] = { - import com.openbankproject.commons.dto.{InBoundGetAtms => InBound, OutBoundGetAtms => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetAtms => OutBound, InBoundGetAtms => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) val response: Future[Box[InBound]] = sendRequest[InBound]("get_atms", req, callContext) response.map(convertToTuple[List[AtmTCommons]](callContext)) @@ -3273,7 +2706,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createTransactionAfterChallengev300(initiator: User, fromAccount: BankAccount, transReqId: TransactionRequestId, transactionRequestType: TransactionRequestType, callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = { - import com.openbankproject.commons.dto.{InBoundCreateTransactionAfterChallengev300 => InBound, OutBoundCreateTransactionAfterChallengev300 => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateTransactionAfterChallengev300 => OutBound, InBoundCreateTransactionAfterChallengev300 => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, fromAccount, transReqId, transactionRequestType) val response: Future[Box[InBound]] = sendRequest[InBound]("create_transaction_after_challengev300", req, callContext) response.map(convertToTuple[TransactionRequest](callContext)) @@ -3363,7 +2796,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def makePaymentv300(initiator: User, fromAccount: BankAccount, toAccount: BankAccount, toCounterparty: CounterpartyTrait, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, transactionRequestType: TransactionRequestType, chargePolicy: String, callContext: Option[CallContext]): Future[Box[(TransactionId, Option[CallContext])]] = { - import com.openbankproject.commons.dto.{InBoundMakePaymentv300 => InBound, OutBoundMakePaymentv300 => OutBound} + import com.openbankproject.commons.dto.{OutBoundMakePaymentv300 => OutBound, InBoundMakePaymentv300 => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, fromAccount, toAccount, toCounterparty, transactionRequestCommonBody, transactionRequestType, chargePolicy) val response: Future[Box[InBound]] = sendRequest[InBound]("make_paymentv300", req, callContext) response.map(convertToTuple[TransactionId](callContext)) @@ -3520,7 +2953,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createTransactionRequestv300(initiator: User, viewId: ViewId, fromAccount: BankAccount, toAccount: BankAccount, toCounterparty: CounterpartyTrait, transactionRequestType: TransactionRequestType, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, detailsPlain: String, chargePolicy: String, callContext: Option[CallContext]): Future[Box[(TransactionRequest, Option[CallContext])]] = { - import com.openbankproject.commons.dto.{InBoundCreateTransactionRequestv300 => InBound, OutBoundCreateTransactionRequestv300 => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateTransactionRequestv300 => OutBound, InBoundCreateTransactionRequestv300 => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, viewId, fromAccount, toAccount, toCounterparty, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy) val response: Future[Box[InBound]] = sendRequest[InBound]("create_transaction_requestv300", req, callContext) response.map(convertToTuple[TransactionRequest](callContext)) @@ -3579,7 +3012,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createCounterparty(name: String, description: String, createdByUserId: String, thisBankId: String, thisAccountId: String, thisViewId: String, otherAccountRoutingScheme: String, otherAccountRoutingAddress: String, otherAccountSecondaryRoutingScheme: String, otherAccountSecondaryRoutingAddress: String, otherBankRoutingScheme: String, otherBankRoutingAddress: String, otherBranchRoutingScheme: String, otherBranchRoutingAddress: String, isBeneficiary: Boolean, bespoke: List[CounterpartyBespoke], callContext: Option[CallContext]): Box[(CounterpartyTrait, Option[CallContext])] = { - import com.openbankproject.commons.dto.{InBoundCreateCounterparty => InBound, OutBoundCreateCounterparty => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateCounterparty => OutBound, InBoundCreateCounterparty => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, name, description, createdByUserId, thisBankId, thisAccountId, thisViewId, otherAccountRoutingScheme, otherAccountRoutingAddress, otherAccountSecondaryRoutingScheme, otherAccountSecondaryRoutingAddress, otherBankRoutingScheme, otherBankRoutingAddress, otherBranchRoutingScheme, otherBranchRoutingAddress, isBeneficiary, bespoke) val response: Future[Box[InBound]] = sendRequest[InBound]("create_counterparty", req, callContext) response.map(convertToTuple[CounterpartyTraitCommons](callContext)) @@ -3606,7 +3039,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def checkCustomerNumberAvailable(bankId: BankId, customerNumber: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { - import com.openbankproject.commons.dto.{InBoundCheckCustomerNumberAvailable => InBound, OutBoundCheckCustomerNumberAvailable => OutBound} + import com.openbankproject.commons.dto.{OutBoundCheckCustomerNumberAvailable => OutBound, InBoundCheckCustomerNumberAvailable => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, customerNumber) val response: Future[Box[InBound]] = sendRequest[InBound]("check_customer_number_available", req, callContext) response.map(convertToTuple[Boolean](callContext)) @@ -3674,7 +3107,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createCustomer(bankId: BankId, legalName: String, mobileNumber: String, email: String, faceImage: CustomerFaceImageTrait, dateOfBirth: Date, relationshipStatus: String, dependents: Int, dobOfDependents: List[Date], highestEducationAttained: String, employmentStatus: String, kycStatus: Boolean, lastOkDate: Date, creditRating: Option[CreditRatingTrait], creditLimit: Option[AmountOfMoneyTrait], title: String, branchId: String, nameSuffix: String, callContext: Option[CallContext]): OBPReturnType[Box[Customer]] = { - import com.openbankproject.commons.dto.{InBoundCreateCustomer => InBound, OutBoundCreateCustomer => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateCustomer => OutBound, InBoundCreateCustomer => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, legalName, mobileNumber, email, faceImage, dateOfBirth, relationshipStatus, dependents, dobOfDependents, highestEducationAttained, employmentStatus, kycStatus, lastOkDate, creditRating, creditLimit, title, branchId, nameSuffix) val response: Future[Box[InBound]] = sendRequest[InBound]("create_customer", req, callContext) response.map(convertToTuple[CustomerCommons](callContext)) @@ -3725,7 +3158,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def updateCustomerScaData(customerId: String, mobileNumber: Option[String], email: Option[String], customerNumber: Option[String], callContext: Option[CallContext]): OBPReturnType[Box[Customer]] = { - import com.openbankproject.commons.dto.{InBoundUpdateCustomerScaData => InBound, OutBoundUpdateCustomerScaData => OutBound} + import com.openbankproject.commons.dto.{OutBoundUpdateCustomerScaData => OutBound, InBoundUpdateCustomerScaData => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId, mobileNumber, email, customerNumber) val response: Future[Box[InBound]] = sendRequest[InBound]("update_customer_sca_data", req, callContext) response.map(convertToTuple[CustomerCommons](callContext)) @@ -3777,7 +3210,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def updateCustomerCreditData(customerId: String, creditRating: Option[String], creditSource: Option[String], creditLimit: Option[AmountOfMoney], callContext: Option[CallContext]): OBPReturnType[Box[Customer]] = { - import com.openbankproject.commons.dto.{InBoundUpdateCustomerCreditData => InBound, OutBoundUpdateCustomerCreditData => OutBound} + import com.openbankproject.commons.dto.{OutBoundUpdateCustomerCreditData => OutBound, InBoundUpdateCustomerCreditData => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId, creditRating, creditSource, creditLimit) val response: Future[Box[InBound]] = sendRequest[InBound]("update_customer_credit_data", req, callContext) response.map(convertToTuple[CustomerCommons](callContext)) @@ -3836,7 +3269,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def updateCustomerGeneralData(customerId: String, legalName: Option[String], faceImage: Option[CustomerFaceImageTrait], dateOfBirth: Option[Date], relationshipStatus: Option[String], dependents: Option[Int], highestEducationAttained: Option[String], employmentStatus: Option[String], title: Option[String], branchId: Option[String], nameSuffix: Option[String], callContext: Option[CallContext]): OBPReturnType[Box[Customer]] = { - import com.openbankproject.commons.dto.{InBoundUpdateCustomerGeneralData => InBound, OutBoundUpdateCustomerGeneralData => OutBound} + import com.openbankproject.commons.dto.{OutBoundUpdateCustomerGeneralData => OutBound, InBoundUpdateCustomerGeneralData => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId, legalName, faceImage, dateOfBirth, relationshipStatus, dependents, highestEducationAttained, employmentStatus, title, branchId, nameSuffix) val response: Future[Box[InBound]] = sendRequest[InBound]("update_customer_general_data", req, callContext) response.map(convertToTuple[CustomerCommons](callContext)) @@ -3884,60 +3317,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getCustomersByUserId(userId: String, callContext: Option[CallContext]): Future[Box[(List[Customer], Option[CallContext])]] = { - import com.openbankproject.commons.dto.{InBoundGetCustomersByUserId => InBound, OutBoundGetCustomersByUserId => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetCustomersByUserId => OutBound, InBoundGetCustomersByUserId => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, userId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_customers_by_user_id", req, callContext) response.map(convertToTuple[List[CustomerCommons]](callContext)) } - messageDocs += getCustomerByCustomerIdLegacyDoc - def getCustomerByCustomerIdLegacyDoc = MessageDoc( - process = "obp.getCustomerByCustomerIdLegacy", - messageFormat = messageFormat, - description = "Get Customer By Customer Id Legacy", - outboundTopic = None, - inboundTopic = None, - exampleOutboundMessage = ( - OutBoundGetCustomerByCustomerIdLegacy(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, - customerId=customerIdExample.value) - ), - exampleInboundMessage = ( - InBoundGetCustomerByCustomerIdLegacy(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, - status=MessageDocsSwaggerDefinitions.inboundStatus, - data= CustomerCommons(customerId=customerIdExample.value, - bankId=bankIdExample.value, - number=customerNumberExample.value, - legalName=legalNameExample.value, - mobileNumber=mobileNumberExample.value, - email=emailExample.value, - faceImage= CustomerFaceImage(date=parseDate(customerFaceImageDateExample.value).getOrElse(sys.error("customerFaceImageDateExample.value is not validate date format.")), - url=urlExample.value), - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")), - relationshipStatus=relationshipStatusExample.value, - dependents=dependentsExample.value.toInt, - dobOfDependents=dobOfDependentsExample.value.split("[,;]").map(parseDate).flatMap(_.toSeq).toList, - highestEducationAttained=highestEducationAttainedExample.value, - employmentStatus=employmentStatusExample.value, - creditRating= CreditRating(rating=ratingExample.value, - source=sourceExample.value), - creditLimit= CreditLimit(currency=currencyExample.value, - amount=creditLimitAmountExample.value), - kycStatus=kycStatusExample.value.toBoolean, - lastOkDate=parseDate(customerLastOkDateExample.value).getOrElse(sys.error("customerLastOkDateExample.value is not validate date format.")), - title=customerTitleExample.value, - branchId=branchIdExample.value, - nameSuffix=nameSuffixExample.value)) - ), - adapterImplementation = Some(AdapterImplementation("- Core", 1)) - ) - - override def getCustomerByCustomerIdLegacy(customerId: String, callContext: Option[CallContext]): Box[(Customer, Option[CallContext])] = { - import com.openbankproject.commons.dto.{InBoundGetCustomerByCustomerIdLegacy => InBound, OutBoundGetCustomerByCustomerIdLegacy => OutBound} - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId) - val response: Future[Box[InBound]] = sendRequest[InBound]("get_customer_by_customer_id_legacy", req, callContext) - response.map(convertToTuple[CustomerCommons](callContext)) - } - messageDocs += getCustomerByCustomerIdDoc def getCustomerByCustomerIdDoc = MessageDoc( process = "obp.getCustomerByCustomerId", @@ -3980,7 +3365,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getCustomerByCustomerId(customerId: String, callContext: Option[CallContext]): Future[Box[(Customer, Option[CallContext])]] = { - import com.openbankproject.commons.dto.{InBoundGetCustomerByCustomerId => InBound, OutBoundGetCustomerByCustomerId => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetCustomerByCustomerId => OutBound, InBoundGetCustomerByCustomerId => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_customer_by_customer_id", req, callContext) response.map(convertToTuple[CustomerCommons](callContext)) @@ -4029,7 +3414,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getCustomerByCustomerNumber(customerNumber: String, bankId: BankId, callContext: Option[CallContext]): Future[Box[(Customer, Option[CallContext])]] = { - import com.openbankproject.commons.dto.{InBoundGetCustomerByCustomerNumber => InBound, OutBoundGetCustomerByCustomerNumber => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetCustomerByCustomerNumber => OutBound, InBoundGetCustomerByCustomerNumber => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerNumber, bankId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_customer_by_customer_number", req, callContext) response.map(convertToTuple[CustomerCommons](callContext)) @@ -4067,7 +3452,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getCustomerAddress(customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[CustomerAddress]]] = { - import com.openbankproject.commons.dto.{InBoundGetCustomerAddress => InBound, OutBoundGetCustomerAddress => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetCustomerAddress => OutBound, InBoundGetCustomerAddress => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_customer_address", req, callContext) response.map(convertToTuple[List[CustomerAddressCommons]](callContext)) @@ -4115,7 +3500,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createCustomerAddress(customerId: String, line1: String, line2: String, line3: String, city: String, county: String, state: String, postcode: String, countryCode: String, tags: String, status: String, callContext: Option[CallContext]): OBPReturnType[Box[CustomerAddress]] = { - import com.openbankproject.commons.dto.{InBoundCreateCustomerAddress => InBound, OutBoundCreateCustomerAddress => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateCustomerAddress => OutBound, InBoundCreateCustomerAddress => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId, line1, line2, line3, city, county, state, postcode, countryCode, tags, status) val response: Future[Box[InBound]] = sendRequest[InBound]("create_customer_address", req, callContext) response.map(convertToTuple[CustomerAddressCommons](callContext)) @@ -4163,7 +3548,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def updateCustomerAddress(customerAddressId: String, line1: String, line2: String, line3: String, city: String, county: String, state: String, postcode: String, countryCode: String, tags: String, status: String, callContext: Option[CallContext]): OBPReturnType[Box[CustomerAddress]] = { - import com.openbankproject.commons.dto.{InBoundUpdateCustomerAddress => InBound, OutBoundUpdateCustomerAddress => OutBound} + import com.openbankproject.commons.dto.{OutBoundUpdateCustomerAddress => OutBound, InBoundUpdateCustomerAddress => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerAddressId, line1, line2, line3, city, county, state, postcode, countryCode, tags, status) val response: Future[Box[InBound]] = sendRequest[InBound]("update_customer_address", req, callContext) response.map(convertToTuple[CustomerAddressCommons](callContext)) @@ -4189,7 +3574,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def deleteCustomerAddress(customerAddressId: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { - import com.openbankproject.commons.dto.{InBoundDeleteCustomerAddress => InBound, OutBoundDeleteCustomerAddress => OutBound} + import com.openbankproject.commons.dto.{OutBoundDeleteCustomerAddress => OutBound, InBoundDeleteCustomerAddress => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerAddressId) val response: Future[Box[InBound]] = sendRequest[InBound]("delete_customer_address", req, callContext) response.map(convertToTuple[Boolean](callContext)) @@ -4220,7 +3605,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createTaxResidence(customerId: String, domain: String, taxNumber: String, callContext: Option[CallContext]): OBPReturnType[Box[TaxResidence]] = { - import com.openbankproject.commons.dto.{InBoundCreateTaxResidence => InBound, OutBoundCreateTaxResidence => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateTaxResidence => OutBound, InBoundCreateTaxResidence => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId, domain, taxNumber) val response: Future[Box[InBound]] = sendRequest[InBound]("create_tax_residence", req, callContext) response.map(convertToTuple[TaxResidenceCommons](callContext)) @@ -4249,7 +3634,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getTaxResidence(customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[TaxResidence]]] = { - import com.openbankproject.commons.dto.{InBoundGetTaxResidence => InBound, OutBoundGetTaxResidence => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetTaxResidence => OutBound, InBoundGetTaxResidence => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_tax_residence", req, callContext) response.map(convertToTuple[List[TaxResidenceCommons]](callContext)) @@ -4275,7 +3660,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def deleteTaxResidence(taxResourceId: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { - import com.openbankproject.commons.dto.{InBoundDeleteTaxResidence => InBound, OutBoundDeleteTaxResidence => OutBound} + import com.openbankproject.commons.dto.{OutBoundDeleteTaxResidence => OutBound, InBoundDeleteTaxResidence => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, taxResourceId) val response: Future[Box[InBound]] = sendRequest[InBound]("delete_tax_residence", req, callContext) response.map(convertToTuple[Boolean](callContext)) @@ -4327,7 +3712,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getCustomers(bankId: BankId, callContext: Option[CallContext], queryParams: List[OBPQueryParam]): Future[Box[List[Customer]]] = { - import com.openbankproject.commons.dto.{InBoundGetCustomers => InBound, OutBoundGetCustomers => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetCustomers => OutBound, InBoundGetCustomers => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) val response: Future[Box[InBound]] = sendRequest[InBound]("get_customers", req, callContext) response.map(convertToTuple[List[CustomerCommons]](callContext)) @@ -4376,7 +3761,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getCustomersByCustomerPhoneNumber(bankId: BankId, phoneNumber: String, callContext: Option[CallContext]): OBPReturnType[Box[List[Customer]]] = { - import com.openbankproject.commons.dto.{InBoundGetCustomersByCustomerPhoneNumber => InBound, OutBoundGetCustomersByCustomerPhoneNumber => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetCustomersByCustomerPhoneNumber => OutBound, InBoundGetCustomersByCustomerPhoneNumber => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, phoneNumber) val response: Future[Box[InBound]] = sendRequest[InBound]("get_customers_by_customer_phone_number", req, callContext) response.map(convertToTuple[List[CustomerCommons]](callContext)) @@ -4416,7 +3801,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getCheckbookOrders(bankId: String, accountId: String, callContext: Option[CallContext]): Future[Box[(CheckbookOrdersJson, Option[CallContext])]] = { - import com.openbankproject.commons.dto.{InBoundGetCheckbookOrders => InBound, OutBoundGetCheckbookOrders => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetCheckbookOrders => OutBound, InBoundGetCheckbookOrders => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_checkbook_orders", req, callContext) response.map(convertToTuple[CheckbookOrdersJson](callContext)) @@ -4445,7 +3830,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getStatusOfCreditCardOrder(bankId: String, accountId: String, callContext: Option[CallContext]): Future[Box[(List[CardObjectJson], Option[CallContext])]] = { - import com.openbankproject.commons.dto.{InBoundGetStatusOfCreditCardOrder => InBound, OutBoundGetStatusOfCreditCardOrder => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetStatusOfCreditCardOrder => OutBound, InBoundGetStatusOfCreditCardOrder => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_status_of_credit_card_order", req, callContext) response.map(convertToTuple[List[CardObjectJson]](callContext)) @@ -4476,7 +3861,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createUserAuthContext(userId: String, key: String, value: String, callContext: Option[CallContext]): OBPReturnType[Box[UserAuthContext]] = { - import com.openbankproject.commons.dto.{InBoundCreateUserAuthContext => InBound, OutBoundCreateUserAuthContext => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateUserAuthContext => OutBound, InBoundCreateUserAuthContext => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, userId, key, value) val response: Future[Box[InBound]] = sendRequest[InBound]("create_user_auth_context", req, callContext) response.map(convertToTuple[UserAuthContextCommons](callContext)) @@ -4509,7 +3894,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createUserAuthContextUpdate(userId: String, key: String, value: String, callContext: Option[CallContext]): OBPReturnType[Box[UserAuthContextUpdate]] = { - import com.openbankproject.commons.dto.{InBoundCreateUserAuthContextUpdate => InBound, OutBoundCreateUserAuthContextUpdate => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateUserAuthContextUpdate => OutBound, InBoundCreateUserAuthContextUpdate => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, userId, key, value) val response: Future[Box[InBound]] = sendRequest[InBound]("create_user_auth_context_update", req, callContext) response.map(convertToTuple[UserAuthContextUpdateCommons](callContext)) @@ -4535,7 +3920,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def deleteUserAuthContexts(userId: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { - import com.openbankproject.commons.dto.{InBoundDeleteUserAuthContexts => InBound, OutBoundDeleteUserAuthContexts => OutBound} + import com.openbankproject.commons.dto.{OutBoundDeleteUserAuthContexts => OutBound, InBoundDeleteUserAuthContexts => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, userId) val response: Future[Box[InBound]] = sendRequest[InBound]("delete_user_auth_contexts", req, callContext) response.map(convertToTuple[Boolean](callContext)) @@ -4561,7 +3946,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def deleteUserAuthContextById(userAuthContextId: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { - import com.openbankproject.commons.dto.{InBoundDeleteUserAuthContextById => InBound, OutBoundDeleteUserAuthContextById => OutBound} + import com.openbankproject.commons.dto.{OutBoundDeleteUserAuthContextById => OutBound, InBoundDeleteUserAuthContextById => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, userAuthContextId) val response: Future[Box[InBound]] = sendRequest[InBound]("delete_user_auth_context_by_id", req, callContext) response.map(convertToTuple[Boolean](callContext)) @@ -4590,7 +3975,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getUserAuthContexts(userId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[UserAuthContext]]] = { - import com.openbankproject.commons.dto.{InBoundGetUserAuthContexts => InBound, OutBoundGetUserAuthContexts => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetUserAuthContexts => OutBound, InBoundGetUserAuthContexts => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, userId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_user_auth_contexts", req, callContext) response.map(convertToTuple[List[UserAuthContextCommons]](callContext)) @@ -4626,7 +4011,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createOrUpdateProductAttribute(bankId: BankId, productCode: ProductCode, productAttributeId: Option[String], name: String, productAttributeType: ProductAttributeType.Value, value: String, callContext: Option[CallContext]): OBPReturnType[Box[ProductAttribute]] = { - import com.openbankproject.commons.dto.{InBoundCreateOrUpdateProductAttribute => InBound, OutBoundCreateOrUpdateProductAttribute => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateProductAttribute => OutBound, InBoundCreateOrUpdateProductAttribute => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, productCode, productAttributeId, name, productAttributeType, value) val response: Future[Box[InBound]] = sendRequest[InBound]("create_or_update_product_attribute", req, callContext) response.map(convertToTuple[ProductAttributeCommons](callContext)) @@ -4657,7 +4042,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getProductAttributeById(productAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[ProductAttribute]] = { - import com.openbankproject.commons.dto.{InBoundGetProductAttributeById => InBound, OutBoundGetProductAttributeById => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetProductAttributeById => OutBound, InBoundGetProductAttributeById => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, productAttributeId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_product_attribute_by_id", req, callContext) response.map(convertToTuple[ProductAttributeCommons](callContext)) @@ -4689,7 +4074,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getProductAttributesByBankAndCode(bank: BankId, productCode: ProductCode, callContext: Option[CallContext]): OBPReturnType[Box[List[ProductAttribute]]] = { - import com.openbankproject.commons.dto.{InBoundGetProductAttributesByBankAndCode => InBound, OutBoundGetProductAttributesByBankAndCode => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetProductAttributesByBankAndCode => OutBound, InBoundGetProductAttributesByBankAndCode => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bank, productCode) val response: Future[Box[InBound]] = sendRequest[InBound]("get_product_attributes_by_bank_and_code", req, callContext) response.map(convertToTuple[List[ProductAttributeCommons]](callContext)) @@ -4715,7 +4100,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def deleteProductAttribute(productAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { - import com.openbankproject.commons.dto.{InBoundDeleteProductAttribute => InBound, OutBoundDeleteProductAttribute => OutBound} + import com.openbankproject.commons.dto.{OutBoundDeleteProductAttribute => OutBound, InBoundDeleteProductAttribute => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, productAttributeId) val response: Future[Box[InBound]] = sendRequest[InBound]("delete_product_attribute", req, callContext) response.map(convertToTuple[Boolean](callContext)) @@ -4747,7 +4132,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getAccountAttributeById(accountAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[AccountAttribute]] = { - import com.openbankproject.commons.dto.{InBoundGetAccountAttributeById => InBound, OutBoundGetAccountAttributeById => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetAccountAttributeById => OutBound, InBoundGetAccountAttributeById => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, accountAttributeId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_account_attribute_by_id", req, callContext) response.map(convertToTuple[AccountAttributeCommons](callContext)) @@ -4778,7 +4163,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getTransactionAttributeById(transactionAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[TransactionAttribute]] = { - import com.openbankproject.commons.dto.{InBoundGetTransactionAttributeById => InBound, OutBoundGetTransactionAttributeById => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetTransactionAttributeById => OutBound, InBoundGetTransactionAttributeById => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, transactionAttributeId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_transaction_attribute_by_id", req, callContext) response.map(convertToTuple[TransactionAttributeCommons](callContext)) @@ -4816,7 +4201,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createOrUpdateAccountAttribute(bankId: BankId, accountId: AccountId, productCode: ProductCode, productAttributeId: Option[String], name: String, accountAttributeType: AccountAttributeType.Value, value: String, callContext: Option[CallContext]): OBPReturnType[Box[AccountAttribute]] = { - import com.openbankproject.commons.dto.{InBoundCreateOrUpdateAccountAttribute => InBound, OutBoundCreateOrUpdateAccountAttribute => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateAccountAttribute => OutBound, InBoundCreateOrUpdateAccountAttribute => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, productCode, productAttributeId, name, accountAttributeType, value) val response: Future[Box[InBound]] = sendRequest[InBound]("create_or_update_account_attribute", req, callContext) response.map(convertToTuple[AccountAttributeCommons](callContext)) @@ -4852,7 +4237,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createOrUpdateCustomerAttribute(bankId: BankId, customerId: CustomerId, customerAttributeId: Option[String], name: String, attributeType: CustomerAttributeType.Value, value: String, callContext: Option[CallContext]): OBPReturnType[Box[CustomerAttribute]] = { - import com.openbankproject.commons.dto.{InBoundCreateOrUpdateCustomerAttribute => InBound, OutBoundCreateOrUpdateCustomerAttribute => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateCustomerAttribute => OutBound, InBoundCreateOrUpdateCustomerAttribute => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, customerId, customerAttributeId, name, attributeType, value) val response: Future[Box[InBound]] = sendRequest[InBound]("create_or_update_customer_attribute", req, callContext) response.map(convertToTuple[CustomerAttributeCommons](callContext)) @@ -4888,7 +4273,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createOrUpdateTransactionAttribute(bankId: BankId, transactionId: TransactionId, transactionAttributeId: Option[String], name: String, attributeType: TransactionAttributeType.Value, value: String, callContext: Option[CallContext]): OBPReturnType[Box[TransactionAttribute]] = { - import com.openbankproject.commons.dto.{InBoundCreateOrUpdateTransactionAttribute => InBound, OutBoundCreateOrUpdateTransactionAttribute => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateTransactionAttribute => OutBound, InBoundCreateOrUpdateTransactionAttribute => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, transactionId, transactionAttributeId, name, attributeType, value) val response: Future[Box[InBound]] = sendRequest[InBound]("create_or_update_transaction_attribute", req, callContext) response.map(convertToTuple[TransactionAttributeCommons](callContext)) @@ -4928,7 +4313,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createAccountAttributes(bankId: BankId, accountId: AccountId, productCode: ProductCode, accountAttributes: List[ProductAttribute], callContext: Option[CallContext]): OBPReturnType[Box[List[AccountAttribute]]] = { - import com.openbankproject.commons.dto.{InBoundCreateAccountAttributes => InBound, OutBoundCreateAccountAttributes => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateAccountAttributes => OutBound, InBoundCreateAccountAttributes => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, productCode, accountAttributes) val response: Future[Box[InBound]] = sendRequest[InBound]("create_account_attributes", req, callContext) response.map(convertToTuple[List[AccountAttributeCommons]](callContext)) @@ -4961,7 +4346,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getAccountAttributesByAccount(bankId: BankId, accountId: AccountId, callContext: Option[CallContext]): OBPReturnType[Box[List[AccountAttribute]]] = { - import com.openbankproject.commons.dto.{InBoundGetAccountAttributesByAccount => InBound, OutBoundGetAccountAttributesByAccount => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetAccountAttributesByAccount => OutBound, InBoundGetAccountAttributesByAccount => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_account_attributes_by_account", req, callContext) response.map(convertToTuple[List[AccountAttributeCommons]](callContext)) @@ -4993,7 +4378,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getCustomerAttributes(bankId: BankId, customerId: CustomerId, callContext: Option[CallContext]): OBPReturnType[Box[List[CustomerAttribute]]] = { - import com.openbankproject.commons.dto.{InBoundGetCustomerAttributes => InBound, OutBoundGetCustomerAttributes => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetCustomerAttributes => OutBound, InBoundGetCustomerAttributes => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, customerId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_customer_attributes", req, callContext) response.map(convertToTuple[List[CustomerAttributeCommons]](callContext)) @@ -5020,7 +4405,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getCustomerIdsByAttributeNameValues(bankId: BankId, nameValues: Map[String,List[String]], callContext: Option[CallContext]): OBPReturnType[Box[List[String]]] = { - import com.openbankproject.commons.dto.{InBoundGetCustomerIdsByAttributeNameValues => InBound, OutBoundGetCustomerIdsByAttributeNameValues => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetCustomerIdsByAttributeNameValues => OutBound, InBoundGetCustomerIdsByAttributeNameValues => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, nameValues) val response: Future[Box[InBound]] = sendRequest[InBound]("get_customer_ids_by_attribute_name_values", req, callContext) response.map(convertToTuple[List[String]](callContext)) @@ -5074,7 +4459,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getCustomerAttributesForCustomers(customers: List[Customer], callContext: Option[CallContext]): OBPReturnType[Box[List[(Customer, List[CustomerAttribute])]]] = { - import com.openbankproject.commons.dto.{InBoundGetCustomerAttributesForCustomers => InBound, OutBoundGetCustomerAttributesForCustomers => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetCustomerAttributesForCustomers => OutBound, InBoundGetCustomerAttributesForCustomers => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customers) val response: Future[Box[InBound]] = sendRequest[InBound]("get_customer_attributes_for_customers", req, callContext) response.map(convertToTuple[List[(Customer, List[CustomerAttribute])]](callContext)) @@ -5101,7 +4486,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getTransactionIdsByAttributeNameValues(bankId: BankId, nameValues: Map[String,List[String]], callContext: Option[CallContext]): OBPReturnType[Box[List[String]]] = { - import com.openbankproject.commons.dto.{InBoundGetTransactionIdsByAttributeNameValues => InBound, OutBoundGetTransactionIdsByAttributeNameValues => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetTransactionIdsByAttributeNameValues => OutBound, InBoundGetTransactionIdsByAttributeNameValues => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, nameValues) val response: Future[Box[InBound]] = sendRequest[InBound]("get_transaction_ids_by_attribute_name_values", req, callContext) response.map(convertToTuple[List[String]](callContext)) @@ -5133,7 +4518,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getTransactionAttributes(bankId: BankId, transactionId: TransactionId, callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionAttribute]]] = { - import com.openbankproject.commons.dto.{InBoundGetTransactionAttributes => InBound, OutBoundGetTransactionAttributes => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetTransactionAttributes => OutBound, InBoundGetTransactionAttributes => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, transactionId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_transaction_attributes", req, callContext) response.map(convertToTuple[List[TransactionAttributeCommons]](callContext)) @@ -5164,7 +4549,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getCustomerAttributeById(customerAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[CustomerAttribute]] = { - import com.openbankproject.commons.dto.{InBoundGetCustomerAttributeById => InBound, OutBoundGetCustomerAttributeById => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetCustomerAttributeById => OutBound, InBoundGetCustomerAttributeById => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerAttributeId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_customer_attribute_by_id", req, callContext) response.map(convertToTuple[CustomerAttributeCommons](callContext)) @@ -5200,7 +4585,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createOrUpdateCardAttribute(bankId: Option[BankId], cardId: Option[String], cardAttributeId: Option[String], name: String, cardAttributeType: CardAttributeType.Value, value: String, callContext: Option[CallContext]): OBPReturnType[Box[CardAttribute]] = { - import com.openbankproject.commons.dto.{InBoundCreateOrUpdateCardAttribute => InBound, OutBoundCreateOrUpdateCardAttribute => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateCardAttribute => OutBound, InBoundCreateOrUpdateCardAttribute => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, cardId, cardAttributeId, name, cardAttributeType, value) val response: Future[Box[InBound]] = sendRequest[InBound]("create_or_update_card_attribute", req, callContext) response.map(convertToTuple[CardAttributeCommons](callContext)) @@ -5231,7 +4616,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getCardAttributeById(cardAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[CardAttribute]] = { - import com.openbankproject.commons.dto.{InBoundGetCardAttributeById => InBound, OutBoundGetCardAttributeById => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetCardAttributeById => OutBound, InBoundGetCardAttributeById => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, cardAttributeId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_card_attribute_by_id", req, callContext) response.map(convertToTuple[CardAttributeCommons](callContext)) @@ -5262,7 +4647,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getCardAttributesFromProvider(cardId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[CardAttribute]]] = { - import com.openbankproject.commons.dto.{InBoundGetCardAttributesFromProvider => InBound, OutBoundGetCardAttributesFromProvider => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetCardAttributesFromProvider => OutBound, InBoundGetCardAttributesFromProvider => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, cardId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_card_attributes_from_provider", req, callContext) response.map(convertToTuple[List[CardAttributeCommons]](callContext)) @@ -5295,7 +4680,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createAccountApplication(productCode: ProductCode, userId: Option[String], customerId: Option[String], callContext: Option[CallContext]): OBPReturnType[Box[AccountApplication]] = { - import com.openbankproject.commons.dto.{InBoundCreateAccountApplication => InBound, OutBoundCreateAccountApplication => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateAccountApplication => OutBound, InBoundCreateAccountApplication => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, productCode, userId, customerId) val response: Future[Box[InBound]] = sendRequest[InBound]("create_account_application", req, callContext) response.map(convertToTuple[AccountApplicationCommons](callContext)) @@ -5325,7 +4710,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getAllAccountApplication(callContext: Option[CallContext]): OBPReturnType[Box[List[AccountApplication]]] = { - import com.openbankproject.commons.dto.{InBoundGetAllAccountApplication => InBound, OutBoundGetAllAccountApplication => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetAllAccountApplication => OutBound, InBoundGetAllAccountApplication => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull) val response: Future[Box[InBound]] = sendRequest[InBound]("get_all_account_application", req, callContext) response.map(convertToTuple[List[AccountApplicationCommons]](callContext)) @@ -5356,7 +4741,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getAccountApplicationById(accountApplicationId: String, callContext: Option[CallContext]): OBPReturnType[Box[AccountApplication]] = { - import com.openbankproject.commons.dto.{InBoundGetAccountApplicationById => InBound, OutBoundGetAccountApplicationById => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetAccountApplicationById => OutBound, InBoundGetAccountApplicationById => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, accountApplicationId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_account_application_by_id", req, callContext) response.map(convertToTuple[AccountApplicationCommons](callContext)) @@ -5388,7 +4773,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def updateAccountApplicationStatus(accountApplicationId: String, status: String, callContext: Option[CallContext]): OBPReturnType[Box[AccountApplication]] = { - import com.openbankproject.commons.dto.{InBoundUpdateAccountApplicationStatus => InBound, OutBoundUpdateAccountApplicationStatus => OutBound} + import com.openbankproject.commons.dto.{OutBoundUpdateAccountApplicationStatus => OutBound, InBoundUpdateAccountApplicationStatus => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, accountApplicationId, status) val response: Future[Box[InBound]] = sendRequest[InBound]("update_account_application_status", req, callContext) response.map(convertToTuple[AccountApplicationCommons](callContext)) @@ -5416,7 +4801,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getOrCreateProductCollection(collectionCode: String, productCodes: List[String], callContext: Option[CallContext]): OBPReturnType[Box[List[ProductCollection]]] = { - import com.openbankproject.commons.dto.{InBoundGetOrCreateProductCollection => InBound, OutBoundGetOrCreateProductCollection => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetOrCreateProductCollection => OutBound, InBoundGetOrCreateProductCollection => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, collectionCode, productCodes) val response: Future[Box[InBound]] = sendRequest[InBound]("get_or_create_product_collection", req, callContext) response.map(convertToTuple[List[ProductCollectionCommons]](callContext)) @@ -5443,7 +4828,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getProductCollection(collectionCode: String, callContext: Option[CallContext]): OBPReturnType[Box[List[ProductCollection]]] = { - import com.openbankproject.commons.dto.{InBoundGetProductCollection => InBound, OutBoundGetProductCollection => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetProductCollection => OutBound, InBoundGetProductCollection => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, collectionCode) val response: Future[Box[InBound]] = sendRequest[InBound]("get_product_collection", req, callContext) response.map(convertToTuple[List[ProductCollectionCommons]](callContext)) @@ -5471,7 +4856,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getOrCreateProductCollectionItem(collectionCode: String, memberProductCodes: List[String], callContext: Option[CallContext]): OBPReturnType[Box[List[ProductCollectionItem]]] = { - import com.openbankproject.commons.dto.{InBoundGetOrCreateProductCollectionItem => InBound, OutBoundGetOrCreateProductCollectionItem => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetOrCreateProductCollectionItem => OutBound, InBoundGetOrCreateProductCollectionItem => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, collectionCode, memberProductCodes) val response: Future[Box[InBound]] = sendRequest[InBound]("get_or_create_product_collection_item", req, callContext) response.map(convertToTuple[List[ProductCollectionItemCommons]](callContext)) @@ -5498,7 +4883,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getProductCollectionItem(collectionCode: String, callContext: Option[CallContext]): OBPReturnType[Box[List[ProductCollectionItem]]] = { - import com.openbankproject.commons.dto.{InBoundGetProductCollectionItem => InBound, OutBoundGetProductCollectionItem => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetProductCollectionItem => OutBound, InBoundGetProductCollectionItem => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, collectionCode) val response: Future[Box[InBound]] = sendRequest[InBound]("get_product_collection_item", req, callContext) response.map(convertToTuple[List[ProductCollectionItemCommons]](callContext)) @@ -5542,7 +4927,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getProductCollectionItemsTree(collectionCode: String, bankId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[(ProductCollectionItem, Product, List[ProductAttribute])]]] = { - import com.openbankproject.commons.dto.{InBoundGetProductCollectionItemsTree => InBound, OutBoundGetProductCollectionItemsTree => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetProductCollectionItemsTree => OutBound, InBoundGetProductCollectionItemsTree => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, collectionCode, bankId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_product_collection_items_tree", req, callContext) response.map(convertToTuple[List[(ProductCollectionItemCommons, ProductCommons, List[ProductAttributeCommons])]](callContext)) @@ -5609,7 +4994,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createMeeting(bankId: BankId, staffUser: User, customerUser: User, providerId: String, purposeId: String, when: Date, sessionId: String, customerToken: String, staffToken: String, creator: ContactDetails, invitees: List[Invitee], callContext: Option[CallContext]): OBPReturnType[Box[Meeting]] = { - import com.openbankproject.commons.dto.{InBoundCreateMeeting => InBound, OutBoundCreateMeeting => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateMeeting => OutBound, InBoundCreateMeeting => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, staffUser, customerUser, providerId, purposeId, when, sessionId, customerToken, staffToken, creator, invitees) val response: Future[Box[InBound]] = sendRequest[InBound]("create_meeting", req, callContext) response.map(convertToTuple[MeetingCommons](callContext)) @@ -5657,7 +5042,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getMeetings(bankId: BankId, user: User, callContext: Option[CallContext]): OBPReturnType[Box[List[Meeting]]] = { - import com.openbankproject.commons.dto.{InBoundGetMeetings => InBound, OutBoundGetMeetings => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetMeetings => OutBound, InBoundGetMeetings => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, user) val response: Future[Box[InBound]] = sendRequest[InBound]("get_meetings", req, callContext) response.map(convertToTuple[List[MeetingCommons]](callContext)) @@ -5706,7 +5091,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getMeeting(bankId: BankId, user: User, meetingId: String, callContext: Option[CallContext]): OBPReturnType[Box[Meeting]] = { - import com.openbankproject.commons.dto.{InBoundGetMeeting => InBound, OutBoundGetMeeting => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetMeeting => OutBound, InBoundGetMeeting => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, user, meetingId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_meeting", req, callContext) response.map(convertToTuple[MeetingCommons](callContext)) @@ -5750,7 +5135,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createOrUpdateKycCheck(bankId: String, customerId: String, id: String, customerNumber: String, date: Date, how: String, staffUserId: String, mStaffName: String, mSatisfied: Boolean, comments: String, callContext: Option[CallContext]): OBPReturnType[Box[KycCheck]] = { - import com.openbankproject.commons.dto.{InBoundCreateOrUpdateKycCheck => InBound, OutBoundCreateOrUpdateKycCheck => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateKycCheck => OutBound, InBoundCreateOrUpdateKycCheck => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, customerId, id, customerNumber, date, how, staffUserId, mStaffName, mSatisfied, comments) val response: Future[Box[InBound]] = sendRequest[InBound]("create_or_update_kyc_check", req, callContext) response.map(convertToTuple[KycCheckCommons](callContext)) @@ -5792,7 +5177,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createOrUpdateKycDocument(bankId: String, customerId: String, id: String, customerNumber: String, `type`: String, number: String, issueDate: Date, issuePlace: String, expiryDate: Date, callContext: Option[CallContext]): OBPReturnType[Box[KycDocument]] = { - import com.openbankproject.commons.dto.{InBoundCreateOrUpdateKycDocument => InBound, OutBoundCreateOrUpdateKycDocument => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateKycDocument => OutBound, InBoundCreateOrUpdateKycDocument => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, customerId, id, customerNumber, `type`, number, issueDate, issuePlace, expiryDate) val response: Future[Box[InBound]] = sendRequest[InBound]("create_or_update_kyc_document", req, callContext) response.map(convertToTuple[KycDocument](callContext)) @@ -5834,7 +5219,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createOrUpdateKycMedia(bankId: String, customerId: String, id: String, customerNumber: String, `type`: String, url: String, date: Date, relatesToKycDocumentId: String, relatesToKycCheckId: String, callContext: Option[CallContext]): OBPReturnType[Box[KycMedia]] = { - import com.openbankproject.commons.dto.{InBoundCreateOrUpdateKycMedia => InBound, OutBoundCreateOrUpdateKycMedia => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateKycMedia => OutBound, InBoundCreateOrUpdateKycMedia => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, customerId, id, customerNumber, `type`, url, date, relatesToKycDocumentId, relatesToKycCheckId) val response: Future[Box[InBound]] = sendRequest[InBound]("create_or_update_kyc_media", req, callContext) response.map(convertToTuple[KycMediaCommons](callContext)) @@ -5868,7 +5253,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createOrUpdateKycStatus(bankId: String, customerId: String, customerNumber: String, ok: Boolean, date: Date, callContext: Option[CallContext]): OBPReturnType[Box[KycStatus]] = { - import com.openbankproject.commons.dto.{InBoundCreateOrUpdateKycStatus => InBound, OutBoundCreateOrUpdateKycStatus => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateKycStatus => OutBound, InBoundCreateOrUpdateKycStatus => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, customerId, customerNumber, ok, date) val response: Future[Box[InBound]] = sendRequest[InBound]("create_or_update_kyc_status", req, callContext) response.map(convertToTuple[KycStatusCommons](callContext)) @@ -5903,7 +5288,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getKycChecks(customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[KycCheck]]] = { - import com.openbankproject.commons.dto.{InBoundGetKycChecks => InBound, OutBoundGetKycChecks => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetKycChecks => OutBound, InBoundGetKycChecks => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_kyc_checks", req, callContext) response.map(convertToTuple[List[KycCheckCommons]](callContext)) @@ -5937,7 +5322,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getKycDocuments(customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[KycDocument]]] = { - import com.openbankproject.commons.dto.{InBoundGetKycDocuments => InBound, OutBoundGetKycDocuments => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetKycDocuments => OutBound, InBoundGetKycDocuments => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_kyc_documents", req, callContext) response.map(convertToTuple[List[KycDocumentCommons]](callContext)) @@ -5971,7 +5356,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getKycMedias(customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[KycMedia]]] = { - import com.openbankproject.commons.dto.{InBoundGetKycMedias => InBound, OutBoundGetKycMedias => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetKycMedias => OutBound, InBoundGetKycMedias => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_kyc_medias", req, callContext) response.map(convertToTuple[List[KycMediaCommons]](callContext)) @@ -6001,7 +5386,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def getKycStatuses(customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[KycStatus]]] = { - import com.openbankproject.commons.dto.{InBoundGetKycStatuses => InBound, OutBoundGetKycStatuses => OutBound} + import com.openbankproject.commons.dto.{OutBoundGetKycStatuses => OutBound, InBoundGetKycStatuses => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId) val response: Future[Box[InBound]] = sendRequest[InBound]("get_kyc_statuses", req, callContext) response.map(convertToTuple[List[KycStatusCommons]](callContext)) @@ -6040,7 +5425,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createMessage(user: User, bankId: BankId, message: String, fromDepartment: String, fromPerson: String, callContext: Option[CallContext]): OBPReturnType[Box[CustomerMessage]] = { - import com.openbankproject.commons.dto.{InBoundCreateMessage => InBound, OutBoundCreateMessage => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateMessage => OutBound, InBoundCreateMessage => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, user, bankId, message, fromDepartment, fromPerson) val response: Future[Box[InBound]] = sendRequest[InBound]("create_message", req, callContext) response.map(convertToTuple[CustomerMessageCommons](callContext)) @@ -6107,7 +5492,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def makeHistoricalPayment(fromAccount: BankAccount, toAccount: BankAccount, posted: Date, completed: Date, amount: BigDecimal, description: String, transactionRequestType: String, chargePolicy: String, callContext: Option[CallContext]): OBPReturnType[Box[TransactionId]] = { - import com.openbankproject.commons.dto.{InBoundMakeHistoricalPayment => InBound, OutBoundMakeHistoricalPayment => OutBound} + import com.openbankproject.commons.dto.{OutBoundMakeHistoricalPayment => OutBound, InBoundMakeHistoricalPayment => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, fromAccount, toAccount, posted, completed, amount, description, transactionRequestType, chargePolicy) val response: Future[Box[InBound]] = sendRequest[InBound]("make_historical_payment", req, callContext) response.map(convertToTuple[TransactionId](callContext)) @@ -6150,7 +5535,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def createDirectDebit(bankId: String, accountId: String, customerId: String, userId: String, counterpartyId: String, dateSigned: Date, dateStarts: Date, dateExpires: Option[Date], callContext: Option[CallContext]): OBPReturnType[Box[DirectDebitTrait]] = { - import com.openbankproject.commons.dto.{InBoundCreateDirectDebit => InBound, OutBoundCreateDirectDebit => OutBound} + import com.openbankproject.commons.dto.{OutBoundCreateDirectDebit => OutBound, InBoundCreateDirectDebit => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, customerId, userId, counterpartyId, dateSigned, dateStarts, dateExpires) val response: Future[Box[InBound]] = sendRequest[InBound]("create_direct_debit", req, callContext) response.map(convertToTuple[DirectDebitTraitCommons](callContext)) @@ -6176,14 +5561,14 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { ) override def deleteCustomerAttribute(customerAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { - import com.openbankproject.commons.dto.{InBoundDeleteCustomerAttribute => InBound, OutBoundDeleteCustomerAttribute => OutBound} + import com.openbankproject.commons.dto.{OutBoundDeleteCustomerAttribute => OutBound, InBoundDeleteCustomerAttribute => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerAttributeId) val response: Future[Box[InBound]] = sendRequest[InBound]("delete_customer_attribute", req, callContext) response.map(convertToTuple[Boolean](callContext)) } -// ---------- create on Tue Jun 16 19:55:42 CST 2020 -//---------------- dynamic end ---------------------please don't modify this line +// ---------- create on Tue Jun 16 22:58:26 CST 2020 +//---------------- dynamic end ---------------------please don't modify this line private val availableOperation = DynamicEntityOperation.values.map(it => s""""$it"""").mkString("[", ", ", "]") From fbac90b5f0054a7d0cb1de8cd5fb562b44f292ef Mon Sep 17 00:00:00 2001 From: shuang Date: Wed, 17 Jun 2020 14:25:58 +0800 Subject: [PATCH 09/10] feature/create_ms_stored_procedure_script: fix conflict caused by merge with develop branch, add @out_bound_json example to generated stored procedure script. --- .../bankconnectors/ConnectorBuilderUtil.scala | 7 +- .../akka/AkkaConnectorBuilder.scala | 19 +- .../akka/AkkaConnector_vDec2018.scala | 5173 +++++++- .../storedprocedure/MSsqlStoredProcedure.sql | 10359 +++++++++++++++- .../MSsqlStoredProcedureBuilder.scala | 22 +- 5 files changed, 14997 insertions(+), 583 deletions(-) diff --git a/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala b/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala index 40a01cc32..9c49c4816 100644 --- a/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala +++ b/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala @@ -3,7 +3,7 @@ package code.bankconnectors import java.io.File import java.util.Date -import code.api.util.CallContext +import code.api.util.{APIUtil, CallContext} import code.api.util.CodeGenerateUtils.createDocExample import code.bankconnectors.vSept2018.KafkaMappedConnector_vSept2018 import com.openbankproject.commons.util.ReflectUtils @@ -72,11 +72,12 @@ object ConnectorBuilderUtil { val start = "//---------------- dynamic start -------------------please don't modify this line" val end = "//---------------- dynamic end ---------------------please don't modify this line" val placeHolderInSource = s"""(?s)$start.+$end""" + val currentTime = APIUtil.DateWithSecondsFormat.format(new Date()) val insertCode = s"""$start - |// ---------- create on ${new Date()} + |// ---------- create on $currentTime |${codeList.mkString} - |// ---------- create on ${new Date()} + |// ---------- create on $currentTime |$end """.stripMargin val newSource = source.replaceFirst(placeHolderInSource, insertCode) FileUtils.writeStringToFile(path, newSource, "utf-8") diff --git a/obp-api/src/main/scala/code/bankconnectors/akka/AkkaConnectorBuilder.scala b/obp-api/src/main/scala/code/bankconnectors/akka/AkkaConnectorBuilder.scala index 4c854529a..4160146bc 100644 --- a/obp-api/src/main/scala/code/bankconnectors/akka/AkkaConnectorBuilder.scala +++ b/obp-api/src/main/scala/code/bankconnectors/akka/AkkaConnectorBuilder.scala @@ -6,7 +6,22 @@ import scala.language.postfixOps object AkkaConnectorBuilder extends App { - generateMethods(commonMethodNames, + val createManually = List( + "getAdapterInfo", + "getBanks", + "getBank", + "getBankAccountsForUser", + "checkBankAccountExists", + "getBankAccount", + "getCoreBankAccounts", + "getCustomersByUserId", + "getTransactions", + "getTransaction", + ) + // exclude manually created methods + val toGenerateMethodNames = commonMethodNames.filterNot(createManually.contains) + + generateMethods(toGenerateMethodNames, "src/main/scala/code/bankconnectors/akka/AkkaConnector_vDec2018.scala", - "(southSideActor ? req).mapTo[InBound].map(Box !! _)") + "(southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) ") } 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 a6713c2fd..f99441f14 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 @@ -1,10 +1,13 @@ package code.bankconnectors.akka +import java.util.Date + import akka.pattern.ask import code.actorsystem.ObpLookupSystem +import code.api.ResourceDocs1_4_0.MessageDocsSwaggerDefinitions import code.api.ResourceDocs1_4_0.MessageDocsSwaggerDefinitions.{bankAccountCommons, bankCommons, transactionCommons, _} -import code.api.util.APIUtil.{AdapterImplementation, MessageDoc, OBPReturnType} -import code.api.util.ErrorMessages.{AdapterUnknownError, AdapterFunctionNotImplemented} +import code.api.util.APIUtil.{AdapterImplementation, MessageDoc, OBPReturnType, parseDate} +import code.api.util.ErrorMessages.{AdapterFunctionNotImplemented, AdapterUnknownError} import code.api.util.ExampleValue._ import code.api.util._ import code.bankconnectors._ @@ -12,6 +15,7 @@ import code.bankconnectors.akka.actor.{AkkaConnectorActorInit, AkkaConnectorHelp import com.openbankproject.commons.ExecutionContext.Implicits.global import com.openbankproject.commons.dto._ import com.openbankproject.commons.model._ +import com.openbankproject.commons.model.enums.{AccountAttributeType, CardAttributeType, CustomerAttributeType, ProductAttributeType, StrongCustomerAuthentication, TransactionAttributeType} import com.sksamuel.avro4s.SchemaFor import net.liftweb.common.{Box, Full} import net.liftweb.json.parse @@ -23,7 +27,7 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { implicit override val nameOfConnector = AkkaConnector_vDec2018.toString val messageFormat: String = "Dec2018" - + lazy val southSideActor = ObpLookupSystem.getAkkaConnectorActor(AkkaConnectorHelperActor.actorName) private def recoverFunction[U]: PartialFunction[Throwable, Future[U]] = { @@ -42,13 +46,13 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { exampleOutboundMessage = ( OutBoundGetAdapterInfo( outboundAdapterCallContext - )), + )), exampleInboundMessage = ( InBoundGetAdapterInfo( inboundAdapterCallContext, inboundStatus, inboundAdapterInfoInternal) - ), + ), outboundAvroSchema = Some(parse(SchemaFor[OutBoundGetAdapterInfo]().toString(true))), inboundAvroSchema = Some(parse(SchemaFor[InBoundGetAdapterInfo]().toString(true))), adapterImplementation = Some(AdapterImplementation("- Core", 1)) @@ -67,19 +71,19 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { inboundTopic = Some(InBoundGetBanks.getClass.getSimpleName.replace("$", "")), exampleOutboundMessage = ( OutBoundGetBanks(outboundAdapterCallContext) - ), + ), exampleInboundMessage = ( InBoundGetBanks( inboundAdapterCallContext, inboundStatus, List(bankCommons) - ) - ), + ) + ), outboundAvroSchema = Some(parse(SchemaFor[OutBoundGetBanks]().toString(true))), inboundAvroSchema = Some(parse(SchemaFor[InBoundGetBanks]().toString(true))), adapterImplementation = Some(AdapterImplementation("- Core", 2)) ) - + override def getBanks(callContext: Option[CallContext]): Future[Box[(List[Bank], Option[CallContext])]] = { val req = OutBoundGetBanks(callContext.map(_.toOutboundAdapterCallContext).get) val response: Future[InBoundGetBanks] = (southSideActor ? req).mapTo[InBoundGetBanks] recoverWith { recoverFunction } @@ -96,14 +100,14 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { OutBoundGetBank( outboundAdapterCallContext, BankId(bankIdExample.value)) - ), + ), exampleInboundMessage = ( InBoundGetBank( inboundAdapterCallContext, inboundStatus, bankCommons ) - ), + ), outboundAvroSchema = Some(parse(SchemaFor[OutBoundGetBank]().toString(true))), inboundAvroSchema = Some(parse(SchemaFor[InBoundGetBank]().toString(true))), adapterImplementation = Some(AdapterImplementation("- Core", 5)) @@ -114,7 +118,7 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { response.map(r => Full(r.data, callContext)) } - messageDocs += MessageDoc( + messageDocs += MessageDoc( process = "obp.getBankAccountsForUser", messageFormat = messageFormat, description = "Gets the list of accounts available to the User. This call sends authInfo including username.", @@ -124,14 +128,14 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { OutBoundGetBankAccountsForUser( outboundAdapterCallContext, usernameExample.value) - ), + ), exampleInboundMessage = ( InBoundGetBankAccountsForUser( inboundAdapterCallContext, inboundStatus, List(inboundAccountCommons) ) - ), + ), adapterImplementation = Some(AdapterImplementation("Accounts", 5)) ) override def getBankAccountsForUser(username: String, callContext: Option[CallContext]): Future[Box[(List[InboundAccount], Option[CallContext])]] = { @@ -139,7 +143,7 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { val response = (southSideActor ? req).mapTo[InBoundGetBankAccountsForUser] recoverWith { recoverFunction } response.map(a =>(Full(a.data, callContext))) } - + messageDocs += MessageDoc( process = "obp.checkBankAccountExists", messageFormat = messageFormat, @@ -152,21 +156,21 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { BankId(bankIdExample.value), AccountId(accountIdExample.value) ) - ), + ), exampleInboundMessage = ( InBoundCheckBankAccountExists( inboundAdapterCallContext, inboundStatus, bankAccountCommons ) - ), + ), adapterImplementation = Some(AdapterImplementation("Accounts", 4)) ) override def checkBankAccountExists(bankId : BankId, accountId : AccountId, callContext: Option[CallContext] = None) = { val req = OutBoundCheckBankAccountExists(callContext.map(_.toOutboundAdapterCallContext).get, bankId, accountId) val response: Future[InBoundCheckBankAccountExists] = (southSideActor ? req).mapTo[InBoundCheckBankAccountExists] recoverWith { recoverFunction } response.map(a =>(Full(a.data), callContext)) - + } messageDocs += MessageDoc( @@ -181,14 +185,14 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { BankId(bankIdExample.value), AccountId(accountIdExample.value), ) - ), + ), exampleInboundMessage = ( InBoundGetBankAccount( inboundAdapterCallContext, inboundStatus, bankAccountCommons ) - ), + ), adapterImplementation = Some(AdapterImplementation("Accounts", 7)) ) override def getBankAccount(bankId : BankId, accountId : AccountId, callContext: Option[CallContext]): OBPReturnType[Box[BankAccount]] = { @@ -208,17 +212,17 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { outboundAdapterCallContext, List(BankIdAccountId(BankId(bankIdExample.value), AccountId(accountIdExample.value))) ) - ), + ), exampleInboundMessage = ( InBoundGetCoreBankAccounts( inboundAdapterCallContext, inboundStatus, List( CoreAccount( - accountIdExample.value, - "My private account for Uber", - bankIdExample.value, - accountTypeExample.value, + accountIdExample.value, + "My private account for Uber", + bankIdExample.value, + accountTypeExample.value, List(AccountRouting(accountRoutingSchemeExample.value, accountRoutingAddressExample.value) ) ) @@ -227,7 +231,7 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { adapterImplementation = Some(AdapterImplementation("Accounts", 1)) ) override def getCoreBankAccounts(BankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]) : Future[Box[(List[CoreAccount], Option[CallContext])]] = { - val req = OutBoundGetCoreBankAccounts(callContext.map(_.toOutboundAdapterCallContext).get, BankIdAccountIds) + val req = OutBoundGetCoreBankAccounts(callContext.map(_.toOutboundAdapterCallContext).get, BankIdAccountIds) val response = (southSideActor ? req).mapTo[InBoundGetCoreBankAccounts] recoverWith { recoverFunction } response.map(a =>(Full(a.data, callContext))) } @@ -245,14 +249,14 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { outboundAdapterCallContext, userIdExample.value ) - ), + ), exampleInboundMessage = ( InBoundGetCustomersByUserId( inboundAdapterCallContext, inboundStatus, customerCommons:: Nil, ) - ), + ), outboundAvroSchema = None, inboundAvroSchema = None, adapterImplementation = Some(AdapterImplementation("Accounts", 0)) @@ -276,16 +280,16 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { accountId = AccountId(accountIdExample.value), limit = limitExample.value.toInt, offset = offsetExample.value.toInt, - fromDate = APIUtil.DateWithDayExampleString, - toDate = APIUtil.DateWithDayExampleString) - ), + fromDate = APIUtil.DateWithDayExampleString, + toDate = APIUtil.DateWithDayExampleString) + ), exampleInboundMessage = ( InBoundGetTransactions( inboundAdapterCallContext, inboundStatus, List(transactionCommons) ) - ), + ), adapterImplementation = Some(AdapterImplementation("Transactions", 10)) ) override def getTransactions(bankId: BankId, accountId: AccountId, callContext: Option[CallContext], queryParams: List[OBPQueryParam]): OBPReturnType[Box[List[Transaction]]] = { @@ -312,14 +316,14 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { accountId = AccountId(accountIdExample.value), transactionId = TransactionId(transactionIdExample.value) ) - ), + ), exampleInboundMessage = ( InBoundGetTransaction( inboundAdapterCallContext, inboundStatus, transactionCommons ) - ), + ), adapterImplementation = Some(AdapterImplementation("Transactions", 11)) ) override def getTransaction(bankId: BankId, accountId: AccountId, transactionId: TransactionId, callContext: Option[CallContext]): OBPReturnType[Box[Transaction]] = { @@ -327,5 +331,5104 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { val response= (southSideActor ? req).mapTo[InBoundGetTransaction] recoverWith { recoverFunction } response.map(a =>(Full(a.data), callContext)) } - + + +//---------------- dynamic start -------------------please don't modify this line +// ---------- create on 2020-06-17T14:19:04Z + + messageDocs += getChallengeThresholdDoc + def getChallengeThresholdDoc = MessageDoc( + process = "obp.getChallengeThreshold", + messageFormat = messageFormat, + description = "Get Challenge Threshold", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetChallengeThreshold(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=bankIdExample.value, + accountId=accountIdExample.value, + viewId=viewIdExample.value, + transactionRequestType=transactionRequestTypeExample.value, + currency=currencyExample.value, + userId=userIdExample.value, + userName="string") + ), + exampleInboundMessage = ( + InBoundGetChallengeThreshold(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= AmountOfMoney(currency=currencyExample.value, + amount="string")) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getChallengeThreshold(bankId: String, accountId: String, viewId: String, transactionRequestType: String, currency: String, userId: String, userName: String, callContext: Option[CallContext]): OBPReturnType[Box[AmountOfMoney]] = { + import com.openbankproject.commons.dto.{OutBoundGetChallengeThreshold => OutBound, InBoundGetChallengeThreshold => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, viewId, transactionRequestType, currency, userId, userName) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[AmountOfMoney](callContext)) + } + + messageDocs += getChargeLevelDoc + def getChargeLevelDoc = MessageDoc( + process = "obp.getChargeLevel", + messageFormat = messageFormat, + description = "Get Charge Level", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetChargeLevel(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + accountId=AccountId(accountIdExample.value), + viewId=ViewId(viewIdExample.value), + userId=userIdExample.value, + userName="string", + transactionRequestType=transactionRequestTypeExample.value, + currency=currencyExample.value) + ), + exampleInboundMessage = ( + InBoundGetChargeLevel(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= AmountOfMoney(currency=currencyExample.value, + amount="string")) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getChargeLevel(bankId: BankId, accountId: AccountId, viewId: ViewId, userId: String, userName: String, transactionRequestType: String, currency: String, callContext: Option[CallContext]): OBPReturnType[Box[AmountOfMoney]] = { + import com.openbankproject.commons.dto.{OutBoundGetChargeLevel => OutBound, InBoundGetChargeLevel => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, viewId, userId, userName, transactionRequestType, currency) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[AmountOfMoney](callContext)) + } + + messageDocs += createChallengeDoc + def createChallengeDoc = MessageDoc( + process = "obp.createChallenge", + messageFormat = messageFormat, + description = "Create Challenge", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateChallenge(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + accountId=AccountId(accountIdExample.value), + userId=userIdExample.value, + transactionRequestType=TransactionRequestType(transactionRequestTypeExample.value), + transactionRequestId="string", + scaMethod=Some(com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SMS)) + ), + exampleInboundMessage = ( + InBoundCreateChallenge(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data="string") + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createChallenge(bankId: BankId, accountId: AccountId, userId: String, transactionRequestType: TransactionRequestType, transactionRequestId: String, scaMethod: Option[StrongCustomerAuthentication.SCA], callContext: Option[CallContext]): OBPReturnType[Box[String]] = { + import com.openbankproject.commons.dto.{OutBoundCreateChallenge => OutBound, InBoundCreateChallenge => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, userId, transactionRequestType, transactionRequestId, scaMethod) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[String](callContext)) + } + + messageDocs += createChallengesDoc + def createChallengesDoc = MessageDoc( + process = "obp.createChallenges", + messageFormat = messageFormat, + description = "Create Challenges", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateChallenges(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + accountId=AccountId(accountIdExample.value), + userIds=List(userIdExample.value), + transactionRequestType=TransactionRequestType(transactionRequestTypeExample.value), + transactionRequestId="string", + scaMethod=Some(com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SMS)) + ), + exampleInboundMessage = ( + InBoundCreateChallenges(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List("string")) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createChallenges(bankId: BankId, accountId: AccountId, userIds: List[String], transactionRequestType: TransactionRequestType, transactionRequestId: String, scaMethod: Option[StrongCustomerAuthentication.SCA], callContext: Option[CallContext]): OBPReturnType[Box[List[String]]] = { + import com.openbankproject.commons.dto.{OutBoundCreateChallenges => OutBound, InBoundCreateChallenges => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, userIds, transactionRequestType, transactionRequestId, scaMethod) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[String]](callContext)) + } + + messageDocs += validateChallengeAnswerDoc + def validateChallengeAnswerDoc = MessageDoc( + process = "obp.validateChallengeAnswer", + messageFormat = messageFormat, + description = "Validate Challenge Answer", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundValidateChallengeAnswer(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + challengeId="string", + hashOfSuppliedAnswer="string") + ), + exampleInboundMessage = ( + InBoundValidateChallengeAnswer(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=true) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def validateChallengeAnswer(challengeId: String, hashOfSuppliedAnswer: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { + import com.openbankproject.commons.dto.{OutBoundValidateChallengeAnswer => OutBound, InBoundValidateChallengeAnswer => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, challengeId, hashOfSuppliedAnswer) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[Boolean](callContext)) + } + + messageDocs += getUserDoc + def getUserDoc = MessageDoc( + process = "obp.getUser", + messageFormat = messageFormat, + description = "Get User", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetUser(name=usernameExample.value, + password="string") + ), + exampleInboundMessage = ( + InBoundGetUser(status=MessageDocsSwaggerDefinitions.inboundStatus, + data= InboundUser(email=emailExample.value, + password="string", + displayName="string")) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getUser(name: String, password: String): Box[InboundUser] = { + import com.openbankproject.commons.dto.{OutBoundGetUser => OutBound, InBoundGetUser => InBound} + val callContext: Option[CallContext] = None + val req = OutBound(name, password) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[InboundUser](callContext)) + } + + messageDocs += getBankAccountOldDoc + def getBankAccountOldDoc = MessageDoc( + process = "obp.getBankAccountOld", + messageFormat = messageFormat, + description = "Get Bank Account Old", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetBankAccountOld(bankId=BankId(bankIdExample.value), + accountId=AccountId(accountIdExample.value)) + ), + exampleInboundMessage = ( + InBoundGetBankAccountOld(status=MessageDocsSwaggerDefinitions.inboundStatus, + data= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getBankAccountOld(bankId: BankId, accountId: AccountId): Box[BankAccount] = { + import com.openbankproject.commons.dto.{OutBoundGetBankAccountOld => OutBound, InBoundGetBankAccountOld => InBound} + val callContext: Option[CallContext] = None + val req = OutBound(bankId, accountId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[BankAccountCommons](callContext)) + } + + messageDocs += getBankAccountByIbanDoc + def getBankAccountByIbanDoc = MessageDoc( + process = "obp.getBankAccountByIban", + messageFormat = messageFormat, + description = "Get Bank Account By Iban", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetBankAccountByIban(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + iban=ibanExample.value) + ), + exampleInboundMessage = ( + InBoundGetBankAccountByIban(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getBankAccountByIban(iban: String, callContext: Option[CallContext]): OBPReturnType[Box[BankAccount]] = { + import com.openbankproject.commons.dto.{OutBoundGetBankAccountByIban => OutBound, InBoundGetBankAccountByIban => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, iban) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[BankAccountCommons](callContext)) + } + + messageDocs += getBankAccountByRoutingDoc + def getBankAccountByRoutingDoc = MessageDoc( + process = "obp.getBankAccountByRouting", + messageFormat = messageFormat, + description = "Get Bank Account By Routing", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetBankAccountByRouting(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + scheme="string", + address="string") + ), + exampleInboundMessage = ( + InBoundGetBankAccountByRouting(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getBankAccountByRouting(scheme: String, address: String, callContext: Option[CallContext]): Box[(BankAccount, Option[CallContext])] = { + import com.openbankproject.commons.dto.{OutBoundGetBankAccountByRouting => OutBound, InBoundGetBankAccountByRouting => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, scheme, address) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[BankAccountCommons](callContext)) + } + + messageDocs += getBankAccountsDoc + def getBankAccountsDoc = MessageDoc( + process = "obp.getBankAccounts", + messageFormat = messageFormat, + description = "Get Bank Accounts", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetBankAccounts(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankIdAccountIds=List( BankIdAccountId(bankId=BankId(bankIdExample.value), + accountId=AccountId(accountIdExample.value)))) + ), + exampleInboundMessage = ( + InBoundGetBankAccounts(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getBankAccounts(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]): OBPReturnType[Box[List[BankAccount]]] = { + import com.openbankproject.commons.dto.{OutBoundGetBankAccounts => OutBound, InBoundGetBankAccounts => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankIdAccountIds) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[BankAccountCommons]](callContext)) + } + + messageDocs += getBankAccountsBalancesDoc + def getBankAccountsBalancesDoc = MessageDoc( + process = "obp.getBankAccountsBalances", + messageFormat = messageFormat, + description = "Get Bank Accounts Balances", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetBankAccountsBalances(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankIdAccountIds=List( BankIdAccountId(bankId=BankId(bankIdExample.value), + accountId=AccountId(accountIdExample.value)))) + ), + exampleInboundMessage = ( + InBoundGetBankAccountsBalances(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= AccountsBalances(accounts=List( AccountBalance(id=accountIdExample.value, + label=labelExample.value, + bankId=bankIdExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + balance= AmountOfMoney(currency=balanceCurrencyExample.value, + amount=balanceAmountExample.value))), + overallBalance= AmountOfMoney(currency=currencyExample.value, + amount="string"), + overallBalanceDate=new Date())) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getBankAccountsBalances(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]): OBPReturnType[Box[AccountsBalances]] = { + import com.openbankproject.commons.dto.{OutBoundGetBankAccountsBalances => OutBound, InBoundGetBankAccountsBalances => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankIdAccountIds) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[AccountsBalances](callContext)) + } + + messageDocs += getBankAccountsHeldDoc + def getBankAccountsHeldDoc = MessageDoc( + process = "obp.getBankAccountsHeld", + messageFormat = messageFormat, + description = "Get Bank Accounts Held", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetBankAccountsHeld(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankIdAccountIds=List( BankIdAccountId(bankId=BankId(bankIdExample.value), + accountId=AccountId(accountIdExample.value)))) + ), + exampleInboundMessage = ( + InBoundGetBankAccountsHeld(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( AccountHeld(id="string", + bankId=bankIdExample.value, + number="string", + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value))))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getBankAccountsHeld(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]): OBPReturnType[Box[List[AccountHeld]]] = { + import com.openbankproject.commons.dto.{OutBoundGetBankAccountsHeld => OutBound, InBoundGetBankAccountsHeld => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankIdAccountIds) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[AccountHeld]](callContext)) + } + + messageDocs += getCounterpartyTraitDoc + def getCounterpartyTraitDoc = MessageDoc( + process = "obp.getCounterpartyTrait", + messageFormat = messageFormat, + description = "Get Counterparty Trait", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetCounterpartyTrait(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + accountId=AccountId(accountIdExample.value), + couterpartyId="string") + ), + exampleInboundMessage = ( + InBoundGetCounterpartyTrait(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= CounterpartyTraitCommons(createdByUserId="string", + name="string", + description="string", + thisBankId="string", + thisAccountId="string", + thisViewId="string", + counterpartyId=counterpartyIdExample.value, + otherAccountRoutingScheme=accountRoutingSchemeExample.value, + otherAccountRoutingAddress=accountRoutingAddressExample.value, + otherAccountSecondaryRoutingScheme="string", + otherAccountSecondaryRoutingAddress="string", + otherBankRoutingScheme=bankRoutingSchemeExample.value, + otherBankRoutingAddress=bankRoutingAddressExample.value, + otherBranchRoutingScheme=branchRoutingSchemeExample.value, + otherBranchRoutingAddress=branchRoutingAddressExample.value, + isBeneficiary=isBeneficiaryExample.value.toBoolean, + bespoke=List( CounterpartyBespoke(key=keyExample.value, + value=valueExample.value)))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getCounterpartyTrait(bankId: BankId, accountId: AccountId, couterpartyId: String, callContext: Option[CallContext]): OBPReturnType[Box[CounterpartyTrait]] = { + import com.openbankproject.commons.dto.{OutBoundGetCounterpartyTrait => OutBound, InBoundGetCounterpartyTrait => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, couterpartyId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[CounterpartyTraitCommons](callContext)) + } + + messageDocs += getCounterpartyByCounterpartyIdDoc + def getCounterpartyByCounterpartyIdDoc = MessageDoc( + process = "obp.getCounterpartyByCounterpartyId", + messageFormat = messageFormat, + description = "Get Counterparty By Counterparty Id", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetCounterpartyByCounterpartyId(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + counterpartyId=CounterpartyId(counterpartyIdExample.value)) + ), + exampleInboundMessage = ( + InBoundGetCounterpartyByCounterpartyId(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= CounterpartyTraitCommons(createdByUserId="string", + name="string", + description="string", + thisBankId="string", + thisAccountId="string", + thisViewId="string", + counterpartyId=counterpartyIdExample.value, + otherAccountRoutingScheme=accountRoutingSchemeExample.value, + otherAccountRoutingAddress=accountRoutingAddressExample.value, + otherAccountSecondaryRoutingScheme="string", + otherAccountSecondaryRoutingAddress="string", + otherBankRoutingScheme=bankRoutingSchemeExample.value, + otherBankRoutingAddress=bankRoutingAddressExample.value, + otherBranchRoutingScheme=branchRoutingSchemeExample.value, + otherBranchRoutingAddress=branchRoutingAddressExample.value, + isBeneficiary=isBeneficiaryExample.value.toBoolean, + bespoke=List( CounterpartyBespoke(key=keyExample.value, + value=valueExample.value)))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getCounterpartyByCounterpartyId(counterpartyId: CounterpartyId, callContext: Option[CallContext]): OBPReturnType[Box[CounterpartyTrait]] = { + import com.openbankproject.commons.dto.{OutBoundGetCounterpartyByCounterpartyId => OutBound, InBoundGetCounterpartyByCounterpartyId => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, counterpartyId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[CounterpartyTraitCommons](callContext)) + } + + messageDocs += getCounterpartyByIbanDoc + def getCounterpartyByIbanDoc = MessageDoc( + process = "obp.getCounterpartyByIban", + messageFormat = messageFormat, + description = "Get Counterparty By Iban", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetCounterpartyByIban(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + iban=ibanExample.value) + ), + exampleInboundMessage = ( + InBoundGetCounterpartyByIban(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= CounterpartyTraitCommons(createdByUserId="string", + name="string", + description="string", + thisBankId="string", + thisAccountId="string", + thisViewId="string", + counterpartyId=counterpartyIdExample.value, + otherAccountRoutingScheme=accountRoutingSchemeExample.value, + otherAccountRoutingAddress=accountRoutingAddressExample.value, + otherAccountSecondaryRoutingScheme="string", + otherAccountSecondaryRoutingAddress="string", + otherBankRoutingScheme=bankRoutingSchemeExample.value, + otherBankRoutingAddress=bankRoutingAddressExample.value, + otherBranchRoutingScheme=branchRoutingSchemeExample.value, + otherBranchRoutingAddress=branchRoutingAddressExample.value, + isBeneficiary=isBeneficiaryExample.value.toBoolean, + bespoke=List( CounterpartyBespoke(key=keyExample.value, + value=valueExample.value)))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getCounterpartyByIban(iban: String, callContext: Option[CallContext]): OBPReturnType[Box[CounterpartyTrait]] = { + import com.openbankproject.commons.dto.{OutBoundGetCounterpartyByIban => OutBound, InBoundGetCounterpartyByIban => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, iban) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[CounterpartyTraitCommons](callContext)) + } + + messageDocs += getCounterpartiesDoc + def getCounterpartiesDoc = MessageDoc( + process = "obp.getCounterparties", + messageFormat = messageFormat, + description = "Get Counterparties", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetCounterparties(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + thisBankId=BankId(bankIdExample.value), + thisAccountId=AccountId(accountIdExample.value), + viewId=ViewId(viewIdExample.value)) + ), + exampleInboundMessage = ( + InBoundGetCounterparties(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( CounterpartyTraitCommons(createdByUserId="string", + name="string", + description="string", + thisBankId="string", + thisAccountId="string", + thisViewId="string", + counterpartyId=counterpartyIdExample.value, + otherAccountRoutingScheme=accountRoutingSchemeExample.value, + otherAccountRoutingAddress=accountRoutingAddressExample.value, + otherAccountSecondaryRoutingScheme="string", + otherAccountSecondaryRoutingAddress="string", + otherBankRoutingScheme=bankRoutingSchemeExample.value, + otherBankRoutingAddress=bankRoutingAddressExample.value, + otherBranchRoutingScheme=branchRoutingSchemeExample.value, + otherBranchRoutingAddress=branchRoutingAddressExample.value, + isBeneficiary=isBeneficiaryExample.value.toBoolean, + bespoke=List( CounterpartyBespoke(key=keyExample.value, + value=valueExample.value))))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getCounterparties(thisBankId: BankId, thisAccountId: AccountId, viewId: ViewId, callContext: Option[CallContext]): OBPReturnType[Box[List[CounterpartyTrait]]] = { + import com.openbankproject.commons.dto.{OutBoundGetCounterparties => OutBound, InBoundGetCounterparties => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, thisBankId, thisAccountId, viewId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[CounterpartyTraitCommons]](callContext)) + } + + messageDocs += getTransactionsCoreDoc + def getTransactionsCoreDoc = MessageDoc( + process = "obp.getTransactionsCore", + messageFormat = messageFormat, + description = "Get Transactions Core", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetTransactionsCore(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + accountID=AccountId(accountIdExample.value), + limit=limitExample.value.toInt, + offset=offsetExample.value.toInt, + fromDate="string", + toDate="string") + ), + exampleInboundMessage = ( + InBoundGetTransactionsCore(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( TransactionCore(id=TransactionId(transactionIdExample.value), + thisAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value), + otherAccount= CounterpartyCore(kind="string", + counterpartyId=counterpartyIdExample.value, + counterpartyName=counterpartyNameExample.value, + thisBankId=BankId(bankIdExample.value), + thisAccountId=AccountId(accountIdExample.value), + otherBankRoutingScheme=bankRoutingSchemeExample.value, + otherBankRoutingAddress=Some(bankRoutingAddressExample.value), + otherAccountRoutingScheme=accountRoutingSchemeExample.value, + otherAccountRoutingAddress=Some(accountRoutingAddressExample.value), + otherAccountProvider=otherAccountProviderExample.value, + isBeneficiary=isBeneficiaryExample.value.toBoolean), + transactionType=transactionTypeExample.value, + amount=BigDecimal("123.321"), + currency=currencyExample.value, + description=Some("string"), + startDate=new Date(), + finishDate=new Date(), + balance=BigDecimal(balanceAmountExample.value)))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getTransactionsCore(bankId: BankId, accountID: AccountId, queryParams: List[OBPQueryParam], callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionCore]]] = { + import com.openbankproject.commons.dto.{OutBoundGetTransactionsCore => OutBound, InBoundGetTransactionsCore => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountID, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[TransactionCore]](callContext)) + } + + messageDocs += getPhysicalCardForBankDoc + def getPhysicalCardForBankDoc = MessageDoc( + process = "obp.getPhysicalCardForBank", + messageFormat = messageFormat, + description = "Get Physical Card For Bank", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetPhysicalCardForBank(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + cardId=cardIdExample.value) + ), + exampleInboundMessage = ( + InBoundGetPhysicalCardForBank(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= PhysicalCard(cardId=cardIdExample.value, + bankId=bankIdExample.value, + bankCardNumber=bankCardNumberExample.value, + cardType=cardTypeExample.value, + nameOnCard=nameOnCardExample.value, + issueNumber=issueNumberExample.value, + serialNumber=serialNumberExample.value, + validFrom=new Date(), + expires=new Date(), + enabled=true, + cancelled=true, + onHotList=true, + technology="string", + networks=List("string"), + allows=List(com.openbankproject.commons.model.CardAction.DEBIT), + account= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=accountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value), + replacement=Some( CardReplacementInfo(requestedDate=new Date(), + reasonRequested=com.openbankproject.commons.model.CardReplacementReason.FIRST)), + pinResets=List( PinResetInfo(requestedDate=new Date(), + reasonRequested=com.openbankproject.commons.model.PinResetReason.FORGOT)), + collected=Some(CardCollectionInfo(new Date())), + posted=Some(CardPostedInfo(new Date())), + customerId=customerIdExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getPhysicalCardForBank(bankId: BankId, cardId: String, callContext: Option[CallContext]): OBPReturnType[Box[PhysicalCardTrait]] = { + import com.openbankproject.commons.dto.{OutBoundGetPhysicalCardForBank => OutBound, InBoundGetPhysicalCardForBank => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, cardId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[PhysicalCard](callContext)) + } + + messageDocs += deletePhysicalCardForBankDoc + def deletePhysicalCardForBankDoc = MessageDoc( + process = "obp.deletePhysicalCardForBank", + messageFormat = messageFormat, + description = "Delete Physical Card For Bank", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundDeletePhysicalCardForBank(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + cardId=cardIdExample.value) + ), + exampleInboundMessage = ( + InBoundDeletePhysicalCardForBank(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=true) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def deletePhysicalCardForBank(bankId: BankId, cardId: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { + import com.openbankproject.commons.dto.{OutBoundDeletePhysicalCardForBank => OutBound, InBoundDeletePhysicalCardForBank => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, cardId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[Boolean](callContext)) + } + + messageDocs += getPhysicalCardsForBankDoc + def getPhysicalCardsForBankDoc = MessageDoc( + process = "obp.getPhysicalCardsForBank", + messageFormat = messageFormat, + description = "Get Physical Cards For Bank", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetPhysicalCardsForBank(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bank= BankCommons(bankId=BankId(bankIdExample.value), + shortName=bankShortNameExample.value, + fullName=bankFullNameExample.value, + logoUrl=bankLogoUrlExample.value, + websiteUrl=bankWebsiteUrlExample.value, + bankRoutingScheme=bankRoutingSchemeExample.value, + bankRoutingAddress=bankRoutingAddressExample.value, + swiftBic=bankSwiftBicExample.value, + nationalIdentifier=bankNationalIdentifierExample.value), + user= UserCommons(userPrimaryKey=UserPrimaryKey(123), + userId=userIdExample.value, + idGivenByProvider="string", + provider="string", + emailAddress=emailExample.value, + name=usernameExample.value), + limit=limitExample.value.toInt, + offset=offsetExample.value.toInt, + fromDate="string", + toDate="string") + ), + exampleInboundMessage = ( + InBoundGetPhysicalCardsForBank(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( PhysicalCard(cardId=cardIdExample.value, + bankId=bankIdExample.value, + bankCardNumber=bankCardNumberExample.value, + cardType=cardTypeExample.value, + nameOnCard=nameOnCardExample.value, + issueNumber=issueNumberExample.value, + serialNumber=serialNumberExample.value, + validFrom=new Date(), + expires=new Date(), + enabled=true, + cancelled=true, + onHotList=true, + technology="string", + networks=List("string"), + allows=List(com.openbankproject.commons.model.CardAction.DEBIT), + account= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=accountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value), + replacement=Some( CardReplacementInfo(requestedDate=new Date(), + reasonRequested=com.openbankproject.commons.model.CardReplacementReason.FIRST)), + pinResets=List( PinResetInfo(requestedDate=new Date(), + reasonRequested=com.openbankproject.commons.model.PinResetReason.FORGOT)), + collected=Some(CardCollectionInfo(new Date())), + posted=Some(CardPostedInfo(new Date())), + customerId=customerIdExample.value))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getPhysicalCardsForBank(bank: Bank, user: User, queryParams: List[OBPQueryParam], callContext: Option[CallContext]): OBPReturnType[Box[List[PhysicalCard]]] = { + import com.openbankproject.commons.dto.{OutBoundGetPhysicalCardsForBank => OutBound, InBoundGetPhysicalCardsForBank => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bank, user, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[PhysicalCard]](callContext)) + } + + messageDocs += createPhysicalCardDoc + def createPhysicalCardDoc = MessageDoc( + process = "obp.createPhysicalCard", + messageFormat = messageFormat, + description = "Create Physical Card", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreatePhysicalCard(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankCardNumber=bankCardNumberExample.value, + nameOnCard=nameOnCardExample.value, + cardType=cardTypeExample.value, + issueNumber=issueNumberExample.value, + serialNumber=serialNumberExample.value, + validFrom=new Date(), + expires=new Date(), + enabled=true, + cancelled=true, + onHotList=true, + technology="string", + networks=List("string"), + allows=List("string"), + accountId=accountIdExample.value, + bankId=bankIdExample.value, + replacement=Some( CardReplacementInfo(requestedDate=new Date(), + reasonRequested=com.openbankproject.commons.model.CardReplacementReason.FIRST)), + pinResets=List( PinResetInfo(requestedDate=new Date(), + reasonRequested=com.openbankproject.commons.model.PinResetReason.FORGOT)), + collected=Some(CardCollectionInfo(new Date())), + posted=Some(CardPostedInfo(new Date())), + customerId=customerIdExample.value) + ), + exampleInboundMessage = ( + InBoundCreatePhysicalCard(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= PhysicalCard(cardId=cardIdExample.value, + bankId=bankIdExample.value, + bankCardNumber=bankCardNumberExample.value, + cardType=cardTypeExample.value, + nameOnCard=nameOnCardExample.value, + issueNumber=issueNumberExample.value, + serialNumber=serialNumberExample.value, + validFrom=new Date(), + expires=new Date(), + enabled=true, + cancelled=true, + onHotList=true, + technology="string", + networks=List("string"), + allows=List(com.openbankproject.commons.model.CardAction.DEBIT), + account= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=accountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value), + replacement=Some( CardReplacementInfo(requestedDate=new Date(), + reasonRequested=com.openbankproject.commons.model.CardReplacementReason.FIRST)), + pinResets=List( PinResetInfo(requestedDate=new Date(), + reasonRequested=com.openbankproject.commons.model.PinResetReason.FORGOT)), + collected=Some(CardCollectionInfo(new Date())), + posted=Some(CardPostedInfo(new Date())), + customerId=customerIdExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createPhysicalCard(bankCardNumber: String, nameOnCard: String, cardType: String, issueNumber: String, serialNumber: String, validFrom: Date, expires: Date, enabled: Boolean, cancelled: Boolean, onHotList: Boolean, technology: String, networks: List[String], allows: List[String], accountId: String, bankId: String, replacement: Option[CardReplacementInfo], pinResets: List[PinResetInfo], collected: Option[CardCollectionInfo], posted: Option[CardPostedInfo], customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[PhysicalCard]] = { + import com.openbankproject.commons.dto.{OutBoundCreatePhysicalCard => OutBound, InBoundCreatePhysicalCard => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankCardNumber, nameOnCard, cardType, issueNumber, serialNumber, validFrom, expires, enabled, cancelled, onHotList, technology, networks, allows, accountId, bankId, replacement, pinResets, collected, posted, customerId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[PhysicalCard](callContext)) + } + + messageDocs += updatePhysicalCardDoc + def updatePhysicalCardDoc = MessageDoc( + process = "obp.updatePhysicalCard", + messageFormat = messageFormat, + description = "Update Physical Card", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundUpdatePhysicalCard(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + cardId=cardIdExample.value, + bankCardNumber=bankCardNumberExample.value, + nameOnCard=nameOnCardExample.value, + cardType=cardTypeExample.value, + issueNumber=issueNumberExample.value, + serialNumber=serialNumberExample.value, + validFrom=new Date(), + expires=new Date(), + enabled=true, + cancelled=true, + onHotList=true, + technology="string", + networks=List("string"), + allows=List("string"), + accountId=accountIdExample.value, + bankId=bankIdExample.value, + replacement=Some( CardReplacementInfo(requestedDate=new Date(), + reasonRequested=com.openbankproject.commons.model.CardReplacementReason.FIRST)), + pinResets=List( PinResetInfo(requestedDate=new Date(), + reasonRequested=com.openbankproject.commons.model.PinResetReason.FORGOT)), + collected=Some(CardCollectionInfo(new Date())), + posted=Some(CardPostedInfo(new Date())), + customerId=customerIdExample.value) + ), + exampleInboundMessage = ( + InBoundUpdatePhysicalCard(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= PhysicalCard(cardId=cardIdExample.value, + bankId=bankIdExample.value, + bankCardNumber=bankCardNumberExample.value, + cardType=cardTypeExample.value, + nameOnCard=nameOnCardExample.value, + issueNumber=issueNumberExample.value, + serialNumber=serialNumberExample.value, + validFrom=new Date(), + expires=new Date(), + enabled=true, + cancelled=true, + onHotList=true, + technology="string", + networks=List("string"), + allows=List(com.openbankproject.commons.model.CardAction.DEBIT), + account= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=accountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value), + replacement=Some( CardReplacementInfo(requestedDate=new Date(), + reasonRequested=com.openbankproject.commons.model.CardReplacementReason.FIRST)), + pinResets=List( PinResetInfo(requestedDate=new Date(), + reasonRequested=com.openbankproject.commons.model.PinResetReason.FORGOT)), + collected=Some(CardCollectionInfo(new Date())), + posted=Some(CardPostedInfo(new Date())), + customerId=customerIdExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def updatePhysicalCard(cardId: String, bankCardNumber: String, nameOnCard: String, cardType: String, issueNumber: String, serialNumber: String, validFrom: Date, expires: Date, enabled: Boolean, cancelled: Boolean, onHotList: Boolean, technology: String, networks: List[String], allows: List[String], accountId: String, bankId: String, replacement: Option[CardReplacementInfo], pinResets: List[PinResetInfo], collected: Option[CardCollectionInfo], posted: Option[CardPostedInfo], customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[PhysicalCardTrait]] = { + import com.openbankproject.commons.dto.{OutBoundUpdatePhysicalCard => OutBound, InBoundUpdatePhysicalCard => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, cardId, bankCardNumber, nameOnCard, cardType, issueNumber, serialNumber, validFrom, expires, enabled, cancelled, onHotList, technology, networks, allows, accountId, bankId, replacement, pinResets, collected, posted, customerId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[PhysicalCard](callContext)) + } + + messageDocs += makePaymentv210Doc + def makePaymentv210Doc = MessageDoc( + process = "obp.makePaymentv210", + messageFormat = messageFormat, + description = "Make Paymentv210", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundMakePaymentv210(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value), + toAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value), + transactionRequestCommonBody= TransactionRequestCommonBodyJSONCommons(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string"), + amount=BigDecimal("123.321"), + description="string", + transactionRequestType=TransactionRequestType(transactionRequestTypeExample.value), + chargePolicy="string") + ), + exampleInboundMessage = ( + InBoundMakePaymentv210(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=TransactionId(transactionIdExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def makePaymentv210(fromAccount: BankAccount, toAccount: BankAccount, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, amount: BigDecimal, description: String, transactionRequestType: TransactionRequestType, chargePolicy: String, callContext: Option[CallContext]): OBPReturnType[Box[TransactionId]] = { + import com.openbankproject.commons.dto.{OutBoundMakePaymentv210 => OutBound, InBoundMakePaymentv210 => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, fromAccount, toAccount, transactionRequestCommonBody, amount, description, transactionRequestType, chargePolicy) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[TransactionId](callContext)) + } + + messageDocs += createTransactionRequestv210Doc + def createTransactionRequestv210Doc = MessageDoc( + process = "obp.createTransactionRequestv210", + messageFormat = messageFormat, + description = "Create Transaction Requestv210", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateTransactionRequestv210(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + initiator= UserCommons(userPrimaryKey=UserPrimaryKey(123), + userId=userIdExample.value, + idGivenByProvider="string", + provider="string", + emailAddress=emailExample.value, + name=usernameExample.value), + viewId=ViewId(viewIdExample.value), + fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value), + toAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value), + transactionRequestType=TransactionRequestType(transactionRequestTypeExample.value), + transactionRequestCommonBody= TransactionRequestCommonBodyJSONCommons(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string"), + detailsPlain="string", + chargePolicy="string", + challengeType=Some("string"), + scaMethod=Some(com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SMS)) + ), + exampleInboundMessage = ( + InBoundCreateTransactionRequestv210(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= TransactionRequest(id=TransactionRequestId("string"), + `type`=transactionRequestTypeExample.value, + from= TransactionRequestAccount(bank_id="string", + account_id="string"), + body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id="string", + account_id="string")), + to_sepa=Some(TransactionRequestIban("string")), + to_counterparty=Some(TransactionRequestCounterpartyId("string")), + to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string", + message="string", + from= FromAccountTransfer(mobile_phone_number="string", + nickname="string"), + to=ToAccountTransferToPhone("string"))), + to_transfer_to_atm=Some( TransactionRequestTransferToAtm(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string", + message="string", + from= FromAccountTransfer(mobile_phone_number="string", + nickname="string"), + to= ToAccountTransferToAtm(legal_name="string", + date_of_birth="string", + mobile_phone_number="string", + kyc_document= ToAccountTransferToAtmKycDocument(`type`="string", + number="string")))), + to_transfer_to_account=Some( TransactionRequestTransferToAccount(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string", + transfer_type="string", + future_date="string", + to= ToAccountTransferToAccount(name="string", + bank_code="string", + branch_number="string", + account= ToAccountTransferToAccountAccount(number=accountNumberExample.value, + iban=ibanExample.value)))), + to_sepa_credit_transfers=Some( SepaCreditTransfers(debtorAccount=PaymentAccount("string"), + instructedAmount= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + creditorAccount=PaymentAccount("string"), + creditorName="string")), + value= AmountOfMoney(currency=currencyExample.value, + amount="string"), + description="string"), + transaction_ids="string", + status="string", + start_date=new Date(), + end_date=new Date(), + challenge= TransactionRequestChallenge(id="string", + allowed_attempts=123, + challenge_type="string"), + charge= TransactionRequestCharge(summary="string", + value= AmountOfMoney(currency=currencyExample.value, + amount="string")), + charge_policy="string", + counterparty_id=CounterpartyId(counterpartyIdExample.value), + name="string", + this_bank_id=BankId(bankIdExample.value), + this_account_id=AccountId(accountIdExample.value), + this_view_id=ViewId(viewIdExample.value), + other_account_routing_scheme="string", + other_account_routing_address="string", + other_bank_routing_scheme="string", + other_bank_routing_address="string", + is_beneficiary=true, + future_date=Some("string"))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createTransactionRequestv210(initiator: User, viewId: ViewId, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, detailsPlain: String, chargePolicy: String, challengeType: Option[String], scaMethod: Option[StrongCustomerAuthentication.SCA], callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = { + import com.openbankproject.commons.dto.{OutBoundCreateTransactionRequestv210 => OutBound, InBoundCreateTransactionRequestv210 => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, viewId, fromAccount, toAccount, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy, challengeType, scaMethod) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[TransactionRequest](callContext)) + } + + messageDocs += createTransactionRequestv400Doc + def createTransactionRequestv400Doc = MessageDoc( + process = "obp.createTransactionRequestv400", + messageFormat = messageFormat, + description = "Create Transaction Requestv400", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateTransactionRequestv400(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + initiator= UserCommons(userPrimaryKey=UserPrimaryKey(123), + userId=userIdExample.value, + idGivenByProvider="string", + provider="string", + emailAddress=emailExample.value, + name=usernameExample.value), + viewId=ViewId(viewIdExample.value), + fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value), + toAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value), + transactionRequestType=TransactionRequestType(transactionRequestTypeExample.value), + transactionRequestCommonBody= TransactionRequestCommonBodyJSONCommons(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string"), + detailsPlain="string", + chargePolicy="string", + challengeType=Some("string"), + scaMethod=Some(com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SMS)) + ), + exampleInboundMessage = ( + InBoundCreateTransactionRequestv400(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= TransactionRequest(id=TransactionRequestId("string"), + `type`=transactionRequestTypeExample.value, + from= TransactionRequestAccount(bank_id="string", + account_id="string"), + body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id="string", + account_id="string")), + to_sepa=Some(TransactionRequestIban("string")), + to_counterparty=Some(TransactionRequestCounterpartyId("string")), + to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string", + message="string", + from= FromAccountTransfer(mobile_phone_number="string", + nickname="string"), + to=ToAccountTransferToPhone("string"))), + to_transfer_to_atm=Some( TransactionRequestTransferToAtm(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string", + message="string", + from= FromAccountTransfer(mobile_phone_number="string", + nickname="string"), + to= ToAccountTransferToAtm(legal_name="string", + date_of_birth="string", + mobile_phone_number="string", + kyc_document= ToAccountTransferToAtmKycDocument(`type`="string", + number="string")))), + to_transfer_to_account=Some( TransactionRequestTransferToAccount(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string", + transfer_type="string", + future_date="string", + to= ToAccountTransferToAccount(name="string", + bank_code="string", + branch_number="string", + account= ToAccountTransferToAccountAccount(number=accountNumberExample.value, + iban=ibanExample.value)))), + to_sepa_credit_transfers=Some( SepaCreditTransfers(debtorAccount=PaymentAccount("string"), + instructedAmount= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + creditorAccount=PaymentAccount("string"), + creditorName="string")), + value= AmountOfMoney(currency=currencyExample.value, + amount="string"), + description="string"), + transaction_ids="string", + status="string", + start_date=new Date(), + end_date=new Date(), + challenge= TransactionRequestChallenge(id="string", + allowed_attempts=123, + challenge_type="string"), + charge= TransactionRequestCharge(summary="string", + value= AmountOfMoney(currency=currencyExample.value, + amount="string")), + charge_policy="string", + counterparty_id=CounterpartyId(counterpartyIdExample.value), + name="string", + this_bank_id=BankId(bankIdExample.value), + this_account_id=AccountId(accountIdExample.value), + this_view_id=ViewId(viewIdExample.value), + other_account_routing_scheme="string", + other_account_routing_address="string", + other_bank_routing_scheme="string", + other_bank_routing_address="string", + is_beneficiary=true, + future_date=Some("string"))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createTransactionRequestv400(initiator: User, viewId: ViewId, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, detailsPlain: String, chargePolicy: String, challengeType: Option[String], scaMethod: Option[StrongCustomerAuthentication.SCA], callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = { + import com.openbankproject.commons.dto.{OutBoundCreateTransactionRequestv400 => OutBound, InBoundCreateTransactionRequestv400 => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, viewId, fromAccount, toAccount, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy, challengeType, scaMethod) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[TransactionRequest](callContext)) + } + + messageDocs += getTransactionRequests210Doc + def getTransactionRequests210Doc = MessageDoc( + process = "obp.getTransactionRequests210", + messageFormat = messageFormat, + description = "Get Transaction Requests210", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetTransactionRequests210(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + initiator= UserCommons(userPrimaryKey=UserPrimaryKey(123), + userId=userIdExample.value, + idGivenByProvider="string", + provider="string", + emailAddress=emailExample.value, + name=usernameExample.value), + fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value)) + ), + exampleInboundMessage = ( + InBoundGetTransactionRequests210(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( TransactionRequest(id=TransactionRequestId("string"), + `type`=transactionRequestTypeExample.value, + from= TransactionRequestAccount(bank_id="string", + account_id="string"), + body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id="string", + account_id="string")), + to_sepa=Some(TransactionRequestIban("string")), + to_counterparty=Some(TransactionRequestCounterpartyId("string")), + to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string", + message="string", + from= FromAccountTransfer(mobile_phone_number="string", + nickname="string"), + to=ToAccountTransferToPhone("string"))), + to_transfer_to_atm=Some( TransactionRequestTransferToAtm(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string", + message="string", + from= FromAccountTransfer(mobile_phone_number="string", + nickname="string"), + to= ToAccountTransferToAtm(legal_name="string", + date_of_birth="string", + mobile_phone_number="string", + kyc_document= ToAccountTransferToAtmKycDocument(`type`="string", + number="string")))), + to_transfer_to_account=Some( TransactionRequestTransferToAccount(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string", + transfer_type="string", + future_date="string", + to= ToAccountTransferToAccount(name="string", + bank_code="string", + branch_number="string", + account= ToAccountTransferToAccountAccount(number=accountNumberExample.value, + iban=ibanExample.value)))), + to_sepa_credit_transfers=Some( SepaCreditTransfers(debtorAccount=PaymentAccount("string"), + instructedAmount= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + creditorAccount=PaymentAccount("string"), + creditorName="string")), + value= AmountOfMoney(currency=currencyExample.value, + amount="string"), + description="string"), + transaction_ids="string", + status="string", + start_date=new Date(), + end_date=new Date(), + challenge= TransactionRequestChallenge(id="string", + allowed_attempts=123, + challenge_type="string"), + charge= TransactionRequestCharge(summary="string", + value= AmountOfMoney(currency=currencyExample.value, + amount="string")), + charge_policy="string", + counterparty_id=CounterpartyId(counterpartyIdExample.value), + name="string", + this_bank_id=BankId(bankIdExample.value), + this_account_id=AccountId(accountIdExample.value), + this_view_id=ViewId(viewIdExample.value), + other_account_routing_scheme="string", + other_account_routing_address="string", + other_bank_routing_scheme="string", + other_bank_routing_address="string", + is_beneficiary=true, + future_date=Some("string")))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getTransactionRequests210(initiator: User, fromAccount: BankAccount, callContext: Option[CallContext]): Box[(List[TransactionRequest], Option[CallContext])] = { + import com.openbankproject.commons.dto.{OutBoundGetTransactionRequests210 => OutBound, InBoundGetTransactionRequests210 => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, fromAccount) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[TransactionRequest]](callContext)) + } + + messageDocs += getTransactionRequestImplDoc + def getTransactionRequestImplDoc = MessageDoc( + process = "obp.getTransactionRequestImpl", + messageFormat = messageFormat, + description = "Get Transaction Request Impl", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetTransactionRequestImpl(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + transactionRequestId=TransactionRequestId("string")) + ), + exampleInboundMessage = ( + InBoundGetTransactionRequestImpl(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= TransactionRequest(id=TransactionRequestId("string"), + `type`=transactionRequestTypeExample.value, + from= TransactionRequestAccount(bank_id="string", + account_id="string"), + body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id="string", + account_id="string")), + to_sepa=Some(TransactionRequestIban("string")), + to_counterparty=Some(TransactionRequestCounterpartyId("string")), + to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string", + message="string", + from= FromAccountTransfer(mobile_phone_number="string", + nickname="string"), + to=ToAccountTransferToPhone("string"))), + to_transfer_to_atm=Some( TransactionRequestTransferToAtm(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string", + message="string", + from= FromAccountTransfer(mobile_phone_number="string", + nickname="string"), + to= ToAccountTransferToAtm(legal_name="string", + date_of_birth="string", + mobile_phone_number="string", + kyc_document= ToAccountTransferToAtmKycDocument(`type`="string", + number="string")))), + to_transfer_to_account=Some( TransactionRequestTransferToAccount(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string", + transfer_type="string", + future_date="string", + to= ToAccountTransferToAccount(name="string", + bank_code="string", + branch_number="string", + account= ToAccountTransferToAccountAccount(number=accountNumberExample.value, + iban=ibanExample.value)))), + to_sepa_credit_transfers=Some( SepaCreditTransfers(debtorAccount=PaymentAccount("string"), + instructedAmount= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + creditorAccount=PaymentAccount("string"), + creditorName="string")), + value= AmountOfMoney(currency=currencyExample.value, + amount="string"), + description="string"), + transaction_ids="string", + status="string", + start_date=new Date(), + end_date=new Date(), + challenge= TransactionRequestChallenge(id="string", + allowed_attempts=123, + challenge_type="string"), + charge= TransactionRequestCharge(summary="string", + value= AmountOfMoney(currency=currencyExample.value, + amount="string")), + charge_policy="string", + counterparty_id=CounterpartyId(counterpartyIdExample.value), + name="string", + this_bank_id=BankId(bankIdExample.value), + this_account_id=AccountId(accountIdExample.value), + this_view_id=ViewId(viewIdExample.value), + other_account_routing_scheme="string", + other_account_routing_address="string", + other_bank_routing_scheme="string", + other_bank_routing_address="string", + is_beneficiary=true, + future_date=Some("string"))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getTransactionRequestImpl(transactionRequestId: TransactionRequestId, callContext: Option[CallContext]): Box[(TransactionRequest, Option[CallContext])] = { + import com.openbankproject.commons.dto.{OutBoundGetTransactionRequestImpl => OutBound, InBoundGetTransactionRequestImpl => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, transactionRequestId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[TransactionRequest](callContext)) + } + + messageDocs += createTransactionAfterChallengeV210Doc + def createTransactionAfterChallengeV210Doc = MessageDoc( + process = "obp.createTransactionAfterChallengeV210", + messageFormat = messageFormat, + description = "Create Transaction After Challenge V210", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateTransactionAfterChallengeV210(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value), + transactionRequest= TransactionRequest(id=TransactionRequestId("string"), + `type`=transactionRequestTypeExample.value, + from= TransactionRequestAccount(bank_id="string", + account_id="string"), + body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id="string", + account_id="string")), + to_sepa=Some(TransactionRequestIban("string")), + to_counterparty=Some(TransactionRequestCounterpartyId("string")), + to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string", + message="string", + from= FromAccountTransfer(mobile_phone_number="string", + nickname="string"), + to=ToAccountTransferToPhone("string"))), + to_transfer_to_atm=Some( TransactionRequestTransferToAtm(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string", + message="string", + from= FromAccountTransfer(mobile_phone_number="string", + nickname="string"), + to= ToAccountTransferToAtm(legal_name="string", + date_of_birth="string", + mobile_phone_number="string", + kyc_document= ToAccountTransferToAtmKycDocument(`type`="string", + number="string")))), + to_transfer_to_account=Some( TransactionRequestTransferToAccount(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string", + transfer_type="string", + future_date="string", + to= ToAccountTransferToAccount(name="string", + bank_code="string", + branch_number="string", + account= ToAccountTransferToAccountAccount(number=accountNumberExample.value, + iban=ibanExample.value)))), + to_sepa_credit_transfers=Some( SepaCreditTransfers(debtorAccount=PaymentAccount("string"), + instructedAmount= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + creditorAccount=PaymentAccount("string"), + creditorName="string")), + value= AmountOfMoney(currency=currencyExample.value, + amount="string"), + description="string"), + transaction_ids="string", + status="string", + start_date=new Date(), + end_date=new Date(), + challenge= TransactionRequestChallenge(id="string", + allowed_attempts=123, + challenge_type="string"), + charge= TransactionRequestCharge(summary="string", + value= AmountOfMoney(currency=currencyExample.value, + amount="string")), + charge_policy="string", + counterparty_id=CounterpartyId(counterpartyIdExample.value), + name="string", + this_bank_id=BankId(bankIdExample.value), + this_account_id=AccountId(accountIdExample.value), + this_view_id=ViewId(viewIdExample.value), + other_account_routing_scheme="string", + other_account_routing_address="string", + other_bank_routing_scheme="string", + other_bank_routing_address="string", + is_beneficiary=true, + future_date=Some("string"))) + ), + exampleInboundMessage = ( + InBoundCreateTransactionAfterChallengeV210(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= TransactionRequest(id=TransactionRequestId("string"), + `type`=transactionRequestTypeExample.value, + from= TransactionRequestAccount(bank_id="string", + account_id="string"), + body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id="string", + account_id="string")), + to_sepa=Some(TransactionRequestIban("string")), + to_counterparty=Some(TransactionRequestCounterpartyId("string")), + to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string", + message="string", + from= FromAccountTransfer(mobile_phone_number="string", + nickname="string"), + to=ToAccountTransferToPhone("string"))), + to_transfer_to_atm=Some( TransactionRequestTransferToAtm(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string", + message="string", + from= FromAccountTransfer(mobile_phone_number="string", + nickname="string"), + to= ToAccountTransferToAtm(legal_name="string", + date_of_birth="string", + mobile_phone_number="string", + kyc_document= ToAccountTransferToAtmKycDocument(`type`="string", + number="string")))), + to_transfer_to_account=Some( TransactionRequestTransferToAccount(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string", + transfer_type="string", + future_date="string", + to= ToAccountTransferToAccount(name="string", + bank_code="string", + branch_number="string", + account= ToAccountTransferToAccountAccount(number=accountNumberExample.value, + iban=ibanExample.value)))), + to_sepa_credit_transfers=Some( SepaCreditTransfers(debtorAccount=PaymentAccount("string"), + instructedAmount= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + creditorAccount=PaymentAccount("string"), + creditorName="string")), + value= AmountOfMoney(currency=currencyExample.value, + amount="string"), + description="string"), + transaction_ids="string", + status="string", + start_date=new Date(), + end_date=new Date(), + challenge= TransactionRequestChallenge(id="string", + allowed_attempts=123, + challenge_type="string"), + charge= TransactionRequestCharge(summary="string", + value= AmountOfMoney(currency=currencyExample.value, + amount="string")), + charge_policy="string", + counterparty_id=CounterpartyId(counterpartyIdExample.value), + name="string", + this_bank_id=BankId(bankIdExample.value), + this_account_id=AccountId(accountIdExample.value), + this_view_id=ViewId(viewIdExample.value), + other_account_routing_scheme="string", + other_account_routing_address="string", + other_bank_routing_scheme="string", + other_bank_routing_address="string", + is_beneficiary=true, + future_date=Some("string"))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createTransactionAfterChallengeV210(fromAccount: BankAccount, transactionRequest: TransactionRequest, callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = { + import com.openbankproject.commons.dto.{OutBoundCreateTransactionAfterChallengeV210 => OutBound, InBoundCreateTransactionAfterChallengeV210 => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, fromAccount, transactionRequest) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[TransactionRequest](callContext)) + } + + messageDocs += updateBankAccountDoc + def updateBankAccountDoc = MessageDoc( + process = "obp.updateBankAccount", + messageFormat = messageFormat, + description = "Update Bank Account", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundUpdateBankAccount(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + accountLabel="string", + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value) + ), + exampleInboundMessage = ( + InBoundUpdateBankAccount(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def updateBankAccount(bankId: BankId, accountId: AccountId, accountType: String, accountLabel: String, branchId: String, accountRoutingScheme: String, accountRoutingAddress: String, callContext: Option[CallContext]): OBPReturnType[Box[BankAccount]] = { + import com.openbankproject.commons.dto.{OutBoundUpdateBankAccount => OutBound, InBoundUpdateBankAccount => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, accountType, accountLabel, branchId, accountRoutingScheme, accountRoutingAddress) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[BankAccountCommons](callContext)) + } + + messageDocs += createBankAccountDoc + def createBankAccountDoc = MessageDoc( + process = "obp.createBankAccount", + messageFormat = messageFormat, + description = "Create Bank Account", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateBankAccount(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + accountLabel="string", + currency=currencyExample.value, + initialBalance=BigDecimal("123.321"), + accountHolderName="string", + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value) + ), + exampleInboundMessage = ( + InBoundCreateBankAccount(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createBankAccount(bankId: BankId, accountId: AccountId, accountType: String, accountLabel: String, currency: String, initialBalance: BigDecimal, accountHolderName: String, branchId: String, accountRoutingScheme: String, accountRoutingAddress: String, callContext: Option[CallContext]): OBPReturnType[Box[BankAccount]] = { + import com.openbankproject.commons.dto.{OutBoundCreateBankAccount => OutBound, InBoundCreateBankAccount => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, accountType, accountLabel, currency, initialBalance, accountHolderName, branchId, accountRoutingScheme, accountRoutingAddress) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[BankAccountCommons](callContext)) + } + + messageDocs += accountExistsDoc + def accountExistsDoc = MessageDoc( + process = "obp.accountExists", + messageFormat = messageFormat, + description = "Account Exists", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundAccountExists(bankId=BankId(bankIdExample.value), + accountNumber=accountNumberExample.value) + ), + exampleInboundMessage = ( + InBoundAccountExists(status=MessageDocsSwaggerDefinitions.inboundStatus, + data=true) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def accountExists(bankId: BankId, accountNumber: String): Box[Boolean] = { + import com.openbankproject.commons.dto.{OutBoundAccountExists => OutBound, InBoundAccountExists => InBound} + val callContext: Option[CallContext] = None + val req = OutBound(bankId, accountNumber) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[Boolean](callContext)) + } + + messageDocs += getBranchDoc + def getBranchDoc = MessageDoc( + process = "obp.getBranch", + messageFormat = messageFormat, + description = "Get Branch", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetBranch(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + branchId=BranchId(branchIdExample.value)) + ), + exampleInboundMessage = ( + InBoundGetBranch(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= BranchTCommons(branchId=BranchId(branchIdExample.value), + bankId=BankId(bankIdExample.value), + name="string", + address= Address(line1="string", + line2="string", + line3="string", + city="string", + county=Some("string"), + state="string", + postCode="string", + countryCode="string"), + location= Location(latitude=123.123, + longitude=123.123, + date=Some(new Date()), + user=Some( BasicResourceUser(userId=userIdExample.value, + provider="string", + username=usernameExample.value))), + lobbyString=Some(LobbyString("string")), + driveUpString=Some(DriveUpString("string")), + meta=Meta( License(id="string", + name="string")), + branchRouting=Some( Routing(scheme=branchRoutingSchemeExample.value, + address=branchRoutingAddressExample.value)), + lobby=Some( Lobby(monday=List( OpeningTimes(openingTime="string", + closingTime="string")), + tuesday=List( OpeningTimes(openingTime="string", + closingTime="string")), + wednesday=List( OpeningTimes(openingTime="string", + closingTime="string")), + thursday=List( OpeningTimes(openingTime="string", + closingTime="string")), + friday=List( OpeningTimes(openingTime="string", + closingTime="string")), + saturday=List( OpeningTimes(openingTime="string", + closingTime="string")), + sunday=List( OpeningTimes(openingTime="string", + closingTime="string")))), + driveUp=Some( DriveUp(monday= OpeningTimes(openingTime="string", + closingTime="string"), + tuesday= OpeningTimes(openingTime="string", + closingTime="string"), + wednesday= OpeningTimes(openingTime="string", + closingTime="string"), + thursday= OpeningTimes(openingTime="string", + closingTime="string"), + friday= OpeningTimes(openingTime="string", + closingTime="string"), + saturday= OpeningTimes(openingTime="string", + closingTime="string"), + sunday= OpeningTimes(openingTime="string", + closingTime="string"))), + isAccessible=Some(true), + accessibleFeatures=Some("string"), + branchType=Some("string"), + moreInfo=Some("string"), + phoneNumber=Some("string"), + isDeleted=Some(true))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getBranch(bankId: BankId, branchId: BranchId, callContext: Option[CallContext]): Future[Box[(BranchT, Option[CallContext])]] = { + import com.openbankproject.commons.dto.{OutBoundGetBranch => OutBound, InBoundGetBranch => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, branchId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[BranchTCommons](callContext)) + } + + messageDocs += getBranchesDoc + def getBranchesDoc = MessageDoc( + process = "obp.getBranches", + messageFormat = messageFormat, + description = "Get Branches", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetBranches(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + limit=limitExample.value.toInt, + offset=offsetExample.value.toInt, + fromDate="string", + toDate="string") + ), + exampleInboundMessage = ( + InBoundGetBranches(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( BranchTCommons(branchId=BranchId(branchIdExample.value), + bankId=BankId(bankIdExample.value), + name="string", + address= Address(line1="string", + line2="string", + line3="string", + city="string", + county=Some("string"), + state="string", + postCode="string", + countryCode="string"), + location= Location(latitude=123.123, + longitude=123.123, + date=Some(new Date()), + user=Some( BasicResourceUser(userId=userIdExample.value, + provider="string", + username=usernameExample.value))), + lobbyString=Some(LobbyString("string")), + driveUpString=Some(DriveUpString("string")), + meta=Meta( License(id="string", + name="string")), + branchRouting=Some( Routing(scheme=branchRoutingSchemeExample.value, + address=branchRoutingAddressExample.value)), + lobby=Some( Lobby(monday=List( OpeningTimes(openingTime="string", + closingTime="string")), + tuesday=List( OpeningTimes(openingTime="string", + closingTime="string")), + wednesday=List( OpeningTimes(openingTime="string", + closingTime="string")), + thursday=List( OpeningTimes(openingTime="string", + closingTime="string")), + friday=List( OpeningTimes(openingTime="string", + closingTime="string")), + saturday=List( OpeningTimes(openingTime="string", + closingTime="string")), + sunday=List( OpeningTimes(openingTime="string", + closingTime="string")))), + driveUp=Some( DriveUp(monday= OpeningTimes(openingTime="string", + closingTime="string"), + tuesday= OpeningTimes(openingTime="string", + closingTime="string"), + wednesday= OpeningTimes(openingTime="string", + closingTime="string"), + thursday= OpeningTimes(openingTime="string", + closingTime="string"), + friday= OpeningTimes(openingTime="string", + closingTime="string"), + saturday= OpeningTimes(openingTime="string", + closingTime="string"), + sunday= OpeningTimes(openingTime="string", + closingTime="string"))), + isAccessible=Some(true), + accessibleFeatures=Some("string"), + branchType=Some("string"), + moreInfo=Some("string"), + phoneNumber=Some("string"), + isDeleted=Some(true)))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getBranches(bankId: BankId, callContext: Option[CallContext], queryParams: List[OBPQueryParam]): Future[Box[(List[BranchT], Option[CallContext])]] = { + import com.openbankproject.commons.dto.{OutBoundGetBranches => OutBound, InBoundGetBranches => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[BranchTCommons]](callContext)) + } + + messageDocs += getAtmDoc + def getAtmDoc = MessageDoc( + process = "obp.getAtm", + messageFormat = messageFormat, + description = "Get Atm", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetAtm(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + atmId=AtmId("string")) + ), + exampleInboundMessage = ( + InBoundGetAtm(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= AtmTCommons(atmId=AtmId("string"), + bankId=BankId(bankIdExample.value), + name="string", + address= Address(line1="string", + line2="string", + line3="string", + city="string", + county=Some("string"), + state="string", + postCode="string", + countryCode="string"), + location= Location(latitude=123.123, + longitude=123.123, + date=Some(new Date()), + user=Some( BasicResourceUser(userId=userIdExample.value, + provider="string", + username=usernameExample.value))), + meta=Meta( License(id="string", + name="string")), + OpeningTimeOnMonday=Some("string"), + ClosingTimeOnMonday=Some("string"), + OpeningTimeOnTuesday=Some("string"), + ClosingTimeOnTuesday=Some("string"), + OpeningTimeOnWednesday=Some("string"), + ClosingTimeOnWednesday=Some("string"), + OpeningTimeOnThursday=Some("string"), + ClosingTimeOnThursday=Some("string"), + OpeningTimeOnFriday=Some("string"), + ClosingTimeOnFriday=Some("string"), + OpeningTimeOnSaturday=Some("string"), + ClosingTimeOnSaturday=Some("string"), + OpeningTimeOnSunday=Some("string"), + ClosingTimeOnSunday=Some("string"), + isAccessible=Some(true), + locatedAt=Some("string"), + moreInfo=Some("string"), + hasDepositCapability=Some(true))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getAtm(bankId: BankId, atmId: AtmId, callContext: Option[CallContext]): Future[Box[(AtmT, Option[CallContext])]] = { + import com.openbankproject.commons.dto.{OutBoundGetAtm => OutBound, InBoundGetAtm => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, atmId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[AtmTCommons](callContext)) + } + + messageDocs += getAtmsDoc + def getAtmsDoc = MessageDoc( + process = "obp.getAtms", + messageFormat = messageFormat, + description = "Get Atms", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetAtms(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + limit=limitExample.value.toInt, + offset=offsetExample.value.toInt, + fromDate="string", + toDate="string") + ), + exampleInboundMessage = ( + InBoundGetAtms(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( AtmTCommons(atmId=AtmId("string"), + bankId=BankId(bankIdExample.value), + name="string", + address= Address(line1="string", + line2="string", + line3="string", + city="string", + county=Some("string"), + state="string", + postCode="string", + countryCode="string"), + location= Location(latitude=123.123, + longitude=123.123, + date=Some(new Date()), + user=Some( BasicResourceUser(userId=userIdExample.value, + provider="string", + username=usernameExample.value))), + meta=Meta( License(id="string", + name="string")), + OpeningTimeOnMonday=Some("string"), + ClosingTimeOnMonday=Some("string"), + OpeningTimeOnTuesday=Some("string"), + ClosingTimeOnTuesday=Some("string"), + OpeningTimeOnWednesday=Some("string"), + ClosingTimeOnWednesday=Some("string"), + OpeningTimeOnThursday=Some("string"), + ClosingTimeOnThursday=Some("string"), + OpeningTimeOnFriday=Some("string"), + ClosingTimeOnFriday=Some("string"), + OpeningTimeOnSaturday=Some("string"), + ClosingTimeOnSaturday=Some("string"), + OpeningTimeOnSunday=Some("string"), + ClosingTimeOnSunday=Some("string"), + isAccessible=Some(true), + locatedAt=Some("string"), + moreInfo=Some("string"), + hasDepositCapability=Some(true)))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getAtms(bankId: BankId, callContext: Option[CallContext], queryParams: List[OBPQueryParam]): Future[Box[(List[AtmT], Option[CallContext])]] = { + import com.openbankproject.commons.dto.{OutBoundGetAtms => OutBound, InBoundGetAtms => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[AtmTCommons]](callContext)) + } + + messageDocs += createTransactionAfterChallengev300Doc + def createTransactionAfterChallengev300Doc = MessageDoc( + process = "obp.createTransactionAfterChallengev300", + messageFormat = messageFormat, + description = "Create Transaction After Challengev300", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateTransactionAfterChallengev300(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + initiator= UserCommons(userPrimaryKey=UserPrimaryKey(123), + userId=userIdExample.value, + idGivenByProvider="string", + provider="string", + emailAddress=emailExample.value, + name=usernameExample.value), + fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value), + transReqId=TransactionRequestId("string"), + transactionRequestType=TransactionRequestType(transactionRequestTypeExample.value)) + ), + exampleInboundMessage = ( + InBoundCreateTransactionAfterChallengev300(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= TransactionRequest(id=TransactionRequestId("string"), + `type`=transactionRequestTypeExample.value, + from= TransactionRequestAccount(bank_id="string", + account_id="string"), + body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id="string", + account_id="string")), + to_sepa=Some(TransactionRequestIban("string")), + to_counterparty=Some(TransactionRequestCounterpartyId("string")), + to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string", + message="string", + from= FromAccountTransfer(mobile_phone_number="string", + nickname="string"), + to=ToAccountTransferToPhone("string"))), + to_transfer_to_atm=Some( TransactionRequestTransferToAtm(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string", + message="string", + from= FromAccountTransfer(mobile_phone_number="string", + nickname="string"), + to= ToAccountTransferToAtm(legal_name="string", + date_of_birth="string", + mobile_phone_number="string", + kyc_document= ToAccountTransferToAtmKycDocument(`type`="string", + number="string")))), + to_transfer_to_account=Some( TransactionRequestTransferToAccount(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string", + transfer_type="string", + future_date="string", + to= ToAccountTransferToAccount(name="string", + bank_code="string", + branch_number="string", + account= ToAccountTransferToAccountAccount(number=accountNumberExample.value, + iban=ibanExample.value)))), + to_sepa_credit_transfers=Some( SepaCreditTransfers(debtorAccount=PaymentAccount("string"), + instructedAmount= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + creditorAccount=PaymentAccount("string"), + creditorName="string")), + value= AmountOfMoney(currency=currencyExample.value, + amount="string"), + description="string"), + transaction_ids="string", + status="string", + start_date=new Date(), + end_date=new Date(), + challenge= TransactionRequestChallenge(id="string", + allowed_attempts=123, + challenge_type="string"), + charge= TransactionRequestCharge(summary="string", + value= AmountOfMoney(currency=currencyExample.value, + amount="string")), + charge_policy="string", + counterparty_id=CounterpartyId(counterpartyIdExample.value), + name="string", + this_bank_id=BankId(bankIdExample.value), + this_account_id=AccountId(accountIdExample.value), + this_view_id=ViewId(viewIdExample.value), + other_account_routing_scheme="string", + other_account_routing_address="string", + other_bank_routing_scheme="string", + other_bank_routing_address="string", + is_beneficiary=true, + future_date=Some("string"))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createTransactionAfterChallengev300(initiator: User, fromAccount: BankAccount, transReqId: TransactionRequestId, transactionRequestType: TransactionRequestType, callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = { + import com.openbankproject.commons.dto.{OutBoundCreateTransactionAfterChallengev300 => OutBound, InBoundCreateTransactionAfterChallengev300 => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, fromAccount, transReqId, transactionRequestType) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[TransactionRequest](callContext)) + } + + messageDocs += makePaymentv300Doc + def makePaymentv300Doc = MessageDoc( + process = "obp.makePaymentv300", + messageFormat = messageFormat, + description = "Make Paymentv300", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundMakePaymentv300(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + initiator= UserCommons(userPrimaryKey=UserPrimaryKey(123), + userId=userIdExample.value, + idGivenByProvider="string", + provider="string", + emailAddress=emailExample.value, + name=usernameExample.value), + fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value), + toAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value), + toCounterparty= CounterpartyTraitCommons(createdByUserId="string", + name="string", + description="string", + thisBankId="string", + thisAccountId="string", + thisViewId="string", + counterpartyId=counterpartyIdExample.value, + otherAccountRoutingScheme=accountRoutingSchemeExample.value, + otherAccountRoutingAddress=accountRoutingAddressExample.value, + otherAccountSecondaryRoutingScheme="string", + otherAccountSecondaryRoutingAddress="string", + otherBankRoutingScheme=bankRoutingSchemeExample.value, + otherBankRoutingAddress=bankRoutingAddressExample.value, + otherBranchRoutingScheme=branchRoutingSchemeExample.value, + otherBranchRoutingAddress=branchRoutingAddressExample.value, + isBeneficiary=isBeneficiaryExample.value.toBoolean, + bespoke=List( CounterpartyBespoke(key=keyExample.value, + value=valueExample.value))), + transactionRequestCommonBody= TransactionRequestCommonBodyJSONCommons(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string"), + transactionRequestType=TransactionRequestType(transactionRequestTypeExample.value), + chargePolicy="string") + ), + exampleInboundMessage = ( + InBoundMakePaymentv300(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=TransactionId(transactionIdExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def makePaymentv300(initiator: User, fromAccount: BankAccount, toAccount: BankAccount, toCounterparty: CounterpartyTrait, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, transactionRequestType: TransactionRequestType, chargePolicy: String, callContext: Option[CallContext]): Future[Box[(TransactionId, Option[CallContext])]] = { + import com.openbankproject.commons.dto.{OutBoundMakePaymentv300 => OutBound, InBoundMakePaymentv300 => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, fromAccount, toAccount, toCounterparty, transactionRequestCommonBody, transactionRequestType, chargePolicy) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[TransactionId](callContext)) + } + + messageDocs += createTransactionRequestv300Doc + def createTransactionRequestv300Doc = MessageDoc( + process = "obp.createTransactionRequestv300", + messageFormat = messageFormat, + description = "Create Transaction Requestv300", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateTransactionRequestv300(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + initiator= UserCommons(userPrimaryKey=UserPrimaryKey(123), + userId=userIdExample.value, + idGivenByProvider="string", + provider="string", + emailAddress=emailExample.value, + name=usernameExample.value), + viewId=ViewId(viewIdExample.value), + fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value), + toAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value), + toCounterparty= CounterpartyTraitCommons(createdByUserId="string", + name="string", + description="string", + thisBankId="string", + thisAccountId="string", + thisViewId="string", + counterpartyId=counterpartyIdExample.value, + otherAccountRoutingScheme=accountRoutingSchemeExample.value, + otherAccountRoutingAddress=accountRoutingAddressExample.value, + otherAccountSecondaryRoutingScheme="string", + otherAccountSecondaryRoutingAddress="string", + otherBankRoutingScheme=bankRoutingSchemeExample.value, + otherBankRoutingAddress=bankRoutingAddressExample.value, + otherBranchRoutingScheme=branchRoutingSchemeExample.value, + otherBranchRoutingAddress=branchRoutingAddressExample.value, + isBeneficiary=isBeneficiaryExample.value.toBoolean, + bespoke=List( CounterpartyBespoke(key=keyExample.value, + value=valueExample.value))), + transactionRequestType=TransactionRequestType(transactionRequestTypeExample.value), + transactionRequestCommonBody= TransactionRequestCommonBodyJSONCommons(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string"), + detailsPlain="string", + chargePolicy="string") + ), + exampleInboundMessage = ( + InBoundCreateTransactionRequestv300(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= TransactionRequest(id=TransactionRequestId("string"), + `type`=transactionRequestTypeExample.value, + from= TransactionRequestAccount(bank_id="string", + account_id="string"), + body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id="string", + account_id="string")), + to_sepa=Some(TransactionRequestIban("string")), + to_counterparty=Some(TransactionRequestCounterpartyId("string")), + to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string", + message="string", + from= FromAccountTransfer(mobile_phone_number="string", + nickname="string"), + to=ToAccountTransferToPhone("string"))), + to_transfer_to_atm=Some( TransactionRequestTransferToAtm(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string", + message="string", + from= FromAccountTransfer(mobile_phone_number="string", + nickname="string"), + to= ToAccountTransferToAtm(legal_name="string", + date_of_birth="string", + mobile_phone_number="string", + kyc_document= ToAccountTransferToAtmKycDocument(`type`="string", + number="string")))), + to_transfer_to_account=Some( TransactionRequestTransferToAccount(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + description="string", + transfer_type="string", + future_date="string", + to= ToAccountTransferToAccount(name="string", + bank_code="string", + branch_number="string", + account= ToAccountTransferToAccountAccount(number=accountNumberExample.value, + iban=ibanExample.value)))), + to_sepa_credit_transfers=Some( SepaCreditTransfers(debtorAccount=PaymentAccount("string"), + instructedAmount= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount="string"), + creditorAccount=PaymentAccount("string"), + creditorName="string")), + value= AmountOfMoney(currency=currencyExample.value, + amount="string"), + description="string"), + transaction_ids="string", + status="string", + start_date=new Date(), + end_date=new Date(), + challenge= TransactionRequestChallenge(id="string", + allowed_attempts=123, + challenge_type="string"), + charge= TransactionRequestCharge(summary="string", + value= AmountOfMoney(currency=currencyExample.value, + amount="string")), + charge_policy="string", + counterparty_id=CounterpartyId(counterpartyIdExample.value), + name="string", + this_bank_id=BankId(bankIdExample.value), + this_account_id=AccountId(accountIdExample.value), + this_view_id=ViewId(viewIdExample.value), + other_account_routing_scheme="string", + other_account_routing_address="string", + other_bank_routing_scheme="string", + other_bank_routing_address="string", + is_beneficiary=true, + future_date=Some("string"))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createTransactionRequestv300(initiator: User, viewId: ViewId, fromAccount: BankAccount, toAccount: BankAccount, toCounterparty: CounterpartyTrait, transactionRequestType: TransactionRequestType, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, detailsPlain: String, chargePolicy: String, callContext: Option[CallContext]): Future[Box[(TransactionRequest, Option[CallContext])]] = { + import com.openbankproject.commons.dto.{OutBoundCreateTransactionRequestv300 => OutBound, InBoundCreateTransactionRequestv300 => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, viewId, fromAccount, toAccount, toCounterparty, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[TransactionRequest](callContext)) + } + + messageDocs += createCounterpartyDoc + def createCounterpartyDoc = MessageDoc( + process = "obp.createCounterparty", + messageFormat = messageFormat, + description = "Create Counterparty", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateCounterparty(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + name="string", + description="string", + createdByUserId="string", + thisBankId="string", + thisAccountId="string", + thisViewId="string", + otherAccountRoutingScheme=accountRoutingSchemeExample.value, + otherAccountRoutingAddress=accountRoutingAddressExample.value, + otherAccountSecondaryRoutingScheme="string", + otherAccountSecondaryRoutingAddress="string", + otherBankRoutingScheme=bankRoutingSchemeExample.value, + otherBankRoutingAddress=bankRoutingAddressExample.value, + otherBranchRoutingScheme=branchRoutingSchemeExample.value, + otherBranchRoutingAddress=branchRoutingAddressExample.value, + isBeneficiary=isBeneficiaryExample.value.toBoolean, + bespoke=List( CounterpartyBespoke(key=keyExample.value, + value=valueExample.value))) + ), + exampleInboundMessage = ( + InBoundCreateCounterparty(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= CounterpartyTraitCommons(createdByUserId="string", + name="string", + description="string", + thisBankId="string", + thisAccountId="string", + thisViewId="string", + counterpartyId=counterpartyIdExample.value, + otherAccountRoutingScheme=accountRoutingSchemeExample.value, + otherAccountRoutingAddress=accountRoutingAddressExample.value, + otherAccountSecondaryRoutingScheme="string", + otherAccountSecondaryRoutingAddress="string", + otherBankRoutingScheme=bankRoutingSchemeExample.value, + otherBankRoutingAddress=bankRoutingAddressExample.value, + otherBranchRoutingScheme=branchRoutingSchemeExample.value, + otherBranchRoutingAddress=branchRoutingAddressExample.value, + isBeneficiary=isBeneficiaryExample.value.toBoolean, + bespoke=List( CounterpartyBespoke(key=keyExample.value, + value=valueExample.value)))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createCounterparty(name: String, description: String, createdByUserId: String, thisBankId: String, thisAccountId: String, thisViewId: String, otherAccountRoutingScheme: String, otherAccountRoutingAddress: String, otherAccountSecondaryRoutingScheme: String, otherAccountSecondaryRoutingAddress: String, otherBankRoutingScheme: String, otherBankRoutingAddress: String, otherBranchRoutingScheme: String, otherBranchRoutingAddress: String, isBeneficiary: Boolean, bespoke: List[CounterpartyBespoke], callContext: Option[CallContext]): Box[(CounterpartyTrait, Option[CallContext])] = { + import com.openbankproject.commons.dto.{OutBoundCreateCounterparty => OutBound, InBoundCreateCounterparty => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, name, description, createdByUserId, thisBankId, thisAccountId, thisViewId, otherAccountRoutingScheme, otherAccountRoutingAddress, otherAccountSecondaryRoutingScheme, otherAccountSecondaryRoutingAddress, otherBankRoutingScheme, otherBankRoutingAddress, otherBranchRoutingScheme, otherBranchRoutingAddress, isBeneficiary, bespoke) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[CounterpartyTraitCommons](callContext)) + } + + messageDocs += checkCustomerNumberAvailableDoc + def checkCustomerNumberAvailableDoc = MessageDoc( + process = "obp.checkCustomerNumberAvailable", + messageFormat = messageFormat, + description = "Check Customer Number Available", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCheckCustomerNumberAvailable(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + customerNumber=customerNumberExample.value) + ), + exampleInboundMessage = ( + InBoundCheckCustomerNumberAvailable(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=true) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def checkCustomerNumberAvailable(bankId: BankId, customerNumber: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { + import com.openbankproject.commons.dto.{OutBoundCheckCustomerNumberAvailable => OutBound, InBoundCheckCustomerNumberAvailable => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, customerNumber) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[Boolean](callContext)) + } + + messageDocs += createCustomerDoc + def createCustomerDoc = MessageDoc( + process = "obp.createCustomer", + messageFormat = messageFormat, + description = "Create Customer", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateCustomer(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + legalName=legalNameExample.value, + mobileNumber=mobileNumberExample.value, + email=emailExample.value, + faceImage= CustomerFaceImage(date=parseDate(customerFaceImageDateExample.value).getOrElse(sys.error("customerFaceImageDateExample.value is not validate date format.")), + url=urlExample.value), + dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")), + relationshipStatus=relationshipStatusExample.value, + dependents=dependentsExample.value.toInt, + dobOfDependents=dobOfDependentsExample.value.split("[,;]").map(parseDate).flatMap(_.toSeq).toList, + highestEducationAttained=highestEducationAttainedExample.value, + employmentStatus=employmentStatusExample.value, + kycStatus=kycStatusExample.value.toBoolean, + lastOkDate=parseDate(outBoundCreateCustomerLastOkDateExample.value).getOrElse(sys.error("outBoundCreateCustomerLastOkDateExample.value is not validate date format.")), + creditRating=Some( CreditRating(rating=ratingExample.value, + source=sourceExample.value)), + creditLimit=Some( AmountOfMoney(currency=currencyExample.value, + amount=creditLimitAmountExample.value)), + title=titleExample.value, + branchId=branchIdExample.value, + nameSuffix=nameSuffixExample.value) + ), + exampleInboundMessage = ( + InBoundCreateCustomer(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= CustomerCommons(customerId=customerIdExample.value, + bankId=bankIdExample.value, + number=customerNumberExample.value, + legalName=legalNameExample.value, + mobileNumber=mobileNumberExample.value, + email=emailExample.value, + faceImage= CustomerFaceImage(date=parseDate(customerFaceImageDateExample.value).getOrElse(sys.error("customerFaceImageDateExample.value is not validate date format.")), + url=urlExample.value), + dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")), + relationshipStatus=relationshipStatusExample.value, + dependents=dependentsExample.value.toInt, + dobOfDependents=dobOfDependentsExample.value.split("[,;]").map(parseDate).flatMap(_.toSeq).toList, + highestEducationAttained=highestEducationAttainedExample.value, + employmentStatus=employmentStatusExample.value, + creditRating= CreditRating(rating=ratingExample.value, + source=sourceExample.value), + creditLimit= CreditLimit(currency=currencyExample.value, + amount=creditLimitAmountExample.value), + kycStatus=kycStatusExample.value.toBoolean, + lastOkDate=parseDate(customerLastOkDateExample.value).getOrElse(sys.error("customerLastOkDateExample.value is not validate date format.")), + title=customerTitleExample.value, + branchId=branchIdExample.value, + nameSuffix=nameSuffixExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createCustomer(bankId: BankId, legalName: String, mobileNumber: String, email: String, faceImage: CustomerFaceImageTrait, dateOfBirth: Date, relationshipStatus: String, dependents: Int, dobOfDependents: List[Date], highestEducationAttained: String, employmentStatus: String, kycStatus: Boolean, lastOkDate: Date, creditRating: Option[CreditRatingTrait], creditLimit: Option[AmountOfMoneyTrait], title: String, branchId: String, nameSuffix: String, callContext: Option[CallContext]): OBPReturnType[Box[Customer]] = { + import com.openbankproject.commons.dto.{OutBoundCreateCustomer => OutBound, InBoundCreateCustomer => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, legalName, mobileNumber, email, faceImage, dateOfBirth, relationshipStatus, dependents, dobOfDependents, highestEducationAttained, employmentStatus, kycStatus, lastOkDate, creditRating, creditLimit, title, branchId, nameSuffix) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[CustomerCommons](callContext)) + } + + messageDocs += updateCustomerScaDataDoc + def updateCustomerScaDataDoc = MessageDoc( + process = "obp.updateCustomerScaData", + messageFormat = messageFormat, + description = "Update Customer Sca Data", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundUpdateCustomerScaData(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + customerId=customerIdExample.value, + mobileNumber=Some(mobileNumberExample.value), + email=Some(emailExample.value), + customerNumber=Some(customerNumberExample.value)) + ), + exampleInboundMessage = ( + InBoundUpdateCustomerScaData(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= CustomerCommons(customerId=customerIdExample.value, + bankId=bankIdExample.value, + number=customerNumberExample.value, + legalName=legalNameExample.value, + mobileNumber=mobileNumberExample.value, + email=emailExample.value, + faceImage= CustomerFaceImage(date=parseDate(customerFaceImageDateExample.value).getOrElse(sys.error("customerFaceImageDateExample.value is not validate date format.")), + url=urlExample.value), + dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")), + relationshipStatus=relationshipStatusExample.value, + dependents=dependentsExample.value.toInt, + dobOfDependents=dobOfDependentsExample.value.split("[,;]").map(parseDate).flatMap(_.toSeq).toList, + highestEducationAttained=highestEducationAttainedExample.value, + employmentStatus=employmentStatusExample.value, + creditRating= CreditRating(rating=ratingExample.value, + source=sourceExample.value), + creditLimit= CreditLimit(currency=currencyExample.value, + amount=creditLimitAmountExample.value), + kycStatus=kycStatusExample.value.toBoolean, + lastOkDate=parseDate(customerLastOkDateExample.value).getOrElse(sys.error("customerLastOkDateExample.value is not validate date format.")), + title=customerTitleExample.value, + branchId=branchIdExample.value, + nameSuffix=nameSuffixExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def updateCustomerScaData(customerId: String, mobileNumber: Option[String], email: Option[String], customerNumber: Option[String], callContext: Option[CallContext]): OBPReturnType[Box[Customer]] = { + import com.openbankproject.commons.dto.{OutBoundUpdateCustomerScaData => OutBound, InBoundUpdateCustomerScaData => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId, mobileNumber, email, customerNumber) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[CustomerCommons](callContext)) + } + + messageDocs += updateCustomerCreditDataDoc + def updateCustomerCreditDataDoc = MessageDoc( + process = "obp.updateCustomerCreditData", + messageFormat = messageFormat, + description = "Update Customer Credit Data", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundUpdateCustomerCreditData(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + customerId=customerIdExample.value, + creditRating=Some("string"), + creditSource=Some("string"), + creditLimit=Some( AmountOfMoney(currency=currencyExample.value, + amount=creditLimitAmountExample.value))) + ), + exampleInboundMessage = ( + InBoundUpdateCustomerCreditData(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= CustomerCommons(customerId=customerIdExample.value, + bankId=bankIdExample.value, + number=customerNumberExample.value, + legalName=legalNameExample.value, + mobileNumber=mobileNumberExample.value, + email=emailExample.value, + faceImage= CustomerFaceImage(date=parseDate(customerFaceImageDateExample.value).getOrElse(sys.error("customerFaceImageDateExample.value is not validate date format.")), + url=urlExample.value), + dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")), + relationshipStatus=relationshipStatusExample.value, + dependents=dependentsExample.value.toInt, + dobOfDependents=dobOfDependentsExample.value.split("[,;]").map(parseDate).flatMap(_.toSeq).toList, + highestEducationAttained=highestEducationAttainedExample.value, + employmentStatus=employmentStatusExample.value, + creditRating= CreditRating(rating=ratingExample.value, + source=sourceExample.value), + creditLimit= CreditLimit(currency=currencyExample.value, + amount=creditLimitAmountExample.value), + kycStatus=kycStatusExample.value.toBoolean, + lastOkDate=parseDate(customerLastOkDateExample.value).getOrElse(sys.error("customerLastOkDateExample.value is not validate date format.")), + title=customerTitleExample.value, + branchId=branchIdExample.value, + nameSuffix=nameSuffixExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def updateCustomerCreditData(customerId: String, creditRating: Option[String], creditSource: Option[String], creditLimit: Option[AmountOfMoney], callContext: Option[CallContext]): OBPReturnType[Box[Customer]] = { + import com.openbankproject.commons.dto.{OutBoundUpdateCustomerCreditData => OutBound, InBoundUpdateCustomerCreditData => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId, creditRating, creditSource, creditLimit) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[CustomerCommons](callContext)) + } + + messageDocs += updateCustomerGeneralDataDoc + def updateCustomerGeneralDataDoc = MessageDoc( + process = "obp.updateCustomerGeneralData", + messageFormat = messageFormat, + description = "Update Customer General Data", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundUpdateCustomerGeneralData(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + customerId=customerIdExample.value, + legalName=Some(legalNameExample.value), + faceImage=Some( CustomerFaceImage(date=new Date(), + url=urlExample.value)), + dateOfBirth=Some(parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format."))), + relationshipStatus=Some(relationshipStatusExample.value), + dependents=Some(dependentsExample.value.toInt), + highestEducationAttained=Some(highestEducationAttainedExample.value), + employmentStatus=Some(employmentStatusExample.value), + title=Some(titleExample.value), + branchId=Some(branchIdExample.value), + nameSuffix=Some(nameSuffixExample.value)) + ), + exampleInboundMessage = ( + InBoundUpdateCustomerGeneralData(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= CustomerCommons(customerId=customerIdExample.value, + bankId=bankIdExample.value, + number=customerNumberExample.value, + legalName=legalNameExample.value, + mobileNumber=mobileNumberExample.value, + email=emailExample.value, + faceImage= CustomerFaceImage(date=parseDate(customerFaceImageDateExample.value).getOrElse(sys.error("customerFaceImageDateExample.value is not validate date format.")), + url=urlExample.value), + dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")), + relationshipStatus=relationshipStatusExample.value, + dependents=dependentsExample.value.toInt, + dobOfDependents=dobOfDependentsExample.value.split("[,;]").map(parseDate).flatMap(_.toSeq).toList, + highestEducationAttained=highestEducationAttainedExample.value, + employmentStatus=employmentStatusExample.value, + creditRating= CreditRating(rating=ratingExample.value, + source=sourceExample.value), + creditLimit= CreditLimit(currency=currencyExample.value, + amount=creditLimitAmountExample.value), + kycStatus=kycStatusExample.value.toBoolean, + lastOkDate=parseDate(customerLastOkDateExample.value).getOrElse(sys.error("customerLastOkDateExample.value is not validate date format.")), + title=customerTitleExample.value, + branchId=branchIdExample.value, + nameSuffix=nameSuffixExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def updateCustomerGeneralData(customerId: String, legalName: Option[String], faceImage: Option[CustomerFaceImageTrait], dateOfBirth: Option[Date], relationshipStatus: Option[String], dependents: Option[Int], highestEducationAttained: Option[String], employmentStatus: Option[String], title: Option[String], branchId: Option[String], nameSuffix: Option[String], callContext: Option[CallContext]): OBPReturnType[Box[Customer]] = { + import com.openbankproject.commons.dto.{OutBoundUpdateCustomerGeneralData => OutBound, InBoundUpdateCustomerGeneralData => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId, legalName, faceImage, dateOfBirth, relationshipStatus, dependents, highestEducationAttained, employmentStatus, title, branchId, nameSuffix) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[CustomerCommons](callContext)) + } + + messageDocs += getCustomerByCustomerIdDoc + def getCustomerByCustomerIdDoc = MessageDoc( + process = "obp.getCustomerByCustomerId", + messageFormat = messageFormat, + description = "Get Customer By Customer Id", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetCustomerByCustomerId(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + customerId=customerIdExample.value) + ), + exampleInboundMessage = ( + InBoundGetCustomerByCustomerId(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= CustomerCommons(customerId=customerIdExample.value, + bankId=bankIdExample.value, + number=customerNumberExample.value, + legalName=legalNameExample.value, + mobileNumber=mobileNumberExample.value, + email=emailExample.value, + faceImage= CustomerFaceImage(date=parseDate(customerFaceImageDateExample.value).getOrElse(sys.error("customerFaceImageDateExample.value is not validate date format.")), + url=urlExample.value), + dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")), + relationshipStatus=relationshipStatusExample.value, + dependents=dependentsExample.value.toInt, + dobOfDependents=dobOfDependentsExample.value.split("[,;]").map(parseDate).flatMap(_.toSeq).toList, + highestEducationAttained=highestEducationAttainedExample.value, + employmentStatus=employmentStatusExample.value, + creditRating= CreditRating(rating=ratingExample.value, + source=sourceExample.value), + creditLimit= CreditLimit(currency=currencyExample.value, + amount=creditLimitAmountExample.value), + kycStatus=kycStatusExample.value.toBoolean, + lastOkDate=parseDate(customerLastOkDateExample.value).getOrElse(sys.error("customerLastOkDateExample.value is not validate date format.")), + title=customerTitleExample.value, + branchId=branchIdExample.value, + nameSuffix=nameSuffixExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getCustomerByCustomerId(customerId: String, callContext: Option[CallContext]): Future[Box[(Customer, Option[CallContext])]] = { + import com.openbankproject.commons.dto.{OutBoundGetCustomerByCustomerId => OutBound, InBoundGetCustomerByCustomerId => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[CustomerCommons](callContext)) + } + + messageDocs += getCustomerByCustomerNumberDoc + def getCustomerByCustomerNumberDoc = MessageDoc( + process = "obp.getCustomerByCustomerNumber", + messageFormat = messageFormat, + description = "Get Customer By Customer Number", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetCustomerByCustomerNumber(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + customerNumber=customerNumberExample.value, + bankId=BankId(bankIdExample.value)) + ), + exampleInboundMessage = ( + InBoundGetCustomerByCustomerNumber(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= CustomerCommons(customerId=customerIdExample.value, + bankId=bankIdExample.value, + number=customerNumberExample.value, + legalName=legalNameExample.value, + mobileNumber=mobileNumberExample.value, + email=emailExample.value, + faceImage= CustomerFaceImage(date=parseDate(customerFaceImageDateExample.value).getOrElse(sys.error("customerFaceImageDateExample.value is not validate date format.")), + url=urlExample.value), + dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")), + relationshipStatus=relationshipStatusExample.value, + dependents=dependentsExample.value.toInt, + dobOfDependents=dobOfDependentsExample.value.split("[,;]").map(parseDate).flatMap(_.toSeq).toList, + highestEducationAttained=highestEducationAttainedExample.value, + employmentStatus=employmentStatusExample.value, + creditRating= CreditRating(rating=ratingExample.value, + source=sourceExample.value), + creditLimit= CreditLimit(currency=currencyExample.value, + amount=creditLimitAmountExample.value), + kycStatus=kycStatusExample.value.toBoolean, + lastOkDate=parseDate(customerLastOkDateExample.value).getOrElse(sys.error("customerLastOkDateExample.value is not validate date format.")), + title=customerTitleExample.value, + branchId=branchIdExample.value, + nameSuffix=nameSuffixExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getCustomerByCustomerNumber(customerNumber: String, bankId: BankId, callContext: Option[CallContext]): Future[Box[(Customer, Option[CallContext])]] = { + import com.openbankproject.commons.dto.{OutBoundGetCustomerByCustomerNumber => OutBound, InBoundGetCustomerByCustomerNumber => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerNumber, bankId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[CustomerCommons](callContext)) + } + + messageDocs += getCustomerAddressDoc + def getCustomerAddressDoc = MessageDoc( + process = "obp.getCustomerAddress", + messageFormat = messageFormat, + description = "Get Customer Address", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetCustomerAddress(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + customerId=customerIdExample.value) + ), + exampleInboundMessage = ( + InBoundGetCustomerAddress(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( CustomerAddressCommons(customerId=customerIdExample.value, + customerAddressId="string", + line1="string", + line2="string", + line3="string", + city="string", + county="string", + state="string", + postcode="string", + countryCode="string", + status="string", + tags="string", + insertDate=new Date()))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getCustomerAddress(customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[CustomerAddress]]] = { + import com.openbankproject.commons.dto.{OutBoundGetCustomerAddress => OutBound, InBoundGetCustomerAddress => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[CustomerAddressCommons]](callContext)) + } + + messageDocs += createCustomerAddressDoc + def createCustomerAddressDoc = MessageDoc( + process = "obp.createCustomerAddress", + messageFormat = messageFormat, + description = "Create Customer Address", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateCustomerAddress(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + customerId=customerIdExample.value, + line1="string", + line2="string", + line3="string", + city="string", + county="string", + state="string", + postcode="string", + countryCode="string", + tags="string", + status="string") + ), + exampleInboundMessage = ( + InBoundCreateCustomerAddress(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= CustomerAddressCommons(customerId=customerIdExample.value, + customerAddressId="string", + line1="string", + line2="string", + line3="string", + city="string", + county="string", + state="string", + postcode="string", + countryCode="string", + status="string", + tags="string", + insertDate=new Date())) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createCustomerAddress(customerId: String, line1: String, line2: String, line3: String, city: String, county: String, state: String, postcode: String, countryCode: String, tags: String, status: String, callContext: Option[CallContext]): OBPReturnType[Box[CustomerAddress]] = { + import com.openbankproject.commons.dto.{OutBoundCreateCustomerAddress => OutBound, InBoundCreateCustomerAddress => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId, line1, line2, line3, city, county, state, postcode, countryCode, tags, status) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[CustomerAddressCommons](callContext)) + } + + messageDocs += updateCustomerAddressDoc + def updateCustomerAddressDoc = MessageDoc( + process = "obp.updateCustomerAddress", + messageFormat = messageFormat, + description = "Update Customer Address", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundUpdateCustomerAddress(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + customerAddressId="string", + line1="string", + line2="string", + line3="string", + city="string", + county="string", + state="string", + postcode="string", + countryCode="string", + tags="string", + status="string") + ), + exampleInboundMessage = ( + InBoundUpdateCustomerAddress(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= CustomerAddressCommons(customerId=customerIdExample.value, + customerAddressId="string", + line1="string", + line2="string", + line3="string", + city="string", + county="string", + state="string", + postcode="string", + countryCode="string", + status="string", + tags="string", + insertDate=new Date())) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def updateCustomerAddress(customerAddressId: String, line1: String, line2: String, line3: String, city: String, county: String, state: String, postcode: String, countryCode: String, tags: String, status: String, callContext: Option[CallContext]): OBPReturnType[Box[CustomerAddress]] = { + import com.openbankproject.commons.dto.{OutBoundUpdateCustomerAddress => OutBound, InBoundUpdateCustomerAddress => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerAddressId, line1, line2, line3, city, county, state, postcode, countryCode, tags, status) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[CustomerAddressCommons](callContext)) + } + + messageDocs += deleteCustomerAddressDoc + def deleteCustomerAddressDoc = MessageDoc( + process = "obp.deleteCustomerAddress", + messageFormat = messageFormat, + description = "Delete Customer Address", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundDeleteCustomerAddress(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + customerAddressId="string") + ), + exampleInboundMessage = ( + InBoundDeleteCustomerAddress(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=true) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def deleteCustomerAddress(customerAddressId: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { + import com.openbankproject.commons.dto.{OutBoundDeleteCustomerAddress => OutBound, InBoundDeleteCustomerAddress => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerAddressId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[Boolean](callContext)) + } + + messageDocs += createTaxResidenceDoc + def createTaxResidenceDoc = MessageDoc( + process = "obp.createTaxResidence", + messageFormat = messageFormat, + description = "Create Tax Residence", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateTaxResidence(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + customerId=customerIdExample.value, + domain="string", + taxNumber="string") + ), + exampleInboundMessage = ( + InBoundCreateTaxResidence(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= TaxResidenceCommons(customerId=customerIdExample.value, + taxResidenceId="string", + domain="string", + taxNumber="string")) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createTaxResidence(customerId: String, domain: String, taxNumber: String, callContext: Option[CallContext]): OBPReturnType[Box[TaxResidence]] = { + import com.openbankproject.commons.dto.{OutBoundCreateTaxResidence => OutBound, InBoundCreateTaxResidence => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId, domain, taxNumber) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[TaxResidenceCommons](callContext)) + } + + messageDocs += getTaxResidenceDoc + def getTaxResidenceDoc = MessageDoc( + process = "obp.getTaxResidence", + messageFormat = messageFormat, + description = "Get Tax Residence", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetTaxResidence(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + customerId=customerIdExample.value) + ), + exampleInboundMessage = ( + InBoundGetTaxResidence(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( TaxResidenceCommons(customerId=customerIdExample.value, + taxResidenceId="string", + domain="string", + taxNumber="string"))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getTaxResidence(customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[TaxResidence]]] = { + import com.openbankproject.commons.dto.{OutBoundGetTaxResidence => OutBound, InBoundGetTaxResidence => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[TaxResidenceCommons]](callContext)) + } + + messageDocs += deleteTaxResidenceDoc + def deleteTaxResidenceDoc = MessageDoc( + process = "obp.deleteTaxResidence", + messageFormat = messageFormat, + description = "Delete Tax Residence", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundDeleteTaxResidence(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + taxResourceId="string") + ), + exampleInboundMessage = ( + InBoundDeleteTaxResidence(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=true) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def deleteTaxResidence(taxResourceId: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { + import com.openbankproject.commons.dto.{OutBoundDeleteTaxResidence => OutBound, InBoundDeleteTaxResidence => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, taxResourceId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[Boolean](callContext)) + } + + messageDocs += getCustomersDoc + def getCustomersDoc = MessageDoc( + process = "obp.getCustomers", + messageFormat = messageFormat, + description = "Get Customers", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetCustomers(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + limit=limitExample.value.toInt, + offset=offsetExample.value.toInt, + fromDate="string", + toDate="string") + ), + exampleInboundMessage = ( + InBoundGetCustomers(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( CustomerCommons(customerId=customerIdExample.value, + bankId=bankIdExample.value, + number=customerNumberExample.value, + legalName=legalNameExample.value, + mobileNumber=mobileNumberExample.value, + email=emailExample.value, + faceImage= CustomerFaceImage(date=parseDate(customerFaceImageDateExample.value).getOrElse(sys.error("customerFaceImageDateExample.value is not validate date format.")), + url=urlExample.value), + dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")), + relationshipStatus=relationshipStatusExample.value, + dependents=dependentsExample.value.toInt, + dobOfDependents=dobOfDependentsExample.value.split("[,;]").map(parseDate).flatMap(_.toSeq).toList, + highestEducationAttained=highestEducationAttainedExample.value, + employmentStatus=employmentStatusExample.value, + creditRating= CreditRating(rating=ratingExample.value, + source=sourceExample.value), + creditLimit= CreditLimit(currency=currencyExample.value, + amount=creditLimitAmountExample.value), + kycStatus=kycStatusExample.value.toBoolean, + lastOkDate=parseDate(customerLastOkDateExample.value).getOrElse(sys.error("customerLastOkDateExample.value is not validate date format.")), + title=customerTitleExample.value, + branchId=branchIdExample.value, + nameSuffix=nameSuffixExample.value))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getCustomers(bankId: BankId, callContext: Option[CallContext], queryParams: List[OBPQueryParam]): Future[Box[List[Customer]]] = { + import com.openbankproject.commons.dto.{OutBoundGetCustomers => OutBound, InBoundGetCustomers => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams)) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[CustomerCommons]](callContext)) + } + + messageDocs += getCustomersByCustomerPhoneNumberDoc + def getCustomersByCustomerPhoneNumberDoc = MessageDoc( + process = "obp.getCustomersByCustomerPhoneNumber", + messageFormat = messageFormat, + description = "Get Customers By Customer Phone Number", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetCustomersByCustomerPhoneNumber(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + phoneNumber="string") + ), + exampleInboundMessage = ( + InBoundGetCustomersByCustomerPhoneNumber(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( CustomerCommons(customerId=customerIdExample.value, + bankId=bankIdExample.value, + number=customerNumberExample.value, + legalName=legalNameExample.value, + mobileNumber=mobileNumberExample.value, + email=emailExample.value, + faceImage= CustomerFaceImage(date=parseDate(customerFaceImageDateExample.value).getOrElse(sys.error("customerFaceImageDateExample.value is not validate date format.")), + url=urlExample.value), + dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")), + relationshipStatus=relationshipStatusExample.value, + dependents=dependentsExample.value.toInt, + dobOfDependents=dobOfDependentsExample.value.split("[,;]").map(parseDate).flatMap(_.toSeq).toList, + highestEducationAttained=highestEducationAttainedExample.value, + employmentStatus=employmentStatusExample.value, + creditRating= CreditRating(rating=ratingExample.value, + source=sourceExample.value), + creditLimit= CreditLimit(currency=currencyExample.value, + amount=creditLimitAmountExample.value), + kycStatus=kycStatusExample.value.toBoolean, + lastOkDate=parseDate(customerLastOkDateExample.value).getOrElse(sys.error("customerLastOkDateExample.value is not validate date format.")), + title=customerTitleExample.value, + branchId=branchIdExample.value, + nameSuffix=nameSuffixExample.value))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getCustomersByCustomerPhoneNumber(bankId: BankId, phoneNumber: String, callContext: Option[CallContext]): OBPReturnType[Box[List[Customer]]] = { + import com.openbankproject.commons.dto.{OutBoundGetCustomersByCustomerPhoneNumber => OutBound, InBoundGetCustomersByCustomerPhoneNumber => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, phoneNumber) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[CustomerCommons]](callContext)) + } + + messageDocs += getCheckbookOrdersDoc + def getCheckbookOrdersDoc = MessageDoc( + process = "obp.getCheckbookOrders", + messageFormat = messageFormat, + description = "Get Checkbook Orders", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetCheckbookOrders(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=bankIdExample.value, + accountId=accountIdExample.value) + ), + exampleInboundMessage = ( + InBoundGetCheckbookOrders(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= CheckbookOrdersJson(account= AccountV310Json(bank_id="string", + account_id="string", + account_type="string", + account_routings=List( AccountRoutingJsonV121(scheme="string", + address="string")), + branch_routings=List( BranchRoutingJsonV141(scheme="string", + address="string"))), + orders=List(OrderJson( OrderObjectJson(order_id="string", + order_date="string", + number_of_checkbooks="string", + distribution_channel="string", + status="string", + first_check_number="string", + shipping_code="string"))))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getCheckbookOrders(bankId: String, accountId: String, callContext: Option[CallContext]): Future[Box[(CheckbookOrdersJson, Option[CallContext])]] = { + import com.openbankproject.commons.dto.{OutBoundGetCheckbookOrders => OutBound, InBoundGetCheckbookOrders => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[CheckbookOrdersJson](callContext)) + } + + messageDocs += getStatusOfCreditCardOrderDoc + def getStatusOfCreditCardOrderDoc = MessageDoc( + process = "obp.getStatusOfCreditCardOrder", + messageFormat = messageFormat, + description = "Get Status Of Credit Card Order", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetStatusOfCreditCardOrder(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=bankIdExample.value, + accountId=accountIdExample.value) + ), + exampleInboundMessage = ( + InBoundGetStatusOfCreditCardOrder(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( CardObjectJson(card_type="string", + card_description="string", + use_type="string"))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getStatusOfCreditCardOrder(bankId: String, accountId: String, callContext: Option[CallContext]): Future[Box[(List[CardObjectJson], Option[CallContext])]] = { + import com.openbankproject.commons.dto.{OutBoundGetStatusOfCreditCardOrder => OutBound, InBoundGetStatusOfCreditCardOrder => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[CardObjectJson]](callContext)) + } + + messageDocs += createUserAuthContextDoc + def createUserAuthContextDoc = MessageDoc( + process = "obp.createUserAuthContext", + messageFormat = messageFormat, + description = "Create User Auth Context", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateUserAuthContext(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + userId=userIdExample.value, + key=keyExample.value, + value=valueExample.value) + ), + exampleInboundMessage = ( + InBoundCreateUserAuthContext(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= UserAuthContextCommons(userAuthContextId="string", + userId=userIdExample.value, + key=keyExample.value, + value=valueExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createUserAuthContext(userId: String, key: String, value: String, callContext: Option[CallContext]): OBPReturnType[Box[UserAuthContext]] = { + import com.openbankproject.commons.dto.{OutBoundCreateUserAuthContext => OutBound, InBoundCreateUserAuthContext => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, userId, key, value) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[UserAuthContextCommons](callContext)) + } + + messageDocs += createUserAuthContextUpdateDoc + def createUserAuthContextUpdateDoc = MessageDoc( + process = "obp.createUserAuthContextUpdate", + messageFormat = messageFormat, + description = "Create User Auth Context Update", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateUserAuthContextUpdate(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + userId=userIdExample.value, + key=keyExample.value, + value=valueExample.value) + ), + exampleInboundMessage = ( + InBoundCreateUserAuthContextUpdate(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= UserAuthContextUpdateCommons(userAuthContextUpdateId="string", + userId=userIdExample.value, + key=keyExample.value, + value=valueExample.value, + challenge="string", + status="string")) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createUserAuthContextUpdate(userId: String, key: String, value: String, callContext: Option[CallContext]): OBPReturnType[Box[UserAuthContextUpdate]] = { + import com.openbankproject.commons.dto.{OutBoundCreateUserAuthContextUpdate => OutBound, InBoundCreateUserAuthContextUpdate => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, userId, key, value) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[UserAuthContextUpdateCommons](callContext)) + } + + messageDocs += deleteUserAuthContextsDoc + def deleteUserAuthContextsDoc = MessageDoc( + process = "obp.deleteUserAuthContexts", + messageFormat = messageFormat, + description = "Delete User Auth Contexts", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundDeleteUserAuthContexts(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + userId=userIdExample.value) + ), + exampleInboundMessage = ( + InBoundDeleteUserAuthContexts(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=true) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def deleteUserAuthContexts(userId: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { + import com.openbankproject.commons.dto.{OutBoundDeleteUserAuthContexts => OutBound, InBoundDeleteUserAuthContexts => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, userId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[Boolean](callContext)) + } + + messageDocs += deleteUserAuthContextByIdDoc + def deleteUserAuthContextByIdDoc = MessageDoc( + process = "obp.deleteUserAuthContextById", + messageFormat = messageFormat, + description = "Delete User Auth Context By Id", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundDeleteUserAuthContextById(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + userAuthContextId="string") + ), + exampleInboundMessage = ( + InBoundDeleteUserAuthContextById(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=true) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def deleteUserAuthContextById(userAuthContextId: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { + import com.openbankproject.commons.dto.{OutBoundDeleteUserAuthContextById => OutBound, InBoundDeleteUserAuthContextById => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, userAuthContextId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[Boolean](callContext)) + } + + messageDocs += getUserAuthContextsDoc + def getUserAuthContextsDoc = MessageDoc( + process = "obp.getUserAuthContexts", + messageFormat = messageFormat, + description = "Get User Auth Contexts", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetUserAuthContexts(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + userId=userIdExample.value) + ), + exampleInboundMessage = ( + InBoundGetUserAuthContexts(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( UserAuthContextCommons(userAuthContextId="string", + userId=userIdExample.value, + key=keyExample.value, + value=valueExample.value))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getUserAuthContexts(userId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[UserAuthContext]]] = { + import com.openbankproject.commons.dto.{OutBoundGetUserAuthContexts => OutBound, InBoundGetUserAuthContexts => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, userId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[UserAuthContextCommons]](callContext)) + } + + messageDocs += createOrUpdateProductAttributeDoc + def createOrUpdateProductAttributeDoc = MessageDoc( + process = "obp.createOrUpdateProductAttribute", + messageFormat = messageFormat, + description = "Create Or Update Product Attribute", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateOrUpdateProductAttribute(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + productCode=ProductCode("string"), + productAttributeId=Some("string"), + name="string", + productAttributeType=com.openbankproject.commons.model.enums.ProductAttributeType.example, + value=valueExample.value) + ), + exampleInboundMessage = ( + InBoundCreateOrUpdateProductAttribute(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= ProductAttributeCommons(bankId=BankId(bankIdExample.value), + productCode=ProductCode("string"), + productAttributeId="string", + name="string", + attributeType=com.openbankproject.commons.model.enums.ProductAttributeType.example, + value=valueExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createOrUpdateProductAttribute(bankId: BankId, productCode: ProductCode, productAttributeId: Option[String], name: String, productAttributeType: ProductAttributeType.Value, value: String, callContext: Option[CallContext]): OBPReturnType[Box[ProductAttribute]] = { + import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateProductAttribute => OutBound, InBoundCreateOrUpdateProductAttribute => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, productCode, productAttributeId, name, productAttributeType, value) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[ProductAttributeCommons](callContext)) + } + + messageDocs += getProductAttributeByIdDoc + def getProductAttributeByIdDoc = MessageDoc( + process = "obp.getProductAttributeById", + messageFormat = messageFormat, + description = "Get Product Attribute By Id", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetProductAttributeById(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + productAttributeId="string") + ), + exampleInboundMessage = ( + InBoundGetProductAttributeById(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= ProductAttributeCommons(bankId=BankId(bankIdExample.value), + productCode=ProductCode("string"), + productAttributeId="string", + name="string", + attributeType=com.openbankproject.commons.model.enums.ProductAttributeType.example, + value=valueExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getProductAttributeById(productAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[ProductAttribute]] = { + import com.openbankproject.commons.dto.{OutBoundGetProductAttributeById => OutBound, InBoundGetProductAttributeById => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, productAttributeId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[ProductAttributeCommons](callContext)) + } + + messageDocs += getProductAttributesByBankAndCodeDoc + def getProductAttributesByBankAndCodeDoc = MessageDoc( + process = "obp.getProductAttributesByBankAndCode", + messageFormat = messageFormat, + description = "Get Product Attributes By Bank And Code", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetProductAttributesByBankAndCode(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bank=BankId(bankIdExample.value), + productCode=ProductCode("string")) + ), + exampleInboundMessage = ( + InBoundGetProductAttributesByBankAndCode(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( ProductAttributeCommons(bankId=BankId(bankIdExample.value), + productCode=ProductCode("string"), + productAttributeId="string", + name="string", + attributeType=com.openbankproject.commons.model.enums.ProductAttributeType.example, + value=valueExample.value))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getProductAttributesByBankAndCode(bank: BankId, productCode: ProductCode, callContext: Option[CallContext]): OBPReturnType[Box[List[ProductAttribute]]] = { + import com.openbankproject.commons.dto.{OutBoundGetProductAttributesByBankAndCode => OutBound, InBoundGetProductAttributesByBankAndCode => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bank, productCode) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[ProductAttributeCommons]](callContext)) + } + + messageDocs += deleteProductAttributeDoc + def deleteProductAttributeDoc = MessageDoc( + process = "obp.deleteProductAttribute", + messageFormat = messageFormat, + description = "Delete Product Attribute", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundDeleteProductAttribute(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + productAttributeId="string") + ), + exampleInboundMessage = ( + InBoundDeleteProductAttribute(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=true) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def deleteProductAttribute(productAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { + import com.openbankproject.commons.dto.{OutBoundDeleteProductAttribute => OutBound, InBoundDeleteProductAttribute => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, productAttributeId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[Boolean](callContext)) + } + + messageDocs += getAccountAttributeByIdDoc + def getAccountAttributeByIdDoc = MessageDoc( + process = "obp.getAccountAttributeById", + messageFormat = messageFormat, + description = "Get Account Attribute By Id", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetAccountAttributeById(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + accountAttributeId="string") + ), + exampleInboundMessage = ( + InBoundGetAccountAttributeById(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= AccountAttributeCommons(bankId=BankId(bankIdExample.value), + accountId=AccountId(accountIdExample.value), + productCode=ProductCode("string"), + accountAttributeId="string", + name="string", + attributeType=com.openbankproject.commons.model.enums.AccountAttributeType.example, + value=valueExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getAccountAttributeById(accountAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[AccountAttribute]] = { + import com.openbankproject.commons.dto.{OutBoundGetAccountAttributeById => OutBound, InBoundGetAccountAttributeById => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, accountAttributeId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[AccountAttributeCommons](callContext)) + } + + messageDocs += getTransactionAttributeByIdDoc + def getTransactionAttributeByIdDoc = MessageDoc( + process = "obp.getTransactionAttributeById", + messageFormat = messageFormat, + description = "Get Transaction Attribute By Id", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetTransactionAttributeById(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + transactionAttributeId=transactionAttributeIdExample.value) + ), + exampleInboundMessage = ( + InBoundGetTransactionAttributeById(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= TransactionAttributeCommons(bankId=BankId(bankIdExample.value), + transactionId=TransactionId(transactionIdExample.value), + transactionAttributeId=transactionAttributeIdExample.value, + attributeType=com.openbankproject.commons.model.enums.TransactionAttributeType.example, + name=transactionAttributeNameExample.value, + value=transactionAttributeValueExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getTransactionAttributeById(transactionAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[TransactionAttribute]] = { + import com.openbankproject.commons.dto.{OutBoundGetTransactionAttributeById => OutBound, InBoundGetTransactionAttributeById => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, transactionAttributeId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[TransactionAttributeCommons](callContext)) + } + + messageDocs += createOrUpdateAccountAttributeDoc + def createOrUpdateAccountAttributeDoc = MessageDoc( + process = "obp.createOrUpdateAccountAttribute", + messageFormat = messageFormat, + description = "Create Or Update Account Attribute", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateOrUpdateAccountAttribute(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + accountId=AccountId(accountIdExample.value), + productCode=ProductCode("string"), + productAttributeId=Some("string"), + name="string", + accountAttributeType=com.openbankproject.commons.model.enums.AccountAttributeType.example, + value=valueExample.value) + ), + exampleInboundMessage = ( + InBoundCreateOrUpdateAccountAttribute(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= AccountAttributeCommons(bankId=BankId(bankIdExample.value), + accountId=AccountId(accountIdExample.value), + productCode=ProductCode("string"), + accountAttributeId="string", + name="string", + attributeType=com.openbankproject.commons.model.enums.AccountAttributeType.example, + value=valueExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createOrUpdateAccountAttribute(bankId: BankId, accountId: AccountId, productCode: ProductCode, productAttributeId: Option[String], name: String, accountAttributeType: AccountAttributeType.Value, value: String, callContext: Option[CallContext]): OBPReturnType[Box[AccountAttribute]] = { + import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateAccountAttribute => OutBound, InBoundCreateOrUpdateAccountAttribute => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, productCode, productAttributeId, name, accountAttributeType, value) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[AccountAttributeCommons](callContext)) + } + + messageDocs += createOrUpdateCustomerAttributeDoc + def createOrUpdateCustomerAttributeDoc = MessageDoc( + process = "obp.createOrUpdateCustomerAttribute", + messageFormat = messageFormat, + description = "Create Or Update Customer Attribute", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateOrUpdateCustomerAttribute(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + customerId=CustomerId(customerIdExample.value), + customerAttributeId=Some(customerAttributeIdExample.value), + name="string", + attributeType=com.openbankproject.commons.model.enums.CustomerAttributeType.example, + value=valueExample.value) + ), + exampleInboundMessage = ( + InBoundCreateOrUpdateCustomerAttribute(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= CustomerAttributeCommons(bankId=BankId(bankIdExample.value), + customerId=CustomerId(customerIdExample.value), + customerAttributeId=customerAttributeIdExample.value, + attributeType=com.openbankproject.commons.model.enums.CustomerAttributeType.example, + name=customerAttributeNameExample.value, + value=customerAttributeValueExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createOrUpdateCustomerAttribute(bankId: BankId, customerId: CustomerId, customerAttributeId: Option[String], name: String, attributeType: CustomerAttributeType.Value, value: String, callContext: Option[CallContext]): OBPReturnType[Box[CustomerAttribute]] = { + import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateCustomerAttribute => OutBound, InBoundCreateOrUpdateCustomerAttribute => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, customerId, customerAttributeId, name, attributeType, value) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[CustomerAttributeCommons](callContext)) + } + + messageDocs += createOrUpdateTransactionAttributeDoc + def createOrUpdateTransactionAttributeDoc = MessageDoc( + process = "obp.createOrUpdateTransactionAttribute", + messageFormat = messageFormat, + description = "Create Or Update Transaction Attribute", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateOrUpdateTransactionAttribute(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + transactionId=TransactionId(transactionIdExample.value), + transactionAttributeId=Some(transactionAttributeIdExample.value), + name="string", + attributeType=com.openbankproject.commons.model.enums.TransactionAttributeType.example, + value=valueExample.value) + ), + exampleInboundMessage = ( + InBoundCreateOrUpdateTransactionAttribute(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= TransactionAttributeCommons(bankId=BankId(bankIdExample.value), + transactionId=TransactionId(transactionIdExample.value), + transactionAttributeId=transactionAttributeIdExample.value, + attributeType=com.openbankproject.commons.model.enums.TransactionAttributeType.example, + name=transactionAttributeNameExample.value, + value=transactionAttributeValueExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createOrUpdateTransactionAttribute(bankId: BankId, transactionId: TransactionId, transactionAttributeId: Option[String], name: String, attributeType: TransactionAttributeType.Value, value: String, callContext: Option[CallContext]): OBPReturnType[Box[TransactionAttribute]] = { + import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateTransactionAttribute => OutBound, InBoundCreateOrUpdateTransactionAttribute => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, transactionId, transactionAttributeId, name, attributeType, value) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[TransactionAttributeCommons](callContext)) + } + + messageDocs += createAccountAttributesDoc + def createAccountAttributesDoc = MessageDoc( + process = "obp.createAccountAttributes", + messageFormat = messageFormat, + description = "Create Account Attributes", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateAccountAttributes(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + accountId=AccountId(accountIdExample.value), + productCode=ProductCode("string"), + accountAttributes=List( ProductAttributeCommons(bankId=BankId(bankIdExample.value), + productCode=ProductCode("string"), + productAttributeId="string", + name="string", + attributeType=com.openbankproject.commons.model.enums.ProductAttributeType.example, + value=valueExample.value))) + ), + exampleInboundMessage = ( + InBoundCreateAccountAttributes(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( AccountAttributeCommons(bankId=BankId(bankIdExample.value), + accountId=AccountId(accountIdExample.value), + productCode=ProductCode("string"), + accountAttributeId="string", + name="string", + attributeType=com.openbankproject.commons.model.enums.AccountAttributeType.example, + value=valueExample.value))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createAccountAttributes(bankId: BankId, accountId: AccountId, productCode: ProductCode, accountAttributes: List[ProductAttribute], callContext: Option[CallContext]): OBPReturnType[Box[List[AccountAttribute]]] = { + import com.openbankproject.commons.dto.{OutBoundCreateAccountAttributes => OutBound, InBoundCreateAccountAttributes => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, productCode, accountAttributes) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[AccountAttributeCommons]](callContext)) + } + + messageDocs += getAccountAttributesByAccountDoc + def getAccountAttributesByAccountDoc = MessageDoc( + process = "obp.getAccountAttributesByAccount", + messageFormat = messageFormat, + description = "Get Account Attributes By Account", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetAccountAttributesByAccount(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + accountId=AccountId(accountIdExample.value)) + ), + exampleInboundMessage = ( + InBoundGetAccountAttributesByAccount(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( AccountAttributeCommons(bankId=BankId(bankIdExample.value), + accountId=AccountId(accountIdExample.value), + productCode=ProductCode("string"), + accountAttributeId="string", + name="string", + attributeType=com.openbankproject.commons.model.enums.AccountAttributeType.example, + value=valueExample.value))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getAccountAttributesByAccount(bankId: BankId, accountId: AccountId, callContext: Option[CallContext]): OBPReturnType[Box[List[AccountAttribute]]] = { + import com.openbankproject.commons.dto.{OutBoundGetAccountAttributesByAccount => OutBound, InBoundGetAccountAttributesByAccount => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[AccountAttributeCommons]](callContext)) + } + + messageDocs += getCustomerAttributesDoc + def getCustomerAttributesDoc = MessageDoc( + process = "obp.getCustomerAttributes", + messageFormat = messageFormat, + description = "Get Customer Attributes", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetCustomerAttributes(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + customerId=CustomerId(customerIdExample.value)) + ), + exampleInboundMessage = ( + InBoundGetCustomerAttributes(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( CustomerAttributeCommons(bankId=BankId(bankIdExample.value), + customerId=CustomerId(customerIdExample.value), + customerAttributeId=customerAttributeIdExample.value, + attributeType=com.openbankproject.commons.model.enums.CustomerAttributeType.example, + name=customerAttributeNameExample.value, + value=customerAttributeValueExample.value))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getCustomerAttributes(bankId: BankId, customerId: CustomerId, callContext: Option[CallContext]): OBPReturnType[Box[List[CustomerAttribute]]] = { + import com.openbankproject.commons.dto.{OutBoundGetCustomerAttributes => OutBound, InBoundGetCustomerAttributes => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, customerId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[CustomerAttributeCommons]](callContext)) + } + + messageDocs += getCustomerIdsByAttributeNameValuesDoc + def getCustomerIdsByAttributeNameValuesDoc = MessageDoc( + process = "obp.getCustomerIdsByAttributeNameValues", + messageFormat = messageFormat, + description = "Get Customer Ids By Attribute Name Values", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetCustomerIdsByAttributeNameValues(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + nameValues=Map("some_name" -> List("name1", "name2"))) + ), + exampleInboundMessage = ( + InBoundGetCustomerIdsByAttributeNameValues(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List("string")) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getCustomerIdsByAttributeNameValues(bankId: BankId, nameValues: Map[String,List[String]], callContext: Option[CallContext]): OBPReturnType[Box[List[String]]] = { + import com.openbankproject.commons.dto.{OutBoundGetCustomerIdsByAttributeNameValues => OutBound, InBoundGetCustomerIdsByAttributeNameValues => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, nameValues) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[String]](callContext)) + } + + messageDocs += getCustomerAttributesForCustomersDoc + def getCustomerAttributesForCustomersDoc = MessageDoc( + process = "obp.getCustomerAttributesForCustomers", + messageFormat = messageFormat, + description = "Get Customer Attributes For Customers", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetCustomerAttributesForCustomers(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + customers=List( CustomerCommons(customerId=customerIdExample.value, + bankId=bankIdExample.value, + number=customerNumberExample.value, + legalName=legalNameExample.value, + mobileNumber=mobileNumberExample.value, + email=emailExample.value, + faceImage= CustomerFaceImage(date=parseDate(customerFaceImageDateExample.value).getOrElse(sys.error("customerFaceImageDateExample.value is not validate date format.")), + url=urlExample.value), + dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")), + relationshipStatus=relationshipStatusExample.value, + dependents=dependentsExample.value.toInt, + dobOfDependents=dobOfDependentsExample.value.split("[,;]").map(parseDate).flatMap(_.toSeq).toList, + highestEducationAttained=highestEducationAttainedExample.value, + employmentStatus=employmentStatusExample.value, + creditRating= CreditRating(rating=ratingExample.value, + source=sourceExample.value), + creditLimit= CreditLimit(currency=currencyExample.value, + amount=creditLimitAmountExample.value), + kycStatus=kycStatusExample.value.toBoolean, + lastOkDate=parseDate(customerLastOkDateExample.value).getOrElse(sys.error("customerLastOkDateExample.value is not validate date format.")), + title=customerTitleExample.value, + branchId=branchIdExample.value, + nameSuffix=nameSuffixExample.value))) + ), + exampleInboundMessage = ( + InBoundGetCustomerAttributesForCustomers(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + value= List( + CustomerAndAttribute( + MessageDocsSwaggerDefinitions.customerCommons, + List(MessageDocsSwaggerDefinitions.customerAttribute) + ) + ) + ) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getCustomerAttributesForCustomers(customers: List[Customer], callContext: Option[CallContext]): OBPReturnType[Box[List[(Customer, List[CustomerAttribute])]]] = { + import com.openbankproject.commons.dto.{OutBoundGetCustomerAttributesForCustomers => OutBound, InBoundGetCustomerAttributesForCustomers => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customers) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[(Customer, List[CustomerAttribute])]](callContext)) + } + + messageDocs += getTransactionIdsByAttributeNameValuesDoc + def getTransactionIdsByAttributeNameValuesDoc = MessageDoc( + process = "obp.getTransactionIdsByAttributeNameValues", + messageFormat = messageFormat, + description = "Get Transaction Ids By Attribute Name Values", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetTransactionIdsByAttributeNameValues(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + nameValues=Map("some_name" -> List("name1", "name2"))) + ), + exampleInboundMessage = ( + InBoundGetTransactionIdsByAttributeNameValues(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List("string")) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getTransactionIdsByAttributeNameValues(bankId: BankId, nameValues: Map[String,List[String]], callContext: Option[CallContext]): OBPReturnType[Box[List[String]]] = { + import com.openbankproject.commons.dto.{OutBoundGetTransactionIdsByAttributeNameValues => OutBound, InBoundGetTransactionIdsByAttributeNameValues => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, nameValues) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[String]](callContext)) + } + + messageDocs += getTransactionAttributesDoc + def getTransactionAttributesDoc = MessageDoc( + process = "obp.getTransactionAttributes", + messageFormat = messageFormat, + description = "Get Transaction Attributes", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetTransactionAttributes(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + transactionId=TransactionId(transactionIdExample.value)) + ), + exampleInboundMessage = ( + InBoundGetTransactionAttributes(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( TransactionAttributeCommons(bankId=BankId(bankIdExample.value), + transactionId=TransactionId(transactionIdExample.value), + transactionAttributeId=transactionAttributeIdExample.value, + attributeType=com.openbankproject.commons.model.enums.TransactionAttributeType.example, + name=transactionAttributeNameExample.value, + value=transactionAttributeValueExample.value))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getTransactionAttributes(bankId: BankId, transactionId: TransactionId, callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionAttribute]]] = { + import com.openbankproject.commons.dto.{OutBoundGetTransactionAttributes => OutBound, InBoundGetTransactionAttributes => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, transactionId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[TransactionAttributeCommons]](callContext)) + } + + messageDocs += getCustomerAttributeByIdDoc + def getCustomerAttributeByIdDoc = MessageDoc( + process = "obp.getCustomerAttributeById", + messageFormat = messageFormat, + description = "Get Customer Attribute By Id", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetCustomerAttributeById(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + customerAttributeId=customerAttributeIdExample.value) + ), + exampleInboundMessage = ( + InBoundGetCustomerAttributeById(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= CustomerAttributeCommons(bankId=BankId(bankIdExample.value), + customerId=CustomerId(customerIdExample.value), + customerAttributeId=customerAttributeIdExample.value, + attributeType=com.openbankproject.commons.model.enums.CustomerAttributeType.example, + name=customerAttributeNameExample.value, + value=customerAttributeValueExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getCustomerAttributeById(customerAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[CustomerAttribute]] = { + import com.openbankproject.commons.dto.{OutBoundGetCustomerAttributeById => OutBound, InBoundGetCustomerAttributeById => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerAttributeId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[CustomerAttributeCommons](callContext)) + } + + messageDocs += createOrUpdateCardAttributeDoc + def createOrUpdateCardAttributeDoc = MessageDoc( + process = "obp.createOrUpdateCardAttribute", + messageFormat = messageFormat, + description = "Create Or Update Card Attribute", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateOrUpdateCardAttribute(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=Some(BankId(bankIdExample.value)), + cardId=Some(cardIdExample.value), + cardAttributeId=Some(cardAttributeIdExample.value), + name="string", + cardAttributeType=com.openbankproject.commons.model.enums.CardAttributeType.example, + value=valueExample.value) + ), + exampleInboundMessage = ( + InBoundCreateOrUpdateCardAttribute(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= CardAttributeCommons(bankId=Some(BankId(bankIdExample.value)), + cardId=Some(cardIdExample.value), + cardAttributeId=Some(cardAttributeIdExample.value), + name=cardAttributeNameExample.value, + attributeType=com.openbankproject.commons.model.enums.CardAttributeType.example, + value=cardAttributeValueExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createOrUpdateCardAttribute(bankId: Option[BankId], cardId: Option[String], cardAttributeId: Option[String], name: String, cardAttributeType: CardAttributeType.Value, value: String, callContext: Option[CallContext]): OBPReturnType[Box[CardAttribute]] = { + import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateCardAttribute => OutBound, InBoundCreateOrUpdateCardAttribute => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, cardId, cardAttributeId, name, cardAttributeType, value) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[CardAttributeCommons](callContext)) + } + + messageDocs += getCardAttributeByIdDoc + def getCardAttributeByIdDoc = MessageDoc( + process = "obp.getCardAttributeById", + messageFormat = messageFormat, + description = "Get Card Attribute By Id", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetCardAttributeById(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + cardAttributeId=cardAttributeIdExample.value) + ), + exampleInboundMessage = ( + InBoundGetCardAttributeById(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= CardAttributeCommons(bankId=Some(BankId(bankIdExample.value)), + cardId=Some(cardIdExample.value), + cardAttributeId=Some(cardAttributeIdExample.value), + name=cardAttributeNameExample.value, + attributeType=com.openbankproject.commons.model.enums.CardAttributeType.example, + value=cardAttributeValueExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getCardAttributeById(cardAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[CardAttribute]] = { + import com.openbankproject.commons.dto.{OutBoundGetCardAttributeById => OutBound, InBoundGetCardAttributeById => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, cardAttributeId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[CardAttributeCommons](callContext)) + } + + messageDocs += getCardAttributesFromProviderDoc + def getCardAttributesFromProviderDoc = MessageDoc( + process = "obp.getCardAttributesFromProvider", + messageFormat = messageFormat, + description = "Get Card Attributes From Provider", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetCardAttributesFromProvider(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + cardId=cardIdExample.value) + ), + exampleInboundMessage = ( + InBoundGetCardAttributesFromProvider(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( CardAttributeCommons(bankId=Some(BankId(bankIdExample.value)), + cardId=Some(cardIdExample.value), + cardAttributeId=Some(cardAttributeIdExample.value), + name=cardAttributeNameExample.value, + attributeType=com.openbankproject.commons.model.enums.CardAttributeType.example, + value=cardAttributeValueExample.value))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getCardAttributesFromProvider(cardId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[CardAttribute]]] = { + import com.openbankproject.commons.dto.{OutBoundGetCardAttributesFromProvider => OutBound, InBoundGetCardAttributesFromProvider => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, cardId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[CardAttributeCommons]](callContext)) + } + + messageDocs += createAccountApplicationDoc + def createAccountApplicationDoc = MessageDoc( + process = "obp.createAccountApplication", + messageFormat = messageFormat, + description = "Create Account Application", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateAccountApplication(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + productCode=ProductCode("string"), + userId=Some(userIdExample.value), + customerId=Some(customerIdExample.value)) + ), + exampleInboundMessage = ( + InBoundCreateAccountApplication(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= AccountApplicationCommons(accountApplicationId="string", + productCode=ProductCode("string"), + userId=userIdExample.value, + customerId=customerIdExample.value, + dateOfApplication=new Date(), + status="string")) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createAccountApplication(productCode: ProductCode, userId: Option[String], customerId: Option[String], callContext: Option[CallContext]): OBPReturnType[Box[AccountApplication]] = { + import com.openbankproject.commons.dto.{OutBoundCreateAccountApplication => OutBound, InBoundCreateAccountApplication => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, productCode, userId, customerId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[AccountApplicationCommons](callContext)) + } + + messageDocs += getAllAccountApplicationDoc + def getAllAccountApplicationDoc = MessageDoc( + process = "obp.getAllAccountApplication", + messageFormat = messageFormat, + description = "Get All Account Application", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetAllAccountApplication(MessageDocsSwaggerDefinitions.outboundAdapterCallContext) + ), + exampleInboundMessage = ( + InBoundGetAllAccountApplication(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( AccountApplicationCommons(accountApplicationId="string", + productCode=ProductCode("string"), + userId=userIdExample.value, + customerId=customerIdExample.value, + dateOfApplication=new Date(), + status="string"))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getAllAccountApplication(callContext: Option[CallContext]): OBPReturnType[Box[List[AccountApplication]]] = { + import com.openbankproject.commons.dto.{OutBoundGetAllAccountApplication => OutBound, InBoundGetAllAccountApplication => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[AccountApplicationCommons]](callContext)) + } + + messageDocs += getAccountApplicationByIdDoc + def getAccountApplicationByIdDoc = MessageDoc( + process = "obp.getAccountApplicationById", + messageFormat = messageFormat, + description = "Get Account Application By Id", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetAccountApplicationById(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + accountApplicationId="string") + ), + exampleInboundMessage = ( + InBoundGetAccountApplicationById(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= AccountApplicationCommons(accountApplicationId="string", + productCode=ProductCode("string"), + userId=userIdExample.value, + customerId=customerIdExample.value, + dateOfApplication=new Date(), + status="string")) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getAccountApplicationById(accountApplicationId: String, callContext: Option[CallContext]): OBPReturnType[Box[AccountApplication]] = { + import com.openbankproject.commons.dto.{OutBoundGetAccountApplicationById => OutBound, InBoundGetAccountApplicationById => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, accountApplicationId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[AccountApplicationCommons](callContext)) + } + + messageDocs += updateAccountApplicationStatusDoc + def updateAccountApplicationStatusDoc = MessageDoc( + process = "obp.updateAccountApplicationStatus", + messageFormat = messageFormat, + description = "Update Account Application Status", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundUpdateAccountApplicationStatus(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + accountApplicationId="string", + status="string") + ), + exampleInboundMessage = ( + InBoundUpdateAccountApplicationStatus(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= AccountApplicationCommons(accountApplicationId="string", + productCode=ProductCode("string"), + userId=userIdExample.value, + customerId=customerIdExample.value, + dateOfApplication=new Date(), + status="string")) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def updateAccountApplicationStatus(accountApplicationId: String, status: String, callContext: Option[CallContext]): OBPReturnType[Box[AccountApplication]] = { + import com.openbankproject.commons.dto.{OutBoundUpdateAccountApplicationStatus => OutBound, InBoundUpdateAccountApplicationStatus => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, accountApplicationId, status) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[AccountApplicationCommons](callContext)) + } + + messageDocs += getOrCreateProductCollectionDoc + def getOrCreateProductCollectionDoc = MessageDoc( + process = "obp.getOrCreateProductCollection", + messageFormat = messageFormat, + description = "Get Or Create Product Collection", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetOrCreateProductCollection(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + collectionCode="string", + productCodes=List("string")) + ), + exampleInboundMessage = ( + InBoundGetOrCreateProductCollection(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( ProductCollectionCommons(collectionCode="string", + productCode="string"))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getOrCreateProductCollection(collectionCode: String, productCodes: List[String], callContext: Option[CallContext]): OBPReturnType[Box[List[ProductCollection]]] = { + import com.openbankproject.commons.dto.{OutBoundGetOrCreateProductCollection => OutBound, InBoundGetOrCreateProductCollection => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, collectionCode, productCodes) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[ProductCollectionCommons]](callContext)) + } + + messageDocs += getProductCollectionDoc + def getProductCollectionDoc = MessageDoc( + process = "obp.getProductCollection", + messageFormat = messageFormat, + description = "Get Product Collection", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetProductCollection(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + collectionCode="string") + ), + exampleInboundMessage = ( + InBoundGetProductCollection(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( ProductCollectionCommons(collectionCode="string", + productCode="string"))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getProductCollection(collectionCode: String, callContext: Option[CallContext]): OBPReturnType[Box[List[ProductCollection]]] = { + import com.openbankproject.commons.dto.{OutBoundGetProductCollection => OutBound, InBoundGetProductCollection => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, collectionCode) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[ProductCollectionCommons]](callContext)) + } + + messageDocs += getOrCreateProductCollectionItemDoc + def getOrCreateProductCollectionItemDoc = MessageDoc( + process = "obp.getOrCreateProductCollectionItem", + messageFormat = messageFormat, + description = "Get Or Create Product Collection Item", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetOrCreateProductCollectionItem(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + collectionCode="string", + memberProductCodes=List("string")) + ), + exampleInboundMessage = ( + InBoundGetOrCreateProductCollectionItem(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( ProductCollectionItemCommons(collectionCode="string", + memberProductCode="string"))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getOrCreateProductCollectionItem(collectionCode: String, memberProductCodes: List[String], callContext: Option[CallContext]): OBPReturnType[Box[List[ProductCollectionItem]]] = { + import com.openbankproject.commons.dto.{OutBoundGetOrCreateProductCollectionItem => OutBound, InBoundGetOrCreateProductCollectionItem => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, collectionCode, memberProductCodes) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[ProductCollectionItemCommons]](callContext)) + } + + messageDocs += getProductCollectionItemDoc + def getProductCollectionItemDoc = MessageDoc( + process = "obp.getProductCollectionItem", + messageFormat = messageFormat, + description = "Get Product Collection Item", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetProductCollectionItem(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + collectionCode="string") + ), + exampleInboundMessage = ( + InBoundGetProductCollectionItem(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( ProductCollectionItemCommons(collectionCode="string", + memberProductCode="string"))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getProductCollectionItem(collectionCode: String, callContext: Option[CallContext]): OBPReturnType[Box[List[ProductCollectionItem]]] = { + import com.openbankproject.commons.dto.{OutBoundGetProductCollectionItem => OutBound, InBoundGetProductCollectionItem => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, collectionCode) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[ProductCollectionItemCommons]](callContext)) + } + + messageDocs += getProductCollectionItemsTreeDoc + def getProductCollectionItemsTreeDoc = MessageDoc( + process = "obp.getProductCollectionItemsTree", + messageFormat = messageFormat, + description = "Get Product Collection Items Tree", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetProductCollectionItemsTree(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + collectionCode="string", + bankId=bankIdExample.value) + ), + exampleInboundMessage = ( + InBoundGetProductCollectionItemsTree(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List(( ProductCollectionItemCommons(collectionCode="string", + memberProductCode="string"), ProductCommons(bankId=BankId(bankIdExample.value), + code=ProductCode("string"), + parentProductCode=ProductCode("string"), + name="string", + category="string", + family="string", + superFamily="string", + moreInfoUrl="string", + details="string", + description="string", + meta=Meta( License(id="string", + name="string"))), List( ProductAttributeCommons(bankId=BankId(bankIdExample.value), + productCode=ProductCode("string"), + productAttributeId="string", + name="string", + attributeType=com.openbankproject.commons.model.enums.ProductAttributeType.example, + value=valueExample.value))))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getProductCollectionItemsTree(collectionCode: String, bankId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[(ProductCollectionItem, Product, List[ProductAttribute])]]] = { + import com.openbankproject.commons.dto.{OutBoundGetProductCollectionItemsTree => OutBound, InBoundGetProductCollectionItemsTree => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, collectionCode, bankId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[(ProductCollectionItemCommons, ProductCommons, List[ProductAttributeCommons])]](callContext)) + } + + messageDocs += createMeetingDoc + def createMeetingDoc = MessageDoc( + process = "obp.createMeeting", + messageFormat = messageFormat, + description = "Create Meeting", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateMeeting(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + staffUser= UserCommons(userPrimaryKey=UserPrimaryKey(123), + userId=userIdExample.value, + idGivenByProvider="string", + provider="string", + emailAddress=emailExample.value, + name=usernameExample.value), + customerUser= UserCommons(userPrimaryKey=UserPrimaryKey(123), + userId=userIdExample.value, + idGivenByProvider="string", + provider="string", + emailAddress=emailExample.value, + name=usernameExample.value), + providerId="string", + purposeId="string", + when=new Date(), + sessionId=sessionIdExample.value, + customerToken="string", + staffToken="string", + creator= ContactDetails(name="string", + phone="string", + email=emailExample.value), + invitees=List( Invitee(contactDetails= ContactDetails(name="string", + phone="string", + email=emailExample.value), + status="string"))) + ), + exampleInboundMessage = ( + InBoundCreateMeeting(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= MeetingCommons(meetingId="string", + providerId="string", + purposeId="string", + bankId=bankIdExample.value, + present= MeetingPresent(staffUserId="string", + customerUserId="string"), + keys= MeetingKeys(sessionId=sessionIdExample.value, + customerToken="string", + staffToken="string"), + when=new Date(), + creator= ContactDetails(name="string", + phone="string", + email=emailExample.value), + invitees=List( Invitee(contactDetails= ContactDetails(name="string", + phone="string", + email=emailExample.value), + status="string")))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createMeeting(bankId: BankId, staffUser: User, customerUser: User, providerId: String, purposeId: String, when: Date, sessionId: String, customerToken: String, staffToken: String, creator: ContactDetails, invitees: List[Invitee], callContext: Option[CallContext]): OBPReturnType[Box[Meeting]] = { + import com.openbankproject.commons.dto.{OutBoundCreateMeeting => OutBound, InBoundCreateMeeting => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, staffUser, customerUser, providerId, purposeId, when, sessionId, customerToken, staffToken, creator, invitees) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[MeetingCommons](callContext)) + } + + messageDocs += getMeetingsDoc + def getMeetingsDoc = MessageDoc( + process = "obp.getMeetings", + messageFormat = messageFormat, + description = "Get Meetings", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetMeetings(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + user= UserCommons(userPrimaryKey=UserPrimaryKey(123), + userId=userIdExample.value, + idGivenByProvider="string", + provider="string", + emailAddress=emailExample.value, + name=usernameExample.value)) + ), + exampleInboundMessage = ( + InBoundGetMeetings(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( MeetingCommons(meetingId="string", + providerId="string", + purposeId="string", + bankId=bankIdExample.value, + present= MeetingPresent(staffUserId="string", + customerUserId="string"), + keys= MeetingKeys(sessionId=sessionIdExample.value, + customerToken="string", + staffToken="string"), + when=new Date(), + creator= ContactDetails(name="string", + phone="string", + email=emailExample.value), + invitees=List( Invitee(contactDetails= ContactDetails(name="string", + phone="string", + email=emailExample.value), + status="string"))))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getMeetings(bankId: BankId, user: User, callContext: Option[CallContext]): OBPReturnType[Box[List[Meeting]]] = { + import com.openbankproject.commons.dto.{OutBoundGetMeetings => OutBound, InBoundGetMeetings => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, user) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[MeetingCommons]](callContext)) + } + + messageDocs += getMeetingDoc + def getMeetingDoc = MessageDoc( + process = "obp.getMeeting", + messageFormat = messageFormat, + description = "Get Meeting", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetMeeting(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + user= UserCommons(userPrimaryKey=UserPrimaryKey(123), + userId=userIdExample.value, + idGivenByProvider="string", + provider="string", + emailAddress=emailExample.value, + name=usernameExample.value), + meetingId="string") + ), + exampleInboundMessage = ( + InBoundGetMeeting(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= MeetingCommons(meetingId="string", + providerId="string", + purposeId="string", + bankId=bankIdExample.value, + present= MeetingPresent(staffUserId="string", + customerUserId="string"), + keys= MeetingKeys(sessionId=sessionIdExample.value, + customerToken="string", + staffToken="string"), + when=new Date(), + creator= ContactDetails(name="string", + phone="string", + email=emailExample.value), + invitees=List( Invitee(contactDetails= ContactDetails(name="string", + phone="string", + email=emailExample.value), + status="string")))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getMeeting(bankId: BankId, user: User, meetingId: String, callContext: Option[CallContext]): OBPReturnType[Box[Meeting]] = { + import com.openbankproject.commons.dto.{OutBoundGetMeeting => OutBound, InBoundGetMeeting => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, user, meetingId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[MeetingCommons](callContext)) + } + + messageDocs += createOrUpdateKycCheckDoc + def createOrUpdateKycCheckDoc = MessageDoc( + process = "obp.createOrUpdateKycCheck", + messageFormat = messageFormat, + description = "Create Or Update Kyc Check", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateOrUpdateKycCheck(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=bankIdExample.value, + customerId=customerIdExample.value, + id="string", + customerNumber=customerNumberExample.value, + date=new Date(), + how="string", + staffUserId="string", + mStaffName="string", + mSatisfied=true, + comments="string") + ), + exampleInboundMessage = ( + InBoundCreateOrUpdateKycCheck(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= KycCheckCommons(bankId=bankIdExample.value, + customerId=customerIdExample.value, + idKycCheck="string", + customerNumber=customerNumberExample.value, + date=new Date(), + how="string", + staffUserId="string", + staffName="string", + satisfied=true, + comments="string")) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createOrUpdateKycCheck(bankId: String, customerId: String, id: String, customerNumber: String, date: Date, how: String, staffUserId: String, mStaffName: String, mSatisfied: Boolean, comments: String, callContext: Option[CallContext]): OBPReturnType[Box[KycCheck]] = { + import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateKycCheck => OutBound, InBoundCreateOrUpdateKycCheck => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, customerId, id, customerNumber, date, how, staffUserId, mStaffName, mSatisfied, comments) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[KycCheckCommons](callContext)) + } + + messageDocs += createOrUpdateKycDocumentDoc + def createOrUpdateKycDocumentDoc = MessageDoc( + process = "obp.createOrUpdateKycDocument", + messageFormat = messageFormat, + description = "Create Or Update Kyc Document", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateOrUpdateKycDocument(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=bankIdExample.value, + customerId=customerIdExample.value, + id="string", + customerNumber=customerNumberExample.value, + `type`="string", + number="string", + issueDate=new Date(), + issuePlace="string", + expiryDate=new Date()) + ), + exampleInboundMessage = ( + InBoundCreateOrUpdateKycDocument(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= KycDocumentCommons(bankId=bankIdExample.value, + customerId=customerIdExample.value, + idKycDocument="string", + customerNumber=customerNumberExample.value, + `type`="string", + number="string", + issueDate=new Date(), + issuePlace="string", + expiryDate=new Date())) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createOrUpdateKycDocument(bankId: String, customerId: String, id: String, customerNumber: String, `type`: String, number: String, issueDate: Date, issuePlace: String, expiryDate: Date, callContext: Option[CallContext]): OBPReturnType[Box[KycDocument]] = { + import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateKycDocument => OutBound, InBoundCreateOrUpdateKycDocument => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, customerId, id, customerNumber, `type`, number, issueDate, issuePlace, expiryDate) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[KycDocument](callContext)) + } + + messageDocs += createOrUpdateKycMediaDoc + def createOrUpdateKycMediaDoc = MessageDoc( + process = "obp.createOrUpdateKycMedia", + messageFormat = messageFormat, + description = "Create Or Update Kyc Media", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateOrUpdateKycMedia(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=bankIdExample.value, + customerId=customerIdExample.value, + id="string", + customerNumber=customerNumberExample.value, + `type`="string", + url=urlExample.value, + date=new Date(), + relatesToKycDocumentId="string", + relatesToKycCheckId="string") + ), + exampleInboundMessage = ( + InBoundCreateOrUpdateKycMedia(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= KycMediaCommons(bankId=bankIdExample.value, + customerId=customerIdExample.value, + idKycMedia="string", + customerNumber=customerNumberExample.value, + `type`="string", + url=urlExample.value, + date=new Date(), + relatesToKycDocumentId="string", + relatesToKycCheckId="string")) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createOrUpdateKycMedia(bankId: String, customerId: String, id: String, customerNumber: String, `type`: String, url: String, date: Date, relatesToKycDocumentId: String, relatesToKycCheckId: String, callContext: Option[CallContext]): OBPReturnType[Box[KycMedia]] = { + import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateKycMedia => OutBound, InBoundCreateOrUpdateKycMedia => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, customerId, id, customerNumber, `type`, url, date, relatesToKycDocumentId, relatesToKycCheckId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[KycMediaCommons](callContext)) + } + + messageDocs += createOrUpdateKycStatusDoc + def createOrUpdateKycStatusDoc = MessageDoc( + process = "obp.createOrUpdateKycStatus", + messageFormat = messageFormat, + description = "Create Or Update Kyc Status", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateOrUpdateKycStatus(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=bankIdExample.value, + customerId=customerIdExample.value, + customerNumber=customerNumberExample.value, + ok=true, + date=new Date()) + ), + exampleInboundMessage = ( + InBoundCreateOrUpdateKycStatus(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= KycStatusCommons(bankId=bankIdExample.value, + customerId=customerIdExample.value, + customerNumber=customerNumberExample.value, + ok=true, + date=new Date())) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createOrUpdateKycStatus(bankId: String, customerId: String, customerNumber: String, ok: Boolean, date: Date, callContext: Option[CallContext]): OBPReturnType[Box[KycStatus]] = { + import com.openbankproject.commons.dto.{OutBoundCreateOrUpdateKycStatus => OutBound, InBoundCreateOrUpdateKycStatus => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, customerId, customerNumber, ok, date) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[KycStatusCommons](callContext)) + } + + messageDocs += getKycChecksDoc + def getKycChecksDoc = MessageDoc( + process = "obp.getKycChecks", + messageFormat = messageFormat, + description = "Get Kyc Checks", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetKycChecks(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + customerId=customerIdExample.value) + ), + exampleInboundMessage = ( + InBoundGetKycChecks(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( KycCheckCommons(bankId=bankIdExample.value, + customerId=customerIdExample.value, + idKycCheck="string", + customerNumber=customerNumberExample.value, + date=new Date(), + how="string", + staffUserId="string", + staffName="string", + satisfied=true, + comments="string"))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getKycChecks(customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[KycCheck]]] = { + import com.openbankproject.commons.dto.{OutBoundGetKycChecks => OutBound, InBoundGetKycChecks => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[KycCheckCommons]](callContext)) + } + + messageDocs += getKycDocumentsDoc + def getKycDocumentsDoc = MessageDoc( + process = "obp.getKycDocuments", + messageFormat = messageFormat, + description = "Get Kyc Documents", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetKycDocuments(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + customerId=customerIdExample.value) + ), + exampleInboundMessage = ( + InBoundGetKycDocuments(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( KycDocumentCommons(bankId=bankIdExample.value, + customerId=customerIdExample.value, + idKycDocument="string", + customerNumber=customerNumberExample.value, + `type`="string", + number="string", + issueDate=new Date(), + issuePlace="string", + expiryDate=new Date()))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getKycDocuments(customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[KycDocument]]] = { + import com.openbankproject.commons.dto.{OutBoundGetKycDocuments => OutBound, InBoundGetKycDocuments => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[KycDocumentCommons]](callContext)) + } + + messageDocs += getKycMediasDoc + def getKycMediasDoc = MessageDoc( + process = "obp.getKycMedias", + messageFormat = messageFormat, + description = "Get Kyc Medias", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetKycMedias(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + customerId=customerIdExample.value) + ), + exampleInboundMessage = ( + InBoundGetKycMedias(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( KycMediaCommons(bankId=bankIdExample.value, + customerId=customerIdExample.value, + idKycMedia="string", + customerNumber=customerNumberExample.value, + `type`="string", + url=urlExample.value, + date=new Date(), + relatesToKycDocumentId="string", + relatesToKycCheckId="string"))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getKycMedias(customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[KycMedia]]] = { + import com.openbankproject.commons.dto.{OutBoundGetKycMedias => OutBound, InBoundGetKycMedias => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[KycMediaCommons]](callContext)) + } + + messageDocs += getKycStatusesDoc + def getKycStatusesDoc = MessageDoc( + process = "obp.getKycStatuses", + messageFormat = messageFormat, + description = "Get Kyc Statuses", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetKycStatuses(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + customerId=customerIdExample.value) + ), + exampleInboundMessage = ( + InBoundGetKycStatuses(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( KycStatusCommons(bankId=bankIdExample.value, + customerId=customerIdExample.value, + customerNumber=customerNumberExample.value, + ok=true, + date=new Date()))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getKycStatuses(customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[KycStatus]]] = { + import com.openbankproject.commons.dto.{OutBoundGetKycStatuses => OutBound, InBoundGetKycStatuses => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[List[KycStatusCommons]](callContext)) + } + + messageDocs += createMessageDoc + def createMessageDoc = MessageDoc( + process = "obp.createMessage", + messageFormat = messageFormat, + description = "Create Message", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateMessage(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + user= UserCommons(userPrimaryKey=UserPrimaryKey(123), + userId=userIdExample.value, + idGivenByProvider="string", + provider="string", + emailAddress=emailExample.value, + name=usernameExample.value), + bankId=BankId(bankIdExample.value), + message="string", + fromDepartment="string", + fromPerson="string") + ), + exampleInboundMessage = ( + InBoundCreateMessage(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= CustomerMessageCommons(messageId="string", + date=new Date(), + message="string", + fromDepartment="string", + fromPerson="string")) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createMessage(user: User, bankId: BankId, message: String, fromDepartment: String, fromPerson: String, callContext: Option[CallContext]): OBPReturnType[Box[CustomerMessage]] = { + import com.openbankproject.commons.dto.{OutBoundCreateMessage => OutBound, InBoundCreateMessage => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, user, bankId, message, fromDepartment, fromPerson) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[CustomerMessageCommons](callContext)) + } + + messageDocs += makeHistoricalPaymentDoc + def makeHistoricalPaymentDoc = MessageDoc( + process = "obp.makeHistoricalPayment", + messageFormat = messageFormat, + description = "Make Historical Payment", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundMakeHistoricalPayment(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value), + toAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceAmountExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + iban=Some(ibanExample.value), + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")), + branchId=branchIdExample.value, + accountRoutingScheme=accountRoutingSchemeExample.value, + accountRoutingAddress=accountRoutingAddressExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value), + posted=new Date(), + completed=new Date(), + amount=BigDecimal("123.321"), + description="string", + transactionRequestType=transactionRequestTypeExample.value, + chargePolicy="string") + ), + exampleInboundMessage = ( + InBoundMakeHistoricalPayment(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=TransactionId(transactionIdExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def makeHistoricalPayment(fromAccount: BankAccount, toAccount: BankAccount, posted: Date, completed: Date, amount: BigDecimal, description: String, transactionRequestType: String, chargePolicy: String, callContext: Option[CallContext]): OBPReturnType[Box[TransactionId]] = { + import com.openbankproject.commons.dto.{OutBoundMakeHistoricalPayment => OutBound, InBoundMakeHistoricalPayment => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, fromAccount, toAccount, posted, completed, amount, description, transactionRequestType, chargePolicy) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[TransactionId](callContext)) + } + + messageDocs += createDirectDebitDoc + def createDirectDebitDoc = MessageDoc( + process = "obp.createDirectDebit", + messageFormat = messageFormat, + description = "Create Direct Debit", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateDirectDebit(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=bankIdExample.value, + accountId=accountIdExample.value, + customerId=customerIdExample.value, + userId=userIdExample.value, + counterpartyId=counterpartyIdExample.value, + dateSigned=new Date(), + dateStarts=new Date(), + dateExpires=Some(new Date())) + ), + exampleInboundMessage = ( + InBoundCreateDirectDebit(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= DirectDebitTraitCommons(directDebitId="string", + bankId=bankIdExample.value, + accountId=accountIdExample.value, + customerId=customerIdExample.value, + userId=userIdExample.value, + counterpartyId=counterpartyIdExample.value, + dateSigned=new Date(), + dateCancelled=new Date(), + dateStarts=new Date(), + dateExpires=new Date(), + active=true)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createDirectDebit(bankId: String, accountId: String, customerId: String, userId: String, counterpartyId: String, dateSigned: Date, dateStarts: Date, dateExpires: Option[Date], callContext: Option[CallContext]): OBPReturnType[Box[DirectDebitTrait]] = { + import com.openbankproject.commons.dto.{OutBoundCreateDirectDebit => OutBound, InBoundCreateDirectDebit => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, customerId, userId, counterpartyId, dateSigned, dateStarts, dateExpires) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[DirectDebitTraitCommons](callContext)) + } + + messageDocs += deleteCustomerAttributeDoc + def deleteCustomerAttributeDoc = MessageDoc( + process = "obp.deleteCustomerAttribute", + messageFormat = messageFormat, + description = "Delete Customer Attribute", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundDeleteCustomerAttribute(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + customerAttributeId=customerAttributeIdExample.value) + ), + exampleInboundMessage = ( + InBoundDeleteCustomerAttribute(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=true) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def deleteCustomerAttribute(customerAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = { + import com.openbankproject.commons.dto.{OutBoundDeleteCustomerAttribute => OutBound, InBoundDeleteCustomerAttribute => InBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customerAttributeId) + val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) + response.map(convertToTuple[Boolean](callContext)) + } + +// ---------- create on 2020-06-17T14:19:04Z +//---------------- dynamic end ---------------------please don't modify this line } diff --git a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedure.sql b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedure.sql index 930cdb478..8d2420bba 100644 --- a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedure.sql +++ b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedure.sql @@ -1,17 +1,85 @@ --- auto generated MS sql server procedures script, create on 2020-06-16T22:59:24Z +-- auto generated MS sql server procedures script, create on 2020-06-17T14:24:02Z -- drop procedure get_adapter_info DROP PROCEDURE IF EXISTS get_adapter_info; GO -- create procedure get_adapter_info CREATE PROCEDURE get_adapter_info -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + } + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -64,13 +132,88 @@ DROP PROCEDURE IF EXISTS get_challenge_threshold; GO -- create procedure get_challenge_threshold CREATE PROCEDURE get_challenge_threshold -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":"gh.29.uk", + "accountId":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "viewId":"owner", + "transactionRequestType":"SEPA", + "currency":"EUR", + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "userName":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -112,13 +255,94 @@ DROP PROCEDURE IF EXISTS get_charge_level; GO -- create procedure get_charge_level CREATE PROCEDURE get_charge_level -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "viewId":{ + "value":"owner" + }, + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "userName":"string", + "transactionRequestType":"SEPA", + "currency":"EUR" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -160,13 +384,93 @@ DROP PROCEDURE IF EXISTS create_challenge; GO -- create procedure create_challenge CREATE PROCEDURE create_challenge -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "transactionRequestType":{ + "value":"SEPA" + }, + "transactionRequestId":"string", + "scaMethod":"SMS" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -205,13 +509,95 @@ DROP PROCEDURE IF EXISTS create_challenges; GO -- create procedure create_challenges CREATE PROCEDURE create_challenges -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "userIds":[ + "9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1" + ], + "transactionRequestType":{ + "value":"SEPA" + }, + "transactionRequestId":"string", + "scaMethod":"SMS" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -252,13 +638,83 @@ DROP PROCEDURE IF EXISTS validate_challenge_answer; GO -- create procedure validate_challenge_answer CREATE PROCEDURE validate_challenge_answer -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "challengeId":"string", + "hashOfSuppliedAnswer":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -297,13 +753,84 @@ DROP PROCEDURE IF EXISTS get_bank; GO -- create procedure get_bank CREATE PROCEDURE get_bank -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + } + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -354,13 +881,81 @@ DROP PROCEDURE IF EXISTS get_banks; GO -- create procedure get_banks CREATE PROCEDURE get_banks -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + } + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -413,13 +1008,82 @@ DROP PROCEDURE IF EXISTS get_bank_accounts_for_user; GO -- create procedure get_bank_accounts_for_user CREATE PROCEDURE get_bank_accounts_for_user -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "username":"felixsmith" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -485,13 +1149,21 @@ DROP PROCEDURE IF EXISTS get_user; GO -- create procedure get_user CREATE PROCEDURE get_user -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "name":"felixsmith", + "password":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -524,13 +1196,25 @@ DROP PROCEDURE IF EXISTS get_bank_account_old; GO -- create procedure get_bank_account_old CREATE PROCEDURE get_bank_account_old -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "bankId":{ + "value":"gh.29.uk" + }, + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + } + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -590,13 +1274,87 @@ DROP PROCEDURE IF EXISTS get_bank_account; GO -- create procedure get_bank_account CREATE PROCEDURE get_bank_account -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + } + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -666,13 +1424,82 @@ DROP PROCEDURE IF EXISTS get_bank_account_by_iban; GO -- create procedure get_bank_account_by_iban CREATE PROCEDURE get_bank_account_by_iban -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "iban":"DE91 1000 0000 0123 4567 89" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -742,13 +1569,83 @@ DROP PROCEDURE IF EXISTS get_bank_account_by_routing; GO -- create procedure get_bank_account_by_routing CREATE PROCEDURE get_bank_account_by_routing -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "scheme":"string", + "address":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -818,13 +1715,91 @@ DROP PROCEDURE IF EXISTS get_bank_accounts; GO -- create procedure get_bank_accounts CREATE PROCEDURE get_bank_accounts -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankIdAccountIds":[ + { + "bankId":{ + "value":"gh.29.uk" + }, + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + } + } + ] + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -896,13 +1871,91 @@ DROP PROCEDURE IF EXISTS get_bank_accounts_balances; GO -- create procedure get_bank_accounts_balances CREATE PROCEDURE get_bank_accounts_balances -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankIdAccountIds":[ + { + "bankId":{ + "value":"gh.29.uk" + }, + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + } + } + ] + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -949,7 +2002,7 @@ AS "currency":"EUR", "amount":"string" }, - "overallBalanceDate":"2020-06-16T14:59:20Z" + "overallBalanceDate":"2020-06-17T06:24:01Z" } }' ); @@ -964,13 +2017,91 @@ DROP PROCEDURE IF EXISTS get_core_bank_accounts; GO -- create procedure get_core_bank_accounts CREATE PROCEDURE get_core_bank_accounts -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankIdAccountIds":[ + { + "bankId":{ + "value":"gh.29.uk" + }, + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + } + } + ] + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -1022,13 +2153,91 @@ DROP PROCEDURE IF EXISTS get_bank_accounts_held; GO -- create procedure get_bank_accounts_held CREATE PROCEDURE get_bank_accounts_held -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankIdAccountIds":[ + { + "bankId":{ + "value":"gh.29.uk" + }, + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + } + } + ] + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -1079,13 +2288,88 @@ DROP PROCEDURE IF EXISTS get_counterparty_trait; GO -- create procedure get_counterparty_trait CREATE PROCEDURE get_counterparty_trait -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "couterpartyId":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -1147,13 +2431,84 @@ DROP PROCEDURE IF EXISTS get_counterparty_by_counterparty_id; GO -- create procedure get_counterparty_by_counterparty_id CREATE PROCEDURE get_counterparty_by_counterparty_id -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "counterpartyId":{ + "value":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh" + } + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -1215,13 +2570,82 @@ DROP PROCEDURE IF EXISTS get_counterparty_by_iban; GO -- create procedure get_counterparty_by_iban CREATE PROCEDURE get_counterparty_by_iban -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "iban":"DE91 1000 0000 0123 4567 89" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -1283,13 +2707,90 @@ DROP PROCEDURE IF EXISTS get_counterparties; GO -- create procedure get_counterparties CREATE PROCEDURE get_counterparties -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "thisBankId":{ + "value":"gh.29.uk" + }, + "thisAccountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "viewId":{ + "value":"owner" + } + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -1353,13 +2854,91 @@ DROP PROCEDURE IF EXISTS get_transactions; GO -- create procedure get_transactions CREATE PROCEDURE get_transactions -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "limit":100, + "offset":100, + "fromDate":"2018-03-09", + "toDate":"2018-03-09" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -1400,13 +2979,91 @@ DROP PROCEDURE IF EXISTS get_transactions_core; GO -- create procedure get_transactions_core CREATE PROCEDURE get_transactions_core -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "accountID":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "limit":100, + "offset":100, + "fromDate":"string", + "toDate":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -1489,8 +3146,8 @@ AS "amount":"123.321", "currency":"EUR", "description":"string", - "startDate":"2020-06-16T14:59:20Z", - "finishDate":"2020-06-16T14:59:20Z", + "startDate":"2020-06-17T06:24:01Z", + "finishDate":"2020-06-17T06:24:01Z", "balance":"50.89" } ] @@ -1507,13 +3164,90 @@ DROP PROCEDURE IF EXISTS get_transaction; GO -- create procedure get_transaction CREATE PROCEDURE get_transaction -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "transactionId":{ + "value":"2fg8a7e4-6d02-40e3-a129-0b2bf89de8ub" + } + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -1552,13 +3286,85 @@ DROP PROCEDURE IF EXISTS get_physical_card_for_bank; GO -- create procedure get_physical_card_for_bank CREATE PROCEDURE get_physical_card_for_bank -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "cardId":"36f8a9e6-c2b1-407a-8bd0-421b7119307e " + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -1591,8 +3397,8 @@ AS "nameOnCard":"SusanSmith", "issueNumber":"1", "serialNumber":"1324234", - "validFrom":"2020-06-16T14:59:20Z", - "expires":"2020-06-16T14:59:20Z", + "validFrom":"2020-06-17T06:24:01Z", + "expires":"2020-06-17T06:24:01Z", "enabled":true, "cancelled":true, "onHotList":true, @@ -1636,20 +3442,20 @@ AS "accountHolder":"bankAccount accountHolder string" }, "replacement":{ - "requestedDate":"2020-06-16T14:59:20Z", + "requestedDate":"2020-06-17T06:24:01Z", "reasonRequested":{} }, "pinResets":[ { - "requestedDate":"2020-06-16T14:59:20Z", + "requestedDate":"2020-06-17T06:24:01Z", "reasonRequested":{} } ], "collected":{ - "date":"2020-06-16T14:59:20Z" + "date":"2020-06-17T06:24:01Z" }, "posted":{ - "date":"2020-06-16T14:59:20Z" + "date":"2020-06-17T06:24:01Z" }, "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" } @@ -1666,13 +3472,85 @@ DROP PROCEDURE IF EXISTS delete_physical_card_for_bank; GO -- create procedure delete_physical_card_for_bank CREATE PROCEDURE delete_physical_card_for_bank -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "cardId":"36f8a9e6-c2b1-407a-8bd0-421b7119307e " + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -1711,13 +3589,108 @@ DROP PROCEDURE IF EXISTS get_physical_cards_for_bank; GO -- create procedure get_physical_cards_for_bank CREATE PROCEDURE get_physical_cards_for_bank -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bank":{ + "bankId":{ + "value":"gh.29.uk" + }, + "shortName":"bank shortName string", + "fullName":"bank fullName string", + "logoUrl":"bank logoUrl string", + "websiteUrl":"bank websiteUrl string", + "bankRoutingScheme":"BIC", + "bankRoutingAddress":"GENODEM1GLS", + "swiftBic":"bank swiftBic string", + "nationalIdentifier":"bank nationalIdentifier string" + }, + "user":{ + "userPrimaryKey":{ + "value":123 + }, + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "idGivenByProvider":"string", + "provider":"string", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + }, + "limit":100, + "offset":100, + "fromDate":"string", + "toDate":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -1751,8 +3724,8 @@ AS "nameOnCard":"SusanSmith", "issueNumber":"1", "serialNumber":"1324234", - "validFrom":"2020-06-16T14:59:20Z", - "expires":"2020-06-16T14:59:20Z", + "validFrom":"2020-06-17T06:24:01Z", + "expires":"2020-06-17T06:24:01Z", "enabled":true, "cancelled":true, "onHotList":true, @@ -1796,20 +3769,20 @@ AS "accountHolder":"bankAccount accountHolder string" }, "replacement":{ - "requestedDate":"2020-06-16T14:59:20Z", + "requestedDate":"2020-06-17T06:24:01Z", "reasonRequested":{} }, "pinResets":[ { - "requestedDate":"2020-06-16T14:59:20Z", + "requestedDate":"2020-06-17T06:24:01Z", "reasonRequested":{} } ], "collected":{ - "date":"2020-06-16T14:59:20Z" + "date":"2020-06-17T06:24:01Z" }, "posted":{ - "date":"2020-06-16T14:59:20Z" + "date":"2020-06-17T06:24:01Z" }, "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" } @@ -1827,13 +3800,117 @@ DROP PROCEDURE IF EXISTS create_physical_card; GO -- create procedure create_physical_card CREATE PROCEDURE create_physical_card -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankCardNumber":"364435172576215", + "nameOnCard":"SusanSmith", + "cardType":"Credit", + "issueNumber":"1", + "serialNumber":"1324234", + "validFrom":"2020-06-17T06:24:01Z", + "expires":"2020-06-17T06:24:01Z", + "enabled":true, + "cancelled":true, + "onHotList":true, + "technology":"string", + "networks":[ + "string" + ], + "allows":[ + "string" + ], + "accountId":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "bankId":"gh.29.uk", + "replacement":{ + "requestedDate":"2020-06-17T06:24:01Z", + "reasonRequested":{} + }, + "pinResets":[ + { + "requestedDate":"2020-06-17T06:24:01Z", + "reasonRequested":{} + } + ], + "collected":{ + "date":"2020-06-17T06:24:01Z" + }, + "posted":{ + "date":"2020-06-17T06:24:01Z" + }, + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -1866,8 +3943,8 @@ AS "nameOnCard":"SusanSmith", "issueNumber":"1", "serialNumber":"1324234", - "validFrom":"2020-06-16T14:59:20Z", - "expires":"2020-06-16T14:59:20Z", + "validFrom":"2020-06-17T06:24:01Z", + "expires":"2020-06-17T06:24:01Z", "enabled":true, "cancelled":true, "onHotList":true, @@ -1911,20 +3988,20 @@ AS "accountHolder":"bankAccount accountHolder string" }, "replacement":{ - "requestedDate":"2020-06-16T14:59:20Z", + "requestedDate":"2020-06-17T06:24:01Z", "reasonRequested":{} }, "pinResets":[ { - "requestedDate":"2020-06-16T14:59:20Z", + "requestedDate":"2020-06-17T06:24:01Z", "reasonRequested":{} } ], "collected":{ - "date":"2020-06-16T14:59:20Z" + "date":"2020-06-17T06:24:01Z" }, "posted":{ - "date":"2020-06-16T14:59:20Z" + "date":"2020-06-17T06:24:01Z" }, "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" } @@ -1941,13 +4018,118 @@ DROP PROCEDURE IF EXISTS update_physical_card; GO -- create procedure update_physical_card CREATE PROCEDURE update_physical_card -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "cardId":"36f8a9e6-c2b1-407a-8bd0-421b7119307e ", + "bankCardNumber":"364435172576215", + "nameOnCard":"SusanSmith", + "cardType":"Credit", + "issueNumber":"1", + "serialNumber":"1324234", + "validFrom":"2020-06-17T06:24:01Z", + "expires":"2020-06-17T06:24:01Z", + "enabled":true, + "cancelled":true, + "onHotList":true, + "technology":"string", + "networks":[ + "string" + ], + "allows":[ + "string" + ], + "accountId":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "bankId":"gh.29.uk", + "replacement":{ + "requestedDate":"2020-06-17T06:24:01Z", + "reasonRequested":{} + }, + "pinResets":[ + { + "requestedDate":"2020-06-17T06:24:01Z", + "reasonRequested":{} + } + ], + "collected":{ + "date":"2020-06-17T06:24:01Z" + }, + "posted":{ + "date":"2020-06-17T06:24:01Z" + }, + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -1980,8 +4162,8 @@ AS "nameOnCard":"SusanSmith", "issueNumber":"1", "serialNumber":"1324234", - "validFrom":"2020-06-16T14:59:20Z", - "expires":"2020-06-16T14:59:20Z", + "validFrom":"2020-06-17T06:24:01Z", + "expires":"2020-06-17T06:24:01Z", "enabled":true, "cancelled":true, "onHotList":true, @@ -2025,20 +4207,20 @@ AS "accountHolder":"bankAccount accountHolder string" }, "replacement":{ - "requestedDate":"2020-06-16T14:59:20Z", + "requestedDate":"2020-06-17T06:24:01Z", "reasonRequested":{} }, "pinResets":[ { - "requestedDate":"2020-06-16T14:59:20Z", + "requestedDate":"2020-06-17T06:24:01Z", "reasonRequested":{} } ], "collected":{ - "date":"2020-06-16T14:59:20Z" + "date":"2020-06-17T06:24:01Z" }, "posted":{ - "date":"2020-06-16T14:59:20Z" + "date":"2020-06-17T06:24:01Z" }, "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" } @@ -2055,13 +4237,158 @@ DROP PROCEDURE IF EXISTS make_paymentv210; GO -- create procedure make_paymentv210 CREATE PROCEDURE make_paymentv210 -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "fromAccount":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + }, + "toAccount":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + }, + "transactionRequestCommonBody":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string" + }, + "amount":"123.321", + "description":"string", + "transactionRequestType":{ + "value":"SEPA" + }, + "chargePolicy":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -2102,13 +4429,172 @@ DROP PROCEDURE IF EXISTS create_transaction_requestv210; GO -- create procedure create_transaction_requestv210 CREATE PROCEDURE create_transaction_requestv210 -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "initiator":{ + "userPrimaryKey":{ + "value":123 + }, + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "idGivenByProvider":"string", + "provider":"string", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + }, + "viewId":{ + "value":"owner" + }, + "fromAccount":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + }, + "toAccount":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + }, + "transactionRequestType":{ + "value":"SEPA" + }, + "transactionRequestCommonBody":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string" + }, + "detailsPlain":"string", + "chargePolicy":"string", + "challengeType":"string", + "scaMethod":"SMS" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -2228,8 +4714,8 @@ AS }, "transaction_ids":"string", "status":"string", - "start_date":"2020-06-16T14:59:21Z", - "end_date":"2020-06-16T14:59:21Z", + "start_date":"2020-06-17T06:24:01Z", + "end_date":"2020-06-17T06:24:01Z", "challenge":{ "id":"string", "allowed_attempts":123, @@ -2276,13 +4762,172 @@ DROP PROCEDURE IF EXISTS create_transaction_requestv400; GO -- create procedure create_transaction_requestv400 CREATE PROCEDURE create_transaction_requestv400 -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "initiator":{ + "userPrimaryKey":{ + "value":123 + }, + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "idGivenByProvider":"string", + "provider":"string", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + }, + "viewId":{ + "value":"owner" + }, + "fromAccount":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + }, + "toAccount":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + }, + "transactionRequestType":{ + "value":"SEPA" + }, + "transactionRequestCommonBody":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string" + }, + "detailsPlain":"string", + "chargePolicy":"string", + "challengeType":"string", + "scaMethod":"SMS" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -2402,8 +5047,8 @@ AS }, "transaction_ids":"string", "status":"string", - "start_date":"2020-06-16T14:59:21Z", - "end_date":"2020-06-16T14:59:21Z", + "start_date":"2020-06-17T06:24:01Z", + "end_date":"2020-06-17T06:24:01Z", "challenge":{ "id":"string", "allowed_attempts":123, @@ -2450,13 +5095,123 @@ DROP PROCEDURE IF EXISTS get_transaction_requests210; GO -- create procedure get_transaction_requests210 CREATE PROCEDURE get_transaction_requests210 -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "initiator":{ + "userPrimaryKey":{ + "value":123 + }, + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "idGivenByProvider":"string", + "provider":"string", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + }, + "fromAccount":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + } + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -2577,8 +5332,8 @@ AS }, "transaction_ids":"string", "status":"string", - "start_date":"2020-06-16T14:59:21Z", - "end_date":"2020-06-16T14:59:21Z", + "start_date":"2020-06-17T06:24:01Z", + "end_date":"2020-06-17T06:24:01Z", "challenge":{ "id":"string", "allowed_attempts":123, @@ -2626,13 +5381,84 @@ DROP PROCEDURE IF EXISTS get_transaction_request_impl; GO -- create procedure get_transaction_request_impl CREATE PROCEDURE get_transaction_request_impl -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "transactionRequestId":{ + "value":"string" + } + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -2752,8 +5578,8 @@ AS }, "transaction_ids":"string", "status":"string", - "start_date":"2020-06-16T14:59:21Z", - "end_date":"2020-06-16T14:59:21Z", + "start_date":"2020-06-17T06:24:01Z", + "end_date":"2020-06-17T06:24:01Z", "challenge":{ "id":"string", "allowed_attempts":123, @@ -2800,13 +5626,243 @@ DROP PROCEDURE IF EXISTS create_transaction_after_challenge_v210; GO -- create procedure create_transaction_after_challenge_v210 CREATE PROCEDURE create_transaction_after_challenge_v210 -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "fromAccount":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + }, + "transactionRequest":{ + "id":{ + "value":"string" + }, + "type":"SEPA", + "from":{ + "bank_id":"string", + "account_id":"string" + }, + "body":{ + "to_sandbox_tan":{ + "bank_id":"string", + "account_id":"string" + }, + "to_sepa":{ + "iban":"string" + }, + "to_counterparty":{ + "counterparty_id":"string" + }, + "to_transfer_to_phone":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string", + "message":"string", + "from":{ + "mobile_phone_number":"string", + "nickname":"string" + }, + "to":{ + "mobile_phone_number":"string" + } + }, + "to_transfer_to_atm":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string", + "message":"string", + "from":{ + "mobile_phone_number":"string", + "nickname":"string" + }, + "to":{ + "legal_name":"string", + "date_of_birth":"string", + "mobile_phone_number":"string", + "kyc_document":{ + "type":"string", + "number":"string" + } + } + }, + "to_transfer_to_account":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string", + "transfer_type":"string", + "future_date":"string", + "to":{ + "name":"string", + "bank_code":"string", + "branch_number":"string", + "account":{ + "number":"546387432", + "iban":"DE91 1000 0000 0123 4567 89" + } + } + }, + "to_sepa_credit_transfers":{ + "debtorAccount":{ + "iban":"string" + }, + "instructedAmount":{ + "currency":"EUR", + "amount":"string" + }, + "creditorAccount":{ + "iban":"string" + }, + "creditorName":"string" + }, + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string" + }, + "transaction_ids":"string", + "status":"string", + "start_date":"2020-06-17T06:24:01Z", + "end_date":"2020-06-17T06:24:01Z", + "challenge":{ + "id":"string", + "allowed_attempts":123, + "challenge_type":"string" + }, + "charge":{ + "summary":"string", + "value":{ + "currency":"EUR", + "amount":"string" + } + }, + "charge_policy":"string", + "counterparty_id":{ + "value":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }, + "name":"string", + "this_bank_id":{ + "value":"gh.29.uk" + }, + "this_account_id":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "this_view_id":{ + "value":"owner" + }, + "other_account_routing_scheme":"string", + "other_account_routing_address":"string", + "other_bank_routing_scheme":"string", + "other_bank_routing_address":"string", + "is_beneficiary":true, + "future_date":"string" + } + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -2926,8 +5982,8 @@ AS }, "transaction_ids":"string", "status":"string", - "start_date":"2020-06-16T14:59:21Z", - "end_date":"2020-06-16T14:59:21Z", + "start_date":"2020-06-17T06:24:01Z", + "end_date":"2020-06-17T06:24:01Z", "challenge":{ "id":"string", "allowed_attempts":123, @@ -2974,13 +6030,92 @@ DROP PROCEDURE IF EXISTS update_bank_account; GO -- create procedure update_bank_account CREATE PROCEDURE update_bank_account -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "accountLabel":"string", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -3050,13 +6185,95 @@ DROP PROCEDURE IF EXISTS create_bank_account; GO -- create procedure create_bank_account CREATE PROCEDURE create_bank_account -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "accountLabel":"string", + "currency":"EUR", + "initialBalance":"123.321", + "accountHolderName":"string", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -3126,13 +6343,23 @@ DROP PROCEDURE IF EXISTS account_exists; GO -- create procedure account_exists CREATE PROCEDURE account_exists -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "bankId":{ + "value":"gh.29.uk" + }, + "accountNumber":"546387432" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -3161,13 +6388,87 @@ DROP PROCEDURE IF EXISTS get_branch; GO -- create procedure get_branch CREATE PROCEDURE get_branch -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "branchId":{ + "value":"DERBY6" + } + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -3213,7 +6514,7 @@ AS "location":{ "latitude":123.123, "longitude":123.123, - "date":"2020-06-16T14:59:21Z", + "date":"2020-06-17T06:24:01Z", "user":{ "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", "provider":"string", @@ -3330,13 +6631,88 @@ DROP PROCEDURE IF EXISTS get_branches; GO -- create procedure get_branches CREATE PROCEDURE get_branches -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "limit":100, + "offset":100, + "fromDate":"string", + "toDate":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -3383,7 +6759,7 @@ AS "location":{ "latitude":123.123, "longitude":123.123, - "date":"2020-06-16T14:59:21Z", + "date":"2020-06-17T06:24:01Z", "user":{ "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", "provider":"string", @@ -3501,13 +6877,87 @@ DROP PROCEDURE IF EXISTS get_atm; GO -- create procedure get_atm CREATE PROCEDURE get_atm -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "atmId":{ + "value":"string" + } + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -3553,7 +7003,7 @@ AS "location":{ "latitude":123.123, "longitude":123.123, - "date":"2020-06-16T14:59:21Z", + "date":"2020-06-17T06:24:01Z", "user":{ "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", "provider":"string", @@ -3598,13 +7048,88 @@ DROP PROCEDURE IF EXISTS get_atms; GO -- create procedure get_atms CREATE PROCEDURE get_atms -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "limit":100, + "offset":100, + "fromDate":"string", + "toDate":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -3651,7 +7176,7 @@ AS "location":{ "latitude":123.123, "longitude":123.123, - "date":"2020-06-16T14:59:21Z", + "date":"2020-06-17T06:24:01Z", "user":{ "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", "provider":"string", @@ -3697,13 +7222,129 @@ DROP PROCEDURE IF EXISTS create_transaction_after_challengev300; GO -- create procedure create_transaction_after_challengev300 CREATE PROCEDURE create_transaction_after_challengev300 -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "initiator":{ + "userPrimaryKey":{ + "value":123 + }, + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "idGivenByProvider":"string", + "provider":"string", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + }, + "fromAccount":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + }, + "transReqId":{ + "value":"string" + }, + "transactionRequestType":{ + "value":"SEPA" + } + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -3823,8 +7464,8 @@ AS }, "transaction_ids":"string", "status":"string", - "start_date":"2020-06-16T14:59:21Z", - "end_date":"2020-06-16T14:59:21Z", + "start_date":"2020-06-17T06:24:01Z", + "end_date":"2020-06-17T06:24:01Z", "challenge":{ "id":"string", "allowed_attempts":123, @@ -3871,13 +7512,190 @@ DROP PROCEDURE IF EXISTS make_paymentv300; GO -- create procedure make_paymentv300 CREATE PROCEDURE make_paymentv300 -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "initiator":{ + "userPrimaryKey":{ + "value":123 + }, + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "idGivenByProvider":"string", + "provider":"string", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + }, + "fromAccount":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + }, + "toAccount":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + }, + "toCounterparty":{ + "createdByUserId":"string", + "name":"string", + "description":"string", + "thisBankId":"string", + "thisAccountId":"string", + "thisViewId":"string", + "counterpartyId":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "otherAccountRoutingScheme":"IBAN", + "otherAccountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "otherAccountSecondaryRoutingScheme":"string", + "otherAccountSecondaryRoutingAddress":"string", + "otherBankRoutingScheme":"BIC", + "otherBankRoutingAddress":"GENODEM1GLS", + "otherBranchRoutingScheme":"BRANCH-CODE", + "otherBranchRoutingAddress":"DERBY6", + "isBeneficiary":true, + "bespoke":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "transactionRequestCommonBody":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string" + }, + "transactionRequestType":{ + "value":"SEPA" + }, + "chargePolicy":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -3918,13 +7736,194 @@ DROP PROCEDURE IF EXISTS create_transaction_requestv300; GO -- create procedure create_transaction_requestv300 CREATE PROCEDURE create_transaction_requestv300 -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "initiator":{ + "userPrimaryKey":{ + "value":123 + }, + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "idGivenByProvider":"string", + "provider":"string", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + }, + "viewId":{ + "value":"owner" + }, + "fromAccount":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + }, + "toAccount":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + }, + "toCounterparty":{ + "createdByUserId":"string", + "name":"string", + "description":"string", + "thisBankId":"string", + "thisAccountId":"string", + "thisViewId":"string", + "counterpartyId":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "otherAccountRoutingScheme":"IBAN", + "otherAccountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "otherAccountSecondaryRoutingScheme":"string", + "otherAccountSecondaryRoutingAddress":"string", + "otherBankRoutingScheme":"BIC", + "otherBankRoutingAddress":"GENODEM1GLS", + "otherBranchRoutingScheme":"BRANCH-CODE", + "otherBranchRoutingAddress":"DERBY6", + "isBeneficiary":true, + "bespoke":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }, + "transactionRequestType":{ + "value":"SEPA" + }, + "transactionRequestCommonBody":{ + "value":{ + "currency":"EUR", + "amount":"string" + }, + "description":"string" + }, + "detailsPlain":"string", + "chargePolicy":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -4044,8 +8043,8 @@ AS }, "transaction_ids":"string", "status":"string", - "start_date":"2020-06-16T14:59:21Z", - "end_date":"2020-06-16T14:59:21Z", + "start_date":"2020-06-17T06:24:01Z", + "end_date":"2020-06-17T06:24:01Z", "challenge":{ "id":"string", "allowed_attempts":123, @@ -4092,13 +8091,102 @@ DROP PROCEDURE IF EXISTS create_counterparty; GO -- create procedure create_counterparty CREATE PROCEDURE create_counterparty -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "name":"string", + "description":"string", + "createdByUserId":"string", + "thisBankId":"string", + "thisAccountId":"string", + "thisViewId":"string", + "otherAccountRoutingScheme":"IBAN", + "otherAccountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "otherAccountSecondaryRoutingScheme":"string", + "otherAccountSecondaryRoutingAddress":"string", + "otherBankRoutingScheme":"BIC", + "otherBankRoutingAddress":"GENODEM1GLS", + "otherBranchRoutingScheme":"BRANCH-CODE", + "otherBranchRoutingAddress":"DERBY6", + "isBeneficiary":true, + "bespoke":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ] + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -4160,13 +8248,85 @@ DROP PROCEDURE IF EXISTS check_customer_number_available; GO -- create procedure check_customer_number_available CREATE PROCEDURE check_customer_number_available -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "customerNumber":"5987953" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -4205,13 +8365,113 @@ DROP PROCEDURE IF EXISTS create_customer; GO -- create procedure create_customer CREATE PROCEDURE create_customer -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "legalName":"Eveline Tripman", + "mobileNumber":"+44 07972 444 876", + "email":"eveline@example.com", + "faceImage":{ + "date":"2019-09-07T16:00:00Z", + "url":"http://www.example.com/id-docs/123/image.png" + }, + "dateOfBirth":"2018-03-08T16:00:00Z", + "relationshipStatus":"single", + "dependents":1, + "dobOfDependents":[ + "2019-09-07T16:00:00Z", + "2019-01-02T16:00:00Z" + ], + "highestEducationAttained":"Master", + "employmentStatus":"worker", + "kycStatus":true, + "lastOkDate":"2019-09-11T16:00:00Z", + "creditRating":{ + "rating":"", + "source":"" + }, + "creditLimit":{ + "currency":"EUR", + "amount":"1000.00" + }, + "title":"Dr.", + "branchId":"DERBY6", + "nameSuffix":"Sr" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -4283,13 +8543,85 @@ DROP PROCEDURE IF EXISTS update_customer_sca_data; GO -- create procedure update_customer_sca_data CREATE PROCEDURE update_customer_sca_data -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "mobileNumber":"+44 07972 444 876", + "email":"eveline@example.com", + "customerNumber":"5987953" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -4361,13 +8693,88 @@ DROP PROCEDURE IF EXISTS update_customer_credit_data; GO -- create procedure update_customer_credit_data CREATE PROCEDURE update_customer_credit_data -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "creditRating":"string", + "creditSource":"string", + "creditLimit":{ + "currency":"EUR", + "amount":"1000.00" + } + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -4439,13 +8846,95 @@ DROP PROCEDURE IF EXISTS update_customer_general_data; GO -- create procedure update_customer_general_data CREATE PROCEDURE update_customer_general_data -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "legalName":"Eveline Tripman", + "faceImage":{ + "date":"2020-06-17T06:24:01Z", + "url":"http://www.example.com/id-docs/123/image.png" + }, + "dateOfBirth":"2018-03-08T16:00:00Z", + "relationshipStatus":"single", + "dependents":1, + "highestEducationAttained":"Master", + "employmentStatus":"worker", + "title":"Dr.", + "branchId":"DERBY6", + "nameSuffix":"Sr" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -4517,13 +9006,82 @@ DROP PROCEDURE IF EXISTS get_customers_by_user_id; GO -- create procedure get_customers_by_user_id CREATE PROCEDURE get_customers_by_user_id -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -4597,13 +9155,82 @@ DROP PROCEDURE IF EXISTS get_customer_by_customer_id; GO -- create procedure get_customer_by_customer_id CREATE PROCEDURE get_customer_by_customer_id -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -4675,13 +9302,85 @@ DROP PROCEDURE IF EXISTS get_customer_by_customer_number; GO -- create procedure get_customer_by_customer_number CREATE PROCEDURE get_customer_by_customer_number -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "customerNumber":"5987953", + "bankId":{ + "value":"gh.29.uk" + } + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -4753,13 +9452,82 @@ DROP PROCEDURE IF EXISTS get_customer_address; GO -- create procedure get_customer_address CREATE PROCEDURE get_customer_address -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -4798,7 +9566,7 @@ AS "countryCode":"string", "status":"string", "tags":"string", - "insertDate":"2020-06-16T14:59:21Z" + "insertDate":"2020-06-17T06:24:01Z" } ] }' @@ -4814,13 +9582,92 @@ DROP PROCEDURE IF EXISTS create_customer_address; GO -- create procedure create_customer_address CREATE PROCEDURE create_customer_address -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "line1":"string", + "line2":"string", + "line3":"string", + "city":"string", + "county":"string", + "state":"string", + "postcode":"string", + "countryCode":"string", + "tags":"string", + "status":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -4858,7 +9705,7 @@ AS "countryCode":"string", "status":"string", "tags":"string", - "insertDate":"2020-06-16T14:59:21Z" + "insertDate":"2020-06-17T06:24:01Z" } }' ); @@ -4873,13 +9720,92 @@ DROP PROCEDURE IF EXISTS update_customer_address; GO -- create procedure update_customer_address CREATE PROCEDURE update_customer_address -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "customerAddressId":"string", + "line1":"string", + "line2":"string", + "line3":"string", + "city":"string", + "county":"string", + "state":"string", + "postcode":"string", + "countryCode":"string", + "tags":"string", + "status":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -4917,7 +9843,7 @@ AS "countryCode":"string", "status":"string", "tags":"string", - "insertDate":"2020-06-16T14:59:21Z" + "insertDate":"2020-06-17T06:24:01Z" } }' ); @@ -4932,13 +9858,82 @@ DROP PROCEDURE IF EXISTS delete_customer_address; GO -- create procedure delete_customer_address CREATE PROCEDURE delete_customer_address -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "customerAddressId":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -4977,13 +9972,84 @@ DROP PROCEDURE IF EXISTS create_tax_residence; GO -- create procedure create_tax_residence CREATE PROCEDURE create_tax_residence -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "domain":"string", + "taxNumber":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -5027,13 +10093,82 @@ DROP PROCEDURE IF EXISTS get_tax_residence; GO -- create procedure get_tax_residence CREATE PROCEDURE get_tax_residence -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -5079,13 +10214,82 @@ DROP PROCEDURE IF EXISTS delete_tax_residence; GO -- create procedure delete_tax_residence CREATE PROCEDURE delete_tax_residence -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "taxResourceId":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -5124,13 +10328,88 @@ DROP PROCEDURE IF EXISTS get_customers; GO -- create procedure get_customers CREATE PROCEDURE get_customers -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "limit":100, + "offset":100, + "fromDate":"string", + "toDate":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -5204,13 +10483,85 @@ DROP PROCEDURE IF EXISTS get_customers_by_customer_phone_number; GO -- create procedure get_customers_by_customer_phone_number CREATE PROCEDURE get_customers_by_customer_phone_number -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "phoneNumber":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -5284,13 +10635,83 @@ DROP PROCEDURE IF EXISTS get_checkbook_orders; GO -- create procedure get_checkbook_orders CREATE PROCEDURE get_checkbook_orders -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":"gh.29.uk", + "accountId":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -5360,13 +10781,83 @@ DROP PROCEDURE IF EXISTS get_status_of_credit_card_order; GO -- create procedure get_status_of_credit_card_order CREATE PROCEDURE get_status_of_credit_card_order -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":"gh.29.uk", + "accountId":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -5411,13 +10902,84 @@ DROP PROCEDURE IF EXISTS create_user_auth_context; GO -- create procedure create_user_auth_context CREATE PROCEDURE create_user_auth_context -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "key":"5987953", + "value":"FYIUYF6SUYFSD" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -5461,13 +11023,84 @@ DROP PROCEDURE IF EXISTS create_user_auth_context_update; GO -- create procedure create_user_auth_context_update CREATE PROCEDURE create_user_auth_context_update -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "key":"5987953", + "value":"FYIUYF6SUYFSD" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -5513,13 +11146,82 @@ DROP PROCEDURE IF EXISTS delete_user_auth_contexts; GO -- create procedure delete_user_auth_contexts CREATE PROCEDURE delete_user_auth_contexts -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -5558,13 +11260,82 @@ DROP PROCEDURE IF EXISTS delete_user_auth_context_by_id; GO -- create procedure delete_user_auth_context_by_id CREATE PROCEDURE delete_user_auth_context_by_id -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "userAuthContextId":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -5603,13 +11374,82 @@ DROP PROCEDURE IF EXISTS get_user_auth_contexts; GO -- create procedure get_user_auth_contexts CREATE PROCEDURE get_user_auth_contexts -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -5655,13 +11495,91 @@ DROP PROCEDURE IF EXISTS create_or_update_product_attribute; GO -- create procedure create_or_update_product_attribute CREATE PROCEDURE create_or_update_product_attribute -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "productCode":{ + "value":"string" + }, + "productAttributeId":"string", + "name":"string", + "productAttributeType":"STRING", + "value":"FYIUYF6SUYFSD" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -5711,13 +11629,82 @@ DROP PROCEDURE IF EXISTS get_product_attribute_by_id; GO -- create procedure get_product_attribute_by_id CREATE PROCEDURE get_product_attribute_by_id -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "productAttributeId":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -5767,13 +11754,87 @@ DROP PROCEDURE IF EXISTS get_product_attributes_by_bank_and_code; GO -- create procedure get_product_attributes_by_bank_and_code CREATE PROCEDURE get_product_attributes_by_bank_and_code -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bank":{ + "value":"gh.29.uk" + }, + "productCode":{ + "value":"string" + } + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -5825,13 +11886,82 @@ DROP PROCEDURE IF EXISTS delete_product_attribute; GO -- create procedure delete_product_attribute CREATE PROCEDURE delete_product_attribute -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "productAttributeId":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -5870,13 +12000,82 @@ DROP PROCEDURE IF EXISTS get_account_attribute_by_id; GO -- create procedure get_account_attribute_by_id CREATE PROCEDURE get_account_attribute_by_id -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "accountAttributeId":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -5929,13 +12128,82 @@ DROP PROCEDURE IF EXISTS get_transaction_attribute_by_id; GO -- create procedure get_transaction_attribute_by_id CREATE PROCEDURE get_transaction_attribute_by_id -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "transactionAttributeId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -5985,13 +12253,94 @@ DROP PROCEDURE IF EXISTS create_or_update_account_attribute; GO -- create procedure create_or_update_account_attribute CREATE PROCEDURE create_or_update_account_attribute -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "productCode":{ + "value":"string" + }, + "productAttributeId":"string", + "name":"string", + "accountAttributeType":"STRING", + "value":"FYIUYF6SUYFSD" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -6044,13 +12393,91 @@ DROP PROCEDURE IF EXISTS create_or_update_customer_attribute; GO -- create procedure create_or_update_customer_attribute CREATE PROCEDURE create_or_update_customer_attribute -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "customerId":{ + "value":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }, + "customerAttributeId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "name":"string", + "attributeType":"STRING", + "value":"FYIUYF6SUYFSD" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -6100,13 +12527,91 @@ DROP PROCEDURE IF EXISTS create_or_update_transaction_attribute; GO -- create procedure create_or_update_transaction_attribute CREATE PROCEDURE create_or_update_transaction_attribute -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "transactionId":{ + "value":"2fg8a7e4-6d02-40e3-a129-0b2bf89de8ub" + }, + "transactionAttributeId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "name":"string", + "attributeType":"STRING", + "value":"FYIUYF6SUYFSD" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -6156,13 +12661,104 @@ DROP PROCEDURE IF EXISTS create_account_attributes; GO -- create procedure create_account_attributes CREATE PROCEDURE create_account_attributes -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "productCode":{ + "value":"string" + }, + "accountAttributes":[ + { + "bankId":{ + "value":"gh.29.uk" + }, + "productCode":{ + "value":"string" + }, + "productAttributeId":"string", + "name":"string", + "attributeType":"STRING", + "value":"FYIUYF6SUYFSD" + } + ] + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -6217,13 +12813,87 @@ DROP PROCEDURE IF EXISTS get_account_attributes_by_account; GO -- create procedure get_account_attributes_by_account CREATE PROCEDURE get_account_attributes_by_account -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + } + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -6278,13 +12948,87 @@ DROP PROCEDURE IF EXISTS get_customer_attributes; GO -- create procedure get_customer_attributes CREATE PROCEDURE get_customer_attributes -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "customerId":{ + "value":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" + } + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -6336,13 +13080,90 @@ DROP PROCEDURE IF EXISTS get_customer_ids_by_attribute_name_values; GO -- create procedure get_customer_ids_by_attribute_name_values CREATE PROCEDURE get_customer_ids_by_attribute_name_values -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "nameValues":{ + "some_name":[ + "name1", + "name2" + ] + } + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -6383,13 +13204,117 @@ DROP PROCEDURE IF EXISTS get_customer_attributes_for_customers; GO -- create procedure get_customer_attributes_for_customers CREATE PROCEDURE get_customer_attributes_for_customers -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "customers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "bankId":"gh.29.uk", + "number":"5987953", + "legalName":"Eveline Tripman", + "mobileNumber":"+44 07972 444 876", + "email":"eveline@example.com", + "faceImage":{ + "date":"2019-09-07T16:00:00Z", + "url":"http://www.example.com/id-docs/123/image.png" + }, + "dateOfBirth":"2018-03-08T16:00:00Z", + "relationshipStatus":"single", + "dependents":1, + "dobOfDependents":[ + "2019-09-07T16:00:00Z", + "2019-01-02T16:00:00Z" + ], + "highestEducationAttained":"Master", + "employmentStatus":"worker", + "creditRating":{ + "rating":"", + "source":"" + }, + "creditLimit":{ + "currency":"EUR", + "amount":"1000.00" + }, + "kycStatus":true, + "lastOkDate":"2019-09-07T16:00:00Z", + "title":"title of customer", + "branchId":"DERBY6", + "nameSuffix":"Sr" + } + ] + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -6478,13 +13403,90 @@ DROP PROCEDURE IF EXISTS get_transaction_ids_by_attribute_name_values; GO -- create procedure get_transaction_ids_by_attribute_name_values CREATE PROCEDURE get_transaction_ids_by_attribute_name_values -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "nameValues":{ + "some_name":[ + "name1", + "name2" + ] + } + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -6525,13 +13527,87 @@ DROP PROCEDURE IF EXISTS get_transaction_attributes; GO -- create procedure get_transaction_attributes CREATE PROCEDURE get_transaction_attributes -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "transactionId":{ + "value":"2fg8a7e4-6d02-40e3-a129-0b2bf89de8ub" + } + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -6583,13 +13659,82 @@ DROP PROCEDURE IF EXISTS get_customer_attribute_by_id; GO -- create procedure get_customer_attribute_by_id CREATE PROCEDURE get_customer_attribute_by_id -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "customerAttributeId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -6639,13 +13784,89 @@ DROP PROCEDURE IF EXISTS create_or_update_card_attribute; GO -- create procedure create_or_update_card_attribute CREATE PROCEDURE create_or_update_card_attribute -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "cardId":"36f8a9e6-c2b1-407a-8bd0-421b7119307e ", + "cardAttributeId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "name":"string", + "cardAttributeType":"STRING", + "value":"FYIUYF6SUYFSD" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -6693,13 +13914,82 @@ DROP PROCEDURE IF EXISTS get_card_attribute_by_id; GO -- create procedure get_card_attribute_by_id CREATE PROCEDURE get_card_attribute_by_id -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "cardAttributeId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -6747,13 +14037,82 @@ DROP PROCEDURE IF EXISTS get_card_attributes_from_provider; GO -- create procedure get_card_attributes_from_provider CREATE PROCEDURE get_card_attributes_from_provider -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "cardId":"36f8a9e6-c2b1-407a-8bd0-421b7119307e " + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -6803,13 +14162,86 @@ DROP PROCEDURE IF EXISTS create_account_application; GO -- create procedure create_account_application CREATE PROCEDURE create_account_application -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "productCode":{ + "value":"string" + }, + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -6841,7 +14273,7 @@ AS }, "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", - "dateOfApplication":"2020-06-16T14:59:22Z", + "dateOfApplication":"2020-06-17T06:24:01Z", "status":"string" } }' @@ -6857,13 +14289,81 @@ DROP PROCEDURE IF EXISTS get_all_account_application; GO -- create procedure get_all_account_application CREATE PROCEDURE get_all_account_application -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + } + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -6896,7 +14396,7 @@ AS }, "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", - "dateOfApplication":"2020-06-16T14:59:22Z", + "dateOfApplication":"2020-06-17T06:24:01Z", "status":"string" } ] @@ -6913,13 +14413,82 @@ DROP PROCEDURE IF EXISTS get_account_application_by_id; GO -- create procedure get_account_application_by_id CREATE PROCEDURE get_account_application_by_id -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "accountApplicationId":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -6951,7 +14520,7 @@ AS }, "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", - "dateOfApplication":"2020-06-16T14:59:22Z", + "dateOfApplication":"2020-06-17T06:24:01Z", "status":"string" } }' @@ -6967,13 +14536,83 @@ DROP PROCEDURE IF EXISTS update_account_application_status; GO -- create procedure update_account_application_status CREATE PROCEDURE update_account_application_status -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "accountApplicationId":"string", + "status":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -7005,7 +14644,7 @@ AS }, "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", - "dateOfApplication":"2020-06-16T14:59:22Z", + "dateOfApplication":"2020-06-17T06:24:01Z", "status":"string" } }' @@ -7021,13 +14660,85 @@ DROP PROCEDURE IF EXISTS get_or_create_product_collection; GO -- create procedure get_or_create_product_collection CREATE PROCEDURE get_or_create_product_collection -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "collectionCode":"string", + "productCodes":[ + "string" + ] + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -7071,13 +14782,82 @@ DROP PROCEDURE IF EXISTS get_product_collection; GO -- create procedure get_product_collection CREATE PROCEDURE get_product_collection -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "collectionCode":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -7121,13 +14901,85 @@ DROP PROCEDURE IF EXISTS get_or_create_product_collection_item; GO -- create procedure get_or_create_product_collection_item CREATE PROCEDURE get_or_create_product_collection_item -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "collectionCode":"string", + "memberProductCodes":[ + "string" + ] + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -7171,13 +15023,82 @@ DROP PROCEDURE IF EXISTS get_product_collection_item; GO -- create procedure get_product_collection_item CREATE PROCEDURE get_product_collection_item -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "collectionCode":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -7221,13 +15142,83 @@ DROP PROCEDURE IF EXISTS get_product_collection_items_tree; GO -- create procedure get_product_collection_items_tree CREATE PROCEDURE get_product_collection_items_tree -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "collectionCode":"string", + "bankId":"gh.29.uk" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -7311,13 +15302,125 @@ DROP PROCEDURE IF EXISTS create_meeting; GO -- create procedure create_meeting CREATE PROCEDURE create_meeting -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "staffUser":{ + "userPrimaryKey":{ + "value":123 + }, + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "idGivenByProvider":"string", + "provider":"string", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + }, + "customerUser":{ + "userPrimaryKey":{ + "value":123 + }, + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "idGivenByProvider":"string", + "provider":"string", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + }, + "providerId":"string", + "purposeId":"string", + "when":"2020-06-17T06:24:01Z", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "customerToken":"string", + "staffToken":"string", + "creator":{ + "name":"string", + "phone":"string", + "email":"eveline@example.com" + }, + "invitees":[ + { + "contactDetails":{ + "name":"string", + "phone":"string", + "email":"eveline@example.com" + }, + "status":"string" + } + ] + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -7356,7 +15459,7 @@ AS "customerToken":"string", "staffToken":"string" }, - "when":"2020-06-16T14:59:22Z", + "when":"2020-06-17T06:24:01Z", "creator":{ "name":"string", "phone":"string", @@ -7386,13 +15489,94 @@ DROP PROCEDURE IF EXISTS get_meetings; GO -- create procedure get_meetings CREATE PROCEDURE get_meetings -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "user":{ + "userPrimaryKey":{ + "value":123 + }, + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "idGivenByProvider":"string", + "provider":"string", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -7432,7 +15616,7 @@ AS "customerToken":"string", "staffToken":"string" }, - "when":"2020-06-16T14:59:22Z", + "when":"2020-06-17T06:24:01Z", "creator":{ "name":"string", "phone":"string", @@ -7463,13 +15647,95 @@ DROP PROCEDURE IF EXISTS get_meeting; GO -- create procedure get_meeting CREATE PROCEDURE get_meeting -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":{ + "value":"gh.29.uk" + }, + "user":{ + "userPrimaryKey":{ + "value":123 + }, + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "idGivenByProvider":"string", + "provider":"string", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + }, + "meetingId":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -7508,7 +15774,7 @@ AS "customerToken":"string", "staffToken":"string" }, - "when":"2020-06-16T14:59:22Z", + "when":"2020-06-17T06:24:01Z", "creator":{ "name":"string", "phone":"string", @@ -7538,13 +15804,91 @@ DROP PROCEDURE IF EXISTS create_or_update_kyc_check; GO -- create procedure create_or_update_kyc_check CREATE PROCEDURE create_or_update_kyc_check -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "id":"string", + "customerNumber":"5987953", + "date":"2020-06-17T06:24:01Z", + "how":"string", + "staffUserId":"string", + "mStaffName":"string", + "mSatisfied":true, + "comments":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -7574,7 +15918,7 @@ AS "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", "idKycCheck":"string", "customerNumber":"5987953", - "date":"2020-06-16T14:59:22Z", + "date":"2020-06-17T06:24:01Z", "how":"string", "staffUserId":"string", "staffName":"string", @@ -7594,13 +15938,90 @@ DROP PROCEDURE IF EXISTS create_or_update_kyc_document; GO -- create procedure create_or_update_kyc_document CREATE PROCEDURE create_or_update_kyc_document -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "id":"string", + "customerNumber":"5987953", + "type":"string", + "number":"string", + "issueDate":"2020-06-17T06:24:01Z", + "issuePlace":"string", + "expiryDate":"2020-06-17T06:24:01Z" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -7632,9 +16053,9 @@ AS "customerNumber":"5987953", "type":"string", "number":"string", - "issueDate":"2020-06-16T14:59:22Z", + "issueDate":"2020-06-17T06:24:01Z", "issuePlace":"string", - "expiryDate":"2020-06-16T14:59:22Z" + "expiryDate":"2020-06-17T06:24:01Z" } }' ); @@ -7649,13 +16070,90 @@ DROP PROCEDURE IF EXISTS create_or_update_kyc_media; GO -- create procedure create_or_update_kyc_media CREATE PROCEDURE create_or_update_kyc_media -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "id":"string", + "customerNumber":"5987953", + "type":"string", + "url":"http://www.example.com/id-docs/123/image.png", + "date":"2020-06-17T06:24:01Z", + "relatesToKycDocumentId":"string", + "relatesToKycCheckId":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -7687,7 +16185,7 @@ AS "customerNumber":"5987953", "type":"string", "url":"http://www.example.com/id-docs/123/image.png", - "date":"2020-06-16T14:59:22Z", + "date":"2020-06-17T06:24:01Z", "relatesToKycDocumentId":"string", "relatesToKycCheckId":"string" } @@ -7704,13 +16202,86 @@ DROP PROCEDURE IF EXISTS create_or_update_kyc_status; GO -- create procedure create_or_update_kyc_status CREATE PROCEDURE create_or_update_kyc_status -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "ok":true, + "date":"2020-06-17T06:24:01Z" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -7740,7 +16311,7 @@ AS "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", "customerNumber":"5987953", "ok":true, - "date":"2020-06-16T14:59:22Z" + "date":"2020-06-17T06:24:01Z" } }' ); @@ -7755,13 +16326,82 @@ DROP PROCEDURE IF EXISTS get_kyc_checks; GO -- create procedure get_kyc_checks CREATE PROCEDURE get_kyc_checks -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -7792,7 +16432,7 @@ AS "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", "idKycCheck":"string", "customerNumber":"5987953", - "date":"2020-06-16T14:59:22Z", + "date":"2020-06-17T06:24:01Z", "how":"string", "staffUserId":"string", "staffName":"string", @@ -7813,13 +16453,82 @@ DROP PROCEDURE IF EXISTS get_kyc_documents; GO -- create procedure get_kyc_documents CREATE PROCEDURE get_kyc_documents -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -7852,9 +16561,9 @@ AS "customerNumber":"5987953", "type":"string", "number":"string", - "issueDate":"2020-06-16T14:59:22Z", + "issueDate":"2020-06-17T06:24:01Z", "issuePlace":"string", - "expiryDate":"2020-06-16T14:59:22Z" + "expiryDate":"2020-06-17T06:24:01Z" } ] }' @@ -7870,13 +16579,82 @@ DROP PROCEDURE IF EXISTS get_kyc_medias; GO -- create procedure get_kyc_medias CREATE PROCEDURE get_kyc_medias -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -7909,7 +16687,7 @@ AS "customerNumber":"5987953", "type":"string", "url":"http://www.example.com/id-docs/123/image.png", - "date":"2020-06-16T14:59:22Z", + "date":"2020-06-17T06:24:01Z", "relatesToKycDocumentId":"string", "relatesToKycCheckId":"string" } @@ -7927,13 +16705,82 @@ DROP PROCEDURE IF EXISTS get_kyc_statuses; GO -- create procedure get_kyc_statuses CREATE PROCEDURE get_kyc_statuses -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -7964,7 +16811,7 @@ AS "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", "customerNumber":"5987953", "ok":true, - "date":"2020-06-16T14:59:22Z" + "date":"2020-06-17T06:24:01Z" } ] }' @@ -7980,13 +16827,97 @@ DROP PROCEDURE IF EXISTS create_message; GO -- create procedure create_message CREATE PROCEDURE create_message -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "user":{ + "userPrimaryKey":{ + "value":123 + }, + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "idGivenByProvider":"string", + "provider":"string", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + }, + "bankId":{ + "value":"gh.29.uk" + }, + "message":"string", + "fromDepartment":"string", + "fromPerson":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -8013,7 +16944,7 @@ AS }, "data":{ "messageId":"string", - "date":"2020-06-16T14:59:22Z", + "date":"2020-06-17T06:24:01Z", "message":"string", "fromDepartment":"string", "fromPerson":"string" @@ -8031,13 +16962,151 @@ DROP PROCEDURE IF EXISTS make_historical_payment; GO -- create procedure make_historical_payment CREATE PROCEDURE make_historical_payment -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "fromAccount":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + }, + "toAccount":{ + "accountId":{ + "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" + }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", + "bankId":{ + "value":"gh.29.uk" + }, + "lastUpdate":"2018-03-08T16:00:00Z", + "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" + }, + "posted":"2020-06-17T06:24:01Z", + "completed":"2020-06-17T06:24:01Z", + "amount":"123.321", + "description":"string", + "transactionRequestType":"SEPA", + "chargePolicy":"string" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -8078,13 +17147,89 @@ DROP PROCEDURE IF EXISTS create_direct_debit; GO -- create procedure create_direct_debit CREATE PROCEDURE create_direct_debit -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "bankId":"gh.29.uk", + "accountId":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "counterpartyId":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "dateSigned":"2020-06-17T06:24:01Z", + "dateStarts":"2020-06-17T06:24:01Z", + "dateExpires":"2020-06-17T06:24:01Z" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -8116,10 +17261,10 @@ AS "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", "counterpartyId":"9fg8a7e4-6d02-40e3-a129-0b2bf89de8uh", - "dateSigned":"2020-06-16T14:59:22Z", - "dateCancelled":"2020-06-16T14:59:22Z", - "dateStarts":"2020-06-16T14:59:22Z", - "dateExpires":"2020-06-16T14:59:22Z", + "dateSigned":"2020-06-17T06:24:01Z", + "dateCancelled":"2020-06-17T06:24:01Z", + "dateStarts":"2020-06-17T06:24:01Z", + "dateExpires":"2020-06-17T06:24:01Z", "active":true } }' @@ -8135,13 +17280,82 @@ DROP PROCEDURE IF EXISTS delete_customer_attribute; GO -- create procedure delete_customer_attribute CREATE PROCEDURE delete_customer_attribute -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2020-06-17T06:24:01Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "customerAttributeId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ @@ -8180,13 +17394,88 @@ DROP PROCEDURE IF EXISTS dynamic_entity_process; GO -- create procedure dynamic_entity_process CREATE PROCEDURE dynamic_entity_process -@out_bound_json NVARCHAR(MAX), -@in_bound_json NVARCHAR(MAX) OUT -AS - SET nocount on + @out_bound_json NVARCHAR(MAX), + @in_bound_json NVARCHAR(MAX) OUT + AS + SET nocount on -- replace the follow example to real logic +/* +this is example of parameter @out_bound_json + N'{ + "outboundAdapterCallContext":{ + "correlationId":"1flssoftxq0cr1nssr68u0mioj", + "sessionId":"b4e0352a-9a0f-4bfa-b30b-9003aa467f50", + "consumerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "generalContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "outboundAdapterAuthInfo":{ + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "username":"felixsmith", + "linkedCustomers":[ + { + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman" + } + ], + "userAuthContext":[ + { + "key":"5987953", + "value":"FYIUYF6SUYFSD" + } + ], + "authViews":[ + { + "view":{ + "id":"owner", + "name":"Owner", + "description":"This view is for the owner for the account." + }, + "account":{ + "id":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], + "customerOwners":[ + { + "bankId":"gh.29.uk", + "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", + "customerNumber":"5987953", + "legalName":"Eveline Tripman", + "dateOfBirth":"2018-03-08T16:00:00Z" + } + ], + "userOwners":[ + { + "userId":"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", + "emailAddress":"eveline@example.com", + "name":"felixsmith" + } + ] + } + } + ] + } + }, + "operation":"UPDATE", + "entityName":"FooBar", + "requestBody":{ + "name":"James Brown", + "number":1234567890 + }, + "entityId":"foobar-id-value" + }' +*/ +-- return example value SELECT @in_bound_json = ( SELECT N'{ diff --git a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedureBuilder.scala b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedureBuilder.scala index 90424df90..07c26f1f6 100644 --- a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedureBuilder.scala +++ b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedureBuilder.scala @@ -37,11 +37,12 @@ object MSsqlStoredProcedureBuilder { implicit val customFormats = formats + StatusSerializer val messageDocs: ArrayBuffer[MessageDoc] = StoredProcedureConnector_vDec2019.messageDocs def toProcedureName(processName: String) = StringHelpers.snakify(processName.replace("obp.", "")) - def inboundToJson(any: Any) = json.prettyRender(json.Extraction.decompose(any)) + def toJson(any: Any) = json.prettyRender(json.Extraction.decompose(any)) val procedureNameToInbound = messageDocs.map(doc => { val procedureName = toProcedureName(doc.process) - val inBoundExample = inboundToJson(doc.exampleInboundMessage) - buildProcedure(procedureName, inBoundExample) + val outBoundExample = toJson(doc.exampleOutboundMessage) + val inBoundExample = toJson(doc.exampleInboundMessage) + buildProcedure(procedureName, outBoundExample, inBoundExample) }).mkString(s"-- auto generated MS sql server procedures script, create on ${APIUtil.DateWithSecondsFormat.format(new Date())}", " \n \n", "") val path = new File(getClass.getResource("").toURI.toString.replaceFirst("target/.*", "").replace("file:", ""), @@ -49,7 +50,7 @@ object MSsqlStoredProcedureBuilder { val source = FileUtils.write(path, procedureNameToInbound, "utf-8") } - def buildProcedure(processName: String, inBoundExample: String) = { + def buildProcedure(processName: String, outBoundExample: String, inBoundExample: String) = { s""" | |-- drop procedure $processName @@ -57,13 +58,18 @@ object MSsqlStoredProcedureBuilder { |GO |-- create procedure $processName |CREATE PROCEDURE $processName - |@out_bound_json NVARCHAR(MAX), - |@in_bound_json NVARCHAR(MAX) OUT - |AS - | SET nocount on + | @out_bound_json NVARCHAR(MAX), + | @in_bound_json NVARCHAR(MAX) OUT + | AS + | SET nocount on | |-- replace the follow example to real logic + |/* + |this is example of parameter @out_bound_json + | N'${outBoundExample.replaceAll("(?m)^", " ").trim()}' + |*/ | + |-- return example value | SELECT @in_bound_json = ( | SELECT | N'${inBoundExample.replaceAll("(?m)^", " ").trim()}' From ada4753cd80e27cb05ed9a2f3e1c6b5b9396d979 Mon Sep 17 00:00:00 2001 From: shuang Date: Wed, 17 Jun 2020 14:45:59 +0800 Subject: [PATCH 10/10] feature/create_ms_stored_procedure_script: fix error cause drop function for MS sql server, it only fit for postgresql. --- .../bankconnectors/storedprocedure/StoredProcedureUtils.scala | 2 -- 1 file changed, 2 deletions(-) diff --git a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureUtils.scala b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureUtils.scala index 1a150a69f..3e2d898ca 100644 --- a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureUtils.scala +++ b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureUtils.scala @@ -124,8 +124,6 @@ object StoredProceduresMockedData { create() case (Full(mapper), Full(connector)) if(mapper == connector && mapper == "org.postgresql.Driver") => create() - case (_, _) if thereIsTheProcedure => - drop() case _ => "" }