mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 16:16:47 +00:00
refactor/generate more commons classes
This commit is contained in:
parent
01a48d8faa
commit
856b9ee7c4
@ -33,7 +33,7 @@ import code.model._
|
||||
import code.apicollectionendpoint.{ApiCollectionEndpointTrait, MappedApiCollectionEndpointsProvider}
|
||||
import code.apicollection.{ApiCollectionTrait, MappedApiCollectionsProvider}
|
||||
import code.model.dataAccess.{AuthUser, BankAccountRouting}
|
||||
import code.standingorders.StandingOrderTrait
|
||||
import com.openbankproject.commons.model.StandingOrderTrait
|
||||
import code.usercustomerlinks.UserCustomerLink
|
||||
import code.users.{UserAgreement, UserAgreementProvider, UserAttribute, UserInvitation, UserInvitationProvider, Users}
|
||||
import code.util.Helper
|
||||
@ -73,14 +73,15 @@ import code.api.dynamic.entity.helper.{DynamicEntityHelper, DynamicEntityInfo}
|
||||
import code.atmattribute.AtmAttribute
|
||||
import code.bankattribute.BankAttribute
|
||||
import code.connectormethod.{ConnectorMethodProvider, JsonConnectorMethod}
|
||||
import code.counterpartylimit.{CounterpartyLimit, CounterpartyLimitTrait}
|
||||
import code.counterpartylimit.{CounterpartyLimit}
|
||||
import com.openbankproject.commons.model.CounterpartyLimitTrait
|
||||
import code.crm.CrmEvent
|
||||
import code.crm.CrmEvent.CrmEvent
|
||||
import code.customeraccountlinks.CustomerAccountLinkTrait
|
||||
import com.openbankproject.commons.model.CustomerAccountLinkTrait
|
||||
import code.dynamicMessageDoc.{DynamicMessageDocProvider, JsonDynamicMessageDoc}
|
||||
import code.dynamicResourceDoc.{DynamicResourceDocProvider, JsonDynamicResourceDoc}
|
||||
import code.endpointMapping.{EndpointMappingProvider, EndpointMappingT}
|
||||
import code.endpointTag.EndpointTagT
|
||||
import com.openbankproject.commons.model.EndpointTagT
|
||||
import code.util.Helper.MdcLoggable
|
||||
import code.views.system.AccountAccess
|
||||
import com.openbankproject.commons.model.enums.SuppliedAnswerType
|
||||
|
||||
@ -54,7 +54,7 @@ import code.loginattempts.LoginAttempt
|
||||
import code.model.dataAccess.ResourceUser
|
||||
import code.model.{Consumer, ModeratedBankAccount, ModeratedBankAccountCore}
|
||||
import code.ratelimiting.RateLimiting
|
||||
import code.standingorders.StandingOrderTrait
|
||||
import com.openbankproject.commons.model.StandingOrderTrait
|
||||
import code.userlocks.UserLocks
|
||||
import code.users.{UserAgreement, UserAttribute, UserInvitation}
|
||||
import code.views.system.AccountAccess
|
||||
|
||||
@ -42,7 +42,7 @@ import code.api.v3_1_0.{AccountAttributeResponseJson, AccountBasicV310, Customer
|
||||
import code.api.v4_0_0.{APIInfoJson400, BankAttributeBankResponseJsonV400, EnergySource400, HostedAt400, HostedBy400}
|
||||
import code.bankattribute.BankAttribute
|
||||
import code.consent.ConsentRequest
|
||||
import code.customeraccountlinks.CustomerAccountLinkTrait
|
||||
import com.openbankproject.commons.model.CustomerAccountLinkTrait
|
||||
import com.openbankproject.commons.model.{AccountAttribute, AccountRouting, AccountRoutingJsonV121, AmountOfMoneyJsonV121, Bank, BankAccount, CardAttribute, CreateViewJson, Customer, CustomerAttribute, InboundAdapterInfoInternal, InboundStatusMessage, PhysicalCardTrait, UpdateViewJSON, User, UserAuthContext, UserAuthContextUpdate, View, ViewBasic}
|
||||
import com.openbankproject.commons.util.ApiVersion
|
||||
import net.liftweb.json.JsonAST.JValue
|
||||
|
||||
@ -25,12 +25,12 @@ object CommonsCaseClassGenerator extends App {
|
||||
.map(extractReturnModel)
|
||||
.filter(it => {
|
||||
val symbol = it.typeSymbol
|
||||
// val isAbstract = symbol.isAbstract
|
||||
val isAbstract = symbol.isAbstract
|
||||
val isOurClass = symbol.fullName.matches("(code\\.|com.openbankproject\\.).+")
|
||||
//isAbstract &&
|
||||
isOurClass
|
||||
}).toSet
|
||||
|
||||
isAbstract && isOurClass
|
||||
})
|
||||
.toSet
|
||||
|
||||
returnModels.map(_.typeSymbol.fullName).foreach(it => println(s"import $it"))
|
||||
|
||||
def mkClass(tp: ru.Type) = {
|
||||
@ -39,6 +39,7 @@ object CommonsCaseClassGenerator extends App {
|
||||
s"""
|
||||
|case class ${tp.typeSymbol.name}Commons(
|
||||
| $varibles) extends ${tp.typeSymbol.name}
|
||||
|object ${tp.typeSymbol.name}Commons extends Converter[${tp.typeSymbol.name}, ${tp.typeSymbol.name}Commons]
|
||||
""".stripMargin
|
||||
}
|
||||
// private val str: String = ru.typeOf[Bank].decls.map(it => s"${it.name} :${it.typeSignature.typeSymbol.name}").mkString(", \n")
|
||||
|
||||
@ -14,11 +14,11 @@ import code.bankconnectors.rest.RestConnector_vMar2019
|
||||
import code.bankconnectors.storedprocedure.StoredProcedureConnector_vDec2019
|
||||
import code.bankconnectors.vMay2019.KafkaMappedConnector_vMay2019
|
||||
import code.bankconnectors.vSept2018.KafkaMappedConnector_vSept2018
|
||||
import code.counterpartylimit.CounterpartyLimitTrait
|
||||
import code.customeraccountlinks.CustomerAccountLinkTrait
|
||||
import code.endpointTag.EndpointTagT
|
||||
import com.openbankproject.commons.model.CounterpartyLimitTrait
|
||||
import com.openbankproject.commons.model.CustomerAccountLinkTrait
|
||||
import com.openbankproject.commons.model.EndpointTagT
|
||||
import code.model.dataAccess.BankAccountRouting
|
||||
import code.standingorders.StandingOrderTrait
|
||||
import com.openbankproject.commons.model.StandingOrderTrait
|
||||
import code.users.UserAttribute
|
||||
import code.util.Helper._
|
||||
import com.github.dwickern.macros.NameOf.nameOf
|
||||
|
||||
@ -1,5 +1,10 @@
|
||||
package code.bankconnectors
|
||||
|
||||
import code.api.util.{APIUtil, NewStyle}
|
||||
import org.apache.commons.io.FileUtils
|
||||
|
||||
import java.io.File
|
||||
import java.util.Date
|
||||
import scala.concurrent.Future
|
||||
import scala.reflect.runtime.{universe => ru}
|
||||
|
||||
@ -12,44 +17,19 @@ object InOutCaseClassGenerator extends App {
|
||||
extractReturnModel(tp.typeArgs(0))
|
||||
}
|
||||
}
|
||||
val list = List(
|
||||
"validateChallengeAnswer",
|
||||
"getBankLegacy",
|
||||
"getBanksLegacy",
|
||||
"getBankAccountsForUserLegacy",
|
||||
"updateUserAccountViewsOld",
|
||||
"getBankAccountLegacy",
|
||||
"getBankAccountByIban",
|
||||
"getBankAccountByRouting",
|
||||
"getBankAccounts",
|
||||
"getCoreBankAccountsLegacy",
|
||||
"getBankAccountsHeldLegacy",
|
||||
"checkBankAccountExistsLegacy",
|
||||
"getCounterpartyByCounterpartyIdLegacy",
|
||||
"getCounterpartiesLegacy",
|
||||
"getTransactionsLegacy",
|
||||
"getTransactionLegacy",
|
||||
"getPhysicalCardsForBankLegacy",
|
||||
"createPhysicalCardLegacy",
|
||||
"createBankAccountLegacy",
|
||||
"getBranchLegacy",
|
||||
"getAtmLegacy",
|
||||
"getCustomerByCustomerIdLegacy"
|
||||
)
|
||||
|
||||
|
||||
private val mirror: ru.Mirror = ru.runtimeMirror(this.getClass.getClassLoader)
|
||||
private val clazz: ru.ClassSymbol = mirror.typeOf[Connector].typeSymbol.asClass
|
||||
private val retureFutureMethods: Iterable[ru.MethodSymbol] = mirror.typeOf[Connector].decls.filter(symbol => {
|
||||
val isMethod = symbol.isMethod && !symbol.asMethod.isVal && !symbol.asMethod.isVar && !symbol.asMethod.isConstructor && list.contains(symbol.name.toString.trim)
|
||||
isMethod
|
||||
}).map(it => it.asMethod)
|
||||
.filterNot(it => it.returnType <:< ru.typeOf[Future[_]])
|
||||
private val returnObpClassMethods1= mirror.typeOf[Connector].decls
|
||||
private val returnObpClassMethods2= returnObpClassMethods1.filter(symbol => {
|
||||
val isMethod = symbol.isMethod && !symbol.asMethod.isVal && !symbol.asMethod.isVar && !symbol.asMethod.isConstructor && !symbol.isProtected
|
||||
isMethod})
|
||||
private val returnObpClassMethods3 = returnObpClassMethods2.map(it => it.asMethod)
|
||||
.filter(it => {
|
||||
extractReturnModel(it.returnType).typeSymbol.fullName.matches("(code\\.|com.openbankproject\\.).+")
|
||||
extractReturnModel(it.returnType).typeSymbol.fullName.matches("((code\\.|com.openbankproject\\.).+)|(scala\\.Boolean)") //to make sure, it returned the OBP class.
|
||||
})
|
||||
|
||||
|
||||
val code = retureFutureMethods.map(it => {
|
||||
val code = returnObpClassMethods3.map(it => {
|
||||
val returnType = it.returnType
|
||||
val tp = extractReturnModel(returnType)
|
||||
val isCaseClass = tp.typeSymbol.asClass.isCaseClass
|
||||
|
||||
@ -25,11 +25,13 @@ import code.cards.MappedPhysicalCard
|
||||
import code.context.{UserAuthContextProvider, UserAuthContextUpdateProvider}
|
||||
import code.counterpartylimit.CounterpartyLimitProvider
|
||||
import code.customer._
|
||||
import code.customeraccountlinks.CustomerAccountLinkTrait
|
||||
import code.customeraccountlinks.CustomerAccountLinkX
|
||||
import com.openbankproject.commons.model.CustomerAccountLinkTrait
|
||||
import code.customeraddress.CustomerAddressX
|
||||
import code.customerattribute.CustomerAttributeX
|
||||
import code.directdebit.DirectDebits
|
||||
import code.endpointTag.{EndpointTag, EndpointTagT}
|
||||
import code.endpointTag.EndpointTag
|
||||
import com.openbankproject.commons.model.EndpointTagT
|
||||
import code.fx.{MappedFXRate, fx}
|
||||
import code.kycchecks.KycChecks
|
||||
import code.kycdocuments.KycDocuments
|
||||
@ -46,7 +48,8 @@ import code.productcollection.ProductCollectionX
|
||||
import code.productcollectionitem.ProductCollectionItems
|
||||
import code.productfee.ProductFeeX
|
||||
import code.products.MappedProduct
|
||||
import code.standingorders.{StandingOrderTrait, StandingOrders}
|
||||
import code.standingorders.StandingOrders
|
||||
import com.openbankproject.commons.model.StandingOrderTrait
|
||||
import code.taxresidence.TaxResidenceX
|
||||
import code.transaction.MappedTransaction
|
||||
import code.transactionChallenge.Challenges
|
||||
@ -65,6 +68,7 @@ import com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SCA
|
||||
import com.openbankproject.commons.model.enums.StrongCustomerAuthenticationStatus.SCAStatus
|
||||
import com.openbankproject.commons.model.enums.TransactionRequestTypes._
|
||||
import com.openbankproject.commons.model.enums.{TransactionRequestStatus, _}
|
||||
import com.openbankproject.commons.model.CustomerAccountLinkTrait
|
||||
import com.openbankproject.commons.model._
|
||||
import com.tesobe.CacheKeyFromArguments
|
||||
import com.tesobe.model.UpdateBankAccount
|
||||
@ -5002,26 +5006,26 @@ object LocalMappedConnector extends Connector with MdcLoggable {
|
||||
}
|
||||
|
||||
override def getCustomerAccountLinksByCustomerId(customerId: String, callContext: Option[CallContext]) = Future{
|
||||
(CustomerAccountLinkTrait.customerAccountLink.vend.getCustomerAccountLinksByCustomerId(customerId),callContext)
|
||||
(CustomerAccountLinkX.customerAccountLink.vend.getCustomerAccountLinksByCustomerId(customerId),callContext)
|
||||
}
|
||||
|
||||
override def getCustomerAccountLinkById(customerAccountLinkId: String, callContext: Option[CallContext]) = Future{
|
||||
(CustomerAccountLinkTrait.customerAccountLink.vend.getCustomerAccountLinkById(customerAccountLinkId),callContext)
|
||||
(CustomerAccountLinkX.customerAccountLink.vend.getCustomerAccountLinkById(customerAccountLinkId),callContext)
|
||||
}
|
||||
|
||||
override def getCustomerAccountLinksByBankIdAccountId(bankId: String, accountId: String, callContext: Option[CallContext])= Future{
|
||||
(CustomerAccountLinkTrait.customerAccountLink.vend.getCustomerAccountLinksByBankIdAccountId(bankId, accountId),callContext)
|
||||
(CustomerAccountLinkX.customerAccountLink.vend.getCustomerAccountLinksByBankIdAccountId(bankId, accountId),callContext)
|
||||
}
|
||||
|
||||
override def deleteCustomerAccountLinkById(customerAccountLinkId: String, callContext: Option[CallContext]) =
|
||||
CustomerAccountLinkTrait.customerAccountLink.vend.deleteCustomerAccountLinkById(customerAccountLinkId).map {(_, callContext)}
|
||||
CustomerAccountLinkX.customerAccountLink.vend.deleteCustomerAccountLinkById(customerAccountLinkId).map {(_, callContext)}
|
||||
|
||||
override def updateCustomerAccountLinkById(customerAccountLinkId: String, relationshipType: String, callContext: Option[CallContext]) = Future{
|
||||
(CustomerAccountLinkTrait.customerAccountLink.vend.updateCustomerAccountLinkById(customerAccountLinkId, relationshipType),callContext)
|
||||
(CustomerAccountLinkX.customerAccountLink.vend.updateCustomerAccountLinkById(customerAccountLinkId, relationshipType),callContext)
|
||||
}
|
||||
|
||||
override def createCustomerAccountLink(customerId: String, bankId: String, accountId: String, relationshipType: String, callContext: Option[CallContext]): OBPReturnType[Box[CustomerAccountLinkTrait]] = Future{
|
||||
CustomerAccountLinkTrait.customerAccountLink.vend.createCustomerAccountLink(customerId: String, bankId, accountId: String, relationshipType: String) map { ( _, callContext) }
|
||||
CustomerAccountLinkX.customerAccountLink.vend.createCustomerAccountLink(customerId: String, bankId, accountId: String, relationshipType: String) map { ( _, callContext) }
|
||||
}
|
||||
|
||||
override def getConsentImplicitSCA(user: User, callContext: Option[CallContext]): OBPReturnType[Box[ConsentImplicitSCAT]] = Future {
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package code.counterpartylimit
|
||||
|
||||
import code.api.util.APIUtil
|
||||
import com.openbankproject.commons.util.JsonAble
|
||||
import com.openbankproject.commons.model.CounterpartyLimitTrait
|
||||
import net.liftweb.util.SimpleInjector
|
||||
import net.liftweb.common.Box
|
||||
import scala.concurrent.Future
|
||||
@ -39,18 +38,3 @@ trait CounterpartyLimitProviderTrait {
|
||||
maxNumberOfYearlyTransactions: Int): Future[Box[CounterpartyLimitTrait]]
|
||||
}
|
||||
|
||||
trait CounterpartyLimitTrait extends JsonAble{
|
||||
def counterpartyLimitId: String
|
||||
def bankId: String
|
||||
def accountId: String
|
||||
def viewId: String
|
||||
def counterpartyId: String
|
||||
|
||||
def currency: String
|
||||
def maxSingleAmount: Int
|
||||
def maxMonthlyAmount: Int
|
||||
def maxNumberOfMonthlyTransactions: Int
|
||||
def maxYearlyAmount: Int
|
||||
def maxNumberOfYearlyTransactions: Int
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ import net.liftweb.json.Formats
|
||||
import net.liftweb.json.JsonAST.{JValue,JString}
|
||||
import net.liftweb.json.JsonDSL._
|
||||
import scala.concurrent.Future
|
||||
import com.openbankproject.commons.model.CounterpartyLimitTrait
|
||||
|
||||
object MappedCounterpartyLimitProvider extends CounterpartyLimitProviderTrait {
|
||||
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
package code.customeraccountlinks
|
||||
|
||||
import code.api.util.APIUtil
|
||||
import com.openbankproject.commons.model.CustomerAccountLinkTrait
|
||||
import net.liftweb.common.Box
|
||||
import net.liftweb.util.SimpleInjector
|
||||
|
||||
import scala.concurrent.Future
|
||||
|
||||
|
||||
object CustomerAccountLinkTrait extends SimpleInjector {
|
||||
object CustomerAccountLinkX extends SimpleInjector {
|
||||
|
||||
val customerAccountLink = new Inject(buildOne _) {}
|
||||
|
||||
@ -27,12 +26,4 @@ trait CustomerAccountLinkProvider {
|
||||
def getCustomerAccountLinks: Box[List[CustomerAccountLinkTrait]]
|
||||
def bulkDeleteCustomerAccountLinks(): Boolean
|
||||
def deleteCustomerAccountLinkById(customerAccountLinkId: String): Future[Box[Boolean]]
|
||||
}
|
||||
|
||||
trait CustomerAccountLinkTrait {
|
||||
def customerAccountLinkId: String
|
||||
def customerId: String
|
||||
def bankId: String
|
||||
def accountId: String
|
||||
def relationshipType: String
|
||||
}
|
||||
@ -8,6 +8,7 @@ import net.liftweb.mapper._
|
||||
import scala.concurrent.Future
|
||||
import com.openbankproject.commons.ExecutionContext.Implicits.global
|
||||
import net.liftweb.util.Helpers.tryo
|
||||
import com.openbankproject.commons.model.CustomerAccountLinkTrait
|
||||
|
||||
object MappedCustomerAccountLinkProvider extends CustomerAccountLinkProvider {
|
||||
override def createCustomerAccountLink(customerId: String, bankId: String, accountId: String, relationshipType: String): Box[CustomerAccountLinkTrait] = {
|
||||
|
||||
@ -2,7 +2,7 @@ package code.endpointTag
|
||||
|
||||
/* For Connector endpoint routing, star connector use this provider to find proxy connector name */
|
||||
|
||||
import com.openbankproject.commons.model.{Converter, JsonFieldReName}
|
||||
import com.openbankproject.commons.model.{Converter, JsonFieldReName, EndpointTagT}
|
||||
import net.liftweb.common.Box
|
||||
import net.liftweb.json.Formats
|
||||
import net.liftweb.json.JsonAST.{JField, JNull, JObject, JString}
|
||||
@ -15,13 +15,6 @@ object EndpointTagProvider extends SimpleInjector {
|
||||
def buildOne: MappedEndpointTagProvider.type = MappedEndpointTagProvider
|
||||
}
|
||||
|
||||
trait EndpointTagT {
|
||||
def endpointTagId: Option[String]
|
||||
def operationId: String
|
||||
def tagName: String
|
||||
def bankId: Option[String]
|
||||
}
|
||||
|
||||
case class EndpointTagCommons(
|
||||
endpointTagId: Option[String],
|
||||
operationId: String,
|
||||
|
||||
@ -2,6 +2,7 @@ package code.endpointTag
|
||||
|
||||
import code.api.util.CustomJsonFormats
|
||||
import code.util.MappedUUID
|
||||
import com.openbankproject.commons.model.EndpointTagT
|
||||
import net.liftweb.common.{Box, Empty, EmptyBox, Full}
|
||||
import net.liftweb.mapper._
|
||||
import net.liftweb.util.Helpers.tryo
|
||||
|
||||
@ -7,7 +7,7 @@ import code.util.Helper.convertToSmallestCurrencyUnits
|
||||
import code.util.{Helper, UUIDString}
|
||||
import net.liftweb.common.Box
|
||||
import net.liftweb.mapper._
|
||||
|
||||
import com.openbankproject.commons.model.StandingOrderTrait
|
||||
import scala.math.BigDecimal
|
||||
|
||||
object MappedStandingOrderProvider extends StandingOrderProvider {
|
||||
|
||||
@ -4,7 +4,7 @@ import java.util.Date
|
||||
|
||||
import net.liftweb.common.Box
|
||||
import net.liftweb.util.SimpleInjector
|
||||
|
||||
import com.openbankproject.commons.model.StandingOrderTrait
|
||||
import scala.math.BigDecimal
|
||||
|
||||
|
||||
@ -31,20 +31,3 @@ trait StandingOrderProvider {
|
||||
def getStandingOrdersByUser(userId: String) : List[StandingOrderTrait]
|
||||
}
|
||||
|
||||
trait StandingOrderTrait {
|
||||
def standingOrderId: String
|
||||
def bankId: String
|
||||
def accountId: String
|
||||
def customerId: String
|
||||
def userId: String
|
||||
def counterpartyId: String
|
||||
def amountValue : BigDecimal
|
||||
def amountCurrency: String
|
||||
def whenFrequency: String
|
||||
def whenDetail: String
|
||||
def dateSigned: Date
|
||||
def dateCancelled: Date
|
||||
def dateStarts: Date
|
||||
def dateExpires: Date
|
||||
def active: Boolean
|
||||
}
|
||||
@ -1390,4 +1390,8 @@ case class OutBoundGetCounterpartyByIbanAndBankAccountId(outboundAdapterCallCont
|
||||
case class InBoundGetCounterpartyByIbanAndBankAccountId(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CounterpartyTraitCommons) extends InBoundTrait[CounterpartyTraitCommons]
|
||||
|
||||
|
||||
// --------------------- some special connector methods corresponding InBound and OutBound -- end --
|
||||
// --------------------- some special connector methods corresponding InBound and OutBound -- end --
|
||||
|
||||
//---------------- dynamic start -------------------please don't modify this line
|
||||
|
||||
//---------------- dynamic end ---------------------please don't modify this line
|
||||
|
||||
@ -27,13 +27,12 @@ TESOBE (http://www.tesobe.com/)
|
||||
package com.openbankproject.commons.model
|
||||
|
||||
import java.util.Date
|
||||
|
||||
import com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SCA
|
||||
import com.openbankproject.commons.model.enums.StrongCustomerAuthenticationStatus.SCAStatus
|
||||
import com.openbankproject.commons.model.enums._
|
||||
import com.openbankproject.commons.util.{ReflectUtils, optional}
|
||||
import net.liftweb.json.JsonAST.{JObject, JValue}
|
||||
import net.liftweb.json.{JInt, JString}
|
||||
import net.liftweb.json.{Formats, JInt, JString}
|
||||
|
||||
import java.lang
|
||||
import scala.collection.immutable.List
|
||||
@ -571,8 +570,163 @@ case class ChallengeCommons(
|
||||
) extends ChallengeTrait
|
||||
object ChallengeCommons extends Converter[ChallengeTrait, ChallengeCommons]
|
||||
|
||||
case class ProductFeeTraitCommons(
|
||||
bankId: BankId,
|
||||
productCode: ProductCode,
|
||||
productFeeId: String,
|
||||
name: String,
|
||||
isActive: Boolean,
|
||||
moreInfo: String,
|
||||
currency: String,
|
||||
amount: BigDecimal,
|
||||
frequency: String,
|
||||
`type`: String) extends ProductFeeTrait
|
||||
|
||||
//----------------obp-api moved to here case classes
|
||||
object ProductFeeTraitCommons extends Converter[ProductFeeTrait, ProductFeeTraitCommons]
|
||||
|
||||
|
||||
case class CustomerAccountLinkTraitCommons(
|
||||
customerAccountLinkId: String,
|
||||
customerId: String,
|
||||
bankId: String,
|
||||
accountId: String,
|
||||
relationshipType: String) extends CustomerAccountLinkTrait
|
||||
|
||||
object CustomerAccountLinkTraitCommons extends Converter[CustomerAccountLinkTrait, CustomerAccountLinkTraitCommons]
|
||||
|
||||
|
||||
case class CounterpartyLimitTraitCommons(
|
||||
counterpartyLimitId: String,
|
||||
bankId: String,
|
||||
accountId: String,
|
||||
viewId: String,
|
||||
counterpartyId: String,
|
||||
currency: String,
|
||||
maxSingleAmount: Int,
|
||||
maxMonthlyAmount: Int,
|
||||
maxNumberOfMonthlyTransactions: Int,
|
||||
maxYearlyAmount: Int,
|
||||
maxNumberOfYearlyTransactions: Int
|
||||
) extends CounterpartyLimitTrait {
|
||||
override def toJValue(implicit format: Formats): JValue = ???
|
||||
}
|
||||
|
||||
object CounterpartyLimitTraitCommons extends Converter[CounterpartyLimitTrait, CounterpartyLimitTraitCommons]
|
||||
|
||||
case class ChallengeTraitCommons(
|
||||
challengeId: String,
|
||||
transactionRequestId: String,
|
||||
expectedAnswer: String,
|
||||
expectedUserId: String,
|
||||
salt: String,
|
||||
successful: Boolean,
|
||||
challengeType: String,
|
||||
consentId: Option[String],
|
||||
basketId: Option[String],
|
||||
scaMethod: Option[SCA],
|
||||
scaStatus: Option[SCAStatus],
|
||||
authenticationMethodId: Option[String],
|
||||
attemptCounter: Int) extends ChallengeTrait with JsonFieldReName
|
||||
|
||||
object ChallengeTraitCommons extends Converter[ChallengeTrait, ChallengeTraitCommons]
|
||||
|
||||
|
||||
case class PhysicalCardTraitCommons(
|
||||
cardId: String,
|
||||
bankId: String,
|
||||
bankCardNumber: String,
|
||||
cardType: String,
|
||||
nameOnCard: String,
|
||||
issueNumber: String,
|
||||
serialNumber: String,
|
||||
validFrom: Date,
|
||||
expires: Date,
|
||||
enabled: Boolean,
|
||||
cancelled: Boolean,
|
||||
onHotList: Boolean,
|
||||
technology: String,
|
||||
networks: List[String],
|
||||
allows: List[CardAction],
|
||||
account: BankAccount,
|
||||
replacement: Option[CardReplacementInfo],
|
||||
pinResets: List[PinResetInfo],
|
||||
collected: Option[CardCollectionInfo],
|
||||
posted: Option[CardPostedInfo],
|
||||
customerId: String,
|
||||
cvv: Option[String],
|
||||
brand: Option[String]
|
||||
) extends PhysicalCardTrait
|
||||
|
||||
object PhysicalCardTraitCommons extends Converter[PhysicalCardTrait, PhysicalCardTraitCommons]
|
||||
|
||||
case class TransactionRequestAttributeTraitCommons(
|
||||
bankId: BankId,
|
||||
transactionRequestId: TransactionRequestId,
|
||||
transactionRequestAttributeId: String,
|
||||
attributeType: TransactionRequestAttributeType,
|
||||
name: String,
|
||||
value: String) extends TransactionRequestAttributeTrait
|
||||
|
||||
object TransactionRequestAttributeTraitCommons extends Converter[TransactionRequestAttributeTrait, TransactionRequestAttributeTraitCommons]
|
||||
|
||||
|
||||
case class EndpointTagTCommons(
|
||||
endpointTagId: Option[String],
|
||||
operationId: String,
|
||||
tagName: String,
|
||||
bankId: Option[String]) extends EndpointTagT
|
||||
|
||||
object EndpointTagTCommons extends Converter[EndpointTagT, EndpointTagTCommons]
|
||||
|
||||
case class StandingOrderTraitCommons(
|
||||
standingOrderId: String,
|
||||
bankId: String,
|
||||
accountId: String,
|
||||
customerId: String,
|
||||
userId: String,
|
||||
counterpartyId: String,
|
||||
amountValue: BigDecimal,
|
||||
amountCurrency: String,
|
||||
whenFrequency: String,
|
||||
whenDetail: String,
|
||||
dateSigned: Date,
|
||||
dateCancelled: Date,
|
||||
dateStarts: Date,
|
||||
dateExpires: Date,
|
||||
active: Boolean) extends StandingOrderTrait
|
||||
|
||||
object StandingOrderTraitCommons extends Converter[StandingOrderTrait, StandingOrderTraitCommons]
|
||||
|
||||
case class UserAuthContextUpdateCommons(
|
||||
userAuthContextUpdateId: String,
|
||||
userId: String,
|
||||
key: String,
|
||||
value: String,
|
||||
challenge: String,
|
||||
status: String,
|
||||
consumerId: String) extends UserAuthContextUpdate
|
||||
|
||||
object UserAuthContextUpdateCommons extends Converter[UserAuthContextUpdate, UserAuthContextUpdateCommons]
|
||||
|
||||
case class ConsentImplicitSCATCommons(
|
||||
scaMethod: StrongCustomerAuthentication,
|
||||
recipient: String) extends ConsentImplicitSCAT
|
||||
|
||||
object ConsentImplicitSCATCommons extends Converter[ConsentImplicitSCAT, ConsentImplicitSCATCommons]
|
||||
|
||||
|
||||
case class CardAttributeCommons(
|
||||
bankId: Option[BankId],
|
||||
cardId: Option[String],
|
||||
cardAttributeId: Option[String],
|
||||
name: String,
|
||||
attributeType: CardAttributeType.Value,
|
||||
value: String
|
||||
) extends CardAttribute with JsonFieldReName
|
||||
|
||||
object CardAttributeCommons extends Converter[CardAttribute, CardAttributeCommons]
|
||||
|
||||
//----------------obp-api moved to here case classes
|
||||
|
||||
case class BranchRoutingJsonV141(
|
||||
scheme: String,
|
||||
|
||||
@ -31,7 +31,7 @@ import java.util.Date
|
||||
import com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SCA
|
||||
import com.openbankproject.commons.model.enums.StrongCustomerAuthenticationStatus.SCAStatus
|
||||
import com.openbankproject.commons.model.enums._
|
||||
import com.openbankproject.commons.util.ReflectUtils
|
||||
import com.openbankproject.commons.util.{JsonAble, ReflectUtils}
|
||||
|
||||
import scala.collection.immutable.List
|
||||
import scala.math.BigDecimal
|
||||
@ -158,16 +158,6 @@ trait CardAttribute {
|
||||
def attributeType: CardAttributeType.Value
|
||||
def value: String
|
||||
}
|
||||
case class CardAttributeCommons(
|
||||
bankId: Option[BankId],
|
||||
cardId: Option[String],
|
||||
cardAttributeId: Option[String],
|
||||
name: String,
|
||||
attributeType: CardAttributeType.Value,
|
||||
value: String
|
||||
) extends CardAttribute with JsonFieldReName
|
||||
|
||||
object CardAttributeCommons extends Converter[CardAttribute, CardAttributeCommons]
|
||||
|
||||
case class CustomAttribute(
|
||||
name: String,
|
||||
@ -650,6 +640,53 @@ trait ConsentImplicitSCAT {
|
||||
def recipient: String
|
||||
}
|
||||
|
||||
trait CustomerAccountLinkTrait {
|
||||
def customerAccountLinkId: String
|
||||
def customerId: String
|
||||
def bankId: String
|
||||
def accountId: String
|
||||
def relationshipType: String
|
||||
}
|
||||
|
||||
trait CounterpartyLimitTrait extends JsonAble{
|
||||
def counterpartyLimitId: String
|
||||
def bankId: String
|
||||
def accountId: String
|
||||
def viewId: String
|
||||
def counterpartyId: String
|
||||
|
||||
def currency: String
|
||||
def maxSingleAmount: Int
|
||||
def maxMonthlyAmount: Int
|
||||
def maxNumberOfMonthlyTransactions: Int
|
||||
def maxYearlyAmount: Int
|
||||
def maxNumberOfYearlyTransactions: Int
|
||||
}
|
||||
|
||||
trait EndpointTagT {
|
||||
def endpointTagId: Option[String]
|
||||
def operationId: String
|
||||
def tagName: String
|
||||
def bankId: Option[String]
|
||||
}
|
||||
|
||||
trait StandingOrderTrait {
|
||||
def standingOrderId: String
|
||||
def bankId: String
|
||||
def accountId: String
|
||||
def customerId: String
|
||||
def userId: String
|
||||
def counterpartyId: String
|
||||
def amountValue : BigDecimal
|
||||
def amountCurrency: String
|
||||
def whenFrequency: String
|
||||
def whenDetail: String
|
||||
def dateSigned: Date
|
||||
def dateCancelled: Date
|
||||
def dateStarts: Date
|
||||
def dateExpires: Date
|
||||
def active: Boolean
|
||||
}
|
||||
//---------------------------------------- trait dependents of case class
|
||||
case class ConsentImplicitSCA(
|
||||
scaMethod: SCA,
|
||||
|
||||
@ -61,8 +61,8 @@ trait PhysicalCardTrait {
|
||||
def collected: Option[CardCollectionInfo]
|
||||
def posted: Option[CardPostedInfo]
|
||||
def customerId: String
|
||||
def cvv: Option[String] = None //added from V500
|
||||
def brand: Option[String] = None //added from V500
|
||||
def cvv: Option[String] //added from V500
|
||||
def brand: Option[String] //added from V500
|
||||
}
|
||||
|
||||
case class PhysicalCard (
|
||||
|
||||
@ -86,17 +86,6 @@ trait UserAuthContextUpdate {
|
||||
def status: String
|
||||
def consumerId: String
|
||||
}
|
||||
case class UserAuthContextUpdateCommons(
|
||||
userAuthContextUpdateId: String,
|
||||
userId: String,
|
||||
key: String,
|
||||
value: String,
|
||||
challenge: String,
|
||||
status: String,
|
||||
consumerId: String
|
||||
) extends UserAuthContextUpdate
|
||||
|
||||
object UserAuthContextUpdateCommons extends Converter[UserAuthContextUpdate, UserAuthContextUpdateCommons]
|
||||
|
||||
object UserAuthContextUpdateStatus extends Enumeration {
|
||||
type ConsentStatus = Value
|
||||
|
||||
Loading…
Reference in New Issue
Block a user