From f9326cfd69aa084f7c1234b8d52f621cd8a8b1f8 Mon Sep 17 00:00:00 2001 From: hongwei Date: Wed, 26 Oct 2022 16:25:09 +0200 Subject: [PATCH] docfix/added the missing fields doc for createPhysicalCardJsonV310 --- .../api/ResourceDocs1_4_0/SwaggerDefinitionsJSON.scala | 9 +++++---- .../src/main/scala/code/api/util/ExampleValue.scala | 10 +++++----- 2 files changed, 10 insertions(+), 9 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 0ef7f817b..19379b4ec 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 @@ -3888,7 +3888,7 @@ object SwaggerDefinitionsJSON { account_routings = List(AccountRoutingJsonV121(accountRoutingSchemeExample.value, accountRoutingAddressExample.value)) ) val createPhysicalCardJsonV310 = CreatePhysicalCardJsonV310( - card_number = bankCardNumberExample.value, + card_number = cardNumberExample.value, card_type = cardTypeExample.value, name_on_card = nameOnCardExample.value, issue_number = issueNumberExample.value, @@ -3896,9 +3896,10 @@ object SwaggerDefinitionsJSON { valid_from_date = DateWithDayExampleObject, expires_date = DateWithDayExampleObject, enabled = true, - technology = "technology1", - networks = List("network1", "network2"), - allows = List(CardAction.CREDIT.toString.toLowerCase, CardAction.DEBIT.toString.toLowerCase), + technology = technologyExample.value, + networks = List(networksExample.value), + allows = allowsExample.value.replaceAll(""""""","").replace("""[""","") + .replace("""]""","").split(",").toList, account_id =accountIdExample.value, replacement = Some(replacementJSON), pin_reset = List(pinResetJSON, pinResetJSON1), diff --git a/obp-api/src/main/scala/code/api/util/ExampleValue.scala b/obp-api/src/main/scala/code/api/util/ExampleValue.scala index ac5569044..0a493d047 100644 --- a/obp-api/src/main/scala/code/api/util/ExampleValue.scala +++ b/obp-api/src/main/scala/code/api/util/ExampleValue.scala @@ -7,6 +7,7 @@ import net.liftweb.json.JsonDSL._ import code.api.util.Glossary.{glossaryItems, makeGlossaryItem} import code.apicollection.ApiCollection import code.dynamicEntity.{DynamicEntityDefinition, DynamicEntityFooBar, DynamicEntityFullBarFields, DynamicEntityIntTypeExample, DynamicEntityStringTypeExample} +import com.openbankproject.commons.model.CardAction import com.openbankproject.commons.model.enums.{CustomerAttributeType, DynamicEntityFieldType} import com.openbankproject.commons.util.ReflectUtils import net.liftweb.json @@ -1518,6 +1519,9 @@ object ExampleValue { lazy val networksExample = ConnectorField(NoExampleProvided,NoDescriptionProvided) glossaryItems += makeGlossaryItem("networks", networksExample) + + lazy val allowsExample = ConnectorField(List(CardAction.CREDIT.toString.toLowerCase,CardAction.DEBIT.toString.toLowerCase,CardAction.CASH_WITHDRAWAL.toString.toLowerCase).toString(), "The actions of the card.") + glossaryItems += makeGlossaryItem("allows", allowsExample) lazy val `data.bankIdExample` = ConnectorField(NoExampleProvided,NoDescriptionProvided) glossaryItems += makeGlossaryItem("data.bankid", `data.bankIdExample` ) @@ -1714,8 +1718,7 @@ object ExampleValue { lazy val meetingsExample = ConnectorField(NoExampleProvided,NoDescriptionProvided) glossaryItems += makeGlossaryItem("meetings", meetingsExample) - lazy val cardNumberExample = ConnectorField(NoExampleProvided,NoDescriptionProvided) - glossaryItems += makeGlossaryItem("card_number", cardNumberExample) + lazy val cardNumberExample = bankCardNumberExample lazy val instructedamountExample = ConnectorField("100",NoDescriptionProvided) glossaryItems += makeGlossaryItem("instructedamount", instructedamountExample) @@ -2065,9 +2068,6 @@ object ExampleValue { lazy val revokedExample = ConnectorField(NoExampleProvided,NoDescriptionProvided) glossaryItems += makeGlossaryItem("revoked", revokedExample) - lazy val allowsExample = ConnectorField(NoExampleProvided,NoDescriptionProvided) - glossaryItems += makeGlossaryItem("allows", allowsExample) - lazy val currentCreditDocumentationExample = ConnectorField(NoExampleProvided,NoDescriptionProvided) glossaryItems += makeGlossaryItem("current_credit_documentation", currentCreditDocumentationExample)