mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 17:56:46 +00:00
Merge remote-tracking branch 'upstream/develop' into develop
This commit is contained in:
commit
1906f98568
@ -8,7 +8,7 @@
|
||||
<groupId>com.tesobe</groupId>
|
||||
<artifactId>obp-parent</artifactId>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
<version>1.5.0</version>
|
||||
<version>1.5.1</version>
|
||||
</parent>
|
||||
<artifactId>obp-api</artifactId>
|
||||
<packaging>war</packaging>
|
||||
|
||||
@ -79,8 +79,7 @@ object SwaggerJSONFactory extends MdcLoggable {
|
||||
case class BasicTypeSchemaJson(`type`: String) extends ResponseObjectSchemaJson
|
||||
case class ListResultSchemaJson(listResult: ListResult[List[_]]) extends ResponseObjectSchemaJson with JsonAble {
|
||||
|
||||
override def toJValue: json.JValue = {
|
||||
implicit val formats = CustomJsonFormats.formats
|
||||
override def toJValue(implicit format: Formats): json.JValue = {
|
||||
val ListResult(name, head::_) = listResult
|
||||
val schema = buildSwaggerSchema(ReflectUtils.getType(head), head)
|
||||
val definition =
|
||||
@ -103,18 +102,16 @@ object SwaggerJSONFactory extends MdcLoggable {
|
||||
}
|
||||
case class JObjectSchemaJson(jObject: JObject) extends ResponseObjectSchemaJson with JsonAble {
|
||||
|
||||
override def toJValue: json.JValue = {
|
||||
override def toJValue(implicit format: Formats): json.JValue = {
|
||||
val schema = buildSwaggerSchema(typeOf[JObject], jObject)
|
||||
implicit val formats = CustomJsonFormats.formats
|
||||
json.parse(schema)
|
||||
}
|
||||
|
||||
}
|
||||
case class JArraySchemaJson(jArray: JArray) extends ResponseObjectSchemaJson with JsonAble {
|
||||
|
||||
override def toJValue: json.JValue = {
|
||||
override def toJValue(implicit format: Formats): json.JValue = {
|
||||
val schema = buildSwaggerSchema(typeOf[JArray], jArray)
|
||||
implicit val formats = CustomJsonFormats.formats
|
||||
json.parse(schema)
|
||||
}
|
||||
|
||||
|
||||
@ -1113,7 +1113,7 @@ object APIUtil extends MdcLoggable with CustomJsonFormats{
|
||||
case EmptyBody => throw new IllegalArgumentException(s"$EmptyBody have no type name.")
|
||||
}
|
||||
|
||||
override def toJValue: json.JValue = {
|
||||
override def toJValue(implicit format: Formats): json.JValue = {
|
||||
this.asInstanceOf[PrimaryDataBody[_]] match {
|
||||
case EmptyBody => JNothing
|
||||
case StringBody(v) => JString(v)
|
||||
|
||||
@ -36,6 +36,7 @@ import code.util.{Helper, JsonUtils}
|
||||
import code.views.Views
|
||||
import code.webhook.AccountWebhook
|
||||
import com.github.dwickern.macros.NameOf.nameOf
|
||||
import com.openbankproject.commons.dto.ProductCollectionItemsTree
|
||||
import com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SCA
|
||||
import com.openbankproject.commons.model.enums._
|
||||
import com.openbankproject.commons.model.{AccountApplication, Bank, Customer, CustomerAddress, Product, ProductCollection, ProductCollectionItem, TaxResidence, UserAuthContext, UserAuthContextUpdate, _}
|
||||
@ -1215,7 +1216,12 @@ object NewStyle {
|
||||
bankId: String,
|
||||
callContext: Option[CallContext]): OBPReturnType[List[(ProductCollectionItem, Product, List[ProductAttribute])]] = {
|
||||
Connector.connector.vend.getProductCollectionItemsTree(collectionCode, bankId, callContext) map {
|
||||
i => (unboxFullOrFail(i._1, callContext, s"$InvalidConnectorResponse Current collection code($collectionCode)", 400), i._2)
|
||||
i => {
|
||||
val data: Box[List[ProductCollectionItemsTree]] = i._1
|
||||
val tupleData: Box[List[(ProductCollectionItemCommons, ProductCommons, List[ProductAttributeCommons])]] =
|
||||
data.map(boxValue=> boxValue.map(it => (it.productCollectionItem, it.product, it.attributes)))
|
||||
(unboxFullOrFail(tupleData, callContext, s"$InvalidConnectorResponse Current collection code($collectionCode)", 400), i._2)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -25,14 +25,12 @@ import code.api.v2_0_0.{EntitlementJSONs, JSONFactory200}
|
||||
import code.api.v2_1_0._
|
||||
import code.api.v2_2_0.{BankJSONV220, JSONFactory220}
|
||||
import code.api.v3_0_0.JSONFactory300
|
||||
import code.api.v3_1_0.JSONFactory310.createBadLoginStatusJson
|
||||
import code.api.v3_1_0.{CreateAccountRequestJsonV310, CustomerWithAttributesJsonV310, JSONFactory310, ListResult}
|
||||
import code.api.v4_0_0.DynamicEndpointHelper.DynamicReq
|
||||
import code.api.v4_0_0.JSONFactory400.{createBankAccountJSON, createNewCoreBankAccountJson}
|
||||
import code.bankconnectors.Connector
|
||||
import code.dynamicEntity.{DynamicEntityCommons, ReferenceType}
|
||||
import code.entitlement.Entitlement
|
||||
import code.loginattempts.LoginAttempt
|
||||
import code.metadata.counterparties.{Counterparties, MappedCounterparty}
|
||||
import code.metadata.tags.Tags
|
||||
import code.model.dataAccess.{AuthUser, BankAccountCreation}
|
||||
@ -40,19 +38,17 @@ import code.model.{toUserExtended, _}
|
||||
import code.transactionChallenge.MappedExpectedChallengeAnswer
|
||||
import code.transactionrequests.MappedTransactionRequestProvider
|
||||
import code.transactionrequests.TransactionRequests.TransactionChallengeTypes._
|
||||
import code.transactionrequests.TransactionRequests.TransactionRequestTypes.{apply => _, _}
|
||||
import code.transactionrequests.TransactionRequests.TransactionRequestTypes
|
||||
import com.openbankproject.commons.model.enums.TransactionRequestStatus
|
||||
import code.transactionrequests.TransactionRequests.TransactionRequestTypes.{apply => _, _}
|
||||
import code.userlocks.UserLocksProvider
|
||||
import code.users.Users
|
||||
import code.util.Helper.booleanToBox
|
||||
import code.util.{Helper, JsonUtils}
|
||||
import code.views.Views
|
||||
import com.github.dwickern.macros.NameOf.nameOf
|
||||
import com.openbankproject.commons.ExecutionContext.Implicits.global
|
||||
import com.openbankproject.commons.model._
|
||||
import com.openbankproject.commons.model.enums.DynamicEntityOperation._
|
||||
import com.openbankproject.commons.model.enums._
|
||||
import com.openbankproject.commons.model.enums.{TransactionRequestStatus, _}
|
||||
import com.openbankproject.commons.util.ApiVersion
|
||||
import deletion.{DeleteAccountCascade, DeleteProductCascade, DeleteTransactionCascade}
|
||||
import net.liftweb.common.{Box, Failure, Full}
|
||||
@ -63,10 +59,9 @@ import net.liftweb.json.JsonDSL._
|
||||
import net.liftweb.json.Serialization.write
|
||||
import net.liftweb.json.{compactRender, _}
|
||||
import net.liftweb.mapper.By
|
||||
import net.liftweb.util.Helpers.{now, tryo}
|
||||
import net.liftweb.util.Helpers.now
|
||||
import net.liftweb.util.{Helpers, StringHelpers}
|
||||
import org.apache.commons.lang3.StringUtils
|
||||
import org.atteo.evo.inflector.English
|
||||
|
||||
import scala.collection.immutable.{List, Nil}
|
||||
import scala.collection.mutable.ArrayBuffer
|
||||
@ -1071,7 +1066,7 @@ trait APIMethods400 {
|
||||
|
||||
lazy val genericEndpoint: OBPEndpoint = {
|
||||
case EntityName(entityName) :: Nil JsonGet req => { cc =>
|
||||
val listName = StringHelpers.snakify(English.plural(entityName))
|
||||
val listName = StringHelpers.snakify(entityName).replaceFirst("[-_]*$", "_list")
|
||||
for {
|
||||
(Full(u), callContext) <- authenticatedAccess(cc)
|
||||
_ <- NewStyle.function.hasEntitlement("", u.userId, DynamicEntityInfo.canGetRole(entityName), callContext)
|
||||
|
||||
@ -1,19 +1,16 @@
|
||||
package code.api.v4_0_0
|
||||
|
||||
import java.util.regex.Pattern
|
||||
|
||||
import code.api.util.APIUtil.{Catalogs, EmptyBody, ResourceDoc, authenticationRequiredMessage, generateUUID, notCore, notOBWG, notPSD2}
|
||||
import code.api.util.ApiRole.getOrCreateDynamicApiRole
|
||||
import code.api.util.ApiTag.{ResourceDocTag, apiTagApi, apiTagNewStyle}
|
||||
import code.api.util.ErrorMessages.{InvalidJsonFormat, UnknownError, UserHasMissingRoles, UserNotLoggedIn}
|
||||
import code.api.util.{APIUtil, ApiRole, ApiTag, NewStyle}
|
||||
import code.api.util.ApiRole.getOrCreateDynamicApiRole
|
||||
import com.openbankproject.commons.model.enums.DynamicEntityFieldType
|
||||
import com.openbankproject.commons.util.ApiVersion
|
||||
import net.liftweb.json.JsonDSL._
|
||||
import net.liftweb.json._
|
||||
import net.liftweb.util.StringHelpers
|
||||
import org.apache.commons.lang3.StringUtils
|
||||
import org.atteo.evo.inflector.English
|
||||
|
||||
import scala.collection.immutable.{List, Nil}
|
||||
import scala.collection.mutable.ArrayBuffer
|
||||
@ -93,8 +90,7 @@ object MockerConnector {
|
||||
val entityName = dynamicEntityInfo.entityName
|
||||
// e.g: "someMultiple-part_Name" -> ["Some", "Multiple", "Part", "Name"]
|
||||
val capitalizedNameParts = entityName.split("(?<=[a-z0-9])(?=[A-Z])|-|_").map(_.capitalize).filterNot(_.trim.isEmpty)
|
||||
val singularName = capitalizedNameParts.mkString(" ")
|
||||
val pluralName = English.plural(singularName)
|
||||
val splitName = capitalizedNameParts.mkString(" ")
|
||||
|
||||
val idNameInUrl = StringHelpers.snakify(dynamicEntityInfo.idName).toUpperCase()
|
||||
val listName = dynamicEntityInfo.listName
|
||||
@ -102,16 +98,16 @@ object MockerConnector {
|
||||
val endPoint = APIUtil.dynamicEndpointStub
|
||||
val implementedInApiVersion = ApiVersion.v4_0_0
|
||||
val resourceDocs = ArrayBuffer[ResourceDoc]()
|
||||
val apiTag: ResourceDocTag = fun(singularName, entityName)
|
||||
val apiTag: ResourceDocTag = fun(splitName, entityName)
|
||||
|
||||
resourceDocs += ResourceDoc(
|
||||
endPoint,
|
||||
implementedInApiVersion,
|
||||
s"getAll$entityName",
|
||||
s"get${entityName}List",
|
||||
"GET",
|
||||
s"/$entityName",
|
||||
s"Get All $pluralName",
|
||||
s"""Get All $pluralName.
|
||||
s"Get $splitName List",
|
||||
s"""Get $splitName List.
|
||||
|${dynamicEntityInfo.description}
|
||||
|
|
||||
|${dynamicEntityInfo.fieldsDescription}
|
||||
@ -141,8 +137,8 @@ object MockerConnector {
|
||||
s"getSingle$entityName",
|
||||
"GET",
|
||||
s"/$entityName/$idNameInUrl",
|
||||
s"Get one $singularName",
|
||||
s"""Get one $singularName by id.
|
||||
s"Get $splitName by id",
|
||||
s"""Get $splitName by id.
|
||||
|${dynamicEntityInfo.description}
|
||||
|
|
||||
|${dynamicEntityInfo.fieldsDescription}
|
||||
@ -169,8 +165,8 @@ object MockerConnector {
|
||||
s"create$entityName",
|
||||
"POST",
|
||||
s"/$entityName",
|
||||
s"Create one $singularName",
|
||||
s"""Create one $singularName.
|
||||
s"Create new $splitName",
|
||||
s"""Create new $splitName.
|
||||
|${dynamicEntityInfo.description}
|
||||
|
|
||||
|${dynamicEntityInfo.fieldsDescription}
|
||||
@ -199,8 +195,8 @@ object MockerConnector {
|
||||
s"update$entityName",
|
||||
"PUT",
|
||||
s"/$entityName/$idNameInUrl",
|
||||
s"Update one $singularName",
|
||||
s"""Update one $singularName.
|
||||
s"Update exists $splitName",
|
||||
s"""Update exists $splitName.
|
||||
|${dynamicEntityInfo.description}
|
||||
|
|
||||
|${dynamicEntityInfo.fieldsDescription}
|
||||
@ -229,8 +225,8 @@ object MockerConnector {
|
||||
s"delete$entityName",
|
||||
"DELETE",
|
||||
s"/$entityName/$idNameInUrl",
|
||||
s"Delete one $singularName",
|
||||
s"""Delete one $singularName
|
||||
s"Delete $splitName by id",
|
||||
s"""Delete $splitName by id
|
||||
|
|
||||
|${methodRoutingExample(entityName)}
|
||||
|
|
||||
@ -285,7 +281,7 @@ case class DynamicEntityInfo(definition: String, entityName: String) {
|
||||
|
||||
val idName = StringUtils.uncapitalize(entityName) + "Id"
|
||||
|
||||
val listName = StringHelpers.snakify(English.plural(entityName))
|
||||
val listName = StringHelpers.snakify(entityName).replaceFirst("[-_]*$", "_list")
|
||||
|
||||
val jsonTypeMap: Map[String, Class[_]] = DynamicEntityFieldType.nameToValue.mapValues(_.jValueType)
|
||||
|
||||
|
||||
@ -61,7 +61,7 @@ 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
|
||||
import com.openbankproject.commons.dto.{InBoundTrait, ProductCollectionItemsTree}
|
||||
|
||||
/*
|
||||
So we can switch between different sources of resources e.g.
|
||||
@ -2161,7 +2161,7 @@ trait Connector extends MdcLoggable {
|
||||
|
||||
def getProductCollectionItemsTree(collectionCode: String,
|
||||
bankId: String,
|
||||
callContext: Option[CallContext]): OBPReturnType[Box[List[(ProductCollectionItem, Product, List[ProductAttribute])]]] =
|
||||
callContext: Option[CallContext]): OBPReturnType[Box[List[ProductCollectionItemsTree]]] =
|
||||
Future{(Failure(setUnimplementedError), callContext)}
|
||||
|
||||
def createMeeting(
|
||||
|
||||
@ -93,8 +93,8 @@ import scala.concurrent._
|
||||
import scala.language.postfixOps
|
||||
import scala.math.{BigDecimal, BigInt}
|
||||
import scala.util.Random
|
||||
|
||||
import _root_.akka.http.scaladsl.model.HttpMethod
|
||||
import com.openbankproject.commons.dto.ProductCollectionItemsTree
|
||||
|
||||
object LocalMappedConnector extends Connector with MdcLoggable {
|
||||
|
||||
@ -2935,9 +2935,10 @@ object LocalMappedConnector extends Connector with MdcLoggable {
|
||||
|
||||
override def getProductCollectionItemsTree(collectionCode: String,
|
||||
bankId: String,
|
||||
callContext: Option[CallContext]): OBPReturnType[Box[List[(ProductCollectionItem, Product, List[ProductAttribute])]]] =
|
||||
ProductCollectionItems.productCollectionItem.vend.getProductCollectionItemsTree(collectionCode, bankId) map {
|
||||
(_, callContext)
|
||||
callContext: Option[CallContext]): OBPReturnType[Box[List[ProductCollectionItemsTree]]] =
|
||||
ProductCollectionItems.productCollectionItem.vend.getProductCollectionItemsTree(collectionCode, bankId) map { it =>
|
||||
val data: Box[List[ProductCollectionItemsTree]] = it.map(boxValue => boxValue.map(it => ProductCollectionItemsTree(it._1, it._2, it._3)))
|
||||
(data, callContext)
|
||||
}
|
||||
|
||||
override def createMeeting(
|
||||
|
||||
@ -4750,7 +4750,7 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit {
|
||||
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",
|
||||
@ -4766,33 +4766,35 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit {
|
||||
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)))))
|
||||
data=List(ProductCollectionItemsTree(productCollectionItem= ProductCollectionItemCommons(collectionCode="string",
|
||||
memberProductCode="string"),
|
||||
product= 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"))),
|
||||
attributes=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}
|
||||
override def getProductCollectionItemsTree(collectionCode: String, bankId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[ProductCollectionItemsTree]]] = {
|
||||
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))
|
||||
val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _)
|
||||
response.map(convertToTuple[List[ProductCollectionItemsTree]](callContext))
|
||||
}
|
||||
|
||||
messageDocs += createMeetingDoc
|
||||
|
||||
@ -30,6 +30,7 @@ import java.util.Date
|
||||
import akka.http.scaladsl.model.{HttpProtocol, _}
|
||||
import akka.http.scaladsl.model.headers.RawHeader
|
||||
import akka.util.ByteString
|
||||
import code.api.ResourceDocs1_4_0.MessageDocsSwaggerDefinitions
|
||||
import code.api.{APIFailure, APIFailureNewStyle}
|
||||
import com.openbankproject.commons.model.ErrorMessage
|
||||
import code.api.cache.Caching
|
||||
@ -8187,7 +8188,7 @@ trait RestConnector_vMar2019 extends Connector with KafkaHelper with MdcLoggable
|
||||
val result: OBPReturnType[Box[List[ProductCollectionItemCommons]]] = sendRequest[InBound](url, HttpMethods.POST, req, callContext).map(convertToTuple(callContext))
|
||||
result
|
||||
}
|
||||
|
||||
|
||||
messageDocs += getProductCollectionItemsTreeDoc
|
||||
def getProductCollectionItemsTreeDoc = MessageDoc(
|
||||
process = "obp.getProductCollectionItemsTree",
|
||||
@ -8196,73 +8197,42 @@ trait RestConnector_vMar2019 extends Connector with KafkaHelper with MdcLoggable
|
||||
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))))))))),
|
||||
collectionCode="string",
|
||||
bankId=bankIdExample.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))),
|
||||
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)))))
|
||||
),
|
||||
InBoundGetProductCollectionItemsTree(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext,
|
||||
status=MessageDocsSwaggerDefinitions.inboundStatus,
|
||||
data=List( ProductCollectionItemsTree(productCollectionItem= ProductCollectionItemCommons(collectionCode="string",
|
||||
memberProductCode="string"),
|
||||
product= 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"))),
|
||||
attributes=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))
|
||||
)
|
||||
// url example: /getProductCollectionItemsTree
|
||||
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 url = getUrl(callContext, "getProductCollectionItemsTree")
|
||||
val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , collectionCode, bankId)
|
||||
val result: OBPReturnType[Box[List[(ProductCollectionItemCommons, ProductCommons, List[ProductAttributeCommons])]]] = sendRequest[InBound](url, HttpMethods.POST, req, callContext).map(convertToTuple(callContext))
|
||||
result
|
||||
|
||||
override def getProductCollectionItemsTree(collectionCode: String, bankId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[ProductCollectionItemsTree]]] = {
|
||||
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](getUrl(callContext, "getProductCollectionItemsTree"), HttpMethods.POST, req, callContext)
|
||||
response.map(convertToTuple[List[ProductCollectionItemsTree]](callContext))
|
||||
}
|
||||
|
||||
messageDocs += createMeetingDoc
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -4967,7 +4967,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable {
|
||||
val response: Future[Box[InBound]] = sendRequest[InBound]("obp_get_product_collection_item", req, callContext)
|
||||
response.map(convertToTuple[List[ProductCollectionItemCommons]](callContext))
|
||||
}
|
||||
|
||||
|
||||
messageDocs += getProductCollectionItemsTreeDoc
|
||||
def getProductCollectionItemsTreeDoc = MessageDoc(
|
||||
process = "obp.getProductCollectionItemsTree",
|
||||
@ -4976,42 +4976,44 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable {
|
||||
outboundTopic = None,
|
||||
inboundTopic = None,
|
||||
exampleOutboundMessage = (
|
||||
OutBoundGetProductCollectionItemsTree(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext,
|
||||
collectionCode="string",
|
||||
bankId=bankIdExample.value)
|
||||
),
|
||||
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)))))
|
||||
),
|
||||
InBoundGetProductCollectionItemsTree(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext,
|
||||
status=MessageDocsSwaggerDefinitions.inboundStatus,
|
||||
data=List( ProductCollectionItemsTree(productCollectionItem= ProductCollectionItemCommons(collectionCode="string",
|
||||
memberProductCode="string"),
|
||||
product= 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"))),
|
||||
attributes=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]] = sendRequest[InBound]("obp_get_product_collection_items_tree", req, callContext)
|
||||
response.map(convertToTuple[List[(ProductCollectionItemCommons, ProductCommons, List[ProductAttributeCommons])]](callContext))
|
||||
override def getProductCollectionItemsTree(collectionCode: String, bankId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[ProductCollectionItemsTree]]] = {
|
||||
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]("obp_get_product_collection_items_tree", req, callContext)
|
||||
response.map(convertToTuple[List[ProductCollectionItemsTree]](callContext))
|
||||
}
|
||||
|
||||
|
||||
messageDocs += createMeetingDoc
|
||||
def createMeetingDoc = MessageDoc(
|
||||
process = "obp.createMeeting",
|
||||
|
||||
@ -6,6 +6,7 @@ import code.api.util.APIUtil
|
||||
import code.api.util.migration.Migration
|
||||
import code.api.util.migration.Migration.DbFunction
|
||||
import code.bankconnectors.Connector
|
||||
import code.util.Helper.MdcLoggable
|
||||
import com.openbankproject.commons.model.TopicTrait
|
||||
import net.liftweb.common.{Box, Empty, Full}
|
||||
import net.liftweb.json.Serialization.write
|
||||
@ -18,7 +19,7 @@ import scalikejdbc.{DB => scalikeDB, _}
|
||||
* The reason of extract this util: if not call stored procedure connector method, the db connection of
|
||||
* stored procedure will not be initialized.
|
||||
*/
|
||||
object StoredProcedureUtils {
|
||||
object StoredProcedureUtils extends MdcLoggable{
|
||||
|
||||
private implicit val formats = code.api.util.CustomJsonFormats.nullTolerateFormats
|
||||
|
||||
@ -64,6 +65,7 @@ object StoredProcedureUtils {
|
||||
callableStatement.executeUpdate()
|
||||
callableStatement.getString(2)
|
||||
}
|
||||
logger.debug(s"${StoredProcedureConnector_vDec2019.toString} responseJson: $procedureName = $responseJson" )
|
||||
Connector.extractAdapterResponse[T](responseJson, Empty)
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ import com.openbankproject.commons.util.JsonAble
|
||||
import net.liftweb.common.Box
|
||||
import net.liftweb.json
|
||||
import net.liftweb.json.JsonDSL._
|
||||
import net.liftweb.json.JValue
|
||||
import net.liftweb.json.{Formats, JValue}
|
||||
import net.liftweb.json.JsonAST.{JArray, JBool, JField, JNull, JObject, JString}
|
||||
import net.liftweb.util.SimpleInjector
|
||||
|
||||
@ -49,7 +49,7 @@ case class MethodRoutingCommons(methodName: String,
|
||||
* when serialized to json, the Option filed will be not shown, this method just generate a full fields json, include all None value fields
|
||||
* @return JObject include all fields
|
||||
*/
|
||||
def toJson = {
|
||||
def toJson(implicit format: Formats) = {
|
||||
val paramsJson: List[JValue] = this.parameters.map(_.toJValue)
|
||||
|
||||
JObject(List(
|
||||
@ -68,7 +68,7 @@ object MethodRoutingCommons extends Converter[MethodRoutingT, MethodRoutingCommo
|
||||
case class MethodRoutingParam(key: String, value: String) extends JsonAble {
|
||||
def this(jObject: JObject) = this(MethodRoutingParam.extractKey(jObject),MethodRoutingParam.extractValue(jObject))
|
||||
|
||||
override def toJValue: JValue =
|
||||
override def toJValue(implicit format: Formats): JValue =
|
||||
("key" -> key) ~
|
||||
("value" -> {
|
||||
val trimmedValue = value.trim
|
||||
|
||||
@ -121,7 +121,7 @@ class AuthUser extends MegaProtoUser[AuthUser] with MdcLoggable {
|
||||
override def displayName = S.?("Username")
|
||||
override def dbIndexed_? = true
|
||||
override def validations = isEmpty(Helper.i18n("Please.enter.your.username")) _ ::
|
||||
valUnique(S.?("unique.username")) _ ::
|
||||
valUnique(Helper.i18n("unique.username")) _ ::
|
||||
super.validations
|
||||
override val fieldId = Some(Text("txtUsername"))
|
||||
}
|
||||
|
||||
@ -205,6 +205,11 @@ class WebUI extends MdcLoggable{
|
||||
"#sandbox-introduction-link [href]" #> scala.xml.Unparsed(getWebUiPropsValue("webui_api_documentation_url",s"${getServerUrl}/introduction"))
|
||||
}
|
||||
|
||||
def technicalFaqsAnchor: CssSel = {
|
||||
"#technical-faqs-anchor [href]" #> scala.xml.Unparsed(s"${getServerUrl}#technical-faqs")
|
||||
}
|
||||
|
||||
|
||||
def apiDocumentation: CssSel = {
|
||||
val title = "Sandbox Introduction"
|
||||
val propsValue = getWebUiPropsValue("webui_sandbox_introduction", "")
|
||||
|
||||
@ -33,48 +33,57 @@ Berlin 13359, Germany
|
||||
<div id="register-consumer-input">
|
||||
<div id="register-consumer-explanation">Please complete the information about your application below, so we can create your OAuth consumer key and secret.</div>
|
||||
|
||||
<div id="register-consumer-errors" class="alert alert-danger">
|
||||
<div class="error">
|
||||
<span class="errorContent"></span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div id="register-consumer-errors" class="alert alert-danger">-->
|
||||
<!-- <div class="error">-->
|
||||
<!-- <span class="errorContent"></span>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<form method="post">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="form-group">
|
||||
<label for="appType">Application Type</label>
|
||||
<label for="appType">Application type</label>
|
||||
<select name="app-type" id="appType" class="form-control">
|
||||
<option class="app-type-option"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="appName">Application Name</label>
|
||||
<label for="appName">Application name</label>
|
||||
<input type="text" name="app-name" id="appName" class="form-control">
|
||||
<div id = "consumer-registration-app-name-error-div" class="hide alert alert-danger">
|
||||
<span data-lift="Msg?id=consumer-registration-app-name-error"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="appRedirectUrl">Redirect URL</label>
|
||||
<label for="appRedirectUrl">Redirect URL (Optional)</label>
|
||||
<input type="text" name="app-redirect-url" id="appRedirectUrl" class="form-control">
|
||||
<div id = "consumer-registration-app-redirect-url-error-div" class="hide">
|
||||
<span data-lift="Msg?id=consumer-registration-app-redirect-url-error"/>
|
||||
</div>
|
||||
</div>
|
||||
<!--Note for the commented div : 719aa7fd 04/10/15 Stefan. Hongwei just reformatted the code -->
|
||||
<!--<div class="form-group">-->
|
||||
<!--<label for="appUserAuthenticationUrl">Authentication URL</label>-->
|
||||
<!--<input type="text" name="app-user-authentication-url" id="appUserAuthenticationUrl" class="form-control" >-->
|
||||
<!--<img src="/media/images/moreInfo.png" title="The user will redirected to that URL during the authentication phase to authenticate. Leave it blank so that the user will see the default login page." alt="more info" class="more-info-icon"/>-->
|
||||
<!--</div>-->
|
||||
<div class="form-group">
|
||||
<label for="appDev">Developer Email</label>
|
||||
<label for="appDev">Developer email</label>
|
||||
<input type="text" name="app-developer" id="appDev" class="form-control">
|
||||
<div id = "consumer-registration-app-developer-error-div" class="hide alert alert-danger">
|
||||
<span data-lift="Msg?id=consumer-registration-app-developer-error"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="form-group">
|
||||
<label for="appDesc">Description of the application</label>
|
||||
<textarea rows="4" name="app-description" id="appDesc" class="form-control"></textarea>
|
||||
<div id = "consumer-registration-app-description-error-div" class="hide alert alert-danger">
|
||||
<span data-lift="Msg?id=consumer-registration-app-description-error"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="submit" value="Register consumer" class="btn btn-default" />
|
||||
<div id = "register-consumer-errors-div" class="hide alert alert-danger">
|
||||
<span data-lift="Msg?id=register-consumer-errors"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
@ -573,8 +573,6 @@ footer #copyright {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* from oauth/authorize.html */
|
||||
#verifier {
|
||||
margin-top: 30px;
|
||||
@ -588,3 +586,8 @@ footer #copyright {
|
||||
word-break: break-all;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
.error-border{
|
||||
border: 1px solid #A8000B;
|
||||
background:#F9F2F3
|
||||
}
|
||||
|
||||
@ -27,20 +27,19 @@ $(document).ready(function() {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Enforce check of Terms and Conditions (if existing) on signup form
|
||||
$('#signup form').submit(function() {
|
||||
var agreeTerms = $('#signup #signup-agree-terms input');
|
||||
if (agreeTerms.length > 0) {
|
||||
if (!agreeTerms.prop('checked')) {
|
||||
var msg = 'Please agree to the Terms & Conditions';
|
||||
$('#signup #signup-error #error').html(msg);
|
||||
$('#signup #signup-error').removeClass('hide');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
});
|
||||
// $('#signup form').submit(function() {
|
||||
// var agreeTerms = $('#signup #signup-agree-terms input');
|
||||
// if (agreeTerms.length > 0) {
|
||||
// if (!agreeTerms.prop('checked')) {
|
||||
// var msg = 'Please agree to the Terms & Conditions';
|
||||
// $('#signup #signup-error #error').html(msg);
|
||||
// $('#signup #signup-error').removeClass('hide');
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// return true;
|
||||
// });
|
||||
|
||||
// Enforce check of Privacy Policy (if existing) on signup form
|
||||
$('#signup form').submit(function() {
|
||||
@ -57,8 +56,101 @@ $(document).ready(function() {
|
||||
});
|
||||
|
||||
// Show sign up errors - FIXME: Change backend to (not) show errors
|
||||
var signupError = $('#signup #signup-error #error');
|
||||
var signupErrorFirstname = $('#signup #signup-error #authuser_firstName');
|
||||
var txtFirstName = $('#signup #txtFirstName');
|
||||
if (signupErrorFirstname.length > 0 && signupErrorFirstname.html().length > 0) {
|
||||
signupErrorFirstname.parent().removeClass('hide');
|
||||
txtFirstName.addClass("error-border")
|
||||
}
|
||||
var signupErrorLastname = $('#signup #signup-error #authuser_lastName');
|
||||
var txtLastName = $('#signup #txtLastName');
|
||||
if (signupErrorLastname.length > 0 && signupErrorLastname.html().length > 0) {
|
||||
signupErrorLastname.parent().removeClass('hide');
|
||||
txtLastName.addClass("error-border")
|
||||
}
|
||||
var signupError = $('#signup #signup-error #authuser_email');
|
||||
var txtEmail = $('#signup #txtEmail');
|
||||
if (signupError.length > 0 && signupError.html().length > 0) {
|
||||
signupError.parent().removeClass('hide');
|
||||
txtEmail.addClass("error-border")
|
||||
}
|
||||
var signupErrorAuthuserName = $('#signup #signup-error #authuser_username');
|
||||
var txtUsername = $('#signup #txtUsername');
|
||||
if (signupErrorAuthuserName.length > 0 && signupErrorAuthuserName.html().length > 0) {
|
||||
signupErrorAuthuserName.parent().removeClass('hide');
|
||||
txtUsername.addClass("error-border")
|
||||
}
|
||||
var signupErrorPassword = $('#signup #signup-error #authuser_password');
|
||||
var signupErrorRepeat = $('#signup #signup-error #authuser_password_repeat');
|
||||
var textPassword = $('#signup #textPassword');
|
||||
var textPasswordRepeat = $('#signup #textPasswordRepeat');
|
||||
if (signupErrorPassword.length > 0 && signupErrorPassword.html().length > 0) {
|
||||
signupErrorPassword.parent().removeClass('hide');
|
||||
signupErrorRepeat.parent().removeClass('hide');
|
||||
textPassword.addClass("error-border")
|
||||
textPasswordRepeat.addClass("error-border")
|
||||
}
|
||||
|
||||
var loginUsernameError = $('#authorise #login-form-username-error');
|
||||
var loginUsernameForm = $('#authorise #username');
|
||||
if (loginUsernameError.length > 0 && loginUsernameError.html().length > 0) {
|
||||
loginUsernameError.parent().removeClass('hide');
|
||||
loginUsernameForm.addClass("error-border")
|
||||
} else{
|
||||
loginUsernameError.parent().addClass('hide');
|
||||
loginUsernameForm.css("border","").css("background","")
|
||||
}
|
||||
|
||||
var loginPasswordError = $('#authorise #login-form-password-error');
|
||||
var loginPasswordForm = $('#authorise #password');
|
||||
if (loginPasswordError.length > 0 && loginPasswordError.html().length > 0) {
|
||||
loginPasswordError.parent().removeClass('hide');
|
||||
loginPasswordForm.addClass("error-border")
|
||||
}else{
|
||||
loginPasswordError.parent().addClass('hide');
|
||||
loginPasswordForm.css("border","").css("background","")
|
||||
}
|
||||
|
||||
var consumerRegistrationAppnameError = $('#register-consumer-input #consumer-registration-app-name-error');
|
||||
var consumerRegistrationAppnameForm = $('#register-consumer-input #appName');
|
||||
if (consumerRegistrationAppnameError.length > 0 && consumerRegistrationAppnameError.html().length > 0) {
|
||||
consumerRegistrationAppnameError.parent().removeClass('hide');
|
||||
consumerRegistrationAppnameForm.addClass("error-border")
|
||||
}else{
|
||||
consumerRegistrationAppnameError.parent().addClass('hide');
|
||||
}
|
||||
|
||||
var consumerRegistrationAppDeveloperError = $('#register-consumer-input #consumer-registration-app-developer-error');
|
||||
var consumerRegistrationAppDeveloperForm = $('#register-consumer-input #appDev');
|
||||
if (consumerRegistrationAppDeveloperError.length > 0 && consumerRegistrationAppDeveloperError.html().length > 0) {
|
||||
consumerRegistrationAppDeveloperError.parent().removeClass('hide');
|
||||
consumerRegistrationAppDeveloperForm.addClass("error-border")
|
||||
}else{
|
||||
consumerRegistrationAppDeveloperError.parent().addClass('hide');
|
||||
}
|
||||
|
||||
var consumerRegistrationAppDescError = $('#register-consumer-input #consumer-registration-app-description-error');
|
||||
var consumerRegistrationAppDescForm = $('#register-consumer-input #appDesc');
|
||||
if (consumerRegistrationAppDescError.length > 0 && consumerRegistrationAppDescError.html().length > 0) {
|
||||
consumerRegistrationAppDescError.parent().removeClass('hide');
|
||||
consumerRegistrationAppDescForm.addClass("error-border")
|
||||
}else{
|
||||
consumerRegistrationAppDescError.parent().addClass('hide');
|
||||
}
|
||||
|
||||
var consumerRegistrationAppRedirectUrlError = $('#register-consumer-input #consumer-registration-app-description-error');
|
||||
var consumerRegistrationAppRedirectUrlForm = $('#register-consumer-input #appDesc');
|
||||
if (consumerRegistrationAppRedirectUrlError.length > 0 && consumerRegistrationAppRedirectUrlError.html().length > 0) {
|
||||
consumerRegistrationAppRedirectUrlError.parent().removeClass('hide');
|
||||
consumerRegistrationAppRedirectUrlForm.addClass("error-border")
|
||||
}else{
|
||||
consumerRegistrationAppRedirectUrlError.parent().addClass('hide');
|
||||
}
|
||||
|
||||
var registerConsumerError = $('#register-consumer-input #register-consumer-errors');
|
||||
if (registerConsumerError.length > 0 && registerConsumerError.html().length > 0) {
|
||||
registerConsumerError.parent().removeClass('hide');
|
||||
}else{
|
||||
registerConsumerError.parent().addClass('hide');
|
||||
}
|
||||
});
|
||||
|
||||
Binary file not shown.
@ -7,7 +7,7 @@
|
||||
<groupId>com.tesobe</groupId>
|
||||
<artifactId>obp-parent</artifactId>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
<version>1.5.0</version>
|
||||
<version>1.5.1</version>
|
||||
</parent>
|
||||
<artifactId>obp-commons</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
@ -417,7 +417,11 @@ case class InBoundGetProductCollectionItem(inboundAdapterCallContext: InboundAda
|
||||
case class OutBoundGetProductCollectionItemsTree(outboundAdapterCallContext: OutboundAdapterCallContext,
|
||||
collectionCode: String,
|
||||
bankId: String) extends TopicTrait
|
||||
case class InBoundGetProductCollectionItemsTree(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[(ProductCollectionItemCommons, ProductCommons, List[ProductAttributeCommons])])extends InBoundTrait[List[(ProductCollectionItemCommons, ProductCommons, List[ProductAttributeCommons])]]
|
||||
|
||||
case class ProductCollectionItemsTree(productCollectionItem: ProductCollectionItemCommons, product: ProductCommons, attributes: List[ProductAttributeCommons])
|
||||
|
||||
case class InBoundGetProductCollectionItemsTree(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[ProductCollectionItemsTree])
|
||||
extends InBoundTrait[List[ProductCollectionItemsTree]]
|
||||
|
||||
|
||||
case class OutBoundCreateMeeting(outboundAdapterCallContext: OutboundAdapterCallContext,
|
||||
|
||||
@ -29,8 +29,9 @@ package com.openbankproject.commons.model
|
||||
import java.util.Date
|
||||
|
||||
import com.openbankproject.commons.model.enums._
|
||||
import com.openbankproject.commons.util.ReflectUtils
|
||||
import net.liftweb.json.{JInt, JString}
|
||||
import com.openbankproject.commons.util.{JsonAble, ReflectUtils}
|
||||
import net.liftweb.json
|
||||
import net.liftweb.json.{Formats, JInt, JString}
|
||||
import net.liftweb.json.JsonAST.{JObject, JValue}
|
||||
|
||||
import scala.collection.immutable.List
|
||||
@ -706,7 +707,25 @@ case class TransactionCommons(
|
||||
override val startDate : Date,
|
||||
override val finishDate : Date,
|
||||
override val balance : BigDecimal
|
||||
) extends Transaction(uuid, id, thisAccount, otherAccount, transactionType, amount, currency,description, startDate, finishDate, balance)
|
||||
) extends Transaction(uuid, id, thisAccount, otherAccount, transactionType, amount, currency,description, startDate, finishDate, balance) with JsonAble {
|
||||
// if constructor override val value pass to parent class constructor, lift json will not work to do serialize, so here manually do serialize.
|
||||
override def toJValue(implicit format: Formats): json.JValue = {
|
||||
val map = Map(
|
||||
"uuid" -> uuid,
|
||||
"id" -> id,
|
||||
"thisAccount" -> thisAccount,
|
||||
"otherAccount" -> otherAccount,
|
||||
"transactionType" -> transactionType,
|
||||
"amount" -> amount,
|
||||
"currency" -> currency,
|
||||
"description" -> description,
|
||||
"startDate" -> startDate,
|
||||
"finishDate" -> finishDate,
|
||||
"balance" -> balance,
|
||||
)
|
||||
json.Extraction.decompose(map)
|
||||
}
|
||||
}
|
||||
|
||||
case class InternalBasicUser(
|
||||
userId:String,
|
||||
|
||||
@ -3,10 +3,10 @@ package com.openbankproject.commons.util
|
||||
import net.liftweb.json._
|
||||
|
||||
trait JsonAble {
|
||||
def toJValue: JValue
|
||||
def toJValue(implicit format: Formats): JValue
|
||||
}
|
||||
object JsonAble {
|
||||
def unapply(jsonAble: JsonAble): Option[JValue] = Option(jsonAble).map(_.toJValue)
|
||||
def unapply(jsonAble: JsonAble)(implicit format: Formats): Option[JValue] = Option(jsonAble).map(_.toJValue)
|
||||
}
|
||||
|
||||
object JsonAbleSerializer extends Serializer[JsonAble] {
|
||||
|
||||
@ -51,7 +51,7 @@ sealed class RequiredFields
|
||||
object FieldNameApiVersions extends RequiredFields with JsonAble {
|
||||
val `data.bankId`: List[String] = List(ApiVersion.v2_2_0.toString, ApiVersion.v3_1_0.toString)
|
||||
|
||||
override def toJValue: JObject = "data.bankId" -> JArray(this.`data.bankId`.map(JString(_)))
|
||||
override def toJValue(implicit format: Formats): JObject = "data.bankId" -> JArray(this.`data.bankId`.map(JString(_)))
|
||||
}
|
||||
|
||||
/**
|
||||
@ -60,7 +60,7 @@ object FieldNameApiVersions extends RequiredFields with JsonAble {
|
||||
*/
|
||||
case class RequiredInfo(requiredArgs: Seq[RequiredArgs]) extends RequiredFields with JsonAble {
|
||||
|
||||
override def toJValue: JObject = {
|
||||
override def toJValue(implicit format: Formats): JObject = {
|
||||
val jFields = requiredArgs
|
||||
.toList
|
||||
.map(info => JField(
|
||||
@ -238,7 +238,9 @@ case class RequiredArgs(fieldPath:String, include: Array[ApiVersion],
|
||||
case RequiredArgs(path, inc, exc) => Objects.equals(fieldPath, path) && include.sameElements(inc) && exclude.sameElements(exc)
|
||||
case _ => false
|
||||
}
|
||||
override val toJValue: JArray = (include, exclude) match {
|
||||
override def toJValue(implicit format: Formats): JArray = toJson
|
||||
|
||||
private val toJson: JArray = (include, exclude) match {
|
||||
case (_, Array()) =>
|
||||
val includeList = include.toList.map(_.toString).map(JString(_))
|
||||
JArray(includeList)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user