From 4754238969a61017e9c783cf8f56f31e22902b86 Mon Sep 17 00:00:00 2001 From: hongwei Date: Tue, 14 Jan 2025 19:09:25 +0800 Subject: [PATCH 01/17] feature/generate more InBound and OutBound case classes --- .../generator/ConnectorBuilderUtil.scala | 7 +- .../generator/InOutCaseClassGenerator.scala | 4 +- .../commons/dto/JsonsTransfer.scala | 1989 ++++++++++++----- 3 files changed, 1420 insertions(+), 580 deletions(-) diff --git a/obp-api/src/main/scala/code/bankconnectors/generator/ConnectorBuilderUtil.scala b/obp-api/src/main/scala/code/bankconnectors/generator/ConnectorBuilderUtil.scala index 43172d3fa..ec6b65eaa 100644 --- a/obp-api/src/main/scala/code/bankconnectors/generator/ConnectorBuilderUtil.scala +++ b/obp-api/src/main/scala/code/bankconnectors/generator/ConnectorBuilderUtil.scala @@ -21,7 +21,7 @@ import scala.reflect.runtime.{universe => ru} */ object ConnectorBuilderUtil { - def getClassesFromPackage(packageName: String): Seq[Class[_]] = { + def getClassesFromPackage(packageName: String): List[Class[_]] = { val classLoader = Thread.currentThread().getContextClassLoader val path = packageName.replace('.', '/') val resources: Seq[URL] = classLoader.getResources(path).asScala.toSeq @@ -36,7 +36,7 @@ object ConnectorBuilderUtil { } else { Seq.empty } - } + }.toList } @@ -430,7 +430,8 @@ object ConnectorBuilderUtil { "updateAccountLabel", "getProduct", "saveTransactionRequestStatusImpl", - "getTransactionRequestTypeCharges" + "getTransactionRequestTypeCharges", + "getAccountsHeld", ).distinct /** diff --git a/obp-api/src/main/scala/code/bankconnectors/generator/InOutCaseClassGenerator.scala b/obp-api/src/main/scala/code/bankconnectors/generator/InOutCaseClassGenerator.scala index e5e4c5c41..e32d43b1c 100644 --- a/obp-api/src/main/scala/code/bankconnectors/generator/InOutCaseClassGenerator.scala +++ b/obp-api/src/main/scala/code/bankconnectors/generator/InOutCaseClassGenerator.scala @@ -9,7 +9,7 @@ object InOutCaseClassGenerator extends App { val allExistingClasses = getClassesFromPackage("com.openbankproject.commons.dto") val code = connectorDeclsMethodsReturnOBPRequiredType - .filter(it => allExistingClasses.toString.contains(s"OutBound${it.name.toString.capitalize} ")) //filter what we have implemented + .filterNot(it => allExistingClasses.toString.contains(s"${it.name.toString.capitalize}")) //find what we have not implemented .map(it => { val returnType = it.returnType val tp = extractReturnModel(returnType) @@ -37,6 +37,6 @@ object InOutCaseClassGenerator extends App { code.foreach(println) println("#################################Finished########################################################################") - println("Please copy and compair the result to obp-commons/src/main/scala/com/openbankproject/commons/model/CommonModel.scala") + println("Please copy and compair the result to obp-commons/src/main/scala/com/openbankproject/commons/dto/JsonsTransfer.scala") } diff --git a/obp-commons/src/main/scala/com/openbankproject/commons/dto/JsonsTransfer.scala b/obp-commons/src/main/scala/com/openbankproject/commons/dto/JsonsTransfer.scala index 5e1da9bc5..ea248be94 100644 --- a/obp-commons/src/main/scala/com/openbankproject/commons/dto/JsonsTransfer.scala +++ b/obp-commons/src/main/scala/com/openbankproject/commons/dto/JsonsTransfer.scala @@ -1,36 +1,37 @@ /** -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 . - -Email: contact@tesobe.com -TESOBE GmbH. -Osloer Strasse 16/17 -Berlin 13359, Germany - -This product includes software developed at -TESOBE (http://www.tesobe.com/) - */ + * Open Bank Project - API + * Copyright (C) 2011-2025, 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 . + * + * 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 com.openbankproject.commons.dto import java.util.Date -import com.openbankproject.commons.model.enums.{CardAttributeType, ChallengeType, CustomerAttributeType, DynamicEntityOperation, PaymentServiceTypes, StrongCustomerAuthentication, SuppliedAnswerType, TransactionAttributeType, TransactionRequestStatus, TransactionRequestTypes} +import com.openbankproject.commons.model.enums.{AttributeCategory, AttributeType, BankAttributeType, CardAttributeType, ChallengeType, + CustomerAttributeType, DynamicEntityOperation, PaymentServiceTypes, StrongCustomerAuthentication, + SuppliedAnswerType, TransactionAttributeType, TransactionRequestAttributeType, TransactionRequestStatus, TransactionRequestTypes} import com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SCA import com.openbankproject.commons.model.enums.StrongCustomerAuthenticationStatus.SCAStatus -import com.openbankproject.commons.model.enums.SuppliedAnswerType import com.openbankproject.commons.model.{enums, _} import net.liftweb.json.{JObject, JValue} @@ -45,60 +46,68 @@ trait InBoundTrait[T] { //--------generated case class OutBoundGetObpConnectorLoopback(outboundAdapterCallContext: OutboundAdapterCallContext) extends TopicTrait + case class InBoundGetObpConnectorLoopback(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: ObpApiLoopback) extends InBoundTrait[ObpApiLoopback] case class OutBoundGetChallengeThreshold(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: String, - accountId: String, - viewId: String, - transactionRequestType: String, - currency: String, - userId: String, - username: String) extends TopicTrait + bankId: String, + accountId: String, + viewId: String, + transactionRequestType: String, + currency: String, + userId: String, + username: String) extends TopicTrait + case class InBoundGetChallengeThreshold(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AmountOfMoney) extends InBoundTrait[AmountOfMoney] case class OutBoundGetChargeLevel(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - accountId: AccountId, - viewId: ViewId, - userId: String, - username: String, - transactionRequestType: String, - currency: String) extends TopicTrait + bankId: BankId, + accountId: AccountId, + viewId: ViewId, + userId: String, + username: String, + transactionRequestType: String, + currency: String) extends TopicTrait + case class InBoundGetChargeLevel(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AmountOfMoney) extends InBoundTrait[AmountOfMoney] case class OutBoundGetChargeLevelC2(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - accountId: AccountId, - viewId: ViewId, - userId: String, - username: String, - transactionRequestType: String, - currency: String, - amount: String, - toAccountRoutings: List[AccountRouting], - customAttributes: List[CustomAttribute]) extends TopicTrait + bankId: BankId, + accountId: AccountId, + viewId: ViewId, + userId: String, + username: String, + transactionRequestType: String, + currency: String, + amount: String, + toAccountRoutings: List[AccountRouting], + customAttributes: List[CustomAttribute]) extends TopicTrait + case class InBoundGetChargeLevelC2(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AmountOfMoney) extends InBoundTrait[AmountOfMoney] case class OutBoundGetBank(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId) extends TopicTrait + bankId: BankId) extends TopicTrait + case class InBoundGetBank(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankCommons) extends InBoundTrait[BankCommons] case class OutBoundGetBankAccountsForUser(outboundAdapterCallContext: OutboundAdapterCallContext, provider: String, username: String) extends TopicTrait + case class InBoundGetBankAccountsForUser(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[InboundAccountCommons]) extends InBoundTrait[List[InboundAccountCommons]] case class OutBoundGetBankAccount(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - accountId: AccountId) extends TopicTrait + bankId: BankId, + accountId: AccountId) extends TopicTrait + case class InBoundGetBankAccount(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] case class OutBoundGetCoreBankAccounts(outboundAdapterCallContext: OutboundAdapterCallContext, - bankIdAccountIds: List[BankIdAccountId]) extends TopicTrait + bankIdAccountIds: List[BankIdAccountId]) extends TopicTrait + case class InBoundGetCoreBankAccounts(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CoreAccount]) extends InBoundTrait[List[CoreAccount]] case class OutBoundGetBankAccountsBalances(outboundAdapterCallContext: OutboundAdapterCallContext, @@ -112,345 +121,386 @@ case class OutBoundGetBankAccountBalances(outboundAdapterCallContext: OutboundAd case class InBoundGetBankAccountBalances(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AccountBalances) extends InBoundTrait[AccountBalances] case class OutBoundGetCoreBankAccountsHeld(outboundAdapterCallContext: OutboundAdapterCallContext, - bankIdAccountIds: List[BankIdAccountId]) extends TopicTrait + bankIdAccountIds: List[BankIdAccountId]) extends TopicTrait + case class InBoundGetCoreBankAccountsHeld(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[AccountHeld]) extends InBoundTrait[List[AccountHeld]] case class OutBoundCheckBankAccountExists(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - accountId: AccountId) extends TopicTrait + bankId: BankId, + accountId: AccountId) extends TopicTrait + case class InBoundCheckBankAccountExists(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] case class OutBoundGetCounterpartyTrait(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - accountId: AccountId, - couterpartyId: String) extends TopicTrait + bankId: BankId, + accountId: AccountId, + couterpartyId: String) extends TopicTrait + case class InBoundGetCounterpartyTrait(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CounterpartyTraitCommons) extends InBoundTrait[CounterpartyTraitCommons] case class OutBoundGetCounterpartyByCounterpartyId(outboundAdapterCallContext: OutboundAdapterCallContext, - counterpartyId: CounterpartyId) extends TopicTrait + counterpartyId: CounterpartyId) extends TopicTrait + case class InBoundGetCounterpartyByCounterpartyId(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CounterpartyTraitCommons) extends InBoundTrait[CounterpartyTraitCommons] case class OutBoundGetCounterpartyByIban(outboundAdapterCallContext: OutboundAdapterCallContext, - iban: String) extends TopicTrait + iban: String) extends TopicTrait + case class InBoundGetCounterpartyByIban(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CounterpartyTraitCommons) extends InBoundTrait[CounterpartyTraitCommons] case class OutBoundGetTransactions(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - accountId: AccountId, - limit: Int, - offset: Int, - fromDate: String, - toDate: String) extends TopicTrait + bankId: BankId, + accountId: AccountId, + limit: Int, + offset: Int, + fromDate: String, + toDate: String) extends TopicTrait + case class InBoundGetTransactions(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[Transaction]) extends InBoundTrait[List[Transaction]] case class OutBoundGetTransaction(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - accountId: AccountId, - transactionId: TransactionId) extends TopicTrait + bankId: BankId, + accountId: AccountId, + transactionId: TransactionId) extends TopicTrait + case class InBoundGetTransaction(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Transaction) extends InBoundTrait[Transaction] case class OutBoundMakePaymentv210(outboundAdapterCallContext: OutboundAdapterCallContext, - fromAccount: BankAccount, - toAccount: BankAccount, - transactionRequestId: TransactionRequestId, - transactionRequestCommonBody: TransactionRequestCommonBodyJSON, - amount: BigDecimal, - description: String, - transactionRequestType: TransactionRequestType, - chargePolicy: String) extends TopicTrait + fromAccount: BankAccount, + toAccount: BankAccount, + transactionRequestId: TransactionRequestId, + transactionRequestCommonBody: TransactionRequestCommonBodyJSON, + amount: BigDecimal, + description: String, + transactionRequestType: TransactionRequestType, + chargePolicy: String) extends TopicTrait case class InBoundMakePaymentv210(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionId) extends InBoundTrait[TransactionId] case class OutBoundNotifyTransactionRequest(outboundAdapterCallContext: OutboundAdapterCallContext, - fromAccount: BankAccount, toAccount: BankAccount, - transactionRequest: TransactionRequest) extends TopicTrait + fromAccount: BankAccount, toAccount: BankAccount, + transactionRequest: TransactionRequest) extends TopicTrait case class InBoundNotifyTransactionRequest(inboundAdapterCallContext: InboundAdapterCallContext, - status: Status, data: TransactionRequestStatusValue) extends InBoundTrait[TransactionRequestStatusValue] + status: Status, data: TransactionRequestStatusValue) extends InBoundTrait[TransactionRequestStatusValue] case class OutBoundMakePaymentV400(outboundAdapterCallContext: OutboundAdapterCallContext, - transactionRequest: TransactionRequest, - reasons: Option[List[TransactionRequestReason]]) extends TopicTrait + transactionRequest: TransactionRequest, + reasons: Option[List[TransactionRequestReason]]) extends TopicTrait case class InBoundMakePaymentV400(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionId) extends InBoundTrait[TransactionId] case class OutBoundCancelPaymentV400(outboundAdapterCallContext: OutboundAdapterCallContext, - transactionId: TransactionId) extends TopicTrait -case class InBoundCancelPaymentV400(inboundAdapterCallContext: - InboundAdapterCallContext, - status: Status, data: CancelPayment) extends InBoundTrait[CancelPayment] + transactionId: TransactionId) extends TopicTrait + +case class InBoundCancelPaymentV400(inboundAdapterCallContext: +InboundAdapterCallContext, + status: Status, data: CancelPayment) extends InBoundTrait[CancelPayment] case class OutBoundCreateTransactionRequestv210(outboundAdapterCallContext: OutboundAdapterCallContext, - initiator: User, //TODO FIXME - viewId: ViewId, - fromAccount: BankAccount, - toAccount: BankAccount, - transactionRequestType: TransactionRequestType, - transactionRequestCommonBody: TransactionRequestCommonBodyJSON, - detailsPlain: String, - chargePolicy: String, challengeType: Option[String], scaMethod: Option[SCA]) extends TopicTrait + initiator: User, //TODO FIXME + viewId: ViewId, + fromAccount: BankAccount, + toAccount: BankAccount, + transactionRequestType: TransactionRequestType, + transactionRequestCommonBody: TransactionRequestCommonBodyJSON, + detailsPlain: String, + chargePolicy: String, challengeType: Option[String], scaMethod: Option[SCA]) extends TopicTrait + case class InBoundCreateTransactionRequestv210(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] case class OutBoundCreateTransactionAfterChallengeV210(outboundAdapterCallContext: OutboundAdapterCallContext, - fromAccount: BankAccount, - transactionRequest: TransactionRequest) extends TopicTrait + fromAccount: BankAccount, + transactionRequest: TransactionRequest) extends TopicTrait + case class InBoundCreateTransactionAfterChallengeV210(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] case class OutBoundGetBranch(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - branchId: BranchId) extends TopicTrait + bankId: BankId, + branchId: BranchId) extends TopicTrait + case class InBoundGetBranch(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BranchTCommons) extends InBoundTrait[BranchTCommons] case class OutBoundGetBranches(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, limit: Int, offset: Int, fromDate: String, toDate: String) extends TopicTrait + bankId: BankId, limit: Int, offset: Int, fromDate: String, toDate: String) extends TopicTrait + case class InBoundGetBranches(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[BranchTCommons]) extends InBoundTrait[List[BranchTCommons]] - case class OutBoundGetAtm(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - atmId: AtmId) extends TopicTrait + bankId: BankId, + atmId: AtmId) extends TopicTrait + case class InBoundGetAtm(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AtmTCommons) extends InBoundTrait[AtmTCommons] case class OutBoundGetAtms(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, limit: Int, offset: Int, fromDate: String, toDate: String) extends TopicTrait + bankId: BankId, limit: Int, offset: Int, fromDate: String, toDate: String) extends TopicTrait + case class InBoundGetAtms(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[AtmTCommons]) extends InBoundTrait[List[AtmTCommons]] case class OutBoundCreateTransactionAfterChallengev300(outboundAdapterCallContext: OutboundAdapterCallContext, - initiator: User, //TODO fixme - fromAccount: BankAccount, - transReqId: TransactionRequestId, - transactionRequestType: TransactionRequestType) extends TopicTrait + initiator: User, //TODO fixme + fromAccount: BankAccount, + transReqId: TransactionRequestId, + transactionRequestType: TransactionRequestType) extends TopicTrait + case class InBoundCreateTransactionAfterChallengev300(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] case class OutBoundMakePaymentv300(outboundAdapterCallContext: OutboundAdapterCallContext, - initiator: User, //TODO fixme - fromAccount: BankAccount, - toAccount: BankAccount, - toCounterparty: CounterpartyTrait, - transactionRequestCommonBody: TransactionRequestCommonBodyJSON, //TODO FIXME - transactionRequestType: TransactionRequestType, - chargePolicy: String) extends TopicTrait + initiator: User, //TODO fixme + fromAccount: BankAccount, + toAccount: BankAccount, + toCounterparty: CounterpartyTrait, + transactionRequestCommonBody: TransactionRequestCommonBodyJSON, //TODO FIXME + transactionRequestType: TransactionRequestType, + chargePolicy: String) extends TopicTrait + case class InBoundMakePaymentv300(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionId) extends InBoundTrait[TransactionId] case class OutBoundCreateTransactionRequestv300(outboundAdapterCallContext: OutboundAdapterCallContext, - initiator: User, //TODO fixme - viewId: ViewId, - fromAccount: BankAccount, - toAccount: BankAccount, - toCounterparty: CounterpartyTrait, - transactionRequestType: TransactionRequestType, - transactionRequestCommonBody: TransactionRequestCommonBodyJSON, //TODO FIXME - detailsPlain: String, - chargePolicy: String) extends TopicTrait + initiator: User, //TODO fixme + viewId: ViewId, + fromAccount: BankAccount, + toAccount: BankAccount, + toCounterparty: CounterpartyTrait, + transactionRequestType: TransactionRequestType, + transactionRequestCommonBody: TransactionRequestCommonBodyJSON, //TODO FIXME + detailsPlain: String, + chargePolicy: String) extends TopicTrait + case class InBoundCreateTransactionRequestv300(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] case class OutBoundCreateCustomer(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - legalName: String, - mobileNumber: String, - email: String, - faceImage: CustomerFaceImageTrait, - dateOfBirth: Date, - relationshipStatus: String, - dependents: Int, - dobOfDependents: List[Date], - highestEducationAttained: String, - employmentStatus: String, - kycStatus: Boolean, - lastOkDate: Date, - creditRating: Option[CreditRatingTrait], - creditLimit: Option[AmountOfMoneyTrait], - title: String, - branchId: String, - nameSuffix: String) extends TopicTrait + bankId: BankId, + legalName: String, + mobileNumber: String, + email: String, + faceImage: CustomerFaceImageTrait, + dateOfBirth: Date, + relationshipStatus: String, + dependents: Int, + dobOfDependents: List[Date], + highestEducationAttained: String, + employmentStatus: String, + kycStatus: Boolean, + lastOkDate: Date, + creditRating: Option[CreditRatingTrait], + creditLimit: Option[AmountOfMoneyTrait], + title: String, + branchId: String, + nameSuffix: String) extends TopicTrait + case class InBoundCreateCustomer(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CustomerCommons) extends InBoundTrait[CustomerCommons] case class OutBoundGetCustomersByUserId(outboundAdapterCallContext: OutboundAdapterCallContext, - userId: String) extends TopicTrait + userId: String) extends TopicTrait + case class InBoundGetCustomersByUserId(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CustomerCommons]) extends InBoundTrait[List[CustomerCommons]] case class OutBoundGetCustomerByCustomerNumber(outboundAdapterCallContext: OutboundAdapterCallContext, - customerNumber: String, - bankId: BankId) extends TopicTrait + customerNumber: String, + bankId: BankId) extends TopicTrait + case class InBoundGetCustomerByCustomerNumber(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CustomerCommons) extends InBoundTrait[CustomerCommons] case class OutBoundGetCustomerAddress(outboundAdapterCallContext: OutboundAdapterCallContext, - customerId: String) extends TopicTrait + customerId: String) extends TopicTrait + case class InBoundGetCustomerAddress(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CustomerAddressCommons]) extends InBoundTrait[List[CustomerAddressCommons]] case class OutBoundCreateCustomerAddress(outboundAdapterCallContext: OutboundAdapterCallContext, - customerId: String, - line1: String, - line2: String, - line3: String, - city: String, - county: String, - state: String, - postcode: String, - countryCode: String, - tags: String, - status: String) extends TopicTrait + customerId: String, + line1: String, + line2: String, + line3: String, + city: String, + county: String, + state: String, + postcode: String, + countryCode: String, + tags: String, + status: String) extends TopicTrait + case class InBoundCreateCustomerAddress(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CustomerAddressCommons) extends InBoundTrait[CustomerAddressCommons] case class OutBoundUpdateCustomerAddress(outboundAdapterCallContext: OutboundAdapterCallContext, - customerAddressId: String, - line1: String, - line2: String, - line3: String, - city: String, - county: String, - state: String, - postcode: String, - countryCode: String, - tags: String, - status: String) extends TopicTrait + customerAddressId: String, + line1: String, + line2: String, + line3: String, + city: String, + county: String, + state: String, + postcode: String, + countryCode: String, + tags: String, + status: String) extends TopicTrait + case class InBoundUpdateCustomerAddress(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CustomerAddressCommons) extends InBoundTrait[CustomerAddressCommons] case class OutBoundCreateTaxResidence(outboundAdapterCallContext: OutboundAdapterCallContext, - customerId: String, - domain: String, - taxNumber: String) extends TopicTrait + customerId: String, + domain: String, + taxNumber: String) extends TopicTrait + case class InBoundCreateTaxResidence(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TaxResidenceCommons) extends InBoundTrait[TaxResidenceCommons] case class OutBoundGetTaxResidence(outboundAdapterCallContext: OutboundAdapterCallContext, - customerId: String) extends TopicTrait + customerId: String) extends TopicTrait + case class InBoundGetTaxResidence(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TaxResidenceCommons]) extends InBoundTrait[List[TaxResidenceCommons]] case class OutBoundGetCustomers(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - limit: Int, - offset: Int, - fromDate: String, - toDate: String) extends TopicTrait + bankId: BankId, + limit: Int, + offset: Int, + fromDate: String, + toDate: String) extends TopicTrait + case class InBoundGetCustomers(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CustomerCommons]) extends InBoundTrait[List[CustomerCommons]] case class OutBoundGetCheckbookOrders(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: String, - accountId: String) extends TopicTrait + bankId: String, + accountId: String) extends TopicTrait + case class InBoundGetCheckbookOrders(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CheckbookOrdersJson) extends InBoundTrait[CheckbookOrdersJson] case class OutBoundGetStatusOfCreditCardOrder(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: String, - accountId: String) extends TopicTrait + bankId: String, + accountId: String) extends TopicTrait + case class InBoundGetStatusOfCreditCardOrder(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CardObjectJson]) extends InBoundTrait[List[CardObjectJson]] case class OutBoundCreateUserAuthContext(outboundAdapterCallContext: OutboundAdapterCallContext, - userId: String, - key: String, - value: String) extends TopicTrait + userId: String, + key: String, + value: String) extends TopicTrait + case class InBoundCreateUserAuthContext(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: UserAuthContextCommons) extends InBoundTrait[UserAuthContextCommons] case class OutBoundGetUserAuthContexts(outboundAdapterCallContext: OutboundAdapterCallContext, - userId: String) extends TopicTrait + userId: String) extends TopicTrait + case class InBoundGetUserAuthContexts(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[UserAuthContextCommons]) extends InBoundTrait[List[UserAuthContextCommons]] case class OutBoundCreateOrUpdateProductAttribute(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - productCode: ProductCode, - productAttributeId: Option[String], - name: String, - productAttributeType: enums.ProductAttributeType.Value, - value: String, - isActive: Option[Boolean]) extends TopicTrait + bankId: BankId, + productCode: ProductCode, + productAttributeId: Option[String], + name: String, + productAttributeType: enums.ProductAttributeType.Value, + value: String, + isActive: Option[Boolean]) extends TopicTrait + case class InBoundCreateOrUpdateProductAttribute(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: ProductAttributeCommons) extends InBoundTrait[ProductAttributeCommons] case class OutBoundGetProductAttributeById(outboundAdapterCallContext: OutboundAdapterCallContext, - productAttributeId: String) extends TopicTrait + productAttributeId: String) extends TopicTrait + case class InBoundGetProductAttributeById(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: ProductAttributeCommons) extends InBoundTrait[ProductAttributeCommons] case class OutBoundGetProductAttributesByBankAndCode(outboundAdapterCallContext: OutboundAdapterCallContext, - bank: BankId, - productCode: ProductCode) extends TopicTrait + bank: BankId, + productCode: ProductCode) extends TopicTrait + case class InBoundGetProductAttributesByBankAndCode(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[ProductAttributeCommons]) extends InBoundTrait[List[ProductAttributeCommons]] case class OutBoundCreateOrUpdateAccountAttribute(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - accountId: AccountId, - productCode: ProductCode, - productAttributeId: Option[String], - name: String, - accountAttributeType: enums.AccountAttributeType.Value, - value: String, - productInstanceCode: Option[String] = None) extends TopicTrait + bankId: BankId, + accountId: AccountId, + productCode: ProductCode, + productAttributeId: Option[String], + name: String, + accountAttributeType: enums.AccountAttributeType.Value, + value: String, + productInstanceCode: Option[String] = None) extends TopicTrait + case class InBoundCreateOrUpdateAccountAttribute(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AccountAttributeCommons) extends InBoundTrait[AccountAttributeCommons] case class OutBoundCreateAccountApplication(outboundAdapterCallContext: OutboundAdapterCallContext, - productCode: ProductCode, - userId: Option[String], - customerId: Option[String]) extends TopicTrait + productCode: ProductCode, + userId: Option[String], + customerId: Option[String]) extends TopicTrait + case class InBoundCreateAccountApplication(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AccountApplicationCommons) extends InBoundTrait[AccountApplicationCommons] case class OutBoundGetAllAccountApplication(outboundAdapterCallContext: OutboundAdapterCallContext) extends TopicTrait + case class InBoundGetAllAccountApplication(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[AccountApplicationCommons]) extends InBoundTrait[List[AccountApplicationCommons]] case class OutBoundGetAccountApplicationById(outboundAdapterCallContext: OutboundAdapterCallContext, - accountApplicationId: String) extends TopicTrait + accountApplicationId: String) extends TopicTrait + case class InBoundGetAccountApplicationById(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AccountApplicationCommons) extends InBoundTrait[AccountApplicationCommons] case class OutBoundUpdateAccountApplicationStatus(outboundAdapterCallContext: OutboundAdapterCallContext, - accountApplicationId: String, - status: String) extends TopicTrait + accountApplicationId: String, + status: String) extends TopicTrait + case class InBoundUpdateAccountApplicationStatus(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AccountApplicationCommons) extends InBoundTrait[AccountApplicationCommons] case class OutBoundGetOrCreateProductCollection(outboundAdapterCallContext: OutboundAdapterCallContext, - collectionCode: String, - productCodes: List[String]) extends TopicTrait + collectionCode: String, + productCodes: List[String]) extends TopicTrait + case class InBoundGetOrCreateProductCollection(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[ProductCollectionCommons]) extends InBoundTrait[List[ProductCollectionCommons]] case class OutBoundGetProductCollection(outboundAdapterCallContext: OutboundAdapterCallContext, - collectionCode: String) extends TopicTrait + collectionCode: String) extends TopicTrait + case class InBoundGetProductCollection(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[ProductCollectionCommons]) extends InBoundTrait[List[ProductCollectionCommons]] case class OutBoundGetOrCreateProductCollectionItem(outboundAdapterCallContext: OutboundAdapterCallContext, - collectionCode: String, - memberProductCodes: List[String]) extends TopicTrait + collectionCode: String, + memberProductCodes: List[String]) extends TopicTrait + case class InBoundGetOrCreateProductCollectionItem(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[ProductCollectionItemCommons]) extends InBoundTrait[List[ProductCollectionItemCommons]] case class OutBoundGetProductCollectionItem(outboundAdapterCallContext: OutboundAdapterCallContext, - collectionCode: String) extends TopicTrait + collectionCode: String) extends TopicTrait + case class InBoundGetProductCollectionItem(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[ProductCollectionItemCommons]) extends InBoundTrait[List[ProductCollectionItemCommons]] case class OutBoundGetProductCollectionItemsTree(outboundAdapterCallContext: OutboundAdapterCallContext, - collectionCode: String, - bankId: String) extends TopicTrait + collectionCode: String, + bankId: String) extends TopicTrait case class ProductCollectionItemsTree(productCollectionItem: ProductCollectionItemCommons, product: ProductCommons, attributes: List[ProductAttributeCommons]) @@ -459,585 +509,646 @@ case class InBoundGetProductCollectionItemsTree(inboundAdapterCallContext: Inbou case class OutBoundCreateMeeting(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - staffUser: User, //TODO fixme - customerUser: User, //TODO fixme - providerId: String, - purposeId: String, - when: Date, - sessionId: String, - customerToken: String, - staffToken: String, - creator: ContactDetails, - invitees: List[Invitee]) extends TopicTrait + bankId: BankId, + staffUser: User, //TODO fixme + customerUser: User, //TODO fixme + providerId: String, + purposeId: String, + when: Date, + sessionId: String, + customerToken: String, + staffToken: String, + creator: ContactDetails, + invitees: List[Invitee]) extends TopicTrait + case class InBoundCreateMeeting(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: MeetingCommons) extends InBoundTrait[MeetingCommons] case class OutBoundGetMeetings(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - user: User) extends TopicTrait //TODO fixme + bankId: BankId, + user: User) extends TopicTrait //TODO fixme + case class InBoundGetMeetings(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[MeetingCommons]) extends InBoundTrait[List[MeetingCommons]] case class OutBoundGetMeeting(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - user: User, //TODO fixme - meetingId: String) extends TopicTrait + bankId: BankId, + user: User, //TODO fixme + meetingId: String) extends TopicTrait + case class InBoundGetMeeting(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: MeetingCommons) extends InBoundTrait[MeetingCommons] //create bound case classes case class OutBoundCreateChallenge(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - accountId: AccountId, - userId: String, - transactionRequestType: TransactionRequestType, - transactionRequestId: String, - scaMethod: Option[SCA]) extends TopicTrait + bankId: BankId, + accountId: AccountId, + userId: String, + transactionRequestType: TransactionRequestType, + transactionRequestId: String, + scaMethod: Option[SCA]) extends TopicTrait case class InBoundCreateChallenge(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: String) extends InBoundTrait[String] -case class OutBoundCreateCounterparty(outboundAdapterCallContext: OutboundAdapterCallContext, name: String, description: String, currency: 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, +case class OutBoundCreateCounterparty(outboundAdapterCallContext: OutboundAdapterCallContext, name: String, description: String, currency: 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]) extends TopicTrait case class InBoundCreateCounterparty(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CounterpartyTraitCommons) extends InBoundTrait[CounterpartyTraitCommons] -case class OutBoundGetTransactionRequests210(outboundAdapterCallContext: OutboundAdapterCallContext, initiator : User, fromAccount : BankAccount) extends TopicTrait +case class OutBoundGetTransactionRequests210(outboundAdapterCallContext: OutboundAdapterCallContext, initiator: User, fromAccount: BankAccount) extends TopicTrait case class InBoundGetTransactionRequests210(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionRequest]) extends InBoundTrait[List[TransactionRequest]] case class OutBoundGetTransactionsCore(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, accountId: AccountId, limit: Int, offset: Int, fromDate: String, toDate: String) extends TopicTrait + case class InBoundGetTransactionsCore(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionCore]) extends InBoundTrait[List[TransactionCore]] //-------- return type are not Future-------------------------------------------------------------------------------------------------- case class OutBoundGetAdapterInfo(outboundAdapterCallContext: OutboundAdapterCallContext) extends TopicTrait + case class InBoundGetAdapterInfo(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: InboundAdapterInfoInternal) extends InBoundTrait[InboundAdapterInfoInternal] case class OutBoundGetBanks(outboundAdapterCallContext: OutboundAdapterCallContext) extends TopicTrait + case class InBoundGetBanks(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[BankCommons]) extends InBoundTrait[List[BankCommons]] case class OutBoundGetBankAccountsHeld(outboundAdapterCallContext: OutboundAdapterCallContext, - bankIdAccountIds: List[BankIdAccountId]) extends TopicTrait + bankIdAccountIds: List[BankIdAccountId]) extends TopicTrait + case class InBoundGetBankAccountsHeld(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[AccountHeld]) extends InBoundTrait[List[AccountHeld]] case class OutBoundGetCounterparties(outboundAdapterCallContext: OutboundAdapterCallContext, - thisBankId: BankId, - thisAccountId: AccountId, - viewId: ViewId) extends TopicTrait + thisBankId: BankId, + thisAccountId: AccountId, + viewId: ViewId) extends TopicTrait + case class InBoundGetCounterparties(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CounterpartyTraitCommons]) extends InBoundTrait[List[CounterpartyTraitCommons]] case class OutBoundMakeHistoricalPayment(outboundAdapterCallContext: OutboundAdapterCallContext, - fromAccount: BankAccount, - toAccount: BankAccount, - posted: Date, - completed: Date, - amount: BigDecimal, - currency: String, - description: String, - transactionRequestType: String, - chargePolicy: String - ) extends TopicTrait + fromAccount: BankAccount, + toAccount: BankAccount, + posted: Date, + completed: Date, + amount: BigDecimal, + currency: String, + description: String, + transactionRequestType: String, + chargePolicy: String +) extends TopicTrait + case class InBoundMakeHistoricalPayment(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionId) extends InBoundTrait[TransactionId] case class OutBoundGetCardAttributesFromProvider(outboundAdapterCallContext: OutboundAdapterCallContext, - cardId: String - ) extends TopicTrait + cardId: String +) extends TopicTrait + case class InBoundGetCardAttributesFromProvider(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CardAttributeCommons]) extends InBoundTrait[List[CardAttributeCommons]] case class OutBoundGetCardAttributeById(outboundAdapterCallContext: OutboundAdapterCallContext, - cardAttributeId: String - ) extends TopicTrait + cardAttributeId: String +) extends TopicTrait + case class InBoundGetCardAttributeById(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CardAttributeCommons) extends InBoundTrait[CardAttributeCommons] case class OutBoundCreateOrUpdateCardAttribute(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: Option[BankId], - cardId: Option[String], - cardAttributeId: Option[String], - name: String, - cardAttributeType: CardAttributeType, - value: String - ) extends TopicTrait + bankId: Option[BankId], + cardId: Option[String], + cardAttributeId: Option[String], + name: String, + cardAttributeType: CardAttributeType, + value: String +) extends TopicTrait + case class InBoundCreateOrUpdateCardAttribute(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CardAttributeCommons) extends InBoundTrait[CardAttributeCommons] case class OutBoundGetAccountAttributesByAccount(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - accountId: AccountId - ) extends TopicTrait + bankId: BankId, + accountId: AccountId +) extends TopicTrait + case class InBoundGetAccountAttributesByAccount(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[AccountAttributeCommons]) extends InBoundTrait[List[AccountAttributeCommons]] case class OutBoundCreateAccountAttributes(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - accountId: AccountId, - productCode: ProductCode, - accountAttributes: List[ProductAttribute], - productInstanceCode: Option[String] = None, - ) extends TopicTrait + bankId: BankId, + accountId: AccountId, + productCode: ProductCode, + accountAttributes: List[ProductAttribute], + productInstanceCode: Option[String] = None, +) extends TopicTrait + case class InBoundCreateAccountAttributes(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[AccountAttributeCommons]) extends InBoundTrait[List[AccountAttributeCommons]] case class OutBoundGetAccountAttributeById(outboundAdapterCallContext: OutboundAdapterCallContext, - accountAttributeId: String - ) extends TopicTrait + accountAttributeId: String +) extends TopicTrait + case class InBoundGetAccountAttributeById(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AccountAttributeCommons) extends InBoundTrait[AccountAttributeCommons] case class OutBoundDeleteProductAttribute(outboundAdapterCallContext: OutboundAdapterCallContext, - productAttributeId: String - ) extends TopicTrait + productAttributeId: String +) extends TopicTrait + case class InBoundDeleteProductAttribute(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] case class OutBoundDeleteUserAuthContexts(outboundAdapterCallContext: OutboundAdapterCallContext, - userId: String - ) extends TopicTrait + userId: String +) extends TopicTrait + case class InBoundDeleteUserAuthContexts(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] case class OutBoundDeleteUserAuthContextById(outboundAdapterCallContext: OutboundAdapterCallContext, - userAuthContextId: String - ) extends TopicTrait + userAuthContextId: String +) extends TopicTrait + case class InBoundDeleteUserAuthContextById(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] case class OutBoundDeleteCustomerAddress(outboundAdapterCallContext: OutboundAdapterCallContext, - customerAddressId : String) extends TopicTrait + customerAddressId: String) extends TopicTrait + case class InBoundDeleteCustomerAddress(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] case class OutBoundCreateUserAuthContextUpdate(outboundAdapterCallContext: OutboundAdapterCallContext, - userId: String, - key: String, - value: String) extends TopicTrait + userId: String, + key: String, + value: String) extends TopicTrait + case class InBoundCreateUserAuthContextUpdate(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: UserAuthContextUpdateCommons) extends InBoundTrait[UserAuthContextUpdateCommons] case class OutBoundDeleteTaxResidence(outboundAdapterCallContext: OutboundAdapterCallContext, - taxResourceId : String) extends TopicTrait + taxResourceId: String) extends TopicTrait + case class InBoundDeleteTaxResidence(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] case class OutBoundUpdateCustomerGeneralData(outboundAdapterCallContext: OutboundAdapterCallContext, - customerId: String, - legalName: Option[String], - faceImage: Option[CustomerFaceImageTrait], - dateOfBirth: Option[Date], - relationshipStatus: Option[String], - dependents: Option[Int], - highestEducationAttained: Option[String], - employmentStatus: Option[String], - title: Option[String], - branchId: Option[String], - nameSuffix: Option[String] - ) extends TopicTrait + customerId: String, + legalName: Option[String], + faceImage: Option[CustomerFaceImageTrait], + dateOfBirth: Option[Date], + relationshipStatus: Option[String], + dependents: Option[Int], + highestEducationAttained: Option[String], + employmentStatus: Option[String], + title: Option[String], + branchId: Option[String], + nameSuffix: Option[String] +) extends TopicTrait + case class InBoundUpdateCustomerGeneralData(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CustomerCommons) extends InBoundTrait[CustomerCommons] case class OutBoundUpdateCustomerCreditData(outboundAdapterCallContext: OutboundAdapterCallContext, - customerId: String, - creditRating: Option[String], - creditSource: Option[String], - creditLimit: Option[AmountOfMoney]) extends TopicTrait + customerId: String, + creditRating: Option[String], + creditSource: Option[String], + creditLimit: Option[AmountOfMoney]) extends TopicTrait + case class InBoundUpdateCustomerCreditData(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CustomerCommons) extends InBoundTrait[CustomerCommons] case class OutBoundUpdateCustomerScaData(outboundAdapterCallContext: OutboundAdapterCallContext, - customerId: String, - mobileNumber: Option[String], - email: Option[String], - customerNumber: Option[String]) extends TopicTrait + customerId: String, + mobileNumber: Option[String], + email: Option[String], + customerNumber: Option[String]) extends TopicTrait + case class InBoundUpdateCustomerScaData(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CustomerCommons) extends InBoundTrait[CustomerCommons] case class OutBoundCheckCustomerNumberAvailable(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - customerNumber: String) extends TopicTrait + bankId: BankId, + customerNumber: String) extends TopicTrait + case class InBoundCheckCustomerNumberAvailable(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] case class OutBoundUpdateBankAccount(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - accountId: AccountId, - accountType: String, - accountLabel: String, - branchId: String, - accountRoutings: List[AccountRouting] - ) extends TopicTrait + bankId: BankId, + accountId: AccountId, + accountType: String, + accountLabel: String, + branchId: String, + accountRoutings: List[AccountRouting] +) extends TopicTrait + case class InBoundUpdateBankAccount(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] case class OutBoundUpdatePhysicalCard(outboundAdapterCallContext: OutboundAdapterCallContext, - cardId: String, - bankCardNumber: String, - nameOnCard: String, - cardType: String, - issueNumber: String, - serialNumber: String, - validFrom: Date, - expires: Date, - enabled: Boolean, - cancelled: Boolean, - onHotList: Boolean, - technology: String, - networks: List[String], - allows: List[String], - accountId: String, - bankId: String, - replacement: Option[CardReplacementInfo], - pinResets: List[PinResetInfo], - collected: Option[CardCollectionInfo], - posted: Option[CardPostedInfo], - customerId: String - ) extends TopicTrait + cardId: String, + bankCardNumber: String, + nameOnCard: String, + cardType: String, + issueNumber: String, + serialNumber: String, + validFrom: Date, + expires: Date, + enabled: Boolean, + cancelled: Boolean, + onHotList: Boolean, + technology: String, + networks: List[String], + allows: List[String], + accountId: String, + bankId: String, + replacement: Option[CardReplacementInfo], + pinResets: List[PinResetInfo], + collected: Option[CardCollectionInfo], + posted: Option[CardPostedInfo], + customerId: String +) extends TopicTrait + case class InBoundUpdatePhysicalCard(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: PhysicalCard) extends InBoundTrait[PhysicalCard] case class OutBoundDeletePhysicalCardForBank(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - cardId: String) extends TopicTrait + bankId: BankId, + cardId: String) extends TopicTrait + case class InBoundDeletePhysicalCardForBank(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] case class OutBoundGetPhysicalCardForBank(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - cardId: String) extends TopicTrait + bankId: BankId, + cardId: String) extends TopicTrait + case class InBoundGetPhysicalCardForBank(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: PhysicalCard) extends InBoundTrait[PhysicalCard] case class OutBoundGetPhysicalCardsForBank(outboundAdapterCallContext: OutboundAdapterCallContext, - bank: Bank, - user: User, - limit: Int, - offset: Int, - fromDate: String, - toDate: String) extends TopicTrait + bank: Bank, + user: User, + limit: Int, + offset: Int, + fromDate: String, + toDate: String) extends TopicTrait + case class InBoundGetPhysicalCardsForBank(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[PhysicalCard]) extends InBoundTrait[List[PhysicalCard]] //bankCardNumber, nameOnCard, cardType, issueNumber, serialNumber, validFrom, expires, enabled, cancelled, onHotList, technology, networks, allows, accountId, bankId, replacement, pinResets, collected, posted, customerId case class OutBoundCreatePhysicalCard(outboundAdapterCallContext: OutboundAdapterCallContext, - bankCardNumber: String, - nameOnCard: String, - cardType: String, - issueNumber: String, - serialNumber: String, - validFrom: Date, - expires: Date, - enabled: Boolean, - cancelled: Boolean, - onHotList: Boolean, - technology: String, - networks: List[String], - allows: List[String], - accountId: String, - bankId: String, - replacement: Option[CardReplacementInfo], - pinResets: List[PinResetInfo], - collected: Option[CardCollectionInfo], - posted: Option[CardPostedInfo], - customerId: String, - cvv: String, - brand: String - ) extends TopicTrait + bankCardNumber: String, + nameOnCard: String, + cardType: String, + issueNumber: String, + serialNumber: String, + validFrom: Date, + expires: Date, + enabled: Boolean, + cancelled: Boolean, + onHotList: Boolean, + technology: String, + networks: List[String], + allows: List[String], + accountId: String, + bankId: String, + replacement: Option[CardReplacementInfo], + pinResets: List[PinResetInfo], + collected: Option[CardCollectionInfo], + posted: Option[CardPostedInfo], + customerId: String, + cvv: String, + brand: String +) extends TopicTrait + case class InBoundCreatePhysicalCard(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: PhysicalCard) extends InBoundTrait[PhysicalCard] case class OutBoundGetTransactionRequestImpl(outboundAdapterCallContext: OutboundAdapterCallContext, - transactionRequestId: TransactionRequestId) extends TopicTrait + transactionRequestId: TransactionRequestId) extends TopicTrait + case class InBoundGetTransactionRequestImpl(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] case class OutBoundGetCustomerByCustomerId(outboundAdapterCallContext: OutboundAdapterCallContext, - customerId: String) extends TopicTrait + customerId: String) extends TopicTrait + case class InBoundGetCustomerByCustomerId(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CustomerCommons) extends InBoundTrait[CustomerCommons] case class OutBoundCreateOrUpdateKycCheck(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: String, - customerId: String, - id: String, - customerNumber: String, - date: Date, - how: String, - staffUserId: String, - mStaffName: String, - mSatisfied: Boolean, - comments: String) extends TopicTrait + bankId: String, + customerId: String, + id: String, + customerNumber: String, + date: Date, + how: String, + staffUserId: String, + mStaffName: String, + mSatisfied: Boolean, + comments: String) extends TopicTrait case class InBoundCreateOrUpdateKycCheck(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: KycCheckCommons) extends InBoundTrait[KycCheckCommons] case class OutBoundCreateOrUpdateKycDocument(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: String, - customerId: String, - id: String, - customerNumber: String, - `type`: String, - number: String, - issueDate: Date, - issuePlace: String, - expiryDate: Date) extends TopicTrait + bankId: String, + customerId: String, + id: String, + customerNumber: String, + `type`: String, + number: String, + issueDate: Date, + issuePlace: String, + expiryDate: Date) extends TopicTrait case class InBoundCreateOrUpdateKycDocument(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: KycDocument) extends InBoundTrait[KycDocument] case class OutBoundCreateOrUpdateKycMedia(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: String, - customerId: String, - id: String, - customerNumber: String, - `type`: String, - url: String, - date: Date, - relatesToKycDocumentId: String, - relatesToKycCheckId: String) extends TopicTrait + bankId: String, + customerId: String, + id: String, + customerNumber: String, + `type`: String, + url: String, + date: Date, + relatesToKycDocumentId: String, + relatesToKycCheckId: String) extends TopicTrait case class InBoundCreateOrUpdateKycMedia(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: KycMediaCommons) extends InBoundTrait[KycMediaCommons] case class OutBoundCreateOrUpdateKycStatus(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: String, - customerId: String, - customerNumber: String, - ok: Boolean, - date: Date) extends TopicTrait + bankId: String, + customerId: String, + customerNumber: String, + ok: Boolean, + date: Date) extends TopicTrait case class InBoundCreateOrUpdateKycStatus(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: KycStatusCommons) extends InBoundTrait[KycStatusCommons] case class OutBoundGetKycChecks(outboundAdapterCallContext: OutboundAdapterCallContext, - customerId: String) extends TopicTrait + customerId: String) extends TopicTrait case class InBoundGetKycChecks(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[KycCheckCommons]) extends InBoundTrait[List[KycCheckCommons]] case class OutBoundGetKycDocuments(outboundAdapterCallContext: OutboundAdapterCallContext, - customerId: String) extends TopicTrait + customerId: String) extends TopicTrait case class InBoundGetKycDocuments(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[KycDocumentCommons]) extends InBoundTrait[List[KycDocumentCommons]] case class OutBoundGetKycMedias(outboundAdapterCallContext: OutboundAdapterCallContext, - customerId: String) extends TopicTrait + customerId: String) extends TopicTrait case class InBoundGetKycMedias(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[KycMediaCommons]) extends InBoundTrait[List[KycMediaCommons]] case class OutBoundGetKycStatuses(outboundAdapterCallContext: OutboundAdapterCallContext, - customerId: String) extends TopicTrait + customerId: String) extends TopicTrait case class InBoundGetKycStatuses(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[KycStatusCommons]) extends InBoundTrait[List[KycStatusCommons]] case class OutBoundCreateBankAccount(outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - accountId: AccountId, - accountType: String, - accountLabel: String, - currency: String, - initialBalance: BigDecimal, - accountHolderName: String, - branchId: String, - accountRoutings: List[AccountRouting]) extends TopicTrait + bankId: BankId, + accountId: AccountId, + accountType: String, + accountLabel: String, + currency: String, + initialBalance: BigDecimal, + accountHolderName: String, + branchId: String, + accountRoutings: List[AccountRouting]) extends TopicTrait case class InBoundCreateBankAccount(inboundAdapterCallContext: InboundAdapterCallContext, - status: Status, - data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] + status: Status, + data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] case class OutBoundCreateMessage(outboundAdapterCallContext: OutboundAdapterCallContext, - user: User, - bankId: BankId, - message: String, - fromDepartment: String, - fromPerson : String) extends TopicTrait + user: User, + bankId: BankId, + message: String, + fromDepartment: String, + fromPerson: String) extends TopicTrait case class InBoundCreateMessage(inboundAdapterCallContext: InboundAdapterCallContext, - status: Status, - data: CustomerMessageCommons) extends InBoundTrait[CustomerMessageCommons] + status: Status, + data: CustomerMessageCommons) extends InBoundTrait[CustomerMessageCommons] case class OutBoundValidateChallengeAnswer(outboundAdapterCallContext: OutboundAdapterCallContext, - challengeId: String, - hashOfSuppliedAnswer: String) extends TopicTrait + challengeId: String, + hashOfSuppliedAnswer: String) extends TopicTrait case class InBoundValidateChallengeAnswer(inboundAdapterCallContext: InboundAdapterCallContext, - status: Status, - data: Boolean) extends InBoundTrait[Boolean] + status: Status, + data: Boolean) extends InBoundTrait[Boolean] case class OutBoundValidateChallengeAnswerV2(outboundAdapterCallContext: OutboundAdapterCallContext, - challengeId: String, - suppliedAnswer: String, - suppliedAnswerType: SuppliedAnswerType) extends TopicTrait + challengeId: String, + suppliedAnswer: String, + suppliedAnswerType: SuppliedAnswerType) extends TopicTrait case class InBoundValidateChallengeAnswerV2(inboundAdapterCallContext: InboundAdapterCallContext, - status: Status, - data: Boolean) extends InBoundTrait[Boolean] + status: Status, + data: Boolean) extends InBoundTrait[Boolean] //--------------------- -case class OutBoundGetBankLegacy (outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId) extends TopicTrait -case class InBoundGetBankLegacy (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankCommons) extends InBoundTrait[BankCommons] +case class OutBoundGetBankLegacy(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId) extends TopicTrait + +case class InBoundGetBankLegacy(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankCommons) extends InBoundTrait[BankCommons] -case class OutBoundGetBanksLegacy (outboundAdapterCallContext: OutboundAdapterCallContext) extends TopicTrait -case class InBoundGetBanksLegacy (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[BankCommons]) extends InBoundTrait[List[BankCommons]] +case class OutBoundGetBanksLegacy(outboundAdapterCallContext: OutboundAdapterCallContext) extends TopicTrait + +case class InBoundGetBanksLegacy(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[BankCommons]) extends InBoundTrait[List[BankCommons]] -case class OutBoundGetBankAccountsForUserLegacy (outboundAdapterCallContext: OutboundAdapterCallContext, - provider: String, username:String ) extends TopicTrait -case class InBoundGetBankAccountsForUserLegacy (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[InboundAccountCommons]) extends InBoundTrait[List[InboundAccountCommons]] +case class OutBoundGetBankAccountsForUserLegacy(outboundAdapterCallContext: OutboundAdapterCallContext, + provider: String, username: String) extends TopicTrait + +case class InBoundGetBankAccountsForUserLegacy(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[InboundAccountCommons]) extends InBoundTrait[List[InboundAccountCommons]] -case class OutBoundGetBankAccountLegacy (outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - accountId: AccountId) extends TopicTrait -case class InBoundGetBankAccountLegacy (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] +case class OutBoundGetBankAccountLegacy(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + accountId: AccountId) extends TopicTrait + +case class InBoundGetBankAccountLegacy(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] -case class OutBoundGetBankAccountByRouting (outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: Option[BankId], - scheme: String, - address: String) extends TopicTrait -case class InBoundGetBankAccountByRouting (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] +case class OutBoundGetBankAccountByRouting(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: Option[BankId], + scheme: String, + address: String) extends TopicTrait + +case class InBoundGetBankAccountByRouting(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] -case class OutBoundGetCoreBankAccountsLegacy (outboundAdapterCallContext: OutboundAdapterCallContext, - bankIdAccountIds: List[BankIdAccountId]) extends TopicTrait -case class InBoundGetCoreBankAccountsLegacy (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CoreAccount]) extends InBoundTrait[List[CoreAccount]] +case class OutBoundGetCoreBankAccountsLegacy(outboundAdapterCallContext: OutboundAdapterCallContext, + bankIdAccountIds: List[BankIdAccountId]) extends TopicTrait + +case class InBoundGetCoreBankAccountsLegacy(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CoreAccount]) extends InBoundTrait[List[CoreAccount]] -case class OutBoundGetBankAccountsHeldLegacy (outboundAdapterCallContext: OutboundAdapterCallContext, - bankIdAccountIds: List[BankIdAccountId]) extends TopicTrait -case class InBoundGetBankAccountsHeldLegacy (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[AccountHeld]) extends InBoundTrait[List[AccountHeld]] +case class OutBoundGetBankAccountsHeldLegacy(outboundAdapterCallContext: OutboundAdapterCallContext, + bankIdAccountIds: List[BankIdAccountId]) extends TopicTrait + +case class InBoundGetBankAccountsHeldLegacy(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[AccountHeld]) extends InBoundTrait[List[AccountHeld]] -case class OutBoundCheckBankAccountExistsLegacy (outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - accountId: AccountId) extends TopicTrait -case class InBoundCheckBankAccountExistsLegacy (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] +case class OutBoundCheckBankAccountExistsLegacy(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + accountId: AccountId) extends TopicTrait + +case class InBoundCheckBankAccountExistsLegacy(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] -case class OutBoundGetCounterpartyByCounterpartyIdLegacy (outboundAdapterCallContext: OutboundAdapterCallContext, - counterpartyId: CounterpartyId) extends TopicTrait -case class InBoundGetCounterpartyByCounterpartyIdLegacy (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CounterpartyTraitCommons) extends InBoundTrait[CounterpartyTraitCommons] +case class OutBoundGetCounterpartyByCounterpartyIdLegacy(outboundAdapterCallContext: OutboundAdapterCallContext, + counterpartyId: CounterpartyId) extends TopicTrait + +case class InBoundGetCounterpartyByCounterpartyIdLegacy(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CounterpartyTraitCommons) extends InBoundTrait[CounterpartyTraitCommons] -case class OutBoundGetCounterpartiesLegacy (outboundAdapterCallContext: OutboundAdapterCallContext, - thisBankId: BankId, - thisAccountId: AccountId, - viewId: ViewId) extends TopicTrait -case class InBoundGetCounterpartiesLegacy (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CounterpartyTraitCommons]) extends InBoundTrait[List[CounterpartyTraitCommons]] +case class OutBoundGetCounterpartiesLegacy(outboundAdapterCallContext: OutboundAdapterCallContext, + thisBankId: BankId, + thisAccountId: AccountId, + viewId: ViewId) extends TopicTrait + +case class InBoundGetCounterpartiesLegacy(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CounterpartyTraitCommons]) extends InBoundTrait[List[CounterpartyTraitCommons]] -case class OutBoundGetTransactionsLegacy (outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - accountId: AccountId, - limit: Int, - offset: Int, - fromDate: String, - toDate: String) extends TopicTrait -case class InBoundGetTransactionsLegacy (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[Transaction]) extends InBoundTrait[List[Transaction]] +case class OutBoundGetTransactionsLegacy(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + accountId: AccountId, + limit: Int, + offset: Int, + fromDate: String, + toDate: String) extends TopicTrait + +case class InBoundGetTransactionsLegacy(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[Transaction]) extends InBoundTrait[List[Transaction]] -case class OutBoundGetTransactionLegacy (outboundAdapterCallContext: OutboundAdapterCallContext, - bankId: BankId, - accountId: AccountId, - transactionId: TransactionId) extends TopicTrait -case class InBoundGetTransactionLegacy (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Transaction) extends InBoundTrait[Transaction] +case class OutBoundGetTransactionLegacy(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + accountId: AccountId, + transactionId: TransactionId) extends TopicTrait + +case class InBoundGetTransactionLegacy(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Transaction) extends InBoundTrait[Transaction] -case class OutBoundCreatePhysicalCardLegacy (outboundAdapterCallContext: OutboundAdapterCallContext, - bankCardNumber: String, - nameOnCard: String, - cardType: String, - issueNumber: String, - serialNumber: String, - validFrom: Date, - expires: Date, - enabled: Boolean, - cancelled: Boolean, - onHotList: Boolean, - technology: String, - networks: List[String], - allows: List[String], - accountId: String, - bankId: String, - replacement: Option[CardReplacementInfo], - pinResets: List[PinResetInfo], - collected: Option[CardCollectionInfo], - posted: Option[CardPostedInfo], - customerId: String, - cvv: String = "", - brand: String = "") extends TopicTrait -case class InBoundCreatePhysicalCardLegacy (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: PhysicalCard) extends InBoundTrait[PhysicalCard] +case class OutBoundCreatePhysicalCardLegacy(outboundAdapterCallContext: OutboundAdapterCallContext, + bankCardNumber: String, + nameOnCard: String, + cardType: String, + issueNumber: String, + serialNumber: String, + validFrom: Date, + expires: Date, + enabled: Boolean, + cancelled: Boolean, + onHotList: Boolean, + technology: String, + networks: List[String], + allows: List[String], + accountId: String, + bankId: String, + replacement: Option[CardReplacementInfo], + pinResets: List[PinResetInfo], + collected: Option[CardCollectionInfo], + posted: Option[CardPostedInfo], + customerId: String, + cvv: String = "", + brand: String = "") extends TopicTrait + +case class InBoundCreatePhysicalCardLegacy(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: PhysicalCard) extends InBoundTrait[PhysicalCard] -case class OutBoundCreateBankAccountLegacy (bankId: BankId, - accountId: AccountId, - accountType: String, - accountLabel: String, - currency: String, - initialBalance: BigDecimal, - accountHolderName: String, - branchId: String, - accountRoutings: List[AccountRouting]) extends TopicTrait -case class InBoundCreateBankAccountLegacy (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] +case class OutBoundCreateBankAccountLegacy(bankId: BankId, + accountId: AccountId, + accountType: String, + accountLabel: String, + currency: String, + initialBalance: BigDecimal, + accountHolderName: String, + branchId: String, + accountRoutings: List[AccountRouting]) extends TopicTrait + +case class InBoundCreateBankAccountLegacy(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] -case class OutBoundGetCustomerByCustomerIdLegacy (outboundAdapterCallContext: OutboundAdapterCallContext, - customerId: String) extends TopicTrait -case class InBoundGetCustomerByCustomerIdLegacy (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CustomerCommons) extends InBoundTrait[CustomerCommons] +case class OutBoundGetCustomerByCustomerIdLegacy(outboundAdapterCallContext: OutboundAdapterCallContext, + customerId: String) extends TopicTrait -case class OutBoundGetBankAccountByIban (outboundAdapterCallContext: OutboundAdapterCallContext, - iban : String) extends TopicTrait -case class InBoundGetBankAccountByIban (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] +case class InBoundGetCustomerByCustomerIdLegacy(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CustomerCommons) extends InBoundTrait[CustomerCommons] -case class OutBoundGetBankAccounts (outboundAdapterCallContext: OutboundAdapterCallContext, - bankIdAccountIds: List[BankIdAccountId]) extends TopicTrait -case class InBoundGetBankAccounts (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[BankAccountCommons]) extends InBoundTrait[List[BankAccountCommons]] +case class OutBoundGetBankAccountByIban(outboundAdapterCallContext: OutboundAdapterCallContext, + iban: String) extends TopicTrait -case class OutBoundDynamicEntityProcess (outboundAdapterCallContext: OutboundAdapterCallContext, - operation: DynamicEntityOperation, - entityName: String, - requestBody: Option[JObject], - entityId: Option[String], - bankId: Option[String], - queryParameters: Option[Map[String, List[String]]], - userId: Option[String], - isPersonalEntity: Boolean)extends TopicTrait -case class InBoundDynamicEntityProcess (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: JValue) extends InBoundTrait[JValue] +case class InBoundGetBankAccountByIban(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] + +case class OutBoundGetBankAccounts(outboundAdapterCallContext: OutboundAdapterCallContext, + bankIdAccountIds: List[BankIdAccountId]) extends TopicTrait + +case class InBoundGetBankAccounts(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[BankAccountCommons]) extends InBoundTrait[List[BankAccountCommons]] + +case class OutBoundDynamicEntityProcess(outboundAdapterCallContext: OutboundAdapterCallContext, + operation: DynamicEntityOperation, + entityName: String, + requestBody: Option[JObject], + entityId: Option[String], + bankId: Option[String], + queryParameters: Option[Map[String, List[String]]], + userId: Option[String], + isPersonalEntity: Boolean) extends TopicTrait + +case class InBoundDynamicEntityProcess(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: JValue) extends InBoundTrait[JValue] // because swagger generate not support JValue type, so here supply too xxxDoc TO generate correct request and response body example case class FooBar(name: String, number: Int, fooBarId: Option[String] = None) -case class OutBoundDynamicEntityProcessDoc (outboundAdapterCallContext: OutboundAdapterCallContext, - operation: DynamicEntityOperation, - entityName: String, - requestBody: Option[FooBar], - entityId: Option[String]) extends TopicTrait -case class InBoundDynamicEntityProcessDoc (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: FooBar) extends InBoundTrait[FooBar] + +case class OutBoundDynamicEntityProcessDoc(outboundAdapterCallContext: OutboundAdapterCallContext, + operation: DynamicEntityOperation, + entityName: String, + requestBody: Option[FooBar], + entityId: Option[String]) extends TopicTrait + +case class InBoundDynamicEntityProcessDoc(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: FooBar) extends InBoundTrait[FooBar] // --------------------- some special connector methods corresponding InBound and OutBound case class OutBoundCreateChallenges(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, accountId: AccountId, userIds: List[String], transactionRequestType: TransactionRequestType, transactionRequestId: String, scaMethod: Option[StrongCustomerAuthentication.SCA]) extends TopicTrait + case class InBoundCreateChallenges(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[String]) extends InBoundTrait[List[String]] case class OutBoundGetCounterpartyFromTransaction(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, accountId: AccountId, counterpartyId: String) extends TopicTrait + case class InBoundGetCounterpartyFromTransaction(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Counterparty) extends InBoundTrait[Counterparty] case class OutBoundGetCounterpartiesFromTransaction(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, accountId: AccountId) extends TopicTrait + case class InBoundGetCounterpartiesFromTransaction(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[Counterparty]) extends InBoundTrait[List[Counterparty]] case class OutBoundGetCounterparty(outboundAdapterCallContext: OutboundAdapterCallContext, thisBankId: BankId, thisAccountId: AccountId, couterpartyId: String) extends TopicTrait -case class InBoundGetCounterparty(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Counterparty) extends InBoundTrait[Counterparty] + +case class InBoundGetCounterparty(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Counterparty) extends InBoundTrait[Counterparty] case class OutBoundGetPhysicalCardsForUser(outboundAdapterCallContext: OutboundAdapterCallContext, user: User) extends TopicTrait -case class InBoundGetPhysicalCardsForUser(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[PhysicalCard]) extends InBoundTrait[List[PhysicalCard]] + +case class InBoundGetPhysicalCardsForUser(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[PhysicalCard]) extends InBoundTrait[List[PhysicalCard]] +case class OutBoundCreateTransactionRequest(outboundAdapterCallContext: OutboundAdapterCallContext, initiator: User, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, body: TransactionRequestBody) extends TopicTrait -case class OutBoundCreateTransactionRequest(outboundAdapterCallContext: OutboundAdapterCallContext,initiator: User, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, body: TransactionRequestBody) extends TopicTrait case class InBoundCreateTransactionRequest(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] case class OutBoundGetStatus(outboundAdapterCallContext: OutboundAdapterCallContext, challengeThresholdAmount: BigDecimal, transactionRequestCommonBodyAmount: BigDecimal, transactionRequestType: TransactionRequestType) extends TopicTrait + case class InBoundGetStatus(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, statusValue: String, data: TransactionRequestStatus.Value) extends InBoundTrait[TransactionRequestStatus.Value] case class OutBoundGetChargeValue(outboundAdapterCallContext: OutboundAdapterCallContext, chargeLevelAmount: BigDecimal, transactionRequestCommonBodyAmount: BigDecimal) extends TopicTrait -case class InBoundGetChargeValue(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: String) extends InBoundTrait[String] + +case class InBoundGetChargeValue(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: String) extends InBoundTrait[String] case class OutBoundCreateTransactionRequestv400(outboundAdapterCallContext: OutboundAdapterCallContext, initiator: User, viewId: ViewId, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, - detailsPlain: String, + detailsPlain: String, chargePolicy: String, - challengeType: Option[String], + challengeType: Option[String], scaMethod: Option[StrongCustomerAuthentication.SCA], - reasons: Option[List[TransactionRequestReason]], + reasons: Option[List[TransactionRequestReason]], ) extends TopicTrait + case class InBoundCreateTransactionRequestv400(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] case class OutBoundCreateTransactionRequestSepaCreditTransfersBGV1( @@ -1047,7 +1158,7 @@ case class OutBoundCreateTransactionRequestSepaCreditTransfersBGV1( transactionRequestBody: SepaCreditTransfersBerlinGroupV13, ) extends TopicTrait -case class InBoundCreateTransactionRequestSepaCreditTransfersBGV1 (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequestBGV1) extends InBoundTrait[TransactionRequestBGV1] +case class InBoundCreateTransactionRequestSepaCreditTransfersBGV1(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequestBGV1) extends InBoundTrait[TransactionRequestBGV1] case class OutBoundCreateTransactionRequestPeriodicSepaCreditTransfersBGV1( outboundAdapterCallContext: OutboundAdapterCallContext, initiator: User, @@ -1059,109 +1170,143 @@ case class OutBoundCreateTransactionRequestPeriodicSepaCreditTransfersBGV1( case class InBoundCreateTransactionRequestPeriodicSepaCreditTransfersBGV1(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequestBGV1) extends InBoundTrait[TransactionRequestBGV1] case class OutBoundCreateTransactionRequestImpl(outboundAdapterCallContext: OutboundAdapterCallContext, transactionRequestId: TransactionRequestId, transactionRequestType: TransactionRequestType, fromAccount: BankAccount, counterparty: BankAccount, body: TransactionRequestBody, status: String, charge: TransactionRequestCharge) extends TopicTrait -case class InBoundCreateTransactionRequestImpl(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] + +case class InBoundCreateTransactionRequestImpl(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] case class OutBoundSaveTransactionRequestTransaction(outboundAdapterCallContext: OutboundAdapterCallContext, transactionRequestId: TransactionRequestId, transactionId: TransactionId) extends TopicTrait + case class InBoundSaveTransactionRequestTransaction(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] case class OutBoundSaveTransactionRequestTransactionImpl(outboundAdapterCallContext: OutboundAdapterCallContext, transactionRequestId: TransactionRequestId, transactionId: TransactionId) extends TopicTrait -case class InBoundSaveTransactionRequestTransactionImpl(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] + +case class InBoundSaveTransactionRequestTransactionImpl(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] case class OutBoundSaveTransactionRequestChallenge(outboundAdapterCallContext: OutboundAdapterCallContext, transactionRequestId: TransactionRequestId, challenge: TransactionRequestChallenge) extends TopicTrait + case class InBoundSaveTransactionRequestChallenge(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] case class OutBoundSaveTransactionRequestChallengeImpl(outboundAdapterCallContext: OutboundAdapterCallContext, transactionRequestId: TransactionRequestId, challenge: TransactionRequestChallenge) extends TopicTrait + case class InBoundSaveTransactionRequestChallengeImpl(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] case class OutBoundSaveTransactionRequestStatusImpl(outboundAdapterCallContext: OutboundAdapterCallContext, transactionRequestId: TransactionRequestId, status: String) extends TopicTrait + case class InBoundSaveTransactionRequestStatusImpl(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] -case class OutBoundGetTransactionRequests(outboundAdapterCallContext: OutboundAdapterCallContext,initiator: User, fromAccount: BankAccount) extends TopicTrait -case class InBoundGetTransactionRequests(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionRequest]) extends InBoundTrait[List[TransactionRequest]] +case class OutBoundGetTransactionRequests(outboundAdapterCallContext: OutboundAdapterCallContext, initiator: User, fromAccount: BankAccount) extends TopicTrait + +case class InBoundGetTransactionRequests(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionRequest]) extends InBoundTrait[List[TransactionRequest]] case class OutBoundGetTransactionRequestTypes(outboundAdapterCallContext: OutboundAdapterCallContext, initiator: User, fromAccount: BankAccount) extends TopicTrait + case class InBoundGetTransactionRequestTypes(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionRequestType]) extends InBoundTrait[List[TransactionRequestType]] case class OutBoundCreateTransactionAfterChallenge(outboundAdapterCallContext: OutboundAdapterCallContext, initiator: User, transReqId: TransactionRequestId) extends TopicTrait -case class InBoundCreateTransactionAfterChallenge(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] + +case class InBoundCreateTransactionAfterChallenge(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] case class OutBoundCreateSandboxBankAccount(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, accountId: AccountId, accountNumber: String, accountType: String, accountLabel: String, currency: String, initialBalance: BigDecimal, accountHolderName: String, branchId: String, accountRoutings: List[AccountRouting]) extends TopicTrait -case class InBoundCreateSandboxBankAccount(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] + +case class InBoundCreateSandboxBankAccount(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] case class OutBoundUpdateAccountLabel(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, accountId: AccountId, label: String) extends TopicTrait -case class InBoundUpdateAccountLabel(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] + +case class InBoundUpdateAccountLabel(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] case class GetProductsParam(name: String, value: List[String]) + case class OutBoundGetProducts(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, params: List[GetProductsParam]) extends TopicTrait -case class InBoundGetProducts(inboundAdapterCallContext: InboundAdapterCallContext ,status: Status, data: List[ProductCommons]) extends InBoundTrait[List[ProductCommons]] +case class InBoundGetProducts(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[ProductCommons]) extends InBoundTrait[List[ProductCommons]] case class OutBoundGetProduct(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, productCode: ProductCode) extends TopicTrait + case class InBoundGetProduct(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: ProductCommons) extends InBoundTrait[ProductCommons] -case class OutBoundGetCurrentFxRate(outboundAdapterCallContext: OutboundAdapterCallContext,bankId: BankId, fromCurrencyCode: String, toCurrencyCode: String) extends TopicTrait +case class OutBoundGetCurrentFxRate(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, fromCurrencyCode: String, toCurrencyCode: String) extends TopicTrait + case class InBoundGetCurrentFxRate(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: FXRateCommons) extends InBoundTrait[FXRateCommons] case class OutBoundCreateOrUpdateFXRate(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: String, fromCurrencyCode: String, toCurrencyCode: String, conversionValue: Double, inverseConversionValue: Double, effectiveDate: Date) extends TopicTrait -case class InBoundCreateOrUpdateFXRate(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: FXRateCommons) extends InBoundTrait[FXRateCommons] + +case class InBoundCreateOrUpdateFXRate(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: FXRateCommons) extends InBoundTrait[FXRateCommons] case class OutBoundGetBranchLegacy(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, branchId: BranchId) extends TopicTrait -case class InBoundGetBranchLegacy(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BranchTCommons) extends InBoundTrait[BranchTCommons] + +case class InBoundGetBranchLegacy(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BranchTCommons) extends InBoundTrait[BranchTCommons] case class OutBoundGetAtmLegacy(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, atmId: AtmId) extends TopicTrait + case class InBoundGetAtmLegacy(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AtmTCommons) extends InBoundTrait[AtmTCommons] case class OutBoundGetTransactionRequestTypeCharges(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, accountId: AccountId, viewId: ViewId, transactionRequestTypes: List[TransactionRequestType]) extends TopicTrait -case class InBoundGetTransactionRequestTypeCharges(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionRequestTypeChargeCommons]) extends InBoundTrait[List[TransactionRequestTypeChargeCommons]] + +case class InBoundGetTransactionRequestTypeCharges(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionRequestTypeChargeCommons]) extends InBoundTrait[List[TransactionRequestTypeChargeCommons]] case class OutBoundGetCustomersByCustomerPhoneNumber(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, phoneNumber: String) extends TopicTrait + case class InBoundGetCustomersByCustomerPhoneNumber(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CustomerCommons]) extends InBoundTrait[List[CustomerCommons]] case class OutBoundGetTransactionAttributeById(outboundAdapterCallContext: OutboundAdapterCallContext, transactionAttributeId: String) extends TopicTrait + case class InBoundGetTransactionAttributeById(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionAttributeCommons) extends InBoundTrait[TransactionAttributeCommons] case class OutBoundCreateOrUpdateCustomerAttribute(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, customerId: CustomerId, customerAttributeId: Option[String], name: String, attributeType: CustomerAttributeType.Value, value: String) extends TopicTrait + case class InBoundCreateOrUpdateCustomerAttribute(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CustomerAttributeCommons) extends InBoundTrait[CustomerAttributeCommons] case class OutBoundCreateOrUpdateTransactionAttribute(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, transactionId: TransactionId, transactionAttributeId: Option[String], name: String, attributeType: TransactionAttributeType.Value, value: String) extends TopicTrait + case class InBoundCreateOrUpdateTransactionAttribute(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionAttributeCommons) extends InBoundTrait[TransactionAttributeCommons] case class OutBoundGetCustomerAttributes(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, customerId: CustomerId) extends TopicTrait + case class InBoundGetCustomerAttributes(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CustomerAttributeCommons]) extends InBoundTrait[List[CustomerAttributeCommons]] -case class OutBoundGetCustomerIdsByAttributeNameValues(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, nameValues: Map[String,List[String]]) extends TopicTrait +case class OutBoundGetCustomerIdsByAttributeNameValues(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, nameValues: Map[String, List[String]]) extends TopicTrait + case class InBoundGetCustomerIdsByAttributeNameValues(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[String]) extends InBoundTrait[List[String]] case class CustomerAndAttribute(customer: Customer, attributes: List[CustomerAttribute]) + case class OutBoundGetCustomerAttributesForCustomers(outboundAdapterCallContext: OutboundAdapterCallContext, customers: List[Customer]) extends TopicTrait + case class InBoundGetCustomerAttributesForCustomers(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CustomerAndAttribute]) extends InBoundTrait[List[CustomerAndAttribute]] -case class OutBoundGetTransactionIdsByAttributeNameValues(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, nameValues: Map[String,List[String]]) extends TopicTrait +case class OutBoundGetTransactionIdsByAttributeNameValues(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, nameValues: Map[String, List[String]]) extends TopicTrait + case class InBoundGetTransactionIdsByAttributeNameValues(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[String]) extends InBoundTrait[List[String]] case class OutBoundGetTransactionAttributes(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, transactionId: TransactionId) extends TopicTrait + case class InBoundGetTransactionAttributes(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionAttributeCommons]) extends InBoundTrait[List[TransactionAttributeCommons]] case class OutBoundGetBankAttributesByBank(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId) extends TopicTrait + case class InBoundGetBankAttributesByBank(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[BankAttributeTraitCommons]) extends InBoundTrait[List[BankAttributeTraitCommons]] case class OutBoundGetCustomerAttributeById(outboundAdapterCallContext: OutboundAdapterCallContext, customerAttributeId: String) extends TopicTrait + case class InBoundGetCustomerAttributeById(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CustomerAttributeCommons) extends InBoundTrait[CustomerAttributeCommons] case class OutBoundCreateDirectDebit(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: String, accountId: String, customerId: String, userId: String, counterpartyId: String, dateSigned: Date, dateStarts: Date, dateExpires: Option[Date]) extends TopicTrait + case class InBoundCreateDirectDebit(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: DirectDebitTraitCommons) extends InBoundTrait[DirectDebitTraitCommons] case class OutBoundDeleteCustomerAttribute(outboundAdapterCallContext: OutboundAdapterCallContext, customerAttributeId: String) extends TopicTrait + case class InBoundDeleteCustomerAttribute(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] case class OutBoundCheckExternalUserCredentials(outboundAdapterCallContext: OutboundAdapterCallContext, username: String, password: String) extends TopicTrait + case class InBoundCheckExternalUserCredentials(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: InboundExternalUser) extends InBoundTrait[InboundExternalUser] case class OutBoundCheckExternalUserExists(outboundAdapterCallContext: OutboundAdapterCallContext, username: String) extends TopicTrait + case class InBoundCheckExternalUserExists(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: InboundExternalUser) extends InBoundTrait[InboundExternalUser] case class OutBoundCreateChallengesC2( @@ -1173,6 +1318,7 @@ case class OutBoundCreateChallengesC2( scaStatus: Option[SCAStatus], consentId: Option[String], authenticationMethodId: Option[String]) extends TopicTrait + case class OutBoundCreateChallengesC3( outboundAdapterCallContext: OutboundAdapterCallContext, userIds: List[String], @@ -1185,6 +1331,7 @@ case class OutBoundCreateChallengesC3( authenticationMethodId: Option[String]) extends TopicTrait case class InBoundCreateChallengesC2(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[ChallengeCommons]) extends InBoundTrait[List[ChallengeCommons]] + case class InBoundCreateChallengesC3(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[ChallengeCommons]) extends InBoundTrait[List[ChallengeCommons]] case class OutBoundValidateChallengeAnswerC2( @@ -1224,41 +1371,733 @@ case class OutBoundValidateChallengeAnswerC5( ) extends TopicTrait case class InBoundValidateChallengeAnswerC4( - inboundAdapterCallContext: InboundAdapterCallContext, - status: Status, + inboundAdapterCallContext: InboundAdapterCallContext, + status: Status, data: ChallengeCommons ) extends InBoundTrait[ChallengeCommons] case class InBoundValidateChallengeAnswerC5( - inboundAdapterCallContext: InboundAdapterCallContext, - status: Status, + inboundAdapterCallContext: InboundAdapterCallContext, + status: Status, data: ChallengeCommons ) extends InBoundTrait[ChallengeCommons] case class InBoundValidateChallengeAnswerC2(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: ChallengeCommons) extends InBoundTrait[ChallengeCommons] + case class InBoundValidateChallengeAnswerC3(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: ChallengeCommons) extends InBoundTrait[ChallengeCommons] case class OutBoundValidateAndCheckIbanNumber( outboundAdapterCallContext: OutboundAdapterCallContext, iban: String ) extends TopicTrait + case class InBoundValidateAndCheckIbanNumber(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: IbanChecker) extends InBoundTrait[IbanChecker] case class OutBoundGetChallenge(outboundAdapterCallContext: OutboundAdapterCallContext, challengeId: String) extends TopicTrait + case class InBoundGetChallenge(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: ChallengeCommons) extends InBoundTrait[ChallengeCommons] case class OutBoundGetChallengesByTransactionRequestId(outboundAdapterCallContext: OutboundAdapterCallContext, transactionRequestId: String) extends TopicTrait + case class InBoundGetChallengesByTransactionRequestId(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[ChallengeCommons]) extends InBoundTrait[List[ChallengeCommons]] case class OutBoundGetChallengesByConsentId(outboundAdapterCallContext: OutboundAdapterCallContext, consentId: String) extends TopicTrait + case class InBoundGetChallengesByConsentId(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[ChallengeCommons]) extends InBoundTrait[List[ChallengeCommons]] case class OutBoundGetChallengesByBasketId(outboundAdapterCallContext: OutboundAdapterCallContext, basketId: String) extends TopicTrait + case class InBoundGetChallengesByBasketId(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[ChallengeCommons]) extends InBoundTrait[List[ChallengeCommons]] case class OutBoundGetCounterpartyByIbanAndBankAccountId(outboundAdapterCallContext: OutboundAdapterCallContext, iban: String, bankId: BankId, accountId: AccountId) extends TopicTrait + case class InBoundGetCounterpartyByIbanAndBankAccountId(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CounterpartyTraitCommons) extends InBoundTrait[CounterpartyTraitCommons] + +case class OutBoundGetPaymentLimit(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: String, + accountId: String, + viewId: String, + transactionRequestType: String, + currency: String, + userId: String, + username: String) extends TopicTrait + +case class InBoundGetPaymentLimit(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AmountOfMoney) extends InBoundTrait[AmountOfMoney] + + +case class OutBoundAllChallengesSuccessfullyAnswered(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + accountId: AccountId, + transReqId: TransactionRequestId) extends TopicTrait + +case class InBoundAllChallengesSuccessfullyAnswered(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] + +case class OutBoundGetAccountRoutingsByScheme(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: Option[BankId], + scheme: String) extends TopicTrait + +case class InBoundGetBankSettlementAccounts(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[BankAccountCommons]) extends InBoundTrait[List[BankAccountCommons]] + + +case class OutBoundGetAccountsHeld(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + user: User) extends TopicTrait + +case class InBoundGetAccountsHeld(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[BankIdAccountId]) extends InBoundTrait[List[BankIdAccountId]] + + +case class OutBoundGetAccountsHeldByUser(outboundAdapterCallContext: OutboundAdapterCallContext, + user: User) extends TopicTrait + +case class InBoundGetAccountsHeldByUser(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[BankIdAccountId]) extends InBoundTrait[List[BankIdAccountId]] + +case class OutBoundGetBankAccountFromCounterparty(outboundAdapterCallContext: OutboundAdapterCallContext, + counterparty: CounterpartyTrait, + isOutgoingAccount: Boolean) extends TopicTrait + +case class InBoundGetBankAccountFromCounterparty(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] + + +case class OutBoundGetBankAccountByNumber(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: Option[BankId], + accountNumber: String) extends TopicTrait + +case class InBoundGetBankAccountByNumber(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] + + +case class OutBoundGetBankAccountByRoutings(outboundAdapterCallContext: OutboundAdapterCallContext, + bankAccountRoutings: BankAccountRoutings) extends TopicTrait + +case class InBoundGetBankAccountByRoutings(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BankAccountCommons) extends InBoundTrait[BankAccountCommons] + + +case class OutBoundDeleteCounterpartyByCounterpartyId(outboundAdapterCallContext: OutboundAdapterCallContext, + counterpartyId: CounterpartyId) extends TopicTrait + +case class InBoundDeleteCounterpartyByCounterpartyId(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] + + +case class OutBoundGetOrCreateCounterparty(outboundAdapterCallContext: OutboundAdapterCallContext, + name: String, + description: String, + currency: String, + createdByUserId: String, + thisBankId: String, + thisAccountId: String, + thisViewId: String, + other_bank_routing_scheme: String, + other_bank_routing_address: String, + other_branch_routing_scheme: String, + other_branch_routing_address: String, + other_account_routing_scheme: String, + other_account_routing_address: String, + other_account_secondary_routing_scheme: String, + other_account_secondary_routing_address: String) extends TopicTrait + +case class InBoundGetOrCreateCounterparty(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CounterpartyTraitCommons) extends InBoundTrait[CounterpartyTraitCommons] + + +case class OutBoundGetCounterpartyByRoutings(outboundAdapterCallContext: OutboundAdapterCallContext, + otherBankRoutingScheme: String, + otherBankRoutingAddress: String, + otherBranchRoutingScheme: String, + otherBranchRoutingAddress: String, + otherAccountRoutingScheme: String, + otherAccountRoutingAddress: String, + otherAccountSecondaryRoutingScheme: String, + otherAccountSecondaryRoutingAddress: String) extends TopicTrait + +case class InBoundGetCounterpartyByRoutings(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CounterpartyTraitCommons) extends InBoundTrait[CounterpartyTraitCommons] + + +case class OutBoundGetSumOfTransactionsFromAccountToCounterparty(outboundAdapterCallContext: OutboundAdapterCallContext, + fromBankId: BankId, + fromAccountId: AccountId, + counterpartyId: CounterpartyId, + fromDate: Date, + toDate: Date) extends TopicTrait + +case class InBoundGetSumOfTransactionsFromAccountToCounterparty(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AmountOfMoney) extends InBoundTrait[AmountOfMoney] + +case class OutBoundGetPhysicalCardByCardNumber(outboundAdapterCallContext: OutboundAdapterCallContext, + bankCardNumber: String) extends TopicTrait + +case class InBoundGetPhysicalCardByCardNumber(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: PhysicalCardTraitCommons) extends InBoundTrait[PhysicalCardTraitCommons] + + +case class OutBoundSaveDoubleEntryBookTransaction(outboundAdapterCallContext: OutboundAdapterCallContext, + doubleEntryTransaction: DoubleEntryTransaction) extends TopicTrait + +case class InBoundSaveDoubleEntryBookTransaction(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: DoubleEntryTransaction) extends InBoundTrait[DoubleEntryTransaction] + + +case class OutBoundGetDoubleEntryBookTransaction(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + accountId: AccountId, + transactionId: TransactionId) extends TopicTrait + +case class InBoundGetDoubleEntryBookTransaction(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: DoubleEntryTransaction) extends InBoundTrait[DoubleEntryTransaction] + + +case class OutBoundGetBalancingTransaction(outboundAdapterCallContext: OutboundAdapterCallContext, + transactionId: TransactionId) extends TopicTrait + +case class InBoundGetBalancingTransaction(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: DoubleEntryTransaction) extends InBoundTrait[DoubleEntryTransaction] + + +case class OutBoundGetProductTree(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + productCode: ProductCode) extends TopicTrait + +case class InBoundGetProductTree(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[ProductCommons]) extends InBoundTrait[List[ProductCommons]] + + +case class OutBoundCreateOrUpdateBranch(outboundAdapterCallContext: OutboundAdapterCallContext, + branch: BranchT) extends TopicTrait + +case class InBoundCreateOrUpdateBranch(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: BranchTCommons) extends InBoundTrait[BranchTCommons] + + +case class OutBoundCreateOrUpdateAtm(outboundAdapterCallContext: OutboundAdapterCallContext, + atm: AtmT) extends TopicTrait + +case class InBoundCreateOrUpdateAtm(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AtmTCommons) extends InBoundTrait[AtmTCommons] + + +case class OutBoundDeleteAtm(outboundAdapterCallContext: OutboundAdapterCallContext, + atm: AtmT) extends TopicTrait + +case class InBoundDeleteAtm(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] + + +case class OutBoundCreateSystemLevelEndpointTag(outboundAdapterCallContext: OutboundAdapterCallContext, + operationId: String, + tagName: String) extends TopicTrait + +case class InBoundCreateSystemLevelEndpointTag(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: EndpointTagTCommons) extends InBoundTrait[EndpointTagTCommons] + + +case class OutBoundUpdateSystemLevelEndpointTag(outboundAdapterCallContext: OutboundAdapterCallContext, + endpointTagId: String, + operationId: String, + tagName: String) extends TopicTrait + +case class InBoundUpdateSystemLevelEndpointTag(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: EndpointTagTCommons) extends InBoundTrait[EndpointTagTCommons] + + +case class OutBoundCreateBankLevelEndpointTag(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: String, + operationId: String, + tagName: String) extends TopicTrait + +case class InBoundCreateBankLevelEndpointTag(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: EndpointTagTCommons) extends InBoundTrait[EndpointTagTCommons] + + +case class OutBoundUpdateBankLevelEndpointTag(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: String, + endpointTagId: String, + operationId: String, + tagName: String) extends TopicTrait + +case class InBoundUpdateBankLevelEndpointTag(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: EndpointTagTCommons) extends InBoundTrait[EndpointTagTCommons] + + +case class OutBoundGetSystemLevelEndpointTag(outboundAdapterCallContext: OutboundAdapterCallContext, + operationId: String, + tagName: String) extends TopicTrait + +case class InBoundGetSystemLevelEndpointTag(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: EndpointTagTCommons) extends InBoundTrait[EndpointTagTCommons] + + +case class OutBoundGetBankLevelEndpointTag(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: String, + operationId: String, + tagName: String) extends TopicTrait + +case class InBoundGetBankLevelEndpointTag(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: EndpointTagTCommons) extends InBoundTrait[EndpointTagTCommons] + + +case class OutBoundGetEndpointTagById(outboundAdapterCallContext: OutboundAdapterCallContext, + endpointTagId: String) extends TopicTrait + +case class InBoundGetEndpointTagById(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: EndpointTagTCommons) extends InBoundTrait[EndpointTagTCommons] + + +case class OutBoundDeleteEndpointTag(outboundAdapterCallContext: OutboundAdapterCallContext, + endpointTagId: String) extends TopicTrait + +case class InBoundDeleteEndpointTag(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] + + +case class OutBoundGetSystemLevelEndpointTags(outboundAdapterCallContext: OutboundAdapterCallContext, + operationId: String) extends TopicTrait + +case class InBoundGetSystemLevelEndpointTags(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[EndpointTagTCommons]) extends InBoundTrait[List[EndpointTagTCommons]] + + +case class OutBoundGetBankLevelEndpointTags(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: String, + operationId: String) extends TopicTrait + +case class InBoundGetBankLevelEndpointTags(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[EndpointTagTCommons]) extends InBoundTrait[List[EndpointTagTCommons]] + + +case class OutBoundCreateOrUpdateProductFee(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + productCode: ProductCode, + productFeeId: Option[String], + name: String, + isActive: Boolean, + moreInfo: String, + currency: String, + amount: BigDecimal, + frequency: String, + `type`: String) extends TopicTrait + +case class InBoundCreateOrUpdateProductFee(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: ProductFeeTraitCommons) extends InBoundTrait[ProductFeeTraitCommons] + + +case class OutBoundGetProductFeesFromProvider(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + productCode: ProductCode) extends TopicTrait + +case class InBoundGetProductFeesFromProvider(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[ProductFeeTraitCommons]) extends InBoundTrait[List[ProductFeeTraitCommons]] + + +case class OutBoundGetProductFeeById(outboundAdapterCallContext: OutboundAdapterCallContext, + productFeeId: String) extends TopicTrait + +case class InBoundGetProductFeeById(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: ProductFeeTraitCommons) extends InBoundTrait[ProductFeeTraitCommons] + + +case class OutBoundDeleteProductFee(outboundAdapterCallContext: OutboundAdapterCallContext, + productFeeId: String) extends TopicTrait + +case class InBoundDeleteProductFee(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] + + +case class OutBoundUpdateAtmSupportedLanguages(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + atmId: AtmId, + supportedLanguages: List[String]) extends TopicTrait + +case class InBoundUpdateAtmSupportedLanguages(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AtmTCommons) extends InBoundTrait[AtmTCommons] + + +case class OutBoundUpdateAtmSupportedCurrencies(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + atmId: AtmId, + supportedCurrencies: List[String]) extends TopicTrait + +case class InBoundUpdateAtmSupportedCurrencies(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AtmTCommons) extends InBoundTrait[AtmTCommons] + + +case class OutBoundUpdateAtmAccessibilityFeatures(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + atmId: AtmId, + accessibilityFeatures: List[String]) extends TopicTrait + +case class InBoundUpdateAtmAccessibilityFeatures(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AtmTCommons) extends InBoundTrait[AtmTCommons] + + +case class OutBoundUpdateAtmServices(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + atmId: AtmId, + supportedCurrencies: List[String]) extends TopicTrait + +case class InBoundUpdateAtmServices(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AtmTCommons) extends InBoundTrait[AtmTCommons] + + +case class OutBoundUpdateAtmNotes(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + atmId: AtmId, + notes: List[String]) extends TopicTrait + +case class InBoundUpdateAtmNotes(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AtmTCommons) extends InBoundTrait[AtmTCommons] + + +case class OutBoundUpdateAtmLocationCategories(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + atmId: AtmId, + locationCategories: List[String]) extends TopicTrait + +case class InBoundUpdateAtmLocationCategories(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AtmTCommons) extends InBoundTrait[AtmTCommons] + + + +case class OutBoundGetAllAtms(outboundAdapterCallContext: OutboundAdapterCallContext) extends TopicTrait + +case class InBoundGetAllAtms(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[AtmTCommons]) extends InBoundTrait[List[AtmTCommons]] + +case class OutBoundCheckCounterpartyExists(outboundAdapterCallContext: OutboundAdapterCallContext, + name: String, + thisBankId: String, + thisAccountId: String, + thisViewId: String) extends TopicTrait + +case class InBoundCheckCounterpartyExists(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CounterpartyTraitCommons) extends InBoundTrait[CounterpartyTraitCommons] + + +case class OutBoundCheckAgentNumberAvailable(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + agentNumber: String) extends TopicTrait + +case class InBoundCheckAgentNumberAvailable(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] + + +case class OutBoundCreateCustomerC2(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + legalName: String, + customerNumber: String, + mobileNumber: String, + email: String, + faceImage: CustomerFaceImageTrait, + dateOfBirth: Date, + relationshipStatus: String, + dependents: Int, + dobOfDependents: List[Date], + highestEducationAttained: String, + employmentStatus: String, + kycStatus: Boolean, + lastOkDate: Date, + creditRating: Option[CreditRatingTrait], + creditLimit: Option[AmountOfMoneyTrait], + title: String, + branchId: String, + nameSuffix: String) extends TopicTrait + +case class InBoundCreateCustomerC2(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CustomerCommons) extends InBoundTrait[CustomerCommons] + + +case class OutBoundGetAgentByAgentId(outboundAdapterCallContext: OutboundAdapterCallContext, + agentId: String) extends TopicTrait + +case class InBoundGetAgentByAgentId(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AgentCommons) extends InBoundTrait[AgentCommons] + + +case class OutBoundGetAgentByAgentNumber(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + agentNumber: String) extends TopicTrait + +case class InBoundGetAgentByAgentNumber(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AgentCommons) extends InBoundTrait[AgentCommons] + + +case class OutBoundUpdateAgentStatus(outboundAdapterCallContext: OutboundAdapterCallContext, + agentId: String, + isPendingAgent: Boolean, + isConfirmedAgent: Boolean) extends TopicTrait + +case class InBoundUpdateAgentStatus(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AgentCommons) extends InBoundTrait[AgentCommons] + + +case class OutBoundCreateAgent(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: String, + legalName: String, + mobileNumber: String, + agentNumber: String) extends TopicTrait + +case class InBoundCreateAgent(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AgentCommons) extends InBoundTrait[AgentCommons] + + +case class OutBoundGetCustomersAtAllBanks(outboundAdapterCallContext: OutboundAdapterCallContext) extends TopicTrait + +case class InBoundGetCustomersAtAllBanks(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CustomerCommons]) extends InBoundTrait[List[CustomerCommons]] + + +case class OutBoundGetCustomersByCustomerLegalName(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + legalName: String) extends TopicTrait + +case class InBoundGetCustomersByCustomerLegalName(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CustomerCommons]) extends InBoundTrait[List[CustomerCommons]] + +case class OutBoundDeleteBankAttribute(outboundAdapterCallContext: OutboundAdapterCallContext, + bankAttributeId: String) extends TopicTrait + +case class InBoundDeleteBankAttribute(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] + + +case class OutBoundDeleteAtmAttribute(outboundAdapterCallContext: OutboundAdapterCallContext, + atmAttributeId: String) extends TopicTrait + +case class InBoundDeleteAtmAttribute(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] + +case class OutBoundDeleteAtmAttributesByAtmId(outboundAdapterCallContext: OutboundAdapterCallContext, + atmId: AtmId) extends TopicTrait + +case class InBoundDeleteAtmAttributesByAtmId(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] + + +case class OutBoundCreateOrUpdateAttributeDefinition(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + name: String, + category: AttributeCategory.Value, + `type`: AttributeType.Value, + description: String, + alias: String, + canBeSeenOnViews: List[String], + isActive: Boolean + ) extends TopicTrait + + + case class OutBoundCreateOrUpdateUserAttribute(outboundAdapterCallContext: OutboundAdapterCallContext, + userId: String, + userAttributeId: Option[String], + name: String, + attributeType: BankAttributeType.Value, + value: String, + isPersonal: Boolean) extends TopicTrait + + case class InBoundDeleteUserAttribute(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] + + + case class OutBoundGetAccountAttributesByAccountCanBeSeenOnView(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + accountId: AccountId, + viewId: ViewId) extends TopicTrait + + case class InBoundGetAccountAttributesByAccountCanBeSeenOnView(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[AccountAttributeCommons]) extends InBoundTrait[List[AccountAttributeCommons]] + + + case class OutBoundGetAccountAttributesByAccountsCanBeSeenOnView(outboundAdapterCallContext: OutboundAdapterCallContext, + accounts: List[BankIdAccountId], + viewId: ViewId) extends TopicTrait + + case class InBoundGetAccountAttributesByAccountsCanBeSeenOnView(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[AccountAttributeCommons]) extends InBoundTrait[List[AccountAttributeCommons]] + + + case class OutBoundGetTransactionAttributesByTransactionsCanBeSeenOnView(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + transactionIds: List[TransactionId], + viewId: ViewId) extends TopicTrait + + case class InBoundGetTransactionAttributesByTransactionsCanBeSeenOnView(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionAttributeCommons]) extends InBoundTrait[List[TransactionAttributeCommons]] + + + case class OutBoundGetTransactionAttributesCanBeSeenOnView(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + transactionId: TransactionId, + viewId: ViewId) extends TopicTrait + + case class InBoundGetTransactionAttributesCanBeSeenOnView(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionAttributeCommons]) extends InBoundTrait[List[TransactionAttributeCommons]] + + + case class OutBoundGetTransactionRequestAttributesFromProvider(outboundAdapterCallContext: OutboundAdapterCallContext, + transactionRequestId: TransactionRequestId) extends TopicTrait + + case class InBoundGetTransactionRequestAttributesFromProvider(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionRequestAttributeTraitCommons]) extends InBoundTrait[List[TransactionRequestAttributeTraitCommons]] + + + case class OutBoundGetTransactionRequestAttributes(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + transactionRequestId: TransactionRequestId) extends TopicTrait + + case class InBoundGetTransactionRequestAttributes(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionRequestAttributeTraitCommons]) extends InBoundTrait[List[TransactionRequestAttributeTraitCommons]] + + + case class OutBoundGetTransactionRequestAttributesCanBeSeenOnView(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + transactionRequestId: TransactionRequestId, + viewId: ViewId) extends TopicTrait + + case class InBoundGetTransactionRequestAttributesCanBeSeenOnView(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionRequestAttributeTraitCommons]) extends InBoundTrait[List[TransactionRequestAttributeTraitCommons]] + + + case class OutBoundGetTransactionRequestAttributeById(outboundAdapterCallContext: OutboundAdapterCallContext, + transactionRequestAttributeId: String) extends TopicTrait + + case class InBoundGetTransactionRequestAttributeById(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequestAttributeTraitCommons) extends InBoundTrait[TransactionRequestAttributeTraitCommons] + + + case class OutBoundGetByAttributeNameValues(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + params: Map[String, + List[String]], + isPersonal: Boolean) extends TopicTrait + + case class InBoundGetByAttributeNameValues(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionRequestAttributeTraitCommons]) extends InBoundTrait[List[TransactionRequestAttributeTraitCommons]] + + case class OutBoundCreateOrUpdateTransactionRequestAttribute(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + transactionRequestId: TransactionRequestId, + transactionRequestAttributeId: Option[String], + name: String, + attributeType: TransactionRequestAttributeType.Value, + value: String) extends TopicTrait + + case class InBoundCreateOrUpdateTransactionRequestAttribute(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequestAttributeTraitCommons) extends InBoundTrait[TransactionRequestAttributeTraitCommons] + + + case class OutBoundCreateTransactionRequestAttributes(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: BankId, + transactionRequestId: TransactionRequestId, + transactionRequestAttributes: List[TransactionRequestAttributeJsonV400], + isPersonal: Boolean) extends TopicTrait + + case class InBoundCreateTransactionRequestAttributes(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionRequestAttributeTraitCommons]) extends InBoundTrait[List[TransactionRequestAttributeTraitCommons]] + + + case class OutBoundDeleteTransactionRequestAttribute(outboundAdapterCallContext: OutboundAdapterCallContext, + transactionRequestAttributeId: String) extends TopicTrait + + case class InBoundDeleteTransactionRequestAttribute(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] + + + case class OutBoundCreateCustomerMessage(outboundAdapterCallContext: OutboundAdapterCallContext, + customer: Customer, + bankId: BankId, + transport: String, + message: String, + fromDepartment: String, + fromPerson: String) extends TopicTrait + + case class InBoundCreateCustomerMessage(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CustomerMessageCommons) extends InBoundTrait[CustomerMessageCommons] + + + case class OutBoundGetCustomerMessages(outboundAdapterCallContext: OutboundAdapterCallContext, + customer: Customer, + bankId: BankId) extends TopicTrait + + case class InBoundGetCustomerMessages(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CustomerMessageCommons]) extends InBoundTrait[List[CustomerMessageCommons]] + + + case class OutBoundCreateStandingOrder(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: String, + accountId: String, + customerId: String, + userId: String, + counterpartyId: String, + amountValue: BigDecimal, + amountCurrency: String, + whenFrequency: String, + whenDetail: String, + dateSigned: Date, + dateStarts: Date, + dateExpires: Option[Date]) extends TopicTrait + + case class InBoundCreateStandingOrder(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: StandingOrderTraitCommons) extends InBoundTrait[StandingOrderTraitCommons] + + + case class OutBoundValidateUserAuthContextUpdateRequest(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: String, + userId: String, + key: String, + value: String, + scaMethod: String) extends TopicTrait + + case class InBoundValidateUserAuthContextUpdateRequest(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: UserAuthContextUpdateCommons) extends InBoundTrait[UserAuthContextUpdateCommons] + + + case class OutBoundCheckAnswer(outboundAdapterCallContext: OutboundAdapterCallContext, + authContextUpdateId: String, + challenge: String) extends TopicTrait + + case class InBoundCheckAnswer(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: UserAuthContextUpdateCommons) extends InBoundTrait[UserAuthContextUpdateCommons] + + + case class OutBoundGetCustomerAccountLink(outboundAdapterCallContext: OutboundAdapterCallContext, + customerId: String, + accountId: String) extends TopicTrait + + case class InBoundGetCustomerAccountLink(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CustomerAccountLinkTraitCommons) extends InBoundTrait[CustomerAccountLinkTraitCommons] + + + case class OutBoundGetCustomerAccountLinksByCustomerId(outboundAdapterCallContext: OutboundAdapterCallContext, + customerId: String) extends TopicTrait + + case class InBoundGetCustomerAccountLinksByCustomerId(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CustomerAccountLinkTraitCommons]) extends InBoundTrait[List[CustomerAccountLinkTraitCommons]] + + + case class OutBoundGetAgentAccountLinksByAgentId(outboundAdapterCallContext: OutboundAdapterCallContext, + agnetId: String) extends TopicTrait + + case class InBoundGetAgentAccountLinksByAgentId(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CustomerAccountLinkTraitCommons]) extends InBoundTrait[List[CustomerAccountLinkTraitCommons]] + + + case class OutBoundGetCustomerAccountLinksByBankIdAccountId(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: String, + accountId: String) extends TopicTrait + + case class InBoundGetCustomerAccountLinksByBankIdAccountId(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CustomerAccountLinkTraitCommons]) extends InBoundTrait[List[CustomerAccountLinkTraitCommons]] + + + case class OutBoundGetCustomerAccountLinkById(outboundAdapterCallContext: OutboundAdapterCallContext, + customerAccountLinkId: String) extends TopicTrait + + case class InBoundGetCustomerAccountLinkById(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CustomerAccountLinkTraitCommons) extends InBoundTrait[CustomerAccountLinkTraitCommons] + + + case class OutBoundDeleteCustomerAccountLinkById(outboundAdapterCallContext: OutboundAdapterCallContext, + customerAccountLinkId: String) extends TopicTrait + + case class InBoundDeleteCustomerAccountLinkById(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] + + + case class OutBoundCreateCustomerAccountLink(outboundAdapterCallContext: OutboundAdapterCallContext, + customerId: String, + bankId: String, + accountId: String, + relationshipType: String) extends TopicTrait + + case class InBoundCreateCustomerAccountLink(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CustomerAccountLinkTraitCommons) extends InBoundTrait[CustomerAccountLinkTraitCommons] + + + case class OutBoundCreateAgentAccountLink(outboundAdapterCallContext: OutboundAdapterCallContext, + agentId: String, + bankId: String, + accountId: String) extends TopicTrait + + case class InBoundCreateAgentAccountLink(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AgentAccountLinkTraitCommons) extends InBoundTrait[AgentAccountLinkTraitCommons] + + + case class OutBoundUpdateCustomerAccountLinkById(outboundAdapterCallContext: OutboundAdapterCallContext, + customerAccountLinkId: String, + relationshipType: String) extends TopicTrait + + case class InBoundUpdateCustomerAccountLinkById(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CustomerAccountLinkTraitCommons) extends InBoundTrait[CustomerAccountLinkTraitCommons] + + + case class OutBoundGetConsentImplicitSCA(outboundAdapterCallContext: OutboundAdapterCallContext, + user: User) extends TopicTrait + + case class InBoundGetConsentImplicitSCA(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: ConsentImplicitSCATCommons) extends InBoundTrait[ConsentImplicitSCATCommons] + + + case class OutBoundCreateOrUpdateCounterpartyLimit(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: String, + accountId: String, + viewId: String, + counterpartyId: String, + currency: String, + maxSingleAmount: BigDecimal, + maxMonthlyAmount: BigDecimal, + maxNumberOfMonthlyTransactions: Int, + maxYearlyAmount: BigDecimal, + maxNumberOfYearlyTransactions: Int, + maxTotalAmount: BigDecimal, + maxNumberOfTransactions: Int) extends TopicTrait + + case class InBoundCreateOrUpdateCounterpartyLimit(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CounterpartyLimitTraitCommons) extends InBoundTrait[CounterpartyLimitTraitCommons] + + + case class OutBoundGetCounterpartyLimit(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: String, + accountId: String, + viewId: String, + counterpartyId: String) extends TopicTrait + + case class InBoundGetCounterpartyLimit(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: CounterpartyLimitTraitCommons) extends InBoundTrait[CounterpartyLimitTraitCommons] + + + case class OutBoundDeleteCounterpartyLimit(outboundAdapterCallContext: OutboundAdapterCallContext, + bankId: String, + accountId: String, + viewId: String, + counterpartyId: String) extends TopicTrait + + case class InBoundDeleteCounterpartyLimit(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] + + // --------------------- some special connector methods corresponding InBound and OutBound -- end -- From 011cb997e54d068e61dcbae8e2ac0adc7be323e3 Mon Sep 17 00:00:00 2001 From: hongwei Date: Tue, 14 Jan 2025 19:27:05 +0800 Subject: [PATCH 02/17] feature/added getAccountsHeld to rabbitMqConnector --- .../Adapter/MockedRabbitMqAdapter.scala | 71 +++++++++++++++++-- .../rabbitmq/RabbitMQConnector_vOct2024.scala | 43 ++++++++++- 2 files changed, 107 insertions(+), 7 deletions(-) diff --git a/obp-api/src/main/scala/code/bankconnectors/rabbitmq/Adapter/MockedRabbitMqAdapter.scala b/obp-api/src/main/scala/code/bankconnectors/rabbitmq/Adapter/MockedRabbitMqAdapter.scala index ca7646c3f..f4a653494 100644 --- a/obp-api/src/main/scala/code/bankconnectors/rabbitmq/Adapter/MockedRabbitMqAdapter.scala +++ b/obp-api/src/main/scala/code/bankconnectors/rabbitmq/Adapter/MockedRabbitMqAdapter.scala @@ -77,7 +77,7 @@ class ServerCallback(val ch: Channel) extends DeliverCallback with MdcLoggable{ )) } //---------------- dynamic start -------------------please don't modify this line -// ---------- created on 2024-10-28T12:26:57Z +// ---------- created on 2025-01-14T11:14:03Z } else if (obpMessageId.contains("get_adapter_info")) { val outBound = json.parse(message).extract[OutBoundGetAdapterInfo] @@ -687,6 +687,27 @@ class ServerCallback(val ch: Channel) extends DeliverCallback with MdcLoggable{ )).recoverWith { case e: Exception => Future(InBoundGetBankAccountsHeld( + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), + status = Status(e.getMessage, Nil), + data = null + )) + } + } else if (obpMessageId.contains("get_accounts_held")) { + val outBound = json.parse(message).extract[OutBoundGetAccountsHeld] + val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getAccountsHeld(outBound.bankId,outBound.user,None).map(_._1.head) + + obpMappedResponse.map(response => InBoundGetAccountsHeld( + + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), + status = Status("", Nil), + data = response + )).recoverWith { + case e: Exception => Future(InBoundGetAccountsHeld( + inboundAdapterCallContext = InboundAdapterCallContext( correlationId = outBound.outboundAdapterCallContext.correlationId ), @@ -1233,6 +1254,27 @@ class ServerCallback(val ch: Channel) extends DeliverCallback with MdcLoggable{ )).recoverWith { case e: Exception => Future(InBoundGetTransactionRequestImpl( + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), + status = Status(e.getMessage, Nil), + data = null + )) + } + } else if (obpMessageId.contains("get_transaction_request_types")) { + val outBound = json.parse(message).extract[OutBoundGetTransactionRequestTypes] + val obpMappedResponse = Future{code.bankconnectors.LocalMappedConnector.getTransactionRequestTypes(outBound.initiator,outBound.fromAccount,None).map(_._1).head} + + obpMappedResponse.map(response => InBoundGetTransactionRequestTypes( + + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), + status = Status("", Nil), + data = response + )).recoverWith { + case e: Exception => Future(InBoundGetTransactionRequestTypes( + inboundAdapterCallContext = InboundAdapterCallContext( correlationId = outBound.outboundAdapterCallContext.correlationId ), @@ -1450,7 +1492,7 @@ class ServerCallback(val ch: Channel) extends DeliverCallback with MdcLoggable{ data = null )) } - } else if (obpMessageId.contains("create_transaction_after_challengev300")) { + } else if (obpMessageId.contains("create_transaction_after_challengev300")) { val outBound = json.parse(message).extract[OutBoundCreateTransactionAfterChallengev300] val obpMappedResponse = code.bankconnectors.LocalMappedConnector.createTransactionAfterChallengev300(outBound.initiator,outBound.fromAccount,outBound.transReqId,outBound.transactionRequestType,None).map(_._1.head) @@ -2115,6 +2157,27 @@ class ServerCallback(val ch: Channel) extends DeliverCallback with MdcLoggable{ )).recoverWith { case e: Exception => Future(InBoundCreateOrUpdateProductAttribute( + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), + status = Status(e.getMessage, Nil), + data = null + )) + } + } else if (obpMessageId.contains("get_bank_attributes_by_bank")) { + val outBound = json.parse(message).extract[OutBoundGetBankAttributesByBank] + val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getBankAttributesByBank(outBound.bankId,None).map(_._1.head) + + obpMappedResponse.map(response => InBoundGetBankAttributesByBank( + + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), + status = Status("", Nil), + data = response + )).recoverWith { + case e: Exception => Future(InBoundGetBankAttributesByBank( + inboundAdapterCallContext = InboundAdapterCallContext( correlationId = outBound.outboundAdapterCallContext.correlationId ), @@ -3046,8 +3109,8 @@ class ServerCallback(val ch: Channel) extends DeliverCallback with MdcLoggable{ data = null )) } -// ---------- created on 2024-10-28T12:26:57Z -//---------------- dynamic end ---------------------please don't modify this line +// ---------- created on 2025-01-14T11:14:03Z +//---------------- dynamic end ---------------------please don't modify this line } else { Future { 1 diff --git a/obp-api/src/main/scala/code/bankconnectors/rabbitmq/RabbitMQConnector_vOct2024.scala b/obp-api/src/main/scala/code/bankconnectors/rabbitmq/RabbitMQConnector_vOct2024.scala index 16815c136..f8cff917b 100644 --- a/obp-api/src/main/scala/code/bankconnectors/rabbitmq/RabbitMQConnector_vOct2024.scala +++ b/obp-api/src/main/scala/code/bankconnectors/rabbitmq/RabbitMQConnector_vOct2024.scala @@ -70,7 +70,7 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable { val connectorName = "rabbitmq_vOct2024" //---------------- dynamic start -------------------please don't modify this line -// ---------- created on 2024-12-10T10:42:33Z +// ---------- created on 2025-01-14T19:12:57Z messageDocs += getAdapterInfoDoc def getAdapterInfoDoc = MessageDoc( @@ -1154,6 +1154,43 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable { response.map(convertToTuple[List[AccountHeld]](callContext)) } + messageDocs += getAccountsHeldDoc + def getAccountsHeldDoc = MessageDoc( + process = "obp.getAccountsHeld", + messageFormat = messageFormat, + description = "Get Accounts Held", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetAccountsHeld(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + bankId=BankId(bankIdExample.value), + user= UserCommons(userPrimaryKey=UserPrimaryKey(123), + userId=userIdExample.value, + idGivenByProvider="string", + provider=providerExample.value, + emailAddress=emailAddressExample.value, + name=userNameExample.value, + createdByConsentId=Some("string"), + createdByUserInvitationId=Some("string"), + isDeleted=Some(true), + lastMarketingAgreementSignedDate=Some(toDate(dateExample)))) + ), + exampleInboundMessage = ( + InBoundGetAccountsHeld(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( BankIdAccountId(bankId=BankId(bankIdExample.value), + accountId=AccountId(accountIdExample.value)))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getAccountsHeld(bankId: BankId, user: User, callContext: Option[CallContext]): OBPReturnType[Box[List[BankIdAccountId]]] = { + import com.openbankproject.commons.dto.{InBoundGetAccountsHeld => InBound, OutBoundGetAccountsHeld => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, user) + val response: Future[Box[InBound]] = sendRequest[InBound]("obp_get_accounts_held", req, callContext) + response.map(convertToTuple[List[BankIdAccountId]](callContext)) + } + messageDocs += checkBankAccountExistsDoc def checkBankAccountExistsDoc = MessageDoc( process = "obp.checkBankAccountExists", @@ -6997,8 +7034,8 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable { response.map(convertToTuple[Boolean](callContext)) } -// ---------- created on 2024-12-10T10:42:33Z -//---------------- dynamic end ---------------------please don't modify this line +// ---------- created on 2025-01-14T19:12:57Z +//---------------- dynamic end ---------------------please don't modify this line private val availableOperation = DynamicEntityOperation.values.map(it => s""""$it"""").mkString("[", ", ", "]") From be8ec767e528e99990e1daa2956177cb1a57c4e4 Mon Sep 17 00:00:00 2001 From: hongwei Date: Tue, 14 Jan 2025 19:55:22 +0800 Subject: [PATCH 03/17] feature/added getAccountsHeldByUser to rabbitMqConnector --- .../generator/ConnectorBuilderUtil.scala | 1 + .../Adapter/MockedRabbitMqAdapter.scala | 27 ++++++++++-- .../rabbitmq/RabbitMQConnector_vOct2024.scala | 42 +++++++++++++++++-- 3 files changed, 64 insertions(+), 6 deletions(-) diff --git a/obp-api/src/main/scala/code/bankconnectors/generator/ConnectorBuilderUtil.scala b/obp-api/src/main/scala/code/bankconnectors/generator/ConnectorBuilderUtil.scala index ec6b65eaa..afd2cbbf9 100644 --- a/obp-api/src/main/scala/code/bankconnectors/generator/ConnectorBuilderUtil.scala +++ b/obp-api/src/main/scala/code/bankconnectors/generator/ConnectorBuilderUtil.scala @@ -432,6 +432,7 @@ object ConnectorBuilderUtil { "saveTransactionRequestStatusImpl", "getTransactionRequestTypeCharges", "getAccountsHeld", + "getAccountsHeldByUser", ).distinct /** diff --git a/obp-api/src/main/scala/code/bankconnectors/rabbitmq/Adapter/MockedRabbitMqAdapter.scala b/obp-api/src/main/scala/code/bankconnectors/rabbitmq/Adapter/MockedRabbitMqAdapter.scala index f4a653494..bef2cb25f 100644 --- a/obp-api/src/main/scala/code/bankconnectors/rabbitmq/Adapter/MockedRabbitMqAdapter.scala +++ b/obp-api/src/main/scala/code/bankconnectors/rabbitmq/Adapter/MockedRabbitMqAdapter.scala @@ -77,7 +77,7 @@ class ServerCallback(val ch: Channel) extends DeliverCallback with MdcLoggable{ )) } //---------------- dynamic start -------------------please don't modify this line -// ---------- created on 2025-01-14T11:14:03Z +// ---------- created on 2025-01-14T11:53:01Z } else if (obpMessageId.contains("get_adapter_info")) { val outBound = json.parse(message).extract[OutBoundGetAdapterInfo] @@ -708,6 +708,27 @@ class ServerCallback(val ch: Channel) extends DeliverCallback with MdcLoggable{ )).recoverWith { case e: Exception => Future(InBoundGetAccountsHeld( + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), + status = Status(e.getMessage, Nil), + data = null + )) + } + } else if (obpMessageId.contains("get_accounts_held_by_user")) { + val outBound = json.parse(message).extract[OutBoundGetAccountsHeldByUser] + val obpMappedResponse = code.bankconnectors.LocalMappedConnector.getAccountsHeldByUser(outBound.user,None).map(_._1.head) + + obpMappedResponse.map(response => InBoundGetAccountsHeldByUser( + + inboundAdapterCallContext = InboundAdapterCallContext( + correlationId = outBound.outboundAdapterCallContext.correlationId + ), + status = Status("", Nil), + data = response + )).recoverWith { + case e: Exception => Future(InBoundGetAccountsHeldByUser( + inboundAdapterCallContext = InboundAdapterCallContext( correlationId = outBound.outboundAdapterCallContext.correlationId ), @@ -3109,8 +3130,8 @@ class ServerCallback(val ch: Channel) extends DeliverCallback with MdcLoggable{ data = null )) } -// ---------- created on 2025-01-14T11:14:03Z -//---------------- dynamic end ---------------------please don't modify this line +// ---------- created on 2025-01-14T11:53:01Z +//---------------- dynamic end ---------------------please don't modify this line } else { Future { 1 diff --git a/obp-api/src/main/scala/code/bankconnectors/rabbitmq/RabbitMQConnector_vOct2024.scala b/obp-api/src/main/scala/code/bankconnectors/rabbitmq/RabbitMQConnector_vOct2024.scala index f8cff917b..05cb4fb57 100644 --- a/obp-api/src/main/scala/code/bankconnectors/rabbitmq/RabbitMQConnector_vOct2024.scala +++ b/obp-api/src/main/scala/code/bankconnectors/rabbitmq/RabbitMQConnector_vOct2024.scala @@ -70,7 +70,7 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable { val connectorName = "rabbitmq_vOct2024" //---------------- dynamic start -------------------please don't modify this line -// ---------- created on 2025-01-14T19:12:57Z +// ---------- created on 2025-01-14T19:52:36Z messageDocs += getAdapterInfoDoc def getAdapterInfoDoc = MessageDoc( @@ -1191,6 +1191,42 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable { response.map(convertToTuple[List[BankIdAccountId]](callContext)) } + messageDocs += getAccountsHeldByUserDoc + def getAccountsHeldByUserDoc = MessageDoc( + process = "obp.getAccountsHeldByUser", + messageFormat = messageFormat, + description = "Get Accounts Held By User", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundGetAccountsHeldByUser(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + user= UserCommons(userPrimaryKey=UserPrimaryKey(123), + userId=userIdExample.value, + idGivenByProvider="string", + provider=providerExample.value, + emailAddress=emailAddressExample.value, + name=userNameExample.value, + createdByConsentId=Some("string"), + createdByUserInvitationId=Some("string"), + isDeleted=Some(true), + lastMarketingAgreementSignedDate=Some(toDate(dateExample)))) + ), + exampleInboundMessage = ( + InBoundGetAccountsHeldByUser(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data=List( BankIdAccountId(bankId=BankId(bankIdExample.value), + accountId=AccountId(accountIdExample.value)))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def getAccountsHeldByUser(user: User, callContext: Option[CallContext]): OBPReturnType[Box[List[BankIdAccountId]]] = { + import com.openbankproject.commons.dto.{InBoundGetAccountsHeldByUser => InBound, OutBoundGetAccountsHeldByUser => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, user) + val response: Future[Box[InBound]] = sendRequest[InBound]("obp_get_accounts_held_by_user", req, callContext) + response.map(convertToTuple[List[BankIdAccountId]](callContext)) + } + messageDocs += checkBankAccountExistsDoc def checkBankAccountExistsDoc = MessageDoc( process = "obp.checkBankAccountExists", @@ -7034,8 +7070,8 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable { response.map(convertToTuple[Boolean](callContext)) } -// ---------- created on 2025-01-14T19:12:57Z -//---------------- dynamic end ---------------------please don't modify this line +// ---------- created on 2025-01-14T19:52:36Z +//---------------- dynamic end ---------------------please don't modify this line private val availableOperation = DynamicEntityOperation.values.map(it => s""""$it"""").mkString("[", ", ", "]") From 5d5871d6ac9580aff9ddb77b97da1538fb4cb5bd Mon Sep 17 00:00:00 2001 From: hongwei Date: Wed, 15 Jan 2025 15:23:09 +0800 Subject: [PATCH 04/17] test/fixed the failed tests --- .../commons/dto/JsonsTransfer.scala | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/obp-commons/src/main/scala/com/openbankproject/commons/dto/JsonsTransfer.scala b/obp-commons/src/main/scala/com/openbankproject/commons/dto/JsonsTransfer.scala index ea248be94..4a712d791 100644 --- a/obp-commons/src/main/scala/com/openbankproject/commons/dto/JsonsTransfer.scala +++ b/obp-commons/src/main/scala/com/openbankproject/commons/dto/JsonsTransfer.scala @@ -27,9 +27,7 @@ package com.openbankproject.commons.dto import java.util.Date -import com.openbankproject.commons.model.enums.{AttributeCategory, AttributeType, BankAttributeType, CardAttributeType, ChallengeType, - CustomerAttributeType, DynamicEntityOperation, PaymentServiceTypes, StrongCustomerAuthentication, - SuppliedAnswerType, TransactionAttributeType, TransactionRequestAttributeType, TransactionRequestStatus, TransactionRequestTypes} +import com.openbankproject.commons.model.enums.{AttributeCategory, AttributeType, BankAttributeType, CardAttributeType, ChallengeType, CustomerAttributeType, DynamicEntityOperation, PaymentServiceTypes, StrongCustomerAuthentication, SuppliedAnswerType, TransactionAttributeType, TransactionRequestAttributeType, TransactionRequestStatus, TransactionRequestTypes, UserAttributeType} import com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SCA import com.openbankproject.commons.model.enums.StrongCustomerAuthenticationStatus.SCAStatus import com.openbankproject.commons.model.{enums, _} @@ -1726,10 +1724,6 @@ case class InBoundUpdateAtmLocationCategories(inboundAdapterCallContext: Inbound -case class OutBoundGetAllAtms(outboundAdapterCallContext: OutboundAdapterCallContext) extends TopicTrait - -case class InBoundGetAllAtms(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[AtmTCommons]) extends InBoundTrait[List[AtmTCommons]] - case class OutBoundCheckCounterpartyExists(outboundAdapterCallContext: OutboundAdapterCallContext, name: String, thisBankId: String, @@ -1799,12 +1793,6 @@ case class OutBoundCreateAgent(outboundAdapterCallContext: OutboundAdapterCallCo case class InBoundCreateAgent(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: AgentCommons) extends InBoundTrait[AgentCommons] - -case class OutBoundGetCustomersAtAllBanks(outboundAdapterCallContext: OutboundAdapterCallContext) extends TopicTrait - -case class InBoundGetCustomersAtAllBanks(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CustomerCommons]) extends InBoundTrait[List[CustomerCommons]] - - case class OutBoundGetCustomersByCustomerLegalName(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, legalName: String) extends TopicTrait @@ -1840,14 +1828,6 @@ case class OutBoundCreateOrUpdateAttributeDefinition(outboundAdapterCallContext: ) extends TopicTrait - case class OutBoundCreateOrUpdateUserAttribute(outboundAdapterCallContext: OutboundAdapterCallContext, - userId: String, - userAttributeId: Option[String], - name: String, - attributeType: BankAttributeType.Value, - value: String, - isPersonal: Boolean) extends TopicTrait - case class InBoundDeleteUserAttribute(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Boolean) extends InBoundTrait[Boolean] From 803f1e660c4001bf73d80bd29c3cb356e4a76e4b Mon Sep 17 00:00:00 2001 From: hongwei Date: Wed, 15 Jan 2025 18:01:25 +0800 Subject: [PATCH 05/17] refactor/removed the Boolean from CommonsCaseClassGenerator --- .../bankconnectors/generator/CommonsCaseClassGenerator.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/obp-api/src/main/scala/code/bankconnectors/generator/CommonsCaseClassGenerator.scala b/obp-api/src/main/scala/code/bankconnectors/generator/CommonsCaseClassGenerator.scala index 88a284b8c..abd7a1155 100644 --- a/obp-api/src/main/scala/code/bankconnectors/generator/CommonsCaseClassGenerator.scala +++ b/obp-api/src/main/scala/code/bankconnectors/generator/CommonsCaseClassGenerator.scala @@ -9,7 +9,6 @@ object CommonsCaseClassGenerator extends App { //We need to check if the classCommons is existing or not. val allExistingClasses = getClassesFromPackage("com.openbankproject.commons.model") .filter(it =>it.getName.endsWith("Commons")) - .toList val missingReturnModels: Set[ru.Type] = connectorDeclsMethodsReturnOBPRequiredType @@ -17,7 +16,8 @@ object CommonsCaseClassGenerator extends App { .filter(it => { val symbol = it.typeSymbol val isAbstract = symbol.isAbstract - isAbstract //We only need the commons classes for abstract class, eg: ProductAttributeCommons instead of ProductAttribute + isAbstract && //We only need the commons classes for abstract class, eg: ProductAttributeCommons instead of ProductAttribute + !it.toString.equals("Boolean") //Boolean is also abstract class, so we need to remove it. }) .filterNot(it => allExistingClasses.find(thisClass=> thisClass.toString.contains(s"${it.typeSymbol.name}Commons")).isDefined From cfddb1dc8963bb51a342c7aac7d8d90267e197df Mon Sep 17 00:00:00 2001 From: hongwei Date: Wed, 15 Jan 2025 23:58:20 +0800 Subject: [PATCH 06/17] refactor/use all connector methods for code generator - WIP --- .../generator/CommonsCaseClassGenerator.scala | 6 +++++- .../bankconnectors/generator/ConnectorBuilderUtil.scala | 3 +++ .../bankconnectors/generator/InOutCaseClassGenerator.scala | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/obp-api/src/main/scala/code/bankconnectors/generator/CommonsCaseClassGenerator.scala b/obp-api/src/main/scala/code/bankconnectors/generator/CommonsCaseClassGenerator.scala index abd7a1155..e1e7082b2 100644 --- a/obp-api/src/main/scala/code/bankconnectors/generator/CommonsCaseClassGenerator.scala +++ b/obp-api/src/main/scala/code/bankconnectors/generator/CommonsCaseClassGenerator.scala @@ -37,9 +37,13 @@ object CommonsCaseClassGenerator extends App { } // private val str: String = ru.typeOf[Bank].decls.map(it => s"${it.name} :${it.typeSignature.typeSymbol.name}").mkString(", \n") private val caseClassStrings: Set[String] = missingReturnModels.map(mkClass) + println("#################################Started########################################################################") caseClassStrings.foreach { println } - println() + println("#################################Finished########################################################################") + println("Please copy and compair the result to obp-commons/src/main/scala/com/openbankproject/commons/model/CommonModel.scala") + + System.exit(0) } diff --git a/obp-api/src/main/scala/code/bankconnectors/generator/ConnectorBuilderUtil.scala b/obp-api/src/main/scala/code/bankconnectors/generator/ConnectorBuilderUtil.scala index afd2cbbf9..9dce6257b 100644 --- a/obp-api/src/main/scala/code/bankconnectors/generator/ConnectorBuilderUtil.scala +++ b/obp-api/src/main/scala/code/bankconnectors/generator/ConnectorBuilderUtil.scala @@ -273,6 +273,9 @@ object ConnectorBuilderUtil { } } + //TODO WIP, need to fix the code to support the following methods +// val commonMethodNames = Connector.getConnectorInstance("mapped").callableMethods.keySet.toList + val commonMethodNames = List( "getAdapterInfo", "getChallengeThreshold", diff --git a/obp-api/src/main/scala/code/bankconnectors/generator/InOutCaseClassGenerator.scala b/obp-api/src/main/scala/code/bankconnectors/generator/InOutCaseClassGenerator.scala index e32d43b1c..d36c2895f 100644 --- a/obp-api/src/main/scala/code/bankconnectors/generator/InOutCaseClassGenerator.scala +++ b/obp-api/src/main/scala/code/bankconnectors/generator/InOutCaseClassGenerator.scala @@ -34,6 +34,7 @@ object InOutCaseClassGenerator extends App { |case class InBound${it.name.toString.capitalize} (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: $payload) extends InBoundTrait[$payload] """.stripMargin }) + println("#################################Started########################################################################") code.foreach(println) println("#################################Finished########################################################################") From b0a9b65e13858e3c499c0bc6c6ef23a6f4d186b6 Mon Sep 17 00:00:00 2001 From: hongwei Date: Mon, 20 Jan 2025 21:58:45 +0800 Subject: [PATCH 07/17] refactor/use all connector methods for code generator step2- WIP --- .../scala/code/api/util/ExampleValue.scala | 10 +- .../generator/ConnectorBuilderUtil.scala | 383 ++++++++++-------- .../rabbitmq/RabbitMQConnectorBuilder.scala | 2 +- 3 files changed, 213 insertions(+), 182 deletions(-) diff --git a/obp-api/src/main/scala/code/api/util/ExampleValue.scala b/obp-api/src/main/scala/code/api/util/ExampleValue.scala index fa7f4f6ef..01b12cded 100644 --- a/obp-api/src/main/scala/code/api/util/ExampleValue.scala +++ b/obp-api/src/main/scala/code/api/util/ExampleValue.scala @@ -824,7 +824,7 @@ object ExampleValue { lazy val line1Example = ConnectorField(NoExampleProvided,NoDescriptionProvided) glossaryItems += makeGlossaryItem("line1", line1Example) - lazy val fromDateExample = ConnectorField(NoExampleProvided,NoDescriptionProvided) + lazy val fromDateExample = ConnectorField(DateWithMsExampleString,s"The TimeStamp in the format: $DateWithMs") glossaryItems += makeGlossaryItem("from_date", fromDateExample) lazy val creditLimitExample = ConnectorField(NoExampleProvided,NoDescriptionProvided) @@ -908,7 +908,7 @@ object ExampleValue { lazy val cashWithdrawalNationalFeeExample = ConnectorField(NoExampleProvided, NoDescriptionProvided) glossaryItems += makeGlossaryItem("ATM.cash_withdrawal_national_fee", cashWithdrawalNationalFeeExample) - lazy val cashWithdrawalInternationalFeeExample = ConnectorField(NoExampleProvided, NoDescriptionProvided) + lazy val cashWithdrawalInternationalFeeExample: ConnectorField = ConnectorField(NoExampleProvided, NoDescriptionProvided) glossaryItems += makeGlossaryItem("ATM.cash_withdrawal_international_fee", cashWithdrawalInternationalFeeExample) lazy val balanceInquiryFeeExample = ConnectorField(NoExampleProvided, NoDescriptionProvided) @@ -1052,7 +1052,7 @@ object ExampleValue { lazy val itemsExample = ConnectorField(NoExampleProvided,NoDescriptionProvided) glossaryItems += makeGlossaryItem("items", itemsExample) - lazy val toDateExample = ConnectorField(NoExampleProvided,NoDescriptionProvided) + lazy val toDateExample = ConnectorField(DateWithMsExampleString,s"The TimeStamp in the format: $DateWithMs") glossaryItems += makeGlossaryItem("to_date", toDateExample) lazy val bankRoutingsExample = ConnectorField("bank routing in form of (scheme, address)",NoDescriptionProvided) @@ -1622,7 +1622,7 @@ object ExampleValue { lazy val endDateExample = ConnectorField(NoExampleProvided,NoDescriptionProvided) glossaryItems += makeGlossaryItem("end_date", endDateExample) - lazy val canAddTransactionRequestToOwnAccountExample = ConnectorField(NoExampleProvided,NoDescriptionProvided) + lazy val canAddTransactionRequestToOwnAccountExample = ConnectorField(booleanFalse,NoDescriptionProvided) glossaryItems += makeGlossaryItem("can_add_transaction_request_to_own_account", canAddTransactionRequestToOwnAccountExample) lazy val otherAccountRoutingAddressExample = ConnectorField(NoExampleProvided,NoDescriptionProvided) @@ -2340,7 +2340,7 @@ object ExampleValue { lazy val inboundAdapterInfoInternalErrorCodeExample = ConnectorField("error code", "fix me") lazy val inboundAdapterInfoInternalNameExample = ConnectorField("NAME", "fix me") lazy val inboundAdapterInfoInternalGit_commitExample = ConnectorField("git_commit", "fix me") - lazy val inboundAdapterInfoInternalDateExample = ConnectorField("date String", "fix me") + lazy val inboundAdapterInfoInternalDateExample = ConnectorField(DateWithMsExampleString, "") lazy val inboundAdapterInfoInternalVersionExample = ConnectorField("version string", "fix me") lazy val inboundStatusMessageStatusExample = ConnectorField("Status string", "fix me") diff --git a/obp-api/src/main/scala/code/bankconnectors/generator/ConnectorBuilderUtil.scala b/obp-api/src/main/scala/code/bankconnectors/generator/ConnectorBuilderUtil.scala index 9dce6257b..d1302d8bd 100644 --- a/obp-api/src/main/scala/code/bankconnectors/generator/ConnectorBuilderUtil.scala +++ b/obp-api/src/main/scala/code/bankconnectors/generator/ConnectorBuilderUtil.scala @@ -2,7 +2,7 @@ package code.bankconnectors.generator import code.api.util.CodeGenerateUtils.createDocExample import code.api.util.{APIUtil, CallContext} -import code.bankconnectors.Connector +import code.bankconnectors.{Connector, LocalMappedConnector} import code.bankconnectors.vSept2018.KafkaMappedConnector_vSept2018 import com.openbankproject.commons.util.ReflectUtils import org.apache.commons.io.FileUtils @@ -274,169 +274,169 @@ object ConnectorBuilderUtil { } //TODO WIP, need to fix the code to support the following methods -// val commonMethodNames = Connector.getConnectorInstance("mapped").callableMethods.keySet.toList - - val commonMethodNames = List( - "getAdapterInfo", - "getChallengeThreshold", - "getChargeLevel", - "getChargeLevelC2", - "createChallenge", - "getBank", - "getBanks", - "getBankAccountsForUser", - "getBankAccountsBalances", - "getBankAccountBalances", - "getCoreBankAccounts", - "getBankAccountsHeld", - "getCounterpartyTrait", - "getCounterpartyByCounterpartyId", - "getCounterpartyByIban", - "getCounterparties", - "getTransactions", - "getTransactionsCore", - "getTransaction", - "getPhysicalCardForBank", - "deletePhysicalCardForBank", - "getPhysicalCardsForBank", - "createPhysicalCard", - "updatePhysicalCard", - "makePaymentv210", - "makePaymentV400", - "cancelPaymentV400", - "createTransactionRequestv210", - "getTransactionRequests210", - "getTransactionRequestImpl", - "createTransactionAfterChallengeV210", - "updateBankAccount", - "createBankAccount", - "getBranch", - "getBranches", - "getAtm", - "getAtms", - "createTransactionAfterChallengev300", - "makePaymentv300", - "createTransactionRequestv300", - "createCounterparty", - "checkCustomerNumberAvailable", - "createCustomer", - "updateCustomerScaData", - "updateCustomerCreditData", - "updateCustomerGeneralData", - "getCustomersByUserId", - "getCustomerByCustomerId", - "getCustomerByCustomerNumber", - "getCustomerAddress", - "createCustomerAddress", - "updateCustomerAddress", - "deleteCustomerAddress", - "createTaxResidence", - "getTaxResidence", - "deleteTaxResidence", - "getCustomers", - "getCheckbookOrders", - "getStatusOfCreditCardOrder", - "createUserAuthContext", - "createUserAuthContextUpdate", - "deleteUserAuthContexts", - "deleteUserAuthContextById", - "getUserAuthContexts", - "createOrUpdateProductAttribute", - "getProduct", - "getProducts", - "getProductAttributeById", - "getProductAttributesByBankAndCode", - "deleteProductAttribute", - "getAccountAttributeById", - "createOrUpdateAccountAttribute", - "createAccountAttributes", - "getAccountAttributesByAccount", - "createOrUpdateCardAttribute", - "getCardAttributeById", - "getCardAttributesFromProvider", - "createAccountApplication", - "getAllAccountApplication", - "getAccountApplicationById", - "updateAccountApplicationStatus", - "getOrCreateProductCollection", - "getProductCollection", - "getOrCreateProductCollectionItem", - "getProductCollectionItem", - "getProductCollectionItemsTree", - "createMeeting", - "getMeetings", - "getMeeting", - "createOrUpdateKycCheck", - "createOrUpdateKycDocument", - "createOrUpdateKycMedia", - "createOrUpdateKycStatus", - "getKycChecks", - "getKycDocuments", - "getKycMedias", - "getKycStatuses", - "createMessage", - "makeHistoricalPayment", - "validateChallengeAnswer", - //"getBankLegacy", // should not generate for Legacy methods - //"getBanksLegacy", // should not generate for Legacy methods - //"getBankAccountsForUserLegacy", // should not generate for Legacy methods - //"getBankAccountLegacy", // should not generate for Legacy methods - "getBankAccountByIban", - "getBankAccountByRouting", - "getBankAccounts", - "checkBankAccountExists", - //"getCoreBankAccountsLegacy", // should not generate for Legacy methods - //"getBankAccountsHeldLegacy", // should not generate for Legacy methods - //"checkBankAccountExistsLegacy", // should not generate for Legacy methods - //"getCounterpartyByCounterpartyIdLegacy", // should not generate for Legacy methods - //"getCounterpartiesLegacy", // should not generate for Legacy methods - //"getTransactionsLegacy", // should not generate for Legacy methods - //"getTransactionLegacy", // should not generate for Legacy methods - //"createPhysicalCardLegacy", // should not generate for Legacy methods - //"getCustomerByCustomerIdLegacy", // should not generate for Legacy methods +// val commonMethodNames = LocalMappedConnector.callableMethods.keySet.toList - "createChallenges", - "createTransactionRequestv400", - "createTransactionRequestSepaCreditTransfersBGV1", - "createTransactionRequestPeriodicSepaCreditTransfersBGV1", - "getCustomersByCustomerPhoneNumber", - "getTransactionAttributeById", - "createOrUpdateCustomerAttribute", - "createOrUpdateTransactionAttribute", - "getCustomerAttributes", - "getCustomerIdsByAttributeNameValues", - "getCustomerAttributesForCustomers", - "getTransactionIdsByAttributeNameValues", - "getTransactionAttributes", - "getBankAttributesByBank", - "getCustomerAttributeById", - "createDirectDebit", - "deleteCustomerAttribute", - "getPhysicalCardsForUser", - "getChallengesByBasketId", - "createChallengesC2", - "createChallengesC3", - "getChallenge", - "getChallengesByTransactionRequestId", - "getChallengesByConsentId", - "validateAndCheckIbanNumber", - "validateChallengeAnswerC2", - "validateChallengeAnswerC3", - "validateChallengeAnswerC4", - "validateChallengeAnswerC5", - "validateChallengeAnswerV2", - "getCounterpartyByIbanAndBankAccountId", - "getChargeValue", - "saveTransactionRequestTransaction", - "saveTransactionRequestChallenge", - "getTransactionRequestTypes", - "updateAccountLabel", - "getProduct", - "saveTransactionRequestStatusImpl", - "getTransactionRequestTypeCharges", - "getAccountsHeld", - "getAccountsHeldByUser", - ).distinct + val commonMethodNames = List( + "getAdapterInfo", + "getChallengeThreshold", + "getChargeLevel", + "getChargeLevelC2", + "createChallenge", + "getBank", + "getBanks", + "getBankAccountsForUser", + "getBankAccountsBalances", + "getBankAccountBalances", + "getCoreBankAccounts", + "getBankAccountsHeld", + "getCounterpartyTrait", + "getCounterpartyByCounterpartyId", + "getCounterpartyByIban", + "getCounterparties", + "getTransactions", + "getTransactionsCore", + "getTransaction", + "getPhysicalCardForBank", + "deletePhysicalCardForBank", + "getPhysicalCardsForBank", + "createPhysicalCard", + "updatePhysicalCard", + "makePaymentv210", + "makePaymentV400", + "cancelPaymentV400", + "createTransactionRequestv210", + "getTransactionRequests210", + "getTransactionRequestImpl", + "createTransactionAfterChallengeV210", + "updateBankAccount", + "createBankAccount", + "getBranch", + "getBranches", + "getAtm", + "getAtms", + "createTransactionAfterChallengev300", + "makePaymentv300", + "createTransactionRequestv300", + "createCounterparty", + "checkCustomerNumberAvailable", + "createCustomer", + "updateCustomerScaData", + "updateCustomerCreditData", + "updateCustomerGeneralData", + "getCustomersByUserId", + "getCustomerByCustomerId", + "getCustomerByCustomerNumber", + "getCustomerAddress", + "createCustomerAddress", + "updateCustomerAddress", + "deleteCustomerAddress", + "createTaxResidence", + "getTaxResidence", + "deleteTaxResidence", + "getCustomers", + "getCheckbookOrders", + "getStatusOfCreditCardOrder", + "createUserAuthContext", + "createUserAuthContextUpdate", + "deleteUserAuthContexts", + "deleteUserAuthContextById", + "getUserAuthContexts", + "createOrUpdateProductAttribute", + "getProduct", + "getProducts", + "getProductAttributeById", + "getProductAttributesByBankAndCode", + "deleteProductAttribute", + "getAccountAttributeById", + "createOrUpdateAccountAttribute", + "createAccountAttributes", + "getAccountAttributesByAccount", + "createOrUpdateCardAttribute", + "getCardAttributeById", + "getCardAttributesFromProvider", + "createAccountApplication", + "getAllAccountApplication", + "getAccountApplicationById", + "updateAccountApplicationStatus", + "getOrCreateProductCollection", + "getProductCollection", + "getOrCreateProductCollectionItem", + "getProductCollectionItem", + "getProductCollectionItemsTree", + "createMeeting", + "getMeetings", + "getMeeting", + "createOrUpdateKycCheck", + "createOrUpdateKycDocument", + "createOrUpdateKycMedia", + "createOrUpdateKycStatus", + "getKycChecks", + "getKycDocuments", + "getKycMedias", + "getKycStatuses", + "createMessage", + "makeHistoricalPayment", + "validateChallengeAnswer", + //"getBankLegacy", // should not generate for Legacy methods + //"getBanksLegacy", // should not generate for Legacy methods + //"getBankAccountsForUserLegacy", // should not generate for Legacy methods + //"getBankAccountLegacy", // should not generate for Legacy methods + "getBankAccountByIban", + "getBankAccountByRouting", + "getBankAccounts", + "checkBankAccountExists", + //"getCoreBankAccountsLegacy", // should not generate for Legacy methods + //"getBankAccountsHeldLegacy", // should not generate for Legacy methods + //"checkBankAccountExistsLegacy", // should not generate for Legacy methods + //"getCounterpartyByCounterpartyIdLegacy", // should not generate for Legacy methods + //"getCounterpartiesLegacy", // should not generate for Legacy methods + //"getTransactionsLegacy", // should not generate for Legacy methods + //"getTransactionLegacy", // should not generate for Legacy methods + //"createPhysicalCardLegacy", // should not generate for Legacy methods + //"getCustomerByCustomerIdLegacy", // should not generate for Legacy methods + + "createChallenges", + "createTransactionRequestv400", + "createTransactionRequestSepaCreditTransfersBGV1", + "createTransactionRequestPeriodicSepaCreditTransfersBGV1", + "getCustomersByCustomerPhoneNumber", + "getTransactionAttributeById", + "createOrUpdateCustomerAttribute", + "createOrUpdateTransactionAttribute", + "getCustomerAttributes", + "getCustomerIdsByAttributeNameValues", + "getCustomerAttributesForCustomers", + "getTransactionIdsByAttributeNameValues", + "getTransactionAttributes", + "getBankAttributesByBank", + "getCustomerAttributeById", + "createDirectDebit", + "deleteCustomerAttribute", + "getPhysicalCardsForUser", + "getChallengesByBasketId", + "createChallengesC2", + "createChallengesC3", + "getChallenge", + "getChallengesByTransactionRequestId", + "getChallengesByConsentId", + "validateAndCheckIbanNumber", + "validateChallengeAnswerC2", + "validateChallengeAnswerC3", + "validateChallengeAnswerC4", + "validateChallengeAnswerC5", + "validateChallengeAnswerV2", + "getCounterpartyByIbanAndBankAccountId", + "getChargeValue", + "saveTransactionRequestTransaction", + "saveTransactionRequestChallenge", + "getTransactionRequestTypes", + "updateAccountLabel", + "getProduct", + "saveTransactionRequestStatusImpl", + "getTransactionRequestTypeCharges", + "getAccountsHeld", + "getAccountsHeldByUser", + ).distinct /** * these connector methods have special parameter or return type @@ -454,20 +454,51 @@ object ConnectorBuilderUtil { ).distinct val omitMethods = List( - // "createOrUpdateAttributeDefinition", // should not be auto generated - // "deleteAttributeDefinition", // should not be auto generated - // "getAttributeDefinition", // should not be auto generated - // "createStandingOrder", // should not be auto generated - + "createOrUpdateAttributeDefinition", // should not be auto generated + "deleteAttributeDefinition", // should not be auto generated + "getAttributeDefinition", // should not be auto generated + "createStandingOrder", // should not be auto generated //** the follow 5 methods should not be generated, should create manually - // "dynamicEntityProcess", - // "dynamicEndpointProcess", - // "createDynamicEndpoint", - // "getDynamicEndpoint", - // "getDynamicEndpoints", - - // "checkExternalUserCredentials",// this is not a standard connector method. - // "checkExternalUserExists", // this is not a standard connector method. + "dynamicEntityProcess", + "dynamicEndpointProcess", + "createDynamicEndpoint", + "getDynamicEndpoint", + "getDynamicEndpoints", + "checkExternalUserCredentials",// this is not a standard connector method. + "checkExternalUserExists", // this is not a standard connector method. + "getBankAccountByRoutingLegacy", + "getAccountRoutingsByScheme", + "getAccountRouting", + "getBankAccountsWithAttributes", + "getBankSettlementAccounts", + "getCountOfTransactionsFromAccountToCounterparty", + "getStatus", + "createOrUpdateBank", + "createOrUpdateProduct", + "getAllAtms", + "getCurrentCurrencies", + "getAgents", + "getCustomersAtAllBanks", + "createOrUpdateBankAttribute", + "getBankAttribute", + "createOrUpdateAtmAttribute", + "getAtmAttribute", + "getBankAttributeById", + "getAtmAttributeById", + "getUserAttributes", + "getPersonalUserAttributes", + "getNonPersonalUserAttributes", + "getUserAttributesByUsers", + "createOrUpdateUserAttribute", + "getUserAttribute", + "getUserAttributeById", + "deleteUserAttribute", + "getTransactionRequestIdsByAttributeNameValues", + "sendCustomerNotification", + "equals", + "getAtmAttributesByAtm", + "==", + "!=", ).distinct } diff --git a/obp-api/src/main/scala/code/bankconnectors/rabbitmq/RabbitMQConnectorBuilder.scala b/obp-api/src/main/scala/code/bankconnectors/rabbitmq/RabbitMQConnectorBuilder.scala index dbea58c50..52fd28932 100644 --- a/obp-api/src/main/scala/code/bankconnectors/rabbitmq/RabbitMQConnectorBuilder.scala +++ b/obp-api/src/main/scala/code/bankconnectors/rabbitmq/RabbitMQConnectorBuilder.scala @@ -7,7 +7,7 @@ import scala.language.postfixOps object RabbitMQConnectorBuilder extends App { - buildMethods(commonMethodNames, + buildMethods(commonMethodNames.diff(omitMethods), "src/main/scala/code/bankconnectors/rabbitmq/RabbitMQConnector_vOct2024.scala", methodName => s"""sendRequest[InBound]("obp_${StringHelpers.snakify(methodName)}", req, callContext)""") } From c76d587b86521181de896a39cba37cf2a4e16641 Mon Sep 17 00:00:00 2001 From: hongwei Date: Wed, 22 Jan 2025 16:49:31 +0800 Subject: [PATCH 08/17] feature/added confirm-vrp-consent pages - WIP --- .../main/scala/bootstrap/liftweb/Boot.scala | 4 +- .../code/snippet/VrpConsentCreation.scala | 157 ++++++++++++++++++ obp-api/src/main/scala/code/util/Helper.scala | 10 +- .../webapp/confirm-vrp-consent-request.html | 55 ++++++ .../src/main/webapp/confirm-vrp-consent.html | 52 ++++++ obp-api/src/main/webapp/media/css/website.css | 4 + 6 files changed, 278 insertions(+), 4 deletions(-) create mode 100644 obp-api/src/main/scala/code/snippet/VrpConsentCreation.scala create mode 100644 obp-api/src/main/webapp/confirm-vrp-consent-request.html create mode 100644 obp-api/src/main/webapp/confirm-vrp-consent.html diff --git a/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala b/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala index 075c5ef62..88aa9229b 100644 --- a/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala +++ b/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala @@ -593,7 +593,9 @@ class Boot extends MdcLoggable { OAuthWorkedThanks.menu, //OAuth thanks page that will do the redirect Menu.i("Introduction") / "introduction", Menu.i("add-user-auth-context-update-request") / "add-user-auth-context-update-request", - Menu.i("confirm-user-auth-context-update-request") / "confirm-user-auth-context-update-request" + Menu.i("confirm-user-auth-context-update-request") / "confirm-user-auth-context-update-request", + Menu.i("confirm-vrp-consent-request") / "confirm-vrp-consent-request" >> AuthUser.loginFirst,//OAuth consent page, + Menu.i("confirm-vrp-consent") / "confirm-vrp-consent" >> AuthUser.loginFirst //OAuth consent page ) ++ accountCreation ++ Admin.menus // Build SiteMap diff --git a/obp-api/src/main/scala/code/snippet/VrpConsentCreation.scala b/obp-api/src/main/scala/code/snippet/VrpConsentCreation.scala new file mode 100644 index 000000000..b93c22a7f --- /dev/null +++ b/obp-api/src/main/scala/code/snippet/VrpConsentCreation.scala @@ -0,0 +1,157 @@ +/** +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 . + +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.snippet + +import code.api.util.APIUtil._ +import code.api.util.ErrorMessages.InvalidJsonFormat +import code.api.util.CustomJsonFormats +import code.api.v5_0_0.{APIMethods500, ConsentRequestResponseJson} +import code.api.v3_1_0.{APIMethods310, ConsentChallengeJsonV310} +import code.consent.ConsentStatus +import code.util.Helper.{MdcLoggable, ObpS} +import net.liftweb.common.Full +import net.liftweb.http.rest.RestHelper +import net.liftweb.http.{GetRequest, PostRequest, RequestVar, S, SHtml} +import net.liftweb.json +import net.liftweb.json.Formats +import net.liftweb.util.Helpers._ + +class VrpConsentCreation extends MdcLoggable with RestHelper with APIMethods500 with APIMethods310 { + protected implicit override def formats: Formats = CustomJsonFormats.formats + + private object otpValue extends RequestVar("123456") + + def confirmVrpConsentRequest = { + getConsentRequest match { + case Left(error) => { + "#confirm-vrp-consent-request-form-title *" #> s"Please enter your consent request info:" & + "#confirm-vrp-consent-request-response-json *" #> s"""$error""" & + "type=submit" #> "" + } + case Right(response) => { + tryo {json.parse(response).extract[ConsentRequestResponseJson]} match { + case Full(consentRequestResponseJson) => + "#confirm-vrp-consent-request-form-title *" #> s"Please enter your consent request info:" & + "#confirm-vrp-consent-request-response-json *" #> s"""${json.prettyRender(json.Extraction.decompose(consentRequestResponseJson.payload))}""" & + "#confirm-vrp-consent-request-confirm-submit-button" #> SHtml.onSubmitUnit(confirmConsentRequestProcess)& + "#confirm-vrp-consent-request-deny-submit-button" #> SHtml.onSubmitUnit(denyConsentRequestProcess) + case _ => + "#confirm-vrp-consent-request-form-title *" #> s"Please enter your consent request info:" & + "#confirm-vrp-consent-request-response-json *" #> + s"""$InvalidJsonFormat The Json body should be the $ConsentRequestResponseJson. + |Please check `Get Consent Request` endpoint separately! """.stripMargin & + "type=submit" #> "" + } + } + } + + } + + def confirmVrpConsent = { + "#otp-value" #> SHtml.textElem(otpValue) & + "type=submit" #> SHtml.onSubmitUnit(confirmVrpConsentProcess) + } + + private def confirmConsentRequestProcess() ={ + //1st: we need to call `Create Consent By CONSENT_REQUEST_ID (IMPLICIT)`, this will send OTP to account owner. + + //2nd: we need to redirect to confirm page to fill the OTP + + S.redirectTo( + s"/confirm-vrp-consent" + ) + } + private def denyConsentRequestProcess() ={ + S.redirectTo( + s"/" // if click deny, we just redirect to Home page. + ) + } + + private def callAnswerConsentChallenge: Either[(String, Int), String] = { + + val requestParam = List( + ObpS.param("BANK_ID"), + ObpS.param("CONSENT_ID") + ) + + if(requestParam.count(_.isDefined) < requestParam.size) { + return Left(("There are one or many mandatory request parameter not present, please check request parameter: BANK_ID, CONSENT_ID", 500)) + } + + val pathOfEndpoint = List( + "banks", + ObpS.param("BANK_ID")openOr(""), + "consents", + ObpS.param("CONSENT_ID")openOr(""), + "challenge" + ) + + val requestBody = s"""{"answer":"${otpValue.get}"}""" + val authorisationsResult = callEndpoint(Implementations3_1_0.answerConsentChallenge, pathOfEndpoint, PostRequest, requestBody) + + authorisationsResult + + } + + private def confirmVrpConsentProcess() ={ + callAnswerConsentChallenge match { + case Left(error) => S.error("otp-value-error",error._1) + case Right(response) => { + tryo {json.parse(response).extract[ConsentChallengeJsonV310]} match { + case Full(consentChallengeJsonV310) if (consentChallengeJsonV310.status.equals(ConsentStatus.ACCEPTED.toString)) => + S.redirectTo("/") + case Full(consentChallengeJsonV310) => + S.error("otp-value-error",s"Current SCA status is ${consentChallengeJsonV310.status}. Please double check OTP value.") + case _ => S.error("otp-value-error",s"$InvalidJsonFormat The Json body should be the $ConsentChallengeJsonV310. " + + s"Please check `Create User Auth Context Update Request` endpoint separately! ") + } + } + } + } + + private def getConsentRequest: Either[(String, Int), String] = { + + val requestParam = List( + ObpS.param("CONSENT_REQUEST_ID"), + ) + + if(requestParam.count(_.isDefined) < requestParam.size) { + return Left(("Parameter CONSENT_REQUEST_ID is missing, please set it in the URL", 500)) + } + + val pathOfEndpoint = List( + "consumer", + "consent-requests", + ObpS.param("CONSENT_REQUEST_ID")openOr("") + ) + + val authorisationsResult = callEndpoint(Implementations5_0_0.getConsentRequest, pathOfEndpoint, GetRequest) + + authorisationsResult + } + +} diff --git a/obp-api/src/main/scala/code/util/Helper.scala b/obp-api/src/main/scala/code/util/Helper.scala index 084d68729..74e44e83e 100644 --- a/obp-api/src/main/scala/code/util/Helper.scala +++ b/obp-api/src/main/scala/code/util/Helper.scala @@ -212,18 +212,22 @@ object Helper extends Loggable { */ def isValidInternalRedirectUrl(url: String) : Boolean = { //set the default value is "/" and "/oauth/authorize" - val validUrls = List( + val internalRedirectUrlsWhiteList = List( "/","/oauth/authorize","/consumer-registration", "/dummy-user-tokens","/create-sandbox-account", "/add-user-auth-context-update-request","/otp", - "/terms-and-conditions", "/privacy-policy" + "/terms-and-conditions", "/privacy-policy", + "/confirm-vrp-consent-request", + "/confirm-vrp-consent", + "/consent-screen", + "/consent", ) //case1: OBP-API login: url = "/" //case2: API-Explore oauth login: url = "/oauth/authorize?oauth_token=V0JTCDYXWUNTXDZ3VUDNM1HE3Q1PZR2WJ4PURXQA&logUserOut=false" val extractCleanURL = StringUtils.substringBefore(url, "?") - validUrls.contains(extractCleanURL) + internalRedirectUrlsWhiteList.contains(extractCleanURL) } /** diff --git a/obp-api/src/main/webapp/confirm-vrp-consent-request.html b/obp-api/src/main/webapp/confirm-vrp-consent-request.html new file mode 100644 index 000000000..b0758ca55 --- /dev/null +++ b/obp-api/src/main/webapp/confirm-vrp-consent-request.html @@ -0,0 +1,55 @@ + + +
+ + +
+ diff --git a/obp-api/src/main/webapp/confirm-vrp-consent.html b/obp-api/src/main/webapp/confirm-vrp-consent.html new file mode 100644 index 000000000..4d091950e --- /dev/null +++ b/obp-api/src/main/webapp/confirm-vrp-consent.html @@ -0,0 +1,52 @@ + + +
+
+ +
+
+ diff --git a/obp-api/src/main/webapp/media/css/website.css b/obp-api/src/main/webapp/media/css/website.css index a047207c4..b8742d527 100644 --- a/obp-api/src/main/webapp/media/css/website.css +++ b/obp-api/src/main/webapp/media/css/website.css @@ -437,4 +437,8 @@ input{ color: #333333; line-height: 24px; margin-bottom: 15px; +} + +#confirm-vrp-consent-request-deny-submit-button { + background: red; } \ No newline at end of file From 990e5a247e87f9601b75f7d706af425286c0f3c4 Mon Sep 17 00:00:00 2001 From: hongwei Date: Thu, 23 Jan 2025 16:38:47 +0800 Subject: [PATCH 09/17] feature/added confirm-vrp-consent pages - step2 WIP --- .../code/snippet/VrpConsentCreation.scala | 80 +++++++++++++------ .../webapp/confirm-vrp-consent-request.html | 7 +- .../src/main/webapp/confirm-vrp-consent.html | 3 - 3 files changed, 57 insertions(+), 33 deletions(-) diff --git a/obp-api/src/main/scala/code/snippet/VrpConsentCreation.scala b/obp-api/src/main/scala/code/snippet/VrpConsentCreation.scala index b93c22a7f..9169d0256 100644 --- a/obp-api/src/main/scala/code/snippet/VrpConsentCreation.scala +++ b/obp-api/src/main/scala/code/snippet/VrpConsentCreation.scala @@ -28,10 +28,11 @@ package code.snippet import code.api.util.APIUtil._ import code.api.util.ErrorMessages.InvalidJsonFormat -import code.api.util.CustomJsonFormats -import code.api.v5_0_0.{APIMethods500, ConsentRequestResponseJson} +import code.api.util.{APIUtil, CustomJsonFormats} +import code.api.v5_0_0.{APIMethods500, ConsentJsonV500, ConsentRequestResponseJson} import code.api.v3_1_0.{APIMethods310, ConsentChallengeJsonV310} -import code.consent.ConsentStatus +import code.consent.{ConsentStatus, Consents} +import code.consumer.Consumers import code.util.Helper.{MdcLoggable, ObpS} import net.liftweb.common.Full import net.liftweb.http.rest.RestHelper @@ -48,8 +49,9 @@ class VrpConsentCreation extends MdcLoggable with RestHelper with APIMethods500 def confirmVrpConsentRequest = { getConsentRequest match { case Left(error) => { + S.error(error._1) "#confirm-vrp-consent-request-form-title *" #> s"Please enter your consent request info:" & - "#confirm-vrp-consent-request-response-json *" #> s"""$error""" & + "#confirm-vrp-consent-request-response-json *" #> s"""""" & "type=submit" #> "" } case Right(response) => { @@ -57,8 +59,7 @@ class VrpConsentCreation extends MdcLoggable with RestHelper with APIMethods500 case Full(consentRequestResponseJson) => "#confirm-vrp-consent-request-form-title *" #> s"Please enter your consent request info:" & "#confirm-vrp-consent-request-response-json *" #> s"""${json.prettyRender(json.Extraction.decompose(consentRequestResponseJson.payload))}""" & - "#confirm-vrp-consent-request-confirm-submit-button" #> SHtml.onSubmitUnit(confirmConsentRequestProcess)& - "#confirm-vrp-consent-request-deny-submit-button" #> SHtml.onSubmitUnit(denyConsentRequestProcess) + "#confirm-vrp-consent-request-confirm-submit-button" #> SHtml.onSubmitUnit(confirmConsentRequestProcess) case _ => "#confirm-vrp-consent-request-form-title *" #> s"Please enter your consent request info:" & "#confirm-vrp-consent-request-response-json *" #> @@ -78,33 +79,38 @@ class VrpConsentCreation extends MdcLoggable with RestHelper with APIMethods500 private def confirmConsentRequestProcess() ={ //1st: we need to call `Create Consent By CONSENT_REQUEST_ID (IMPLICIT)`, this will send OTP to account owner. - - //2nd: we need to redirect to confirm page to fill the OTP - - S.redirectTo( - s"/confirm-vrp-consent" - ) - } - private def denyConsentRequestProcess() ={ - S.redirectTo( - s"/" // if click deny, we just redirect to Home page. - ) + callCreateConsentByConsentRequestIdImplicit match { + case Left(error) => { + S.error(error._1) + } + case Right(response) => { + tryo {json.parse(response).extract[ConsentJsonV500]} match { + case Full(consentJsonV500) => + //2nd: we need to redirect to confirm page to fill the OTP + S.redirectTo( + s"/confirm-vrp-consent?CONSENT_ID=${consentJsonV500.consent_id}" + ) + case _ => + S.error(s"$InvalidJsonFormat The Json body should be the $ConsentJsonV500. " + + s"Please check `Create Consent By CONSENT_REQUEST_ID (IMPLICIT) !") + } + } + } } private def callAnswerConsentChallenge: Either[(String, Int), String] = { val requestParam = List( - ObpS.param("BANK_ID"), ObpS.param("CONSENT_ID") ) if(requestParam.count(_.isDefined) < requestParam.size) { - return Left(("There are one or many mandatory request parameter not present, please check request parameter: BANK_ID, CONSENT_ID", 500)) + return Left(("There are one or many mandatory request parameter not present, please check request parameter: CONSENT_ID", 500)) } val pathOfEndpoint = List( "banks", - ObpS.param("BANK_ID")openOr(""), + APIUtil.defaultBankId,//we do not need to get this from URL, it will be easier for the developer. "consents", ObpS.param("CONSENT_ID")openOr(""), "challenge" @@ -117,16 +123,42 @@ class VrpConsentCreation extends MdcLoggable with RestHelper with APIMethods500 } + private def callCreateConsentByConsentRequestIdImplicit: Either[(String, Int), String] = { + + val requestParam = List( + ObpS.param("CONSENT_REQUEST_ID"), + ) + if(requestParam.count(_.isDefined) < requestParam.size) { + return Left(("Parameter CONSENT_REQUEST_ID is missing, please set it in the URL", 500)) + } + + val pathOfEndpoint = List( + "consumer", + "consent-requests", + ObpS.param("CONSENT_REQUEST_ID")openOr(""), + "IMPLICIT", + "consents", + ) + + val requestBody = s"""{}""" + val authorisationsResult = callEndpoint(Implementations5_0_0.createConsentByConsentRequestIdImplicit, pathOfEndpoint, PostRequest, requestBody) + + authorisationsResult + } + private def confirmVrpConsentProcess() ={ callAnswerConsentChallenge match { - case Left(error) => S.error("otp-value-error",error._1) + case Left(error) => S.error(error._1) case Right(response) => { tryo {json.parse(response).extract[ConsentChallengeJsonV310]} match { case Full(consentChallengeJsonV310) if (consentChallengeJsonV310.status.equals(ConsentStatus.ACCEPTED.toString)) => - S.redirectTo("/") + val consentId = Consents.consentProvider.vend.getConsentByConsentId(consentChallengeJsonV310.consent_id).map(_.consumerId) + val consumer = consentId.map(Consumers.consumers.vend.getConsumerByConsumerId(_)).flatten + val redirectURL = consumer.map(_.redirectURL.get).getOrElse("") + S.redirectTo(redirectURL) case Full(consentChallengeJsonV310) => - S.error("otp-value-error",s"Current SCA status is ${consentChallengeJsonV310.status}. Please double check OTP value.") - case _ => S.error("otp-value-error",s"$InvalidJsonFormat The Json body should be the $ConsentChallengeJsonV310. " + + S.error(s"Current SCA status is ${consentChallengeJsonV310.status}. Please double check OTP value.") + case _ => S.error(s"$InvalidJsonFormat The Json body should be the $ConsentChallengeJsonV310. " + s"Please check `Create User Auth Context Update Request` endpoint separately! ") } } diff --git a/obp-api/src/main/webapp/confirm-vrp-consent-request.html b/obp-api/src/main/webapp/confirm-vrp-consent-request.html index b0758ca55..f552251e8 100644 --- a/obp-api/src/main/webapp/confirm-vrp-consent-request.html +++ b/obp-api/src/main/webapp/confirm-vrp-consent-request.html @@ -32,9 +32,6 @@ Berlin 13359, Germany
-
- error -