From cdf1d50e7aed2cc60f9a4499f5c0aa406f04612c Mon Sep 17 00:00:00 2001 From: hongwei Date: Tue, 3 Jun 2025 15:02:34 +0200 Subject: [PATCH] refactor/update routing scheme and address examples in banking model and JSON factory --- .../berlin/group/v1_3/JSONFactory_BERLIN_GROUP_1_3.scala | 2 +- obp-api/src/main/scala/code/api/util/ExampleValue.scala | 8 ++++---- .../com/openbankproject/commons/model/BankingModel.scala | 6 +----- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/obp-api/src/main/scala/code/api/berlin/group/v1_3/JSONFactory_BERLIN_GROUP_1_3.scala b/obp-api/src/main/scala/code/api/berlin/group/v1_3/JSONFactory_BERLIN_GROUP_1_3.scala index edc24e7ca..b493fd10a 100644 --- a/obp-api/src/main/scala/code/api/berlin/group/v1_3/JSONFactory_BERLIN_GROUP_1_3.scala +++ b/obp-api/src/main/scala/code/api/berlin/group/v1_3/JSONFactory_BERLIN_GROUP_1_3.scala @@ -462,7 +462,7 @@ object JSONFactory_BERLIN_GROUP_1_3 extends CustomJsonFormats with MdcLoggable{ def createTransactionJSON(bankAccount: BankAccount, transaction : ModeratedTransaction) : TransactionJsonV13 = { val bookingDate = transaction.startDate.orNull val valueDate = transaction.finishDate.orNull - val creditorName = bankAccount.label + val creditorName = transaction.otherBankAccount.map(_.label.display).getOrElse(null) TransactionJsonV13( transactionId = transaction.id.value, creditorName = creditorName, 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 4f434cbc3..ea20307d9 100644 --- a/obp-api/src/main/scala/code/api/util/ExampleValue.scala +++ b/obp-api/src/main/scala/code/api/util/ExampleValue.scala @@ -1460,7 +1460,7 @@ object ExampleValue { lazy val distributionChannelExample = ConnectorField(NoExampleProvided,NoDescriptionProvided) glossaryItems += makeGlossaryItem("distribution_channel", distributionChannelExample) - lazy val otherAccountRoutingSchemeExample = ConnectorField(NoExampleProvided,NoDescriptionProvided) + lazy val otherAccountRoutingSchemeExample = ConnectorField("IBAN","otherAccountRoutingScheme string, eg: IBAN") glossaryItems += makeGlossaryItem("other_account_routing_scheme", otherAccountRoutingSchemeExample) lazy val generateAccountantsViewExample = ConnectorField(NoExampleProvided,NoDescriptionProvided) @@ -1714,7 +1714,7 @@ object ExampleValue { lazy val canAddTransactionRequestToOwnAccountExample = ConnectorField(booleanFalse,NoDescriptionProvided) glossaryItems += makeGlossaryItem("can_add_transaction_request_to_own_account", canAddTransactionRequestToOwnAccountExample) - lazy val otherAccountRoutingAddressExample = ConnectorField(NoExampleProvided,NoDescriptionProvided) + lazy val otherAccountRoutingAddressExample = ConnectorField("DE89370400440532013000","OtherBankRoutingAddress string, eg IBAN value") glossaryItems += makeGlossaryItem("other_account_routing_address", otherAccountRoutingAddressExample) lazy val isFirehoseExample = ConnectorField(NoExampleProvided,NoDescriptionProvided) @@ -2472,8 +2472,8 @@ object ExampleValue { // if these are duplicate with those examples, just delete the follow examples lazy val counterpartyOtherBankRoutingSchemeExample = ConnectorField("OBP" ,"Counterparty otherBankRoutingScheme string") lazy val counterpartyOtherBankRoutingAddressExample = ConnectorField("gh.29.uk", "Counterparty otherBankRoutingAddress string") - lazy val counterpartyOtherAccountRoutingSchemeExample = ConnectorField("OBP", "Counterparty otherAccountRoutingScheme string") - lazy val counterpartyOtherAccountRoutingAddressExample = ConnectorField("36f8a9e6-c2b1-407a-8bd0-421b7119307e", "Counterparty otherAccountRoutingAddress string") + lazy val counterpartyOtherAccountRoutingSchemeExample = ConnectorField("IBAN", "Counterparty otherAccountRoutingScheme string") + lazy val counterpartyOtherAccountRoutingAddressExample = ConnectorField("DE89370400440532013000", "Counterparty otherAccountRoutingAddress string") lazy val counterpartyOtherAccountSecondaryRoutingSchemeExample = ConnectorField("IBAN", "Counterparty otherAccountSecondaryRoutingScheme string") lazy val counterpartyOtherAccountSecondaryRoutingAddressExample = ConnectorField("DE89370400440532013000", "Counterparty otherAccountSecondaryRoutingAddress string") lazy val counterpartyOtherAccountProviderExample = ConnectorField("Counterparty otherAccountProvider string", "fix me") diff --git a/obp-commons/src/main/scala/com/openbankproject/commons/model/BankingModel.scala b/obp-commons/src/main/scala/com/openbankproject/commons/model/BankingModel.scala index caf5613a1..b70a46296 100644 --- a/obp-commons/src/main/scala/com/openbankproject/commons/model/BankingModel.scala +++ b/obp-commons/src/main/scala/com/openbankproject/commons/model/BankingModel.scala @@ -26,13 +26,11 @@ TESOBE (http://www.tesobe.com/) */ package com.openbankproject.commons.model -import java.util.Date import com.openbankproject.commons.util.{OBPRequired, optional} import java.security.AccessControlContext +import java.util.Date import javax.security.auth.AuthPermission -import scala.collection.immutable.List -import scala.math.BigDecimal trait Bank { @@ -289,9 +287,7 @@ case class Counterparty( val otherBankRoutingScheme: String, // This is the scheme a consumer would use to specify the bank e.g. BIC @optional val otherBankRoutingAddress: Option[String], // The (BIC) value e.g. 67895 - @optional val otherAccountRoutingScheme: String, // This is the scheme a consumer would use to instruct a payment e.g. IBAN - @optional val otherAccountRoutingAddress: Option[String], // The (IBAN) value e.g. 2349870987820374 @optional val otherAccountProvider: String, // hasBankId and hasAccountId would refer to an OBP account