refactor/Change queryTags => attributes

This commit is contained in:
Marko Milić 2020-08-14 17:46:21 +02:00
parent e73b7cfa02
commit aa47cbac14
9 changed files with 243 additions and 167 deletions

View File

@ -8,7 +8,7 @@
<groupId>com.tesobe</groupId>
<artifactId>obp-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.7.0</version>
<version>1.7.1</version>
</parent>
<artifactId>obp-api</artifactId>
<packaging>war</packaging>

View File

@ -15,6 +15,7 @@ import com.openbankproject.commons.model.{BankAccount, TransactionRequest, User}
import net.liftweb.common.Full
import net.liftweb.json.JValue
import scala.collection.immutable
import scala.collection.immutable.List
case class JvalueCaseClass(jvalueToCaseclass: JValue)
@ -293,7 +294,7 @@ object JSONFactory_BERLIN_GROUP_1_3 extends CustomJsonFormats {
}
def createCardAccountListJson(bankAccounts: List[BankAccount], user: User): CoreCardAccountsJsonV13 = {
CoreCardAccountsJsonV13(bankAccounts.filter(_.queryTags.getOrElse(List("")).contains("Card")).map {
CoreCardAccountsJsonV13(bankAccounts.filter(_.attributes.map(_.map(_.name)) == "CashAccountType").map {
x =>
val (iBan: String, bBan: String) = getIbanAndBban(x)

View File

@ -327,6 +327,15 @@ object ExampleValue {
lazy val cbsErrorCodeExample = ConnectorField("500-OFFLINE", "An error code returned by the CBS")
lazy val attributeNameExample = ConnectorField("STATUS", s"Transaction attribute name")
glossaryItems += makeGlossaryItem("Transaction.attributeName", attributeNameExample)
lazy val attributeTypeExample = ConnectorField("STRING", s"Transaction attribute type.")
glossaryItems += makeGlossaryItem("Transaction.attributeType", attributeTypeExample)
lazy val attributeValueExample = ConnectorField("closed", s"Transaction attribute value.")
glossaryItems += makeGlossaryItem("Transaction.attributeValue", attributeValueExample)
//------------------------------------------------------------
// TODO @Simon please fix the follow example values to reasonable values
lazy val dateOfBirthExample = ConnectorField("2018-03-09", "customer birthday")

View File

@ -7,7 +7,7 @@
<groupId>com.tesobe</groupId>
<artifactId>obp-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.7.0</version>
<version>1.7.1</version>
</parent>
<artifactId>obp-commons</artifactId>
<packaging>jar</packaging>

View File

@ -200,7 +200,7 @@ trait BankAccount{
//Because of in OBP side, we just have one account table, no difference for different types of accounts.
//So here, we introduce the field for the OBP presentation layer to filter the accounts.
//also @`Reads a list of card accounts` in Berlin group V1.3 ..
def queryTags : Option[List[String]] = None
def attributes : Option[List[Attribute]] = None
}
//This class is used for propagate the BankAccount as the parameters over different methods.
@ -294,6 +294,11 @@ case class Iban(
iban: String
)
case class Attribute(
name: String,
`type`: String,
value: String
)
case class AccountRule(
scheme: String,
value: String

View File

@ -129,7 +129,7 @@ case class BankAccountCommons(
accountRules :List[AccountRule],
@optional
accountHolder :String,
override val queryTags : Option[List[String]] = None) extends BankAccount
override val attributes : Option[List[Attribute]] = None) extends BankAccount
object BankAccountCommons extends Converter[BankAccount, BankAccountCommons]

View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.tesobe</groupId>
<artifactId>obp-parent</artifactId>
<version>1.7.0</version>
<version>1.7.1</version>
<packaging>pom</packaging>
<name>Open Bank Project API Parent</name>
<inceptionYear>2011</inceptionYear>