mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 13:07:02 +00:00
Merge pull request #1088 from hongwei1/develop
added `userOwners` on AuthInfo
This commit is contained in:
commit
180b44bd98
@ -149,7 +149,8 @@ case class ViewBasic(
|
||||
case class AccountBasic(
|
||||
id: String,
|
||||
accountRoutings: List[AccountRouting],
|
||||
customerOwners: List[InternalBasicCustomer]
|
||||
customerOwners: List[InternalBasicCustomer],
|
||||
userOwners: List[InternalBasicUser]
|
||||
)
|
||||
|
||||
case class AuthView(
|
||||
@ -229,8 +230,16 @@ case class InternalBasicCustomer(
|
||||
dateOfBirth: Date
|
||||
)
|
||||
|
||||
case class InternalBasicUser(
|
||||
userId:String,
|
||||
emailAddress: String,
|
||||
name: String
|
||||
)
|
||||
|
||||
case class InternalBasicCustomers(customers: List[InternalBasicCustomer])
|
||||
|
||||
case class InternalBasicUsers(users: List[InternalBasicUser])
|
||||
|
||||
case class InternalCreateChallengeSept2018(
|
||||
errorCode: String,
|
||||
backendMessages: List[InboundStatusMessage],
|
||||
@ -402,7 +411,19 @@ object JsonFactory_vSept2018 {
|
||||
)
|
||||
}
|
||||
|
||||
def createUserJson(user : User) : InternalBasicUser = {
|
||||
InternalBasicUser(
|
||||
user.userId,
|
||||
user.emailAddress,
|
||||
user.name,
|
||||
)
|
||||
}
|
||||
|
||||
def createCustomersJson(customers : List[Customer]) : InternalBasicCustomers = {
|
||||
InternalBasicCustomers(customers.map(createCustomerJson))
|
||||
}
|
||||
|
||||
def createUsersJson(users : List[User]) : InternalBasicUsers = {
|
||||
InternalBasicUsers(users.map(createUserJson))
|
||||
}
|
||||
}
|
||||
@ -92,8 +92,13 @@ trait KafkaMappedConnector_vSept2018 extends Connector with KafkaHelper with Mdc
|
||||
view <- views
|
||||
account <- checkBankAccountExists(view.bankId, view.accountId, Some(cc)) ?~! {BankAccountNotFound}
|
||||
internalCustomers = JsonFactory_vSept2018.createCustomersJson(account.customerOwners.toList)
|
||||
internalUsers = JsonFactory_vSept2018.createUsersJson(account.userOwners.toList)
|
||||
viewBasic = ViewBasic(view.viewId.value, view.name, view.description)
|
||||
accountBasic = AccountBasic(account.accountId.value, account.accountRoutings, internalCustomers.customers)
|
||||
accountBasic = AccountBasic(
|
||||
account.accountId.value,
|
||||
account.accountRoutings,
|
||||
internalCustomers.customers,
|
||||
internalUsers.users)
|
||||
}yield
|
||||
AuthView(viewBasic, accountBasic)
|
||||
)
|
||||
@ -110,11 +115,18 @@ trait KafkaMappedConnector_vSept2018 extends Connector with KafkaHelper with Mdc
|
||||
legalName = "legalName",
|
||||
dateOfBirth = DateWithSecondsExampleObject
|
||||
)
|
||||
val internalBasicUser = InternalBasicUser(
|
||||
userId = "userId",
|
||||
emailAddress = "emailAddress",
|
||||
name = "name"
|
||||
)
|
||||
val accountBasic = AccountBasic(
|
||||
"123123",
|
||||
List(AccountRouting("AccountNumber","2345 6789 1234"),
|
||||
AccountRouting("IBAN","DE91 1000 0000 0123 4567 89")),
|
||||
List(internalBasicCustomer))
|
||||
List(internalBasicCustomer),
|
||||
List(internalBasicUser)
|
||||
)
|
||||
val authView = AuthView(viewBasic, accountBasic)
|
||||
val authViews = List(authView)
|
||||
val authInfoExample = AuthInfo(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user