From a0a3f7dbd6be87e0d193d8fdf3d1d0636e606f48 Mon Sep 17 00:00:00 2001 From: Hongwei Date: Fri, 12 Jul 2024 14:40:49 +0200 Subject: [PATCH] refactor/tweaked the resource docs --- .../SwaggerDefinitionsJSON.scala | 45 ++++++++++--------- .../scala/code/api/v5_1_0/APIMethods510.scala | 2 +- .../MappedCounterpartyLimit.scala | 4 +- 3 files changed, 25 insertions(+), 26 deletions(-) diff --git a/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerDefinitionsJSON.scala b/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerDefinitionsJSON.scala index 11242f92b3..894194da38 100644 --- a/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerDefinitionsJSON.scala +++ b/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerDefinitionsJSON.scala @@ -5232,28 +5232,6 @@ object SwaggerDefinitionsJSON { valid_from = Some(new Date()), time_to_live = Some(3600) ) - - val consentRequestFromAccountJson = ConsentRequestFromAccountJson ( - bank_routing = bankRoutingJsonV121, - account_routing = accountRoutingJsonV121, - branch_routing = branchRoutingJsonV141 - ) - - val consentRequestToAccountJson = ConsentRequestToAccountJson ( - bank_routing = bankRoutingJsonV121, - account_routing = accountRoutingJsonV121, - branch_routing = branchRoutingJsonV141, - limit = postCounterpartyLimitV510 - ) - - val postConsentRequestJsonV510 = PostConsentRequestJsonV510( - from_account = consentRequestFromAccountJson, - to_account = consentRequestToAccountJson, - email = Some(emailExample.value), - phone_number = Some(mobileNumberExample.value), - valid_from = Some(new Date()), - time_to_live = Some(3600) - ) val createPhysicalCardJsonV500 = CreatePhysicalCardJsonV500( card_number = bankCardNumberExample.value, @@ -5483,6 +5461,29 @@ object SwaggerDefinitionsJSON { ) val postAccountAccessJsonV510 = PostAccountAccessJsonV510(userIdExample.value,viewIdExample.value) + + val consentRequestFromAccountJson = ConsentRequestFromAccountJson ( + bank_routing = bankRoutingJsonV121, + account_routing = accountRoutingJsonV121, + branch_routing = branchRoutingJsonV141 + ) + + val consentRequestToAccountJson = ConsentRequestToAccountJson ( + bank_routing = bankRoutingJsonV121, + account_routing = accountRoutingJsonV121, + branch_routing = branchRoutingJsonV141, + limit = postCounterpartyLimitV510 + ) + + val postConsentRequestJsonV510 = PostConsentRequestJsonV510( + from_account = consentRequestFromAccountJson, + to_account = consentRequestToAccountJson, + email = Some(emailExample.value), + phone_number = Some(mobileNumberExample.value), + valid_from = Some(new Date()), + time_to_live = Some(3600) + ) + //The common error or success format. //Just some helper format to use in Json diff --git a/obp-api/src/main/scala/code/api/v5_1_0/APIMethods510.scala b/obp-api/src/main/scala/code/api/v5_1_0/APIMethods510.scala index eb7034597d..14ca628f5c 100644 --- a/obp-api/src/main/scala/code/api/v5_1_0/APIMethods510.scala +++ b/obp-api/src/main/scala/code/api/v5_1_0/APIMethods510.scala @@ -2730,7 +2730,7 @@ trait APIMethods510 { nameOf(createVRPConsentRequest), "POST", "/consumer/vrp-consent-requests", - "Create VRP Consent Request", + "Create Consent Request VRP", s""" |Client Authentication (mandatory) | diff --git a/obp-api/src/main/scala/code/counterpartylimit/MappedCounterpartyLimit.scala b/obp-api/src/main/scala/code/counterpartylimit/MappedCounterpartyLimit.scala index 5552f99bbd..d681075f3d 100644 --- a/obp-api/src/main/scala/code/counterpartylimit/MappedCounterpartyLimit.scala +++ b/obp-api/src/main/scala/code/counterpartylimit/MappedCounterpartyLimit.scala @@ -102,9 +102,7 @@ class CounterpartyLimit extends CounterpartyLimitTrait with LongKeyedMapper[Coun override def dbNotNull_? = true } - object Currency extends MappedString(this, 255){ - override def dbNotNull_? = true - } + object Currency extends MappedString(this, 255) object MaxSingleAmount extends MappedInt(this) { override def defaultValue = -1