mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 16:36:54 +00:00
Merge pull request #2019 from hongwei1/develop
refactor/removeDeprecatedConnectors
This commit is contained in:
commit
ea94ff271b
@ -254,21 +254,6 @@
|
||||
<artifactId>signpost-commonshttp4</artifactId>
|
||||
<version>1.2.1.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.tesobe.obp</groupId>
|
||||
<artifactId>obp-ri-core</artifactId>
|
||||
<version>${obp-ri.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.tesobe.obp</groupId>
|
||||
<artifactId>obp-ri-kafka</artifactId>
|
||||
<version>${obp-ri.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.tesobe.obp</groupId>
|
||||
<artifactId>obp-ri-transport</artifactId>
|
||||
<version>${obp-ri.version}</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.typesafe.akka/akka-http-core -->
|
||||
<dependency>
|
||||
<groupId>com.typesafe.akka</groupId>
|
||||
|
||||
@ -1190,7 +1190,7 @@
|
||||
"request_url": "/obp/v2.2.0/message-docs/CONNECTOR",
|
||||
"summary": "获取消息文档",
|
||||
"description": "映射(类型->字符串)",
|
||||
"description_markdown": "These message docs provide example messages sent by OBP to the (Kafka) message queue for processing by the Core Banking / Payment system Adapter - together with an example expected response and possible error codes.\n Integrators can use these messages to build Adapters that provide core banking services to OBP.\n\n Note: API Explorer provides a Message Docs page where these messages are displayed.\n \n `CONNECTOR`:kafka_vMar2017 , kafka_vJune2017, kafka_vSept2018 ... \n ",
|
||||
"description_markdown": "These message docs provide example messages sent by OBP to the (Kafka) message queue for processing by the Core Banking / Payment system Adapter - together with an example expected response and possible error codes.\n Integrators can use these messages to build Adapters that provide core banking services to OBP.\n\n Note: API Explorer provides a Message Docs page where these messages are displayed.\n \n `CONNECTOR`: kafka_vSept2018 ... \n ",
|
||||
"example_request_body": {
|
||||
"jsonString": "{}"
|
||||
},
|
||||
|
||||
@ -14,12 +14,9 @@
|
||||
## Which data connector to use, if config `star` as connector, please also check `starConnector_supported_types`
|
||||
connector=mapped
|
||||
#connector=mongodb
|
||||
#connector=kafka
|
||||
#conenctor=kafka_vMar2017
|
||||
#connector=akka_vDec2018
|
||||
#connector=rest_vMar2019
|
||||
#connector=stored_procedure_vDec2019
|
||||
#connector=obpjvm
|
||||
#connector=star
|
||||
## proxy connector get data from LocalMappedConnector, and set the follow corresponding fields to be null: @optional, inbound.optional.fields props, outbound.optional.fields props
|
||||
## the proxy connector only for test purpose
|
||||
@ -106,9 +103,6 @@ read_authentication_type_validation_requires_role=false
|
||||
##Added Props property_name_prefix, default is OBP_. This adds the prefix only for the system environment property name, eg: db.driver --> OBP_db.driver
|
||||
#system_environment_property_name_prefix=OBP_
|
||||
|
||||
## OBP-JVM transport type. currently supported: kafka, mock
|
||||
#obpjvm.transport=kafka
|
||||
|
||||
## Transaction status scheduler delay in seconds.
|
||||
## Retrieves transactionRequest status from south-side connector.
|
||||
## Scheduler will be disabled if delay is not set.
|
||||
@ -125,9 +119,6 @@ read_authentication_type_validation_requires_role=false
|
||||
## Enable user authentication via kafka
|
||||
#kafka.user.authentication=true
|
||||
|
||||
## DEPRECATED
|
||||
## Enable user authentication via obpjvm
|
||||
#obpjvm.user.authentication=true
|
||||
|
||||
## Enable user authentication via the connector
|
||||
#connector.user.authentication=true
|
||||
|
||||
@ -239,7 +239,6 @@ object DynamicUtil {
|
||||
|import code.api.util.{APIUtil, CallContext, OBPQueryParam}
|
||||
|import code.api.v4_0_0.dynamic.MockResponseHolder
|
||||
|import code.bankconnectors._
|
||||
|import code.bankconnectors.vJune2017.AuthInfo
|
||||
|import code.customer.internalMapping.MappedCustomerIdMappingProvider
|
||||
|import code.kafka.KafkaHelper
|
||||
|import code.model.dataAccess.internalMapping.MappedAccountIdMappingProvider
|
||||
|
||||
@ -386,7 +386,7 @@ trait APIMethods220 {
|
||||
|
|
||||
| Note: API Explorer provides a Message Docs page where these messages are displayed.
|
||||
|
|
||||
| `CONNECTOR`:kafka_vMar2017 , kafka_vJune2017, kafka_vSept2018, stored_procedure_vDec2019 ...
|
||||
| `CONNECTOR`: kafka_vSept2018, stored_procedure_vDec2019 ...
|
||||
""".stripMargin,
|
||||
emptyObjectJson,
|
||||
messageDocsJson,
|
||||
@ -398,9 +398,8 @@ trait APIMethods220 {
|
||||
case "message-docs" :: connector :: Nil JsonGet _ => {
|
||||
cc => {
|
||||
for {
|
||||
//kafka_vJune2017 --> vJune2017 : get the valid version for search the connector object.
|
||||
connectorObject <- Future(tryo{Connector.getConnectorInstance(connector)}) map { i =>
|
||||
val msg = "$InvalidConnector Current Input is $connector. It should be eg: kafka_vJune2017, kafka_vSept2018..."
|
||||
val msg = "$InvalidConnector Current Input is $connector. It should be eg: kafka_vSept2018..."
|
||||
unboxFullOrFail(i, cc.callContext, msg)
|
||||
}
|
||||
} yield {
|
||||
|
||||
@ -20,8 +20,6 @@ import code.bankconnectors.LocalMappedConnector.setUnimplementedError
|
||||
import code.bankconnectors.akka.AkkaConnector_vDec2018
|
||||
import code.bankconnectors.rest.RestConnector_vMar2019
|
||||
import code.bankconnectors.storedprocedure.StoredProcedureConnector_vDec2019
|
||||
import code.bankconnectors.vJune2017.KafkaMappedConnector_vJune2017
|
||||
import code.bankconnectors.vMar2017.KafkaMappedConnector_vMar2017
|
||||
import code.bankconnectors.vMay2019.KafkaMappedConnector_vMay2019
|
||||
import code.bankconnectors.vSept2018.KafkaMappedConnector_vSept2018
|
||||
import code.endpointTag.EndpointTagT
|
||||
@ -82,11 +80,6 @@ object Connector extends SimpleInjector {
|
||||
"mapped" -> lazyValue(LocalMappedConnector),
|
||||
"akka_vDec2018" -> lazyValue(AkkaConnector_vDec2018),
|
||||
"mongodb" -> lazyValue(LocalRecordConnector),
|
||||
"obpjvm" -> lazyValue(ObpJvmMappedConnector),
|
||||
"kafka" -> lazyValue(KafkaMappedConnector),
|
||||
"kafka_JVMcompatible" -> lazyValue(KafkaMappedConnector_JVMcompatible),
|
||||
"kafka_vMar2017" -> lazyValue(KafkaMappedConnector_vMar2017),
|
||||
"kafka_vJune2017" -> lazyValue(KafkaMappedConnector_vJune2017),
|
||||
"kafka_vSept2018" -> lazyValue(KafkaMappedConnector_vSept2018),
|
||||
"kafka_vMay2019" -> lazyValue(KafkaMappedConnector_vMay2019),
|
||||
"rest_vMar2019" -> lazyValue(RestConnector_vMar2019),
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -41,7 +41,6 @@ import code.api.util.RSAUtil.{computeXSign, getPrivateKeyFromString}
|
||||
import code.api.util.{APIUtil, CallContext, OBPQueryParam}
|
||||
import code.api.v4_0_0.dynamic.MockResponseHolder
|
||||
import code.bankconnectors._
|
||||
import code.bankconnectors.vJune2017.AuthInfo
|
||||
import code.context.UserAuthContextProvider
|
||||
import code.customer.internalMapping.MappedCustomerIdMappingProvider
|
||||
import code.kafka.KafkaHelper
|
||||
|
||||
@ -32,7 +32,6 @@ import code.api.util.ErrorMessages._
|
||||
import code.api.util.ExampleValue._
|
||||
import code.api.util.{APIUtil, CallContext, HashUtil, OBPQueryParam}
|
||||
import code.bankconnectors._
|
||||
import code.bankconnectors.vJune2017.AuthInfo
|
||||
import code.customer.internalMapping.MappedCustomerIdMappingProvider
|
||||
import code.model.dataAccess.internalMapping.MappedAccountIdMappingProvider
|
||||
import code.util.Helper
|
||||
|
||||
@ -1,455 +0,0 @@
|
||||
package code.bankconnectors.vJune2017
|
||||
|
||||
import java.lang
|
||||
import java.util.Date
|
||||
|
||||
import code.api.util.APIUtil
|
||||
import com.openbankproject.commons.model.CheckbookOrdersJson
|
||||
import code.bankconnectors.vMar2017._
|
||||
import code.branches.Branches.{DriveUpString, LobbyString}
|
||||
|
||||
import code.model.dataAccess.MappedBankAccountData
|
||||
import com.openbankproject.commons.model.TransactionRequest
|
||||
import com.openbankproject.commons.model.{CounterpartyTrait, CreditLimit, _}
|
||||
import net.liftweb.mapper.By
|
||||
import net.liftweb.util.Helpers.today
|
||||
|
||||
import scala.collection.immutable.List
|
||||
|
||||
/**
|
||||
* case classes used to define topics, these are outbound kafka messages
|
||||
*/
|
||||
|
||||
case class OutboundGetAdapterInfo(authInfo: AuthInfo, date: String) extends TopicTrait
|
||||
case class OutboundGetBanks(authInfo: AuthInfo) extends TopicTrait
|
||||
case class OutboundGetBank(authInfo: AuthInfo, bankId: String) extends TopicTrait
|
||||
case class OutboundGetAccounts(authInfo: AuthInfo, customers:InternalBasicCustomers) extends TopicTrait
|
||||
case class OutboundGetAccountbyAccountID(authInfo: AuthInfo, bankId: String, accountId: String)extends TopicTrait
|
||||
case class OutboundCheckBankAccountExists(authInfo: AuthInfo, bankId: String, accountId: String)extends TopicTrait
|
||||
case class OutboundGetCoreBankAccounts(authInfo: AuthInfo, bankIdAccountIds: List[BankIdAccountId])extends TopicTrait
|
||||
case class OutboundGetTransactions(authInfo: AuthInfo,bankId: String, accountId: String, limit: Int, fromDate: String, toDate: String) extends TopicTrait
|
||||
case class OutboundGetTransaction(authInfo: AuthInfo, bankId: String, accountId: String, transactionId: String) extends TopicTrait
|
||||
case class OutboundGetBranches(authInfo: AuthInfo,bankId: String) extends TopicTrait
|
||||
case class OutboundGetBranch(authInfo: AuthInfo, bankId: String, branchId: String)extends TopicTrait
|
||||
case class OutboundGetAtms(authInfo: AuthInfo,bankId: String) extends TopicTrait
|
||||
case class OutboundGetAtm(authInfo: AuthInfo,bankId: String, atmId: String) extends TopicTrait
|
||||
|
||||
case class OutboundCreateChallengeJune2017(
|
||||
authInfo: AuthInfo,
|
||||
bankId: String,
|
||||
accountId: String,
|
||||
userId: String,
|
||||
username: String,
|
||||
transactionRequestType: String,
|
||||
transactionRequestId: String
|
||||
) extends TopicTrait
|
||||
|
||||
case class OutboundCreateCounterparty(
|
||||
authInfo: AuthInfo,
|
||||
counterparty: OutboundCounterparty
|
||||
) extends TopicTrait
|
||||
|
||||
case class OutboundGetTransactionRequests210(
|
||||
authInfo: AuthInfo,
|
||||
counterparty: OutboundTransactionRequests
|
||||
) extends TopicTrait
|
||||
|
||||
case class OutboundGetCounterparties(
|
||||
authInfo: AuthInfo,
|
||||
counterparty: InternalOutboundGetCounterparties
|
||||
) extends TopicTrait
|
||||
|
||||
case class OutboundGetCounterpartyByCounterpartyId(
|
||||
authInfo: AuthInfo,
|
||||
counterparty: OutboundGetCounterpartyById
|
||||
) extends TopicTrait
|
||||
case class OutboundGetCounterparty(authInfo: AuthInfo, thisBankId: String, thisAccountId: String, counterpartyId: String) extends TopicTrait
|
||||
|
||||
case class OutboundGetCustomersByUserId(
|
||||
authInfo: AuthInfo
|
||||
) extends TopicTrait
|
||||
|
||||
case class OutboundGetCheckbookOrderStatus(
|
||||
authInfo: AuthInfo,
|
||||
bankId: String,
|
||||
accountId: String,
|
||||
originatorApplication: String,
|
||||
originatorStationIP: String,
|
||||
primaryAccount: String
|
||||
)extends TopicTrait
|
||||
|
||||
case class OutboundGetCreditCardOrderStatus(
|
||||
authInfo: AuthInfo,
|
||||
bankId: String,
|
||||
accountId: String,
|
||||
originatorApplication: String,
|
||||
originatorStationIP: String,
|
||||
primaryAccount: String
|
||||
)extends TopicTrait
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* case classes used in Kafka message, these are InBound Kafka messages
|
||||
*/
|
||||
|
||||
case class InboundAdapterInfo(authInfo: AuthInfo, data: InboundAdapterInfoInternal)
|
||||
case class InboundGetUserByUsernamePassword(authInfo: AuthInfo, data: InboundValidatedUser)
|
||||
case class InboundGetBanks(authInfo: AuthInfo, status: Status,data: List[InboundBank])
|
||||
case class InboundGetBank(authInfo: AuthInfo, status: Status, data: InboundBank)
|
||||
case class InboundGetAccounts(authInfo: AuthInfo, status: Status, data: List[InboundAccountJune2017])
|
||||
case class InboundGetAccountbyAccountID(authInfo: AuthInfo, status: Status, data: Option[InboundAccountJune2017])
|
||||
case class InboundCheckBankAccountExists(authInfo: AuthInfo, status: Status, data: Option[InboundAccountJune2017])
|
||||
case class InboundGetCoreBankAccounts(authInfo: AuthInfo, data: List[InternalInboundCoreAccount])
|
||||
case class InboundGetTransactions(authInfo: AuthInfo, status: Status, data: List[InternalTransaction_vJune2017])
|
||||
case class InboundGetTransaction(authInfo: AuthInfo, status: Status, data: Option[InternalTransaction_vJune2017])
|
||||
case class InboundCreateChallengeJune2017(authInfo: AuthInfo, data: InternalCreateChallengeJune2017)
|
||||
case class InboundCreateCounterparty(authInfo: AuthInfo, status: Status, data: Option[InternalCounterparty])
|
||||
case class InboundGetTransactionRequests210(authInfo: AuthInfo, status: Status, data: List[TransactionRequest])
|
||||
case class InboundGetCounterparties(authInfo: AuthInfo, status: Status, data: List[InternalCounterparty])
|
||||
case class InboundGetCounterparty(authInfo: AuthInfo, status: Status, data: Option[InternalCounterparty])
|
||||
case class InboundGetCustomersByUserId(authInfo: AuthInfo, status: Status, data: List[InternalCustomer])
|
||||
case class InboundGetBranches(authInfo: AuthInfo,status: Status,data: List[InboundBranchVJune2017])
|
||||
case class InboundGetBranch(authInfo: AuthInfo,status: Status, data: Option[InboundBranchVJune2017])
|
||||
case class InboundGetAtms(authInfo: AuthInfo, status: Status, data: List[InboundAtmJune2017])
|
||||
case class InboundGetAtm(authInfo: AuthInfo, status: Status, data: Option[InboundAtmJune2017])
|
||||
case class InboundGetChecksOrderStatus(authInfo: AuthInfo, status: Status, data: CheckbookOrdersJson)
|
||||
case class InboundGetCreditCardOrderStatus(authInfo: AuthInfo, status: Status, data: List[InboundCardDetails])
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// These are case classes, used in internal message mapping
|
||||
case class InternalInboundCoreAccount(
|
||||
errorCode: String,
|
||||
backendMessages: List[InboundStatusMessage],
|
||||
id : String,
|
||||
label : String,
|
||||
bankId : String,
|
||||
accountType: String,
|
||||
accountRoutings: List[AccountRouting]
|
||||
)
|
||||
case class Status(
|
||||
errorCode: String,
|
||||
backendMessages: List[InboundStatusMessage]
|
||||
)
|
||||
case class AuthInfo(userId: String = "", username: String ="", cbsToken: String ="", isFirst: Boolean = true, correlationId: String="", sessionId :String = "")
|
||||
|
||||
case class InboundAccountJune2017(
|
||||
errorCode: String,
|
||||
cbsToken: String, //TODO, this maybe move to AuthInfo, but it is used in GatewayLogin
|
||||
bankId: String,
|
||||
branchId: String,
|
||||
accountId: String,
|
||||
accountNumber: String,
|
||||
accountType: String,
|
||||
balanceAmount: String,
|
||||
balanceCurrency: String,
|
||||
owners: List[String],
|
||||
viewsToGenerate: List[String],
|
||||
bankRoutingScheme: String,
|
||||
bankRoutingAddress: String,
|
||||
branchRoutingScheme: String,
|
||||
branchRoutingAddress: String,
|
||||
accountRoutingScheme: String,
|
||||
accountRoutingAddress: String,
|
||||
accountRouting: List[AccountRouting],
|
||||
accountRules: List[AccountRule]
|
||||
) extends InboundMessageBase with InboundAccount
|
||||
|
||||
case class BankAccountJune2017(r: InboundAccountJune2017) extends BankAccount {
|
||||
|
||||
def accountId: AccountId = AccountId(r.accountId)
|
||||
def accountType: String = r.accountType
|
||||
def balance: BigDecimal = BigDecimal(r.balanceAmount)
|
||||
def currency: String = r.balanceCurrency
|
||||
def name: String = r.owners.head
|
||||
// Note: deprecated, extends from BankAccount
|
||||
def iban: Option[String] = Some("iban")
|
||||
def number: String = r.accountNumber
|
||||
def bankId: BankId = BankId(r.bankId)
|
||||
def lastUpdate: Date = APIUtil.DateWithMsFormat.parse(today.getTime.toString)
|
||||
def accountHolder: String = r.owners.head
|
||||
|
||||
// Fields modifiable from OBP are stored in mapper
|
||||
def label: String = (for {
|
||||
d <- MappedBankAccountData.find(By(MappedBankAccountData.accountId, r.accountId))
|
||||
} yield {
|
||||
d.getLabel
|
||||
}).getOrElse(r.accountNumber)
|
||||
|
||||
def accountRoutingScheme: String = r.accountRoutingScheme
|
||||
def accountRoutingAddress: String = r.accountRoutingAddress
|
||||
def accountRoutings: List[AccountRouting] = List()
|
||||
def branchId: String = r.branchId
|
||||
|
||||
def accountRules: List[AccountRule] = r.accountRules
|
||||
|
||||
}
|
||||
|
||||
case class InternalBasicCustomer(
|
||||
bankId:String,
|
||||
customerId: String,
|
||||
customerNumber: String,
|
||||
legalName: String,
|
||||
dateOfBirth: Date
|
||||
)
|
||||
|
||||
case class InternalBasicCustomers(customers: List[InternalBasicCustomer])
|
||||
|
||||
case class InternalCreateChallengeJune2017(
|
||||
errorCode: String,
|
||||
backendMessages: List[InboundStatusMessage],
|
||||
answer : String
|
||||
)
|
||||
|
||||
case class InternalGetTransactionRequests(
|
||||
errorCode: String,
|
||||
backendMessages: List[InboundStatusMessage],
|
||||
transactionRequests:List[TransactionRequest]
|
||||
)
|
||||
|
||||
case class OutboundCounterparty(
|
||||
name: String,
|
||||
description: String,
|
||||
createdByUserId: String,
|
||||
thisBankId: String,
|
||||
thisAccountId: String,
|
||||
thisViewId: String,
|
||||
otherAccountRoutingScheme: String,
|
||||
otherAccountRoutingAddress: String,
|
||||
otherAccountSecondaryRoutingScheme: String,
|
||||
otherAccountSecondaryRoutingAddress: String,
|
||||
otherBankRoutingScheme: String,
|
||||
otherBankRoutingAddress: String,
|
||||
otherBranchRoutingScheme: String,
|
||||
otherBranchRoutingAddress: String,
|
||||
isBeneficiary:Boolean,
|
||||
bespoke: List[CounterpartyBespoke]
|
||||
)
|
||||
|
||||
case class InternalOutboundGetCounterparties(
|
||||
thisBankId: String,
|
||||
thisAccountId: String,
|
||||
viewId :String
|
||||
)
|
||||
|
||||
case class OutboundGetCounterpartyById(
|
||||
counterpartyId : String
|
||||
)
|
||||
|
||||
case class OutboundTransactionRequests(
|
||||
accountId: String,
|
||||
accountType: String,
|
||||
currency: String,
|
||||
iban: String,
|
||||
number: String,
|
||||
bankId: String,
|
||||
branchId: String,
|
||||
accountRoutingScheme: String,
|
||||
accountRoutingAddress: String
|
||||
)
|
||||
|
||||
|
||||
case class InternalCounterparty(
|
||||
createdByUserId: String,
|
||||
name: String,
|
||||
thisBankId: String,
|
||||
thisAccountId: String,
|
||||
thisViewId: String,
|
||||
counterpartyId: String,
|
||||
otherAccountRoutingScheme: String,
|
||||
otherAccountRoutingAddress: String,
|
||||
otherBankRoutingScheme: String,
|
||||
otherBankRoutingAddress: String,
|
||||
otherBranchRoutingScheme: String,
|
||||
otherBranchRoutingAddress: String,
|
||||
isBeneficiary: Boolean,
|
||||
description: String,
|
||||
currency: String,
|
||||
otherAccountSecondaryRoutingScheme: String,
|
||||
otherAccountSecondaryRoutingAddress: String,
|
||||
bespoke: List[CounterpartyBespoke]) extends CounterpartyTrait
|
||||
|
||||
|
||||
case class InternalCustomer(
|
||||
customerId: String,
|
||||
bankId: String,
|
||||
number: String,
|
||||
legalName: String,
|
||||
mobileNumber: String,
|
||||
email: String,
|
||||
faceImage: CustomerFaceImage,
|
||||
dateOfBirth: Date,
|
||||
relationshipStatus: String,
|
||||
dependents: Integer,
|
||||
dobOfDependents: List[Date],
|
||||
highestEducationAttained: String,
|
||||
employmentStatus: String,
|
||||
creditRating: CreditRating,
|
||||
creditLimit: CreditLimit,
|
||||
kycStatus: lang.Boolean,
|
||||
lastOkDate: Date
|
||||
)
|
||||
|
||||
case class ObpCustomer(
|
||||
customerId: String,
|
||||
bankId: String,
|
||||
number: String,
|
||||
legalName: String,
|
||||
mobileNumber: String,
|
||||
email: String,
|
||||
faceImage: CustomerFaceImage,
|
||||
dateOfBirth: Date,
|
||||
relationshipStatus: String,
|
||||
dependents: Integer,
|
||||
dobOfDependents: List[Date],
|
||||
highestEducationAttained: String,
|
||||
employmentStatus: String,
|
||||
creditRating: CreditRating,
|
||||
creditLimit: CreditLimit,
|
||||
kycStatus: lang.Boolean,
|
||||
lastOkDate: Date,
|
||||
title: String = "", //These new fields for V310, not from Connector for now.
|
||||
branchId: String = "", //These new fields for V310, not from Connector for now.
|
||||
nameSuffix: String = "", //These new fields for V310, not from Connector for now.
|
||||
) extends Customer
|
||||
|
||||
case class InboundBranchVJune2017(
|
||||
branchId: BranchId,
|
||||
bankId: BankId,
|
||||
name: String,
|
||||
address: Address,
|
||||
location: Location,
|
||||
lobbyString: Option[LobbyString],
|
||||
driveUpString: Option[DriveUpString],
|
||||
meta: Meta,
|
||||
branchRouting: Option[Routing],
|
||||
lobby: Option[Lobby],
|
||||
driveUp: Option[DriveUp],
|
||||
// Easy access for people who use wheelchairs etc.
|
||||
isAccessible : Option[Boolean],
|
||||
accessibleFeatures: Option[String],
|
||||
branchType : Option[String],
|
||||
moreInfo : Option[String],
|
||||
phoneNumber : Option[String],
|
||||
isDeleted : Option[Boolean]
|
||||
) extends BranchT
|
||||
|
||||
case class InboundAtmJune2017(
|
||||
atmId : AtmId,
|
||||
bankId : BankId,
|
||||
name : String,
|
||||
address : Address,
|
||||
location : Location,
|
||||
meta : Meta,
|
||||
|
||||
OpeningTimeOnMonday : Option[String],
|
||||
ClosingTimeOnMonday : Option[String],
|
||||
|
||||
OpeningTimeOnTuesday : Option[String],
|
||||
ClosingTimeOnTuesday : Option[String],
|
||||
|
||||
OpeningTimeOnWednesday : Option[String],
|
||||
ClosingTimeOnWednesday : Option[String],
|
||||
|
||||
OpeningTimeOnThursday : Option[String],
|
||||
ClosingTimeOnThursday: Option[String],
|
||||
|
||||
OpeningTimeOnFriday : Option[String],
|
||||
ClosingTimeOnFriday : Option[String],
|
||||
|
||||
OpeningTimeOnSaturday : Option[String],
|
||||
ClosingTimeOnSaturday : Option[String],
|
||||
|
||||
OpeningTimeOnSunday: Option[String],
|
||||
ClosingTimeOnSunday : Option[String],
|
||||
|
||||
isAccessible : Option[Boolean],
|
||||
|
||||
locatedAt : Option[String],
|
||||
moreInfo : Option[String],
|
||||
hasDepositCapability : Option[Boolean],
|
||||
supportedLanguages: Option[List[String]] = None,
|
||||
services: Option[List[String]] = None,
|
||||
notes: Option[List[String]] = None,
|
||||
accessibilityFeatures: Option[List[String]] = None,
|
||||
supportedCurrencies: Option[List[String]] = None,
|
||||
minimumWithdrawal: Option[String] = None,
|
||||
branchIdentification: Option[String] = None,
|
||||
locationCategories: Option[List[String]] = None,
|
||||
siteIdentification: Option[String] = None,
|
||||
siteName: Option[String] = None,
|
||||
cashWithdrawalNationalFee: Option[String] = None,
|
||||
cashWithdrawalInternationalFee: Option[String] = None,
|
||||
balanceInquiryFee: Option[String] = None,
|
||||
) extends AtmT
|
||||
|
||||
case class InternalTransaction_vJune2017(
|
||||
transactionId: String,
|
||||
accountId: String,
|
||||
amount: String,
|
||||
bankId: String,
|
||||
completedDate: String,
|
||||
counterpartyId: String,
|
||||
counterpartyName: String,
|
||||
currency: String,
|
||||
description: String,
|
||||
newBalanceAmount: String,
|
||||
newBalanceCurrency: String,
|
||||
postedDate: String,
|
||||
`type`: String,
|
||||
userId: String
|
||||
)
|
||||
|
||||
case class InboundCardDetails(
|
||||
orderId: String,
|
||||
creditCardType: String,
|
||||
cardDescription: String,
|
||||
useType: String,
|
||||
orderDate: String,
|
||||
deliveryStatus: String,
|
||||
statusDate: String,
|
||||
branch: String
|
||||
)
|
||||
|
||||
object JsonFactory_vJune2017 {
|
||||
def createCustomerJson(customer : Customer) : InternalBasicCustomer = {
|
||||
InternalBasicCustomer(
|
||||
bankId=customer.bankId,
|
||||
customerId = customer.customerId,
|
||||
customerNumber = customer.number,
|
||||
legalName = customer.legalName,
|
||||
dateOfBirth = customer.dateOfBirth
|
||||
)
|
||||
}
|
||||
def createObpCustomer(customer : InternalCustomer) : Customer = {
|
||||
ObpCustomer(
|
||||
customerId = customer.customerId,
|
||||
bankId = customer.bankId,
|
||||
number = customer.number,
|
||||
legalName = customer.legalName,
|
||||
mobileNumber = customer.mobileNumber,
|
||||
email = customer.email,
|
||||
faceImage = customer.faceImage,
|
||||
dateOfBirth = customer.dateOfBirth,
|
||||
relationshipStatus = customer.relationshipStatus,
|
||||
dependents = customer.dependents,
|
||||
dobOfDependents = customer.dobOfDependents,
|
||||
highestEducationAttained = customer.highestEducationAttained,
|
||||
employmentStatus = customer.employmentStatus,
|
||||
creditRating = customer.creditRating,
|
||||
creditLimit = customer.creditLimit,
|
||||
kycStatus = customer.kycStatus,
|
||||
lastOkDate = customer.lastOkDate,
|
||||
)
|
||||
}
|
||||
|
||||
def createCustomersJson(customers : List[Customer]) : InternalBasicCustomers = {
|
||||
InternalBasicCustomers(customers.map(createCustomerJson))
|
||||
}
|
||||
|
||||
def createObpCustomers(customers : List[InternalCustomer]) : List[Customer] = {
|
||||
customers.map(createObpCustomer)
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,600 +0,0 @@
|
||||
/**
|
||||
Open Bank Project - API
|
||||
Copyright (C) 2011-2019, TESOBE GmbH.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Email: contact@tesobe.com
|
||||
TESOBE GmbH.
|
||||
Osloer Strasse 16/17
|
||||
Berlin 13359, Germany
|
||||
|
||||
This product includes software developed at
|
||||
TESOBE (http://www.tesobe.com/)
|
||||
|
||||
*/
|
||||
package code.bankconnectors.vMar2017
|
||||
|
||||
import java.util.Date
|
||||
|
||||
import code.api.util.APIUtil
|
||||
import code.api.util.APIUtil.{MessageDoc}
|
||||
import com.openbankproject.commons.model.FXRate
|
||||
import code.model._
|
||||
import code.model.dataAccess.MappedBankAccountData
|
||||
import com.openbankproject.commons.model.TransactionRequestTypeCharge
|
||||
import com.openbankproject.commons.model.{CounterpartyTrait, _}
|
||||
import net.liftweb.json.JsonAST.JValue
|
||||
import net.liftweb.mapper.By
|
||||
import net.liftweb.util.Helpers.today
|
||||
|
||||
import scala.collection.immutable.List
|
||||
|
||||
|
||||
|
||||
// Only used for import
|
||||
case class InboundAccountData(
|
||||
banks: List[InboundBank],
|
||||
users: List[InboundUser],
|
||||
accounts: List[InboundAccount_vMar2017]
|
||||
)
|
||||
|
||||
case class OutboundUserByUsernamePasswordBase(
|
||||
messageFormat: String,
|
||||
action: String,
|
||||
username: String,
|
||||
password: String
|
||||
)extends OutboundMessageBase
|
||||
|
||||
case class OutboundAdapterInfo(
|
||||
messageFormat: String,
|
||||
action: String,
|
||||
date: String
|
||||
) extends OutboundMessageBase
|
||||
|
||||
case class OutboundUserAccountViewsBase(
|
||||
messageFormat: String,
|
||||
action: String,
|
||||
username: String,
|
||||
userId: String,
|
||||
bankId: String
|
||||
)extends OutboundMessageBase
|
||||
|
||||
|
||||
case class OutboundBanksBase(
|
||||
messageFormat: String,
|
||||
action: String,
|
||||
username: String,
|
||||
userId: String
|
||||
) extends OutboundMessageBase
|
||||
|
||||
case class OUTTBank(
|
||||
messageFormat: String,
|
||||
action: String,
|
||||
bankId: String,
|
||||
userId: String,
|
||||
username: String
|
||||
)extends OutboundMessageBase
|
||||
|
||||
case class OutboundChallengeThresholdBase(
|
||||
messageFormat: String,
|
||||
action: String,
|
||||
bankId: String,
|
||||
accountId: String,
|
||||
viewId: String,
|
||||
transactionRequestType: String,
|
||||
currency: String,
|
||||
userId: String,
|
||||
username: String
|
||||
) extends OutboundMessageBase
|
||||
|
||||
case class OutboundChargeLevelBase(
|
||||
messageFormat: String,
|
||||
action: String,
|
||||
bankId: String,
|
||||
accountId: String,
|
||||
viewId: String,
|
||||
userId: String,
|
||||
username: String,
|
||||
transactionRequestType: String,
|
||||
currency: String
|
||||
) extends OutboundMessageBase
|
||||
|
||||
case class OutboundChallengeBase(
|
||||
messageFormat: String,
|
||||
action: String,
|
||||
bankId: String,
|
||||
accountId: String,
|
||||
userId: String,
|
||||
username: String,
|
||||
transactionRequestType: String,
|
||||
transactionRequestId: String
|
||||
) extends OutboundMessageBase
|
||||
|
||||
case class OutboundChallengeAnswerBase(
|
||||
messageFormat: String,
|
||||
action: String,
|
||||
userId: String,
|
||||
username: String,
|
||||
challengeId: String,
|
||||
hashOfSuppliedAnswer: String
|
||||
) extends OutboundMessageBase
|
||||
|
||||
case class OutboundTransactionQueryBase(
|
||||
messageFormat: String,
|
||||
action: String,
|
||||
userId: String,
|
||||
username: String,
|
||||
bankId: String,
|
||||
accountId: String,
|
||||
transactionId: String
|
||||
) extends OutboundMessageBase
|
||||
|
||||
case class OutboundTransactionsQueryWithParamsBase(
|
||||
messageFormat: String,
|
||||
action: String,
|
||||
userId: String,
|
||||
username: String,
|
||||
bankId: String,
|
||||
accountId: String,
|
||||
queryParams: String
|
||||
) extends OutboundMessageBase
|
||||
|
||||
case class OutboundBankAccountBase(
|
||||
messageFormat: String,
|
||||
action: String,
|
||||
userId: String,
|
||||
username: String,
|
||||
bankId: String,
|
||||
accountId: String
|
||||
) extends OutboundMessageBase
|
||||
|
||||
case class OutboundBankAccountsBase(
|
||||
messageFormat: String,
|
||||
action: String,
|
||||
userId: String,
|
||||
username: String,
|
||||
bankId: String,
|
||||
accountId: String
|
||||
) extends OutboundMessageBase
|
||||
|
||||
case class OutboundAccountByNumberBase(
|
||||
messageFormat: String,
|
||||
action: String,
|
||||
userId: String,
|
||||
username: String,
|
||||
bankId: String,
|
||||
number: String
|
||||
) extends OutboundMessageBase
|
||||
|
||||
case class OutboundCounterpartyByIbanBase(
|
||||
messageFormat: String,
|
||||
action: String,
|
||||
userId: String,
|
||||
username: String,
|
||||
otherAccountRoutingAddress: String,
|
||||
otherAccountRoutingScheme: String
|
||||
) extends OutboundMessageBase
|
||||
|
||||
case class OutboundCounterpartyByCounterpartyIdBase(
|
||||
messageFormat: String,
|
||||
action: String,
|
||||
userId: String,
|
||||
username: String,
|
||||
counterpartyId: String
|
||||
) extends OutboundMessageBase
|
||||
|
||||
case class OutboundSaveTransactionBase(
|
||||
messageFormat: String,
|
||||
action: String,
|
||||
userId: String,
|
||||
username: String,
|
||||
|
||||
// fromAccount
|
||||
fromAccountName: String,
|
||||
fromAccountId: String,
|
||||
fromAccountBankId: String,
|
||||
|
||||
// transaction details
|
||||
transactionId: String,
|
||||
transactionRequestType: String,
|
||||
transactionAmount: String,
|
||||
transactionCurrency: String,
|
||||
transactionChargePolicy: String,
|
||||
transactionChargeAmount: String,
|
||||
transactionChargeCurrency: String,
|
||||
transactionDescription: String,
|
||||
transactionPostedDate: String,
|
||||
|
||||
// toAccount or toCounterparty
|
||||
toCounterpartyId: String,
|
||||
toCounterpartyName: String,
|
||||
toCounterpartyCurrency: String,
|
||||
toCounterpartyRoutingAddress: String,
|
||||
toCounterpartyRoutingScheme: String,
|
||||
toCounterpartyBankRoutingAddress: String,
|
||||
toCounterpartyBankRoutingScheme: String
|
||||
) extends OutboundMessageBase
|
||||
|
||||
case class OutboundTransactionRequestStatusesBase(
|
||||
messageFormat: String,
|
||||
action: String
|
||||
) extends OutboundMessageBase
|
||||
|
||||
case class OutboundCurrentFxRateBase(
|
||||
messageFormat: String,
|
||||
action: String,
|
||||
userId: String,
|
||||
username: String,
|
||||
bankId: String,
|
||||
fromCurrencyCode: String,
|
||||
toCurrencyCode: String
|
||||
) extends OutboundMessageBase
|
||||
|
||||
case class OutboundTransactionRequestTypeChargeBase(
|
||||
messageFormat: String,
|
||||
action: String,
|
||||
userId: String,
|
||||
username: String,
|
||||
bankId: String,
|
||||
accountId: String,
|
||||
viewId: String,
|
||||
transactionRequestType: String
|
||||
) extends OutboundMessageBase
|
||||
|
||||
case class InboundValidatedUser(
|
||||
errorCode: String,
|
||||
backendMessages: List[InboundStatusMessage],
|
||||
email: String,
|
||||
displayName: String
|
||||
) extends InboundMessageBase
|
||||
|
||||
case class InboundCounterparty(
|
||||
errorCode: String,
|
||||
name: String,
|
||||
createdByUserId: String,
|
||||
thisBankId: String,
|
||||
thisAccountId: String,
|
||||
thisViewId: String,
|
||||
counterpartyId: String,
|
||||
otherBankRoutingScheme: String,
|
||||
otherBankRoutingAddress: String,
|
||||
otherAccountRoutingScheme: String,
|
||||
otherAccountRoutingAddress: String,
|
||||
otherBranchRoutingScheme: String,
|
||||
otherBranchRoutingAddress: String,
|
||||
isBeneficiary: Boolean
|
||||
) extends InboundMessageBase
|
||||
|
||||
case class CounterpartyTrait2(counterparty: InboundCounterparty) extends CounterpartyTrait {
|
||||
|
||||
def createdByUserId: String = counterparty.createdByUserId
|
||||
def name: String = counterparty.name
|
||||
def thisBankId: String = counterparty.thisBankId
|
||||
def thisAccountId: String = counterparty.thisAccountId
|
||||
def thisViewId: String = counterparty.thisViewId
|
||||
def counterpartyId: String = counterparty.counterpartyId
|
||||
def otherAccountRoutingScheme: String = counterparty.otherAccountRoutingScheme
|
||||
def otherAccountRoutingAddress: String = counterparty.otherAccountRoutingAddress
|
||||
def otherBankRoutingScheme: String = counterparty.otherBankRoutingScheme
|
||||
def otherBankRoutingAddress: String = counterparty.otherBankRoutingAddress
|
||||
def otherBranchRoutingScheme: String = counterparty.otherBranchRoutingScheme
|
||||
def otherBranchRoutingAddress: String = counterparty.otherBranchRoutingAddress
|
||||
def isBeneficiary: Boolean = counterparty.isBeneficiary
|
||||
def description: String = ""
|
||||
def currency: String = ""
|
||||
def otherAccountSecondaryRoutingScheme: String = ""
|
||||
def otherAccountSecondaryRoutingAddress: String = ""
|
||||
def bespoke: List[CounterpartyBespoke] = Nil
|
||||
}
|
||||
|
||||
case class InboundBank(
|
||||
bankId: String,
|
||||
name: String,
|
||||
logo: String,
|
||||
url: String
|
||||
)
|
||||
|
||||
case class Bank2(r: InboundBank) extends Bank {
|
||||
|
||||
def fullName = r.name
|
||||
def shortName = r.name
|
||||
def logoUrl = r.logo
|
||||
def bankId = BankId(r.bankId)
|
||||
def nationalIdentifier = "None"
|
||||
def swiftBic = "None"
|
||||
def websiteUrl = r.url
|
||||
def bankRoutingScheme = "None"
|
||||
def bankRoutingAddress = "None"
|
||||
}
|
||||
|
||||
case class InboundAccount_vMar2017(
|
||||
errorCode: String,
|
||||
accountId: String,
|
||||
bankId: String,
|
||||
label: String,
|
||||
number: String,
|
||||
`type`: String,
|
||||
balanceAmount: String,
|
||||
balanceCurrency: String,
|
||||
iban: String,
|
||||
owners: List[String],
|
||||
generatePublicView: Boolean,
|
||||
generateAccountantsView: Boolean,
|
||||
generateAuditorsView: Boolean,
|
||||
accountRoutingScheme: String = "None",
|
||||
accountRoutingAddress: String = "None",
|
||||
branchId: String = "None"
|
||||
)extends InboundMessageBase
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
case class BankAccount2(r: InboundAccount_vMar2017) extends BankAccount {
|
||||
|
||||
def accountId: AccountId = AccountId(r.accountId)
|
||||
def accountType: String = r.`type`
|
||||
def balance: BigDecimal = BigDecimal(r.balanceAmount)
|
||||
def currency: String = r.balanceCurrency
|
||||
def name: String = r.owners.head
|
||||
def iban: Option[String] = Some(r.iban)
|
||||
def number: String = r.number
|
||||
def bankId: BankId = BankId(r.bankId)
|
||||
def lastUpdate: Date = APIUtil.DateWithMsFormat.parse(today.getTime.toString)
|
||||
def accountHolder: String = r.owners.head
|
||||
|
||||
// Fields modifiable from OBP are stored in mapper
|
||||
def label: String = (for {
|
||||
d <- MappedBankAccountData.find(By(MappedBankAccountData.accountId, r.accountId))
|
||||
} yield {
|
||||
d.getLabel
|
||||
}).getOrElse(r.number)
|
||||
|
||||
def accountRoutingScheme: String = r.accountRoutingScheme
|
||||
def accountRoutingAddress: String = r.accountRoutingAddress
|
||||
def accountRoutings: List[AccountRouting] = List()
|
||||
def branchId: String = r.branchId
|
||||
|
||||
def accountRules: List[AccountRule] = List()
|
||||
|
||||
}
|
||||
|
||||
case class InboundFXRate(
|
||||
errorCode: String,
|
||||
bankId: String,
|
||||
fromCurrencyCode: String,
|
||||
toCurrencyCode: String,
|
||||
conversionValue: Double,
|
||||
inverseConversionValue: Double,
|
||||
effectiveDate: String
|
||||
)extends InboundMessageBase
|
||||
|
||||
case class FXRate2(inboundFxRate: InboundFXRate) extends FXRate {
|
||||
|
||||
def bankId: BankId = BankId(inboundFxRate.bankId)
|
||||
def fromCurrencyCode: String = inboundFxRate.fromCurrencyCode
|
||||
def toCurrencyCode: String = inboundFxRate.toCurrencyCode
|
||||
def conversionValue: Double = inboundFxRate.conversionValue
|
||||
def inverseConversionValue: Double = inboundFxRate.inverseConversionValue
|
||||
//TODO need to add error handling here for String --> Date transfer
|
||||
def effectiveDate: Date = APIUtil.DateWithMsFormat.parse(inboundFxRate.effectiveDate)
|
||||
}
|
||||
|
||||
case class InboundTransactionRequestTypeCharge(
|
||||
errorCode: String,
|
||||
transactionRequestType: String,
|
||||
bankId: String,
|
||||
chargeCurrency: String,
|
||||
chargeAmount: String,
|
||||
chargeSummary: String
|
||||
)extends InboundMessageBase
|
||||
|
||||
case class TransactionRequestTypeCharge2(inboundTransactionRequestTypeCharge: InboundTransactionRequestTypeCharge) extends TransactionRequestTypeCharge {
|
||||
|
||||
def transactionRequestTypeId: String = inboundTransactionRequestTypeCharge.transactionRequestType
|
||||
def bankId: String = inboundTransactionRequestTypeCharge.bankId
|
||||
def chargeCurrency: String = inboundTransactionRequestTypeCharge.chargeCurrency
|
||||
def chargeAmount: String = inboundTransactionRequestTypeCharge.chargeAmount
|
||||
def chargeSummary: String = inboundTransactionRequestTypeCharge.chargeSummary
|
||||
}
|
||||
|
||||
case class InboundTransactionStatus(
|
||||
transactionId: String,
|
||||
transactionStatus: String,
|
||||
transactionTimestamp: String
|
||||
) extends TransactionStatus
|
||||
|
||||
case class InboundTransactionRequestStatus(
|
||||
transactionRequestId: String,
|
||||
bulkTransactionsStatus: List[InboundTransactionStatus]
|
||||
)
|
||||
|
||||
case class TransactionRequestStatus2(kafkaInboundTransactionRequestStatus: InboundTransactionRequestStatus) extends TransactionRequestStatus {
|
||||
|
||||
override def transactionRequestId: String = kafkaInboundTransactionRequestStatus.transactionRequestId
|
||||
override def bulkTransactionsStatus: List[TransactionStatus] = kafkaInboundTransactionRequestStatus.bulkTransactionsStatus
|
||||
}
|
||||
|
||||
|
||||
/** Bank Branches
|
||||
*
|
||||
* @param id Uniquely identifies the Branch within the Bank. SHOULD be url friendly (no spaces etc.) Used in URLs
|
||||
* @param bankId MUST match bank_id in Banks
|
||||
* @param name Informal name for the Branch
|
||||
* @param address Address
|
||||
* @param location Geolocation
|
||||
* @param meta Meta information including the license this information is published under
|
||||
* @param lobby Info about when the lobby doors are open
|
||||
* @param driveUp Info about when automated facilities are open e.g. cash point machine
|
||||
*/
|
||||
case class InboundBranch(
|
||||
id: String,
|
||||
bankId: String,
|
||||
name: String,
|
||||
address: InboundAddress,
|
||||
location: InboundLocation,
|
||||
meta: InboundMeta,
|
||||
lobby: Option[InboundLobby],
|
||||
driveUp: Option[InboundDriveUp]
|
||||
)
|
||||
|
||||
case class InboundLicense(
|
||||
id: String,
|
||||
name: String
|
||||
)
|
||||
|
||||
case class InboundMeta(
|
||||
license: InboundLicense
|
||||
)
|
||||
|
||||
case class InboundLobby(
|
||||
hours: String
|
||||
)
|
||||
|
||||
case class InboundDriveUp(
|
||||
hours: String
|
||||
)
|
||||
|
||||
/**
|
||||
*
|
||||
* @param line1 Line 1 of Address
|
||||
* @param line2 Line 2 of Address
|
||||
* @param line3 Line 3 of Address
|
||||
* @param city City
|
||||
* @param county County i.e. Division of State
|
||||
* @param state State i.e. Division of Country
|
||||
* @param postCode Post Code or Zip Code
|
||||
* @param countryCode 2 letter country code: ISO 3166-1 alpha-2
|
||||
*/
|
||||
case class InboundAddress(
|
||||
line1: String,
|
||||
line2: String,
|
||||
line3: String,
|
||||
city: String,
|
||||
county: String, // Division of State
|
||||
state: String, // Division of Country
|
||||
postCode: String,
|
||||
countryCode: String
|
||||
)
|
||||
|
||||
case class InboundLocation(
|
||||
latitude: Double,
|
||||
longitude: Double
|
||||
)
|
||||
|
||||
|
||||
//InboundTransaction --> InternalTransaction -->OutboundTransaction
|
||||
case class InternalTransaction(
|
||||
errorCode: String,
|
||||
backendMessages: List[InboundStatusMessage],
|
||||
transactionId: String,
|
||||
accountId: String,
|
||||
amount: String,
|
||||
bankId: String,
|
||||
completedDate: String,
|
||||
counterpartyId: String,
|
||||
counterpartyName: String,
|
||||
currency: String,
|
||||
description: String,
|
||||
newBalanceAmount: String,
|
||||
newBalanceCurrency: String,
|
||||
postedDate: String,
|
||||
`type`: String,
|
||||
userId: String
|
||||
)extends InboundMessageBase
|
||||
|
||||
case class InboundAtm(
|
||||
id: String,
|
||||
bankId: String,
|
||||
name: String,
|
||||
address: InboundAddress,
|
||||
location: InboundLocation,
|
||||
meta: InboundMeta
|
||||
)
|
||||
|
||||
case class InboundProduct(
|
||||
bankId: String,
|
||||
code: String,
|
||||
name: String,
|
||||
category: String,
|
||||
family: String,
|
||||
superFamily: String,
|
||||
moreInfoUrl: String,
|
||||
meta: InboundMeta
|
||||
)
|
||||
|
||||
|
||||
case class InboundCrmEvent(
|
||||
id: String, // crmEventId
|
||||
bankId: String,
|
||||
customer: InboundCustomer,
|
||||
category: String,
|
||||
detail: String,
|
||||
channel: String,
|
||||
actualDate: String
|
||||
)
|
||||
|
||||
case class InboundCustomer(
|
||||
name: String,
|
||||
number: String // customer number, also known as ownerId (owner of accounts) aka API User?
|
||||
)
|
||||
|
||||
case class InboundTransactionId(
|
||||
errorCode: String,
|
||||
transactionId: String
|
||||
)extends InboundMessageBase
|
||||
|
||||
case class OutboundTransaction(
|
||||
action: String,
|
||||
version: String,
|
||||
userId: String,
|
||||
userName: String,
|
||||
accountId: String,
|
||||
currency: String,
|
||||
amount: String,
|
||||
otherAccountId: String,
|
||||
otherAccountCurrency: String,
|
||||
transactionType: String)
|
||||
|
||||
case class InboundChallengeLevel(
|
||||
errorCode: String,
|
||||
limit: String,
|
||||
currency: String
|
||||
)extends InboundMessageBase
|
||||
|
||||
|
||||
case class InboundCreateChallange(
|
||||
errorCode: String,
|
||||
challengeId: String
|
||||
)extends InboundMessageBase
|
||||
|
||||
case class InboundValidateChallangeAnswer(
|
||||
answer: String,
|
||||
errorCode: String
|
||||
)extends InboundMessageBase
|
||||
|
||||
case class InboundChargeLevel(
|
||||
errorCode: String,
|
||||
currency: String,
|
||||
amount: String
|
||||
)extends InboundMessageBase
|
||||
|
||||
|
||||
object JsonFactory_vMar2017 {
|
||||
// moved to Json factory v2.0.0
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -37,8 +37,6 @@ import code.api.util.ExampleValue._
|
||||
import code.api.util._
|
||||
import code.api.v2_1_0.TransactionRequestBodyCommonJSON
|
||||
import code.bankconnectors._
|
||||
import code.bankconnectors.vJune2017.{InternalCustomer, JsonFactory_vJune2017}
|
||||
import code.bankconnectors.vMar2017._
|
||||
import code.bankconnectors.vSept2018.KafkaMappedConnector_vSept2018
|
||||
import code.customer._
|
||||
import code.kafka.{KafkaHelper, Topics}
|
||||
|
||||
@ -3,8 +3,6 @@ package code.bankconnectors.vSept2018
|
||||
import java.util.Date
|
||||
|
||||
import code.api.util.APIUtil
|
||||
import code.bankconnectors.vJune2017.InternalCustomer
|
||||
import code.bankconnectors.vMar2017._
|
||||
import code.branches.Branches.{DriveUpString, LobbyString}
|
||||
import code.model.dataAccess.MappedBankAccountData
|
||||
import com.openbankproject.commons.model.{CounterpartyTrait, Customer, UserAuthContext, _}
|
||||
@ -164,18 +162,6 @@ case class InternalInboundCoreAccount(
|
||||
accountRoutings: List[AccountRouting]
|
||||
)
|
||||
|
||||
case class AuthInfo(
|
||||
userId: String = "",
|
||||
username: String = "",
|
||||
cbsToken: String = "",
|
||||
isFirst: Boolean = true,
|
||||
correlationId: String = "",
|
||||
sessionId: String = "",
|
||||
linkedCustomers: List[BasicCustomer] = Nil,
|
||||
userAuthContexts: List[BasicUserAuthContext]= Nil,
|
||||
authViews: List[AuthView] = Nil,
|
||||
)
|
||||
|
||||
case class InboundAuthInfo(
|
||||
cbsToken: String = "",
|
||||
sessionId: String = ""
|
||||
@ -236,12 +222,6 @@ case class BankAccountSept2018(r: InboundAccountSept2018) extends BankAccount {
|
||||
|
||||
}
|
||||
|
||||
case class BasicCustomer(
|
||||
customerId: String,
|
||||
customerNumber: String,
|
||||
legalName: String,
|
||||
)
|
||||
|
||||
case class InternalCreateChallengeSept2018(
|
||||
errorCode: String,
|
||||
backendMessages: List[InboundStatusMessage],
|
||||
|
||||
@ -39,8 +39,6 @@ import com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SCA
|
||||
import code.api.util._
|
||||
import code.api.v2_1_0.TransactionRequestBodyCommonJSON
|
||||
import code.bankconnectors._
|
||||
import code.bankconnectors.vJune2017.{InternalCustomer, JsonFactory_vJune2017}
|
||||
import code.bankconnectors.vMar2017._
|
||||
import code.context.UserAuthContextProvider
|
||||
import code.customer._
|
||||
import code.kafka.{KafkaHelper, Topics}
|
||||
@ -1499,7 +1497,7 @@ trait KafkaMappedConnector_vSept2018 extends Connector with KafkaHelper with Mdc
|
||||
|
||||
future map {
|
||||
case Full(inbound) if (inbound.status.hasNoError) =>
|
||||
Full(JsonFactory_vJune2017.createObpCustomers(inbound.data))
|
||||
Full(KafkaMappedConnector_vSept2018.createObpCustomers(inbound.data))
|
||||
case Full(inbound) if (inbound.status.hasError) =>
|
||||
Failure("INTERNAL-"+ inbound.status.errorCode+". + CoreBank-Status:" + inbound.status.backendMessages)
|
||||
case failureOrEmpty => failureOrEmpty
|
||||
@ -3839,7 +3837,44 @@ trait KafkaMappedConnector_vSept2018 extends Connector with KafkaHelper with Mdc
|
||||
|
||||
|
||||
object KafkaMappedConnector_vSept2018 extends KafkaMappedConnector_vSept2018{
|
||||
|
||||
def createCustomerJson(customer : Customer) : InternalBasicCustomer = {
|
||||
InternalBasicCustomer(
|
||||
bankId=customer.bankId,
|
||||
customerId = customer.customerId,
|
||||
customerNumber = customer.number,
|
||||
legalName = customer.legalName,
|
||||
dateOfBirth = customer.dateOfBirth
|
||||
)
|
||||
}
|
||||
def createObpCustomer(customer : InternalCustomer) : Customer = {
|
||||
ObpCustomer(
|
||||
customerId = customer.customerId,
|
||||
bankId = customer.bankId,
|
||||
number = customer.number,
|
||||
legalName = customer.legalName,
|
||||
mobileNumber = customer.mobileNumber,
|
||||
email = customer.email,
|
||||
faceImage = customer.faceImage,
|
||||
dateOfBirth = customer.dateOfBirth,
|
||||
relationshipStatus = customer.relationshipStatus,
|
||||
dependents = customer.dependents,
|
||||
dobOfDependents = customer.dobOfDependents,
|
||||
highestEducationAttained = customer.highestEducationAttained,
|
||||
employmentStatus = customer.employmentStatus,
|
||||
creditRating = customer.creditRating,
|
||||
creditLimit = customer.creditLimit,
|
||||
kycStatus = customer.kycStatus,
|
||||
lastOkDate = customer.lastOkDate,
|
||||
)
|
||||
}
|
||||
|
||||
def createCustomersJson(customers : List[Customer]) : InternalBasicCustomers = {
|
||||
InternalBasicCustomers(customers.map(createCustomerJson))
|
||||
}
|
||||
|
||||
def createObpCustomers(customers : List[InternalCustomer]) : List[Customer] = {
|
||||
customers.map(createObpCustomer)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1034,8 +1034,7 @@ def restoreSomeSessions(): Unit = {
|
||||
|
||||
// If user cannot be found locally, try to authenticate user via connector
|
||||
case Empty if (APIUtil.getPropsAsBoolValue("connector.user.authentication", false) ||
|
||||
APIUtil.getPropsAsBoolValue("kafka.user.authentication", false) ||
|
||||
APIUtil.getPropsAsBoolValue("obpjvm.user.authentication", false)) =>
|
||||
APIUtil.getPropsAsBoolValue("kafka.user.authentication", false) ) =>
|
||||
|
||||
val preLoginState = capturePreLoginState()
|
||||
logger.info("login redirect: " + loginRedirect.get)
|
||||
@ -1092,7 +1091,7 @@ def restoreSomeSessions(): Unit = {
|
||||
*/
|
||||
def testExternalPassword(usernameFromGui: String, passwordFromGui: String): Boolean = {
|
||||
// TODO Remove kafka and obpjvm special cases
|
||||
if (connector.startsWith("kafka") || connector == "obpjvm") {
|
||||
if (connector.startsWith("kafka")) {
|
||||
getUserFromConnector(usernameFromGui, passwordFromGui) match {
|
||||
case Full(user:AuthUser) => true
|
||||
case _ => false
|
||||
@ -1110,7 +1109,7 @@ def restoreSomeSessions(): Unit = {
|
||||
*/
|
||||
def externalUserHelper(name: String, password: String): Box[AuthUser] = {
|
||||
// TODO Remove kafka and obpjvm special cases
|
||||
if (connector.startsWith("kafka") || connector == "obpjvm") {
|
||||
if (connector.startsWith("kafka") ) {
|
||||
for {
|
||||
user <- getUserFromConnector(name, password)
|
||||
u <- Users.users.vend.getUserByUserName(name)
|
||||
@ -1132,7 +1131,7 @@ def restoreSomeSessions(): Unit = {
|
||||
* This method will update the views and createAccountHolder ....
|
||||
*/
|
||||
def registeredUserHelper(username: String) = {
|
||||
if (connector.startsWith("kafka") || connector == "obpjvm") {
|
||||
if (connector.startsWith("kafka")) {
|
||||
for {
|
||||
u <- Users.users.vend.getUserByUserName(username)
|
||||
} yield {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package code.api
|
||||
|
||||
import code.api.util.{APIUtil, ErrorMessages}
|
||||
import code.bankconnectors.vJune2017.InboundAccountJune2017
|
||||
import com.openbankproject.commons.model._
|
||||
import code.setup.{APIResponse, DefaultUsers, ServerSetup}
|
||||
import net.liftweb.common.Full
|
||||
import net.liftweb.json
|
||||
|
||||
@ -418,13 +418,6 @@ class API2_2_0Test extends V220ServerSetup with DefaultUsers {
|
||||
}
|
||||
|
||||
feature("Get Message Docs - v2.2.0"){
|
||||
scenario("Get Message Docs - kafka_vJune2017") {
|
||||
val request = (v2_2Request / "message-docs" / "kafka_vJune2017" )
|
||||
val response: APIResponse = makeGetRequest(request)
|
||||
|
||||
response.code should be (200)
|
||||
}
|
||||
|
||||
scenario("Get Message Docs - akka_vDec2018") {
|
||||
val request = (v2_2Request / "message-docs" / "akka_vDec2018" )
|
||||
val response: APIResponse = makeGetRequest(request)
|
||||
|
||||
@ -29,7 +29,6 @@ import code.api.JSONFactoryGateway.PayloadOfJwtJSON
|
||||
import code.api.util.{APIUtil, CallContext, CustomJsonFormats}
|
||||
import code.bankconnectors.Connector
|
||||
import code.bankconnectors.storedprocedure.StoredProcedureConnector_vDec2019
|
||||
import code.bankconnectors.vMar2017.InboundBank
|
||||
import code.bankconnectors.vSept2018._
|
||||
import code.kafka.KafkaHelper
|
||||
import code.setup.{DefaultUsers, KafkaSetup, ServerSetupWithTestData}
|
||||
|
||||
@ -27,7 +27,6 @@ Berlin 13359, Germany
|
||||
import code.api.JSONFactoryGateway.PayloadOfJwtJSON
|
||||
import code.api.util.{APIUtil, CallContext, CustomJsonFormats}
|
||||
import code.bankconnectors.Connector
|
||||
import code.bankconnectors.vMar2017.InboundBank
|
||||
import code.bankconnectors.vSept2018._
|
||||
import code.kafka.KafkaHelper
|
||||
import code.setup.{KafkaSetup, ServerSetupWithTestData}
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
package code.connector
|
||||
|
||||
import code.accountholders.MapperAccountHolders
|
||||
import code.bankconnectors.Connector
|
||||
import code.setup.{DefaultUsers, ServerSetup}
|
||||
import code.views.system.ViewDefinition
|
||||
|
||||
class June2017Test extends ServerSetup with DefaultUsers {
|
||||
|
||||
|
||||
override def beforeAll() = {
|
||||
super.beforeAll()
|
||||
Connector.connector.default.set(MockedJune2017Connector)
|
||||
ViewDefinition.bulkDelete_!!()
|
||||
MapperAccountHolders.bulkDelete_!!()
|
||||
}
|
||||
|
||||
override def afterEach() = {
|
||||
super.afterEach()
|
||||
Connector.connector.default.set(Connector.buildOne)
|
||||
ViewDefinition.bulkDelete_!!()
|
||||
MapperAccountHolders.bulkDelete_!!()
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,39 +0,0 @@
|
||||
package code.connector
|
||||
|
||||
|
||||
import code.api.util.APIUtil.MessageDoc
|
||||
import code.api.util.CustomJsonFormats
|
||||
import code.bankconnectors.vJune2017.{InboundGetTransactionRequests210, InternalGetTransactionRequests, KafkaMappedConnector_vJune2017, OutboundGetTransactionRequests210}
|
||||
import com.openbankproject.commons.model.TransactionRequest
|
||||
import code.util.Helper.MdcLoggable
|
||||
import net.liftweb.json.Extraction
|
||||
import net.liftweb.json.JsonAST.JValue
|
||||
import org.scalatest._
|
||||
|
||||
import scala.collection.mutable.ArrayBuffer
|
||||
|
||||
class June2017UnitTest extends FunSuite
|
||||
with Matchers
|
||||
with MdcLoggable with CustomJsonFormats {
|
||||
|
||||
|
||||
test("getTransactionRequests210 kafka message") {
|
||||
val messageDocs: ArrayBuffer[MessageDoc] = KafkaMappedConnector_vJune2017.messageDocs.filter(_.process=="obp.getTransactionRequests210")
|
||||
val outboundMessage: JValue = Extraction.decompose(messageDocs.head.exampleOutboundMessage)
|
||||
val inboundMessage: JValue = Extraction.decompose(messageDocs.head.exampleInboundMessage)
|
||||
|
||||
|
||||
val outboundGetTransactionRequests210: OutboundGetTransactionRequests210 = outboundMessage.extract[OutboundGetTransactionRequests210]
|
||||
|
||||
val inboundGetTransactionRequests210: InboundGetTransactionRequests210 = inboundMessage.extract[InboundGetTransactionRequests210]
|
||||
val internalGetTransactionRequests: List[TransactionRequest] = inboundGetTransactionRequests210.data
|
||||
|
||||
|
||||
outboundGetTransactionRequests210 shouldBe a [OutboundGetTransactionRequests210]
|
||||
internalGetTransactionRequests shouldBe a [List[_]]
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
package code.connector
|
||||
|
||||
import code.api.util.{CallContext, CustomJsonFormats}
|
||||
import code.bankconnectors._
|
||||
import code.setup.{DefaultConnectorTestSetup, DefaultUsers, ServerSetup}
|
||||
import code.util.Helper.MdcLoggable
|
||||
import com.openbankproject.commons.model.{AccountId, BankId, BankIdAccountId, InboundAccount, InboundAccountCommons}
|
||||
import net.liftweb.common.{Box, Full}
|
||||
|
||||
import scala.collection.immutable.List
|
||||
import com.openbankproject.commons.ExecutionContext.Implicits.global
|
||||
import net.liftweb.json.Formats
|
||||
|
||||
import scala.concurrent.Future
|
||||
|
||||
/**
|
||||
* Created by zhanghongwei on 14/07/2017.
|
||||
*/
|
||||
object MockedCbsConnector extends ServerSetup
|
||||
with Connector with DefaultUsers
|
||||
with DefaultConnectorTestSetup with MdcLoggable {
|
||||
override implicit val formats: Formats = CustomJsonFormats.nullTolerateFormats
|
||||
implicit override val nameOfConnector = "MockedCardConnector"
|
||||
|
||||
//These bank id and account ids are real data over adapter
|
||||
val bankIdAccountId = BankIdAccountId(BankId("obp-bank-x-gh"),AccountId("KOa4M8UfjUuWPIXwPXYPpy5FoFcTUwpfHgXC1qpSluc"))
|
||||
val bankIdAccountId2 = BankIdAccountId(BankId("obp-bank-x-gh"),AccountId("tKWSUBy6sha3Vhxc/vw9OK96a0RprtoxUuObMYR29TI"))
|
||||
|
||||
override def getBankAccountsForUserLegacy(username: String, callContext: Option[CallContext]): Box[(List[InboundAccount], Option[CallContext])] = {
|
||||
Full(
|
||||
List(InboundAccountCommons(
|
||||
bankId = bankIdAccountId.bankId.value,
|
||||
branchId = "",
|
||||
accountId = bankIdAccountId.accountId.value,
|
||||
accountNumber = "",
|
||||
accountType = "",
|
||||
balanceAmount = "",
|
||||
balanceCurrency = "",
|
||||
owners = List(""),
|
||||
viewsToGenerate = "Owner" :: "_Public" :: "Accountant" :: "Auditor" :: Nil,
|
||||
bankRoutingScheme = "",
|
||||
bankRoutingAddress = "",
|
||||
branchRoutingScheme = "",
|
||||
branchRoutingAddress = "",
|
||||
accountRoutingScheme = "",
|
||||
accountRoutingAddress = "",
|
||||
),InboundAccountCommons(
|
||||
bankId = bankIdAccountId2.bankId.value,
|
||||
branchId = "",
|
||||
accountId = bankIdAccountId2.accountId.value,
|
||||
accountNumber = "",
|
||||
accountType = "",
|
||||
balanceAmount = "",
|
||||
balanceCurrency = "",
|
||||
owners = List(""),
|
||||
viewsToGenerate = "Owner" :: "_Public" :: "Accountant" :: "Auditor" :: Nil,
|
||||
bankRoutingScheme = "",
|
||||
bankRoutingAddress = "",
|
||||
branchRoutingScheme = "",
|
||||
branchRoutingAddress = "",
|
||||
accountRoutingScheme = "",
|
||||
accountRoutingAddress = "",
|
||||
)),
|
||||
callContext
|
||||
)
|
||||
}
|
||||
|
||||
override def getBankAccountsForUser(username: String, callContext: Option[CallContext]): Future[Box[(List[InboundAccount], Option[CallContext])]] = Future{
|
||||
getBankAccountsForUserLegacy(username,callContext)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,69 +0,0 @@
|
||||
package code.connector
|
||||
|
||||
import code.api.util.{CallContext, CustomJsonFormats}
|
||||
import code.bankconnectors._
|
||||
import code.bankconnectors.vJune2017.InboundAccountJune2017
|
||||
import code.setup.{DefaultConnectorTestSetup, DefaultUsers, ServerSetup}
|
||||
import code.util.Helper.MdcLoggable
|
||||
import com.openbankproject.commons.model.{AccountId, BankId, BankIdAccountId, InboundAccountCommons}
|
||||
import net.liftweb.common.{Box, Full}
|
||||
|
||||
import scala.collection.immutable.List
|
||||
import com.openbankproject.commons.ExecutionContext.Implicits.global
|
||||
import net.liftweb.json.Formats
|
||||
|
||||
import scala.concurrent.Future
|
||||
|
||||
/**
|
||||
* Created by zhanghongwei on 14/07/2017.
|
||||
*/
|
||||
object MockedJune2017Connector extends ServerSetup
|
||||
with Connector with DefaultUsers
|
||||
with DefaultConnectorTestSetup with MdcLoggable {
|
||||
override implicit val formats: Formats = CustomJsonFormats.nullTolerateFormats
|
||||
implicit override val nameOfConnector = "MockedCardConnector"
|
||||
|
||||
//These bank id and account ids are real data over adapter
|
||||
val bankIdAccountId1 = BankIdAccountId(BankId("obp-bank-id1"),AccountId("KOa4M8UfjUuWPIXwPXYPpy5FoFcTUwpfH-accountId1"))
|
||||
val bankIdAccountId2 = BankIdAccountId(BankId("obp-bank-id2"),AccountId("KOa4M8UfjUuWPIXwPXYPpy5FoFcTUwpfH-accountId2"))
|
||||
|
||||
|
||||
override def getBankAccountsForUser(username: String, callContext: Option[CallContext])= Future{
|
||||
Full(
|
||||
(InboundAccountCommons(
|
||||
bankId = bankIdAccountId1.bankId.value,
|
||||
accountId = bankIdAccountId1.accountId.value,
|
||||
viewsToGenerate = "Owner" :: "_Public" :: "Accountant" :: "Auditor" :: Nil,
|
||||
branchId = "",
|
||||
accountNumber = "",
|
||||
accountType = "",
|
||||
balanceAmount = "",
|
||||
balanceCurrency = "",
|
||||
owners = List(""),
|
||||
bankRoutingScheme = "",
|
||||
bankRoutingAddress = "",
|
||||
branchRoutingScheme = "",
|
||||
branchRoutingAddress = "",
|
||||
accountRoutingScheme = "",
|
||||
accountRoutingAddress = ""
|
||||
) :: InboundAccountCommons(
|
||||
bankId = bankIdAccountId2.bankId.value,
|
||||
accountId = bankIdAccountId2.accountId.value,
|
||||
viewsToGenerate = "Owner" :: "_Public" :: "Accountant" :: "Auditor" :: Nil,
|
||||
branchId = "",
|
||||
accountNumber = "",
|
||||
accountType = "",
|
||||
balanceAmount = "",
|
||||
balanceCurrency = "",
|
||||
owners = List(""),
|
||||
bankRoutingScheme = "",
|
||||
bankRoutingAddress = "",
|
||||
branchRoutingScheme = "",
|
||||
branchRoutingAddress = "",
|
||||
accountRoutingScheme = "",
|
||||
accountRoutingAddress = ""
|
||||
) :: Nil,callContext)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,7 +6,6 @@ import code.api.JSONFactoryGateway.PayloadOfJwtJSON
|
||||
import code.api.util.{APIUtil, CallContext, CustomJsonFormats}
|
||||
import code.api.v2_1_0.TransactionRequestBodyCommonJSON
|
||||
import code.bankconnectors.Connector
|
||||
import code.bankconnectors.vMar2017.InboundBank
|
||||
import code.bankconnectors.vSept2018._
|
||||
import code.setup.{KafkaSetup, ServerSetupWithTestData}
|
||||
import com.openbankproject.commons.dto.{InBoundGetKycChecks, InBoundGetKycMedias, InBoundGetKycStatuses}
|
||||
|
||||
@ -3,7 +3,7 @@ package code.model
|
||||
import code.UserRefreshes.MappedUserRefreshes
|
||||
import code.accountholders.MapperAccountHolders
|
||||
import code.bankconnectors.Connector
|
||||
import code.connector.MockedJune2017Connector
|
||||
import code.connector.MockedCbsConnector
|
||||
import code.model.dataAccess.{AuthUser, ViewImpl, ViewPrivileges}
|
||||
import code.setup.{DefaultUsers, PropsReset, ServerSetup}
|
||||
import code.views.MapperViews
|
||||
@ -23,7 +23,7 @@ class AuthUserTest extends ServerSetup with DefaultUsers with PropsReset{
|
||||
|
||||
override def beforeAll() = {
|
||||
super.beforeAll()
|
||||
Connector.connector.default.set(MockedJune2017Connector)
|
||||
Connector.connector.default.set(MockedCbsConnector)
|
||||
ViewDefinition.bulkDelete_!!()
|
||||
MapperAccountHolders.bulkDelete_!!()
|
||||
AccountAccess.bulkDelete_!!()
|
||||
@ -39,8 +39,8 @@ class AuthUserTest extends ServerSetup with DefaultUsers with PropsReset{
|
||||
MappedUserRefreshes.bulkDelete_!!()
|
||||
}
|
||||
|
||||
val bankIdAccountId1 = MockedJune2017Connector.bankIdAccountId1
|
||||
val bankIdAccountId2 = MockedJune2017Connector.bankIdAccountId2
|
||||
val bankIdAccountId1 = MockedCbsConnector.bankIdAccountId
|
||||
val bankIdAccountId2 = MockedCbsConnector.bankIdAccountId2
|
||||
|
||||
def account1Access = AccountAccess.findAll(
|
||||
By(AccountAccess.user_fk, resourceUser1.userPrimaryKey.value),
|
||||
|
||||
@ -35,6 +35,7 @@ import com.openbankproject.commons.util.{ReflectUtils, optional}
|
||||
import net.liftweb.json.JsonAST.{JObject, JValue}
|
||||
import net.liftweb.json.{JInt, JString}
|
||||
|
||||
import java.lang
|
||||
import scala.collection.immutable.List
|
||||
import scala.reflect.runtime.universe._
|
||||
//import code.customeraddress.CustomerAddress
|
||||
@ -886,6 +887,125 @@ case class InboundAdapterCallContext(
|
||||
generalContext: Option[List[BasicGeneralContext]]= None, //be set by backend, send it back to the header? not finish yet.
|
||||
)
|
||||
|
||||
case class BasicCustomer(
|
||||
customerId: String,
|
||||
customerNumber: String,
|
||||
legalName: String,
|
||||
)
|
||||
|
||||
case class AuthInfo(
|
||||
userId: String = "",
|
||||
username: String = "",
|
||||
cbsToken: String = "",
|
||||
isFirst: Boolean = true,
|
||||
correlationId: String = "",
|
||||
sessionId: String = "",
|
||||
linkedCustomers: List[BasicCustomer] = Nil,
|
||||
userAuthContexts: List[BasicUserAuthContext]= Nil,
|
||||
authViews: List[AuthView] = Nil,
|
||||
)
|
||||
|
||||
case class ObpCustomer(
|
||||
customerId: String,
|
||||
bankId: String,
|
||||
number: String,
|
||||
legalName: String,
|
||||
mobileNumber: String,
|
||||
email: String,
|
||||
faceImage: CustomerFaceImage,
|
||||
dateOfBirth: Date,
|
||||
relationshipStatus: String,
|
||||
dependents: Integer,
|
||||
dobOfDependents: List[Date],
|
||||
highestEducationAttained: String,
|
||||
employmentStatus: String,
|
||||
creditRating: CreditRating,
|
||||
creditLimit: CreditLimit,
|
||||
kycStatus: lang.Boolean,
|
||||
lastOkDate: Date,
|
||||
title: String = "", //These new fields for V310, not from Connector for now.
|
||||
branchId: String = "", //These new fields for V310, not from Connector for now.
|
||||
nameSuffix: String = "", //These new fields for V310, not from Connector for now.
|
||||
) extends Customer
|
||||
|
||||
case class InternalCustomer(
|
||||
customerId: String,
|
||||
bankId: String,
|
||||
number: String,
|
||||
legalName: String,
|
||||
mobileNumber: String,
|
||||
email: String,
|
||||
faceImage: CustomerFaceImage,
|
||||
dateOfBirth: Date,
|
||||
relationshipStatus: String,
|
||||
dependents: Integer,
|
||||
dobOfDependents: List[Date],
|
||||
highestEducationAttained: String,
|
||||
employmentStatus: String,
|
||||
creditRating: CreditRating,
|
||||
creditLimit: CreditLimit,
|
||||
kycStatus: lang.Boolean,
|
||||
lastOkDate: Date
|
||||
)
|
||||
|
||||
case class InboundAccountJune2017(
|
||||
errorCode: String,
|
||||
cbsToken: String, //TODO, this maybe move to AuthInfo, but it is used in GatewayLogin
|
||||
bankId: String,
|
||||
branchId: String,
|
||||
accountId: String,
|
||||
accountNumber: String,
|
||||
accountType: String,
|
||||
balanceAmount: String,
|
||||
balanceCurrency: String,
|
||||
owners: List[String],
|
||||
viewsToGenerate: List[String],
|
||||
bankRoutingScheme: String,
|
||||
bankRoutingAddress: String,
|
||||
branchRoutingScheme: String,
|
||||
branchRoutingAddress: String,
|
||||
accountRoutingScheme: String,
|
||||
accountRoutingAddress: String,
|
||||
accountRouting: List[AccountRouting],
|
||||
accountRules: List[AccountRule]
|
||||
) extends InboundMessageBase with InboundAccount
|
||||
|
||||
case class Bank2(r: InboundBank) extends Bank {
|
||||
def fullName = r.name
|
||||
def shortName = r.name
|
||||
def logoUrl = r.logo
|
||||
def bankId = BankId(r.bankId)
|
||||
def nationalIdentifier = "None"
|
||||
def swiftBic = "None"
|
||||
def websiteUrl = r.url
|
||||
def bankRoutingScheme = "None"
|
||||
def bankRoutingAddress = "None"
|
||||
}
|
||||
|
||||
case class InboundBank(
|
||||
bankId: String,
|
||||
name: String,
|
||||
logo: String,
|
||||
url: String
|
||||
)
|
||||
|
||||
case class InboundValidatedUser(
|
||||
errorCode: String,
|
||||
backendMessages: List[InboundStatusMessage],
|
||||
email: String,
|
||||
displayName: String
|
||||
) extends InboundMessageBase
|
||||
|
||||
case class OutboundChallengeBase(
|
||||
messageFormat: String,
|
||||
action: String,
|
||||
bankId: String,
|
||||
accountId: String,
|
||||
userId: String,
|
||||
username: String,
|
||||
transactionRequestType: String,
|
||||
transactionRequestId: String
|
||||
) extends OutboundMessageBase
|
||||
|
||||
//Note: this is used for connector method: 'def getUser(name: String, password: String): Box[InboundUser]'
|
||||
case class InboundUser(
|
||||
|
||||
@ -228,7 +228,7 @@ trait View {
|
||||
* 2rd: the view can grant the access to any other (not owner) users. eg: Simon's accountant view can grant access to Carola, then Carola can see Simon's accountant data
|
||||
* also look into some createView methods in code, you can understand more:
|
||||
* create1: code.bankconnectors.Connector.createViews
|
||||
* need also look into here code.bankconnectors.vMar2017.KafkaMappedConnector_vMar2017.updateUserAccountViewsOld
|
||||
* need also look into here KafkaMappedConnector_vMar2017.updateUserAccountViewsOld
|
||||
* after createViews method, always need call addPermission(v.uid, user). This will create this field
|
||||
* Create2: code.model.dataAccess.BankAccountCreation.createOwnerView
|
||||
* after create view, always need call `addPermission(ownerViewUID, user)`, this will create this field
|
||||
|
||||
@ -3,6 +3,8 @@
|
||||
### Most recent changes at top of file
|
||||
```
|
||||
Date Commit Action
|
||||
24/02/2022 2882805c removed `kafka`,`kafka_vJune2017` and `kafka_vMar2017` connectors
|
||||
24/02/2022 c7a206fc removed `obpjvm` relevent connectors and java adapter `obp-ri-xxx` dependences
|
||||
18/01/2022 150a4d53 Added the security manager relevant props,they only used for the dynamic code endpoints
|
||||
dynamic_code_sandbox_enable, default is false
|
||||
dynamic_code_sandbox_permissions, default is a list, please check sample.props.template
|
||||
|
||||
Loading…
Reference in New Issue
Block a user