diff --git a/obp-api/src/main/resources/props/sample.props.template b/obp-api/src/main/resources/props/sample.props.template index 5b1810460d..2e8d973669 100644 --- a/obp-api/src/main/resources/props/sample.props.template +++ b/obp-api/src/main/resources/props/sample.props.template @@ -936,7 +936,8 @@ database_messages_scheduler_interval=3600 ReadTransactionsBasic,\ ReadTransactionsDebits,\ ReadTransactionsDetail, \ - ReadAccountsBerlinGroup + ReadAccountsBerlinGroup, \ + InitiatePaymentsBerlinGroup # ----------------------------------------------------------------------------- diff --git a/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala b/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala index e48dd04710..0cb8ca002a 100644 --- a/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala +++ b/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala @@ -286,19 +286,22 @@ class Boot extends MdcLoggable { APIUtil.getPropsValue("additional_system_views") match { case Full(value) => - val viewSetUKOpenBanking = value.split(",").map(_.trim).toList - val viewsUKOpenBanking = List( - SYSTEM_READ_ACCOUNTS_BASIC_VIEW_ID, SYSTEM_READ_ACCOUNTS_DETAIL_VIEW_ID, - SYSTEM_READ_BALANCES_VIEW_ID, SYSTEM_READ_TRANSACTIONS_BASIC_VIEW_ID, - SYSTEM_READ_TRANSACTIONS_DEBITS_VIEW_ID, SYSTEM_READ_TRANSACTIONS_DETAIL_VIEW_ID, + val additionalSystemViewsFromProps = value.split(",").map(_.trim).toList + val additionalSystemViews = List( + SYSTEM_READ_ACCOUNTS_BASIC_VIEW_ID, + SYSTEM_READ_ACCOUNTS_DETAIL_VIEW_ID, + SYSTEM_READ_BALANCES_VIEW_ID, + SYSTEM_READ_TRANSACTIONS_BASIC_VIEW_ID, + SYSTEM_READ_TRANSACTIONS_DEBITS_VIEW_ID, + SYSTEM_READ_TRANSACTIONS_DETAIL_VIEW_ID, SYSTEM_READ_ACCOUNTS_BERLIN_GROUP_VIEW_ID, SYSTEM_READ_BALANCES_BERLIN_GROUP_VIEW_ID, SYSTEM_READ_TRANSACTIONS_BERLIN_GROUP_VIEW_ID, SYSTEM_INITIATE_PAYMENTS_BERLIN_GROUP_VIEW_ID ) for { - systemView <- viewSetUKOpenBanking - if viewsUKOpenBanking.exists(_ == systemView) + systemView <- additionalSystemViewsFromProps + if additionalSystemViews.exists(_ == systemView) } { Views.views.vend.getOrCreateSystemView(systemView) } diff --git a/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerDefinitionsJSON.scala b/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerDefinitionsJSON.scala index d4fc1a8dbd..fa11b74262 100644 --- a/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerDefinitionsJSON.scala +++ b/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerDefinitionsJSON.scala @@ -26,7 +26,8 @@ import code.connectormethod.{JsonConnectorMethod, JsonConnectorMethodMethodBody} import code.dynamicMessageDoc.JsonDynamicMessageDoc import code.dynamicResourceDoc.JsonDynamicResourceDoc import code.sandbox.SandboxData -import code.transactionrequests.TransactionRequests.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.PaymentServiceTypes._ import com.github.dwickern.macros.NameOf.nameOf import com.openbankproject.commons.model import com.openbankproject.commons.model.PinResetReason.{FORGOT, GOOD_SECURITY_PRACTICE} @@ -620,31 +621,6 @@ object SwaggerDefinitionsJSON { description = descriptionExample.value ) - val transactionRequest = TransactionRequest( - id= transactionRequestIdSwagger, - `type`= "String", - from= transactionRequestAccount, - body= transactionRequestBodyAllTypes, - transaction_ids= "String", - status= "String", - start_date= DateWithDayExampleObject, - end_date= DateWithDayExampleObject, - challenge= transactionRequestChallenge, - charge= transactionRequestCharge, - charge_policy= "String", - counterparty_id= counterpartyIdSwagger, - name= "String", - this_bank_id= bankIdSwagger, - this_account_id= accountIdSwagger, - this_view_id= viewIdSwagger, - other_account_routing_scheme= counterpartyOtherAccountRoutingSchemeExample.value, - other_account_routing_address= counterpartyOtherAccountRoutingAddressExample.value, - other_bank_routing_scheme= counterpartyOtherBankRoutingSchemeExample.value, - other_bank_routing_address= counterpartyOtherBankRoutingAddressExample.value, - is_beneficiary= true, - future_date = Some(futureDateExample.value) - ) - val adapterImplementationJson = AdapterImplementationJson("CORE",3) val messageDocJson = MessageDocJson( diff --git a/obp-api/src/main/scala/code/api/berlin/group/v1_3/JSONFactory_BERLIN_GROUP_1_3.scala b/obp-api/src/main/scala/code/api/berlin/group/v1_3/JSONFactory_BERLIN_GROUP_1_3.scala index c26cbe6291..7e9c3240dc 100644 --- a/obp-api/src/main/scala/code/api/berlin/group/v1_3/JSONFactory_BERLIN_GROUP_1_3.scala +++ b/obp-api/src/main/scala/code/api/berlin/group/v1_3/JSONFactory_BERLIN_GROUP_1_3.scala @@ -546,7 +546,7 @@ object JSONFactory_BERLIN_GROUP_1_3 extends CustomJsonFormats { ) } - def createTransactionRequestJson(transactionRequest : TransactionRequest) : InitiatePaymentResponseJson = { + def createTransactionRequestJson(transactionRequest : TransactionRequestBGV1) : InitiatePaymentResponseJson = { // - 'ACCC': 'AcceptedSettlementCompleted' - // Settlement on the creditor's account has been completed. // - 'ACCP': 'AcceptedCustomerProfile' - diff --git a/obp-api/src/main/scala/code/api/berlin/group/v1_3/PaymentInitiationServicePISApi.scala b/obp-api/src/main/scala/code/api/berlin/group/v1_3/PaymentInitiationServicePISApi.scala index 9ce81f9e6f..3b196b7d49 100644 --- a/obp-api/src/main/scala/code/api/berlin/group/v1_3/PaymentInitiationServicePISApi.scala +++ b/obp-api/src/main/scala/code/api/berlin/group/v1_3/PaymentInitiationServicePISApi.scala @@ -12,8 +12,6 @@ import code.api.berlin.group.v1_3.model._ import code.bankconnectors.Connector import code.fx.fx import code.api.Constant._ -import code.transactionrequests.TransactionRequests.TransactionRequestTypes.SEPA_CREDIT_TRANSFERS -import code.transactionrequests.TransactionRequests.{PaymentServiceTypes, TransactionRequestTypes} import code.util.Helper import code.views.Views import com.github.dwickern.macros.NameOf.nameOf @@ -21,7 +19,9 @@ import com.openbankproject.commons.ExecutionContext.Implicits.global import com.openbankproject.commons.model._ import com.openbankproject.commons.model.enums.ChallengeType.BERLIN_GROUP_PAYMENT_CHALLENGE import com.openbankproject.commons.model.enums.TransactionRequestStatus._ -import com.openbankproject.commons.model.enums.{ChallengeType, StrongCustomerAuthenticationStatus, SuppliedAnswerType, TransactionRequestStatus} +import com.openbankproject.commons.model.enums.{ChallengeType, StrongCustomerAuthenticationStatus, SuppliedAnswerType, TransactionRequestStatus,TransactionRequestTypes,PaymentServiceTypes} +import com.openbankproject.commons.model.enums.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.PaymentServiceTypes._ import com.openbankproject.commons.util.ApiVersion import net.liftweb import net.liftweb.common.Box.tryo @@ -42,7 +42,7 @@ object APIMethods_PaymentInitiationServicePISApi extends RestHelper { val apiRelations = ArrayBuffer[ApiRelation]() protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) - def checkPaymentServerError(paymentService: String) = { + def checkPaymentServerTypeError(paymentService: String) = { val ccc = "" s"${InvalidTransactionRequestType.replaceAll("TRANSACTION_REQUEST_TYPE", "PAYMENT_SERVICE in the URL.")}: '${paymentService}'.It should be `payments` or `periodic-payments` for now, will support `bulk-payments` soon" } @@ -116,7 +116,7 @@ or * access method is generally applicable, but further authorisation processes for { (Full(u), callContext) <- authenticatedAccess(cc) _ <- passesPsd2Pisp(callContext) - _ <- NewStyle.function.tryons(checkPaymentServerError(paymentService),400, callContext) { + _ <- NewStyle.function.tryons(checkPaymentServerTypeError(paymentService),400, callContext) { PaymentServiceTypes.withName(paymentService.replaceAll("-","_")) } transactionRequestTypes <- NewStyle.function.tryons(checkPaymentProductError(paymentProduct),400, callContext) { @@ -192,7 +192,7 @@ This method returns the SCA status of a payment initiation's authorisation sub-r for { (_, callContext) <- authenticatedAccess(cc) _ <- passesPsd2Pisp(callContext) - _ <- NewStyle.function.tryons(checkPaymentServerError(paymentService),400, callContext) { + _ <- NewStyle.function.tryons(checkPaymentServerTypeError(paymentService),400, callContext) { PaymentServiceTypes.withName(paymentService.replaceAll("-","_")) } _ <- NewStyle.function.tryons(checkPaymentProductError(paymentProduct),400, callContext) { @@ -239,7 +239,7 @@ Returns the content of a payment object""", for { (Full(u), callContext) <- authenticatedAccess(cc) _ <- passesPsd2Pisp(callContext) - _ <- NewStyle.function.tryons(checkPaymentServerError(paymentService),400, callContext) { + _ <- NewStyle.function.tryons(checkPaymentServerTypeError(paymentService),400, callContext) { PaymentServiceTypes.withName(paymentService.replaceAll("-","_")) } transactionRequestTypes <- NewStyle.function.tryons(checkPaymentProductError(paymentProduct),400, callContext) { @@ -298,7 +298,7 @@ This function returns an array of hyperlinks to all generated authorisation sub- for { (_, callContext) <- authenticatedAccess(cc) _ <- passesPsd2Pisp(callContext) - _ <- NewStyle.function.tryons(checkPaymentServerError(paymentService),400, callContext) { + _ <- NewStyle.function.tryons(checkPaymentServerTypeError(paymentService),400, callContext) { PaymentServiceTypes.withName(paymentService.replaceAll("-","_")) } _ <- NewStyle.function.tryons(checkPaymentProductError(paymentProduct),400, callContext) { @@ -336,7 +336,7 @@ Retrieve a list of all created cancellation authorisation sub-resources. for { (_, callContext) <- authenticatedAccess(cc) _ <- passesPsd2Pisp(callContext) - _ <- NewStyle.function.tryons(checkPaymentServerError(paymentService),400, callContext) { + _ <- NewStyle.function.tryons(checkPaymentServerTypeError(paymentService),400, callContext) { PaymentServiceTypes.withName(paymentService.replaceAll("-","_")) } _ <- NewStyle.function.tryons(checkPaymentProductError(paymentProduct),400, callContext) { @@ -373,7 +373,7 @@ This method returns the SCA status of a payment initiation's authorisation sub-r for { (Full(u), callContext) <- authenticatedAccess(cc) _ <- passesPsd2Pisp(callContext) - _ <- NewStyle.function.tryons(checkPaymentServerError(paymentService),400, callContext) { + _ <- NewStyle.function.tryons(checkPaymentServerTypeError(paymentService),400, callContext) { PaymentServiceTypes.withName(paymentService.replaceAll("-","_")) } _ <- NewStyle.function.tryons(checkPaymentProductError(paymentProduct),400, callContext) { @@ -412,7 +412,7 @@ Check the transaction status of a payment initiation.""", for { (Full(u), callContext) <- authenticatedAccess(cc) _ <- passesPsd2Pisp(callContext) - _ <- NewStyle.function.tryons(checkPaymentServerError(paymentService),400, callContext) { + _ <- NewStyle.function.tryons(checkPaymentServerTypeError(paymentService),400, callContext) { PaymentServiceTypes.withName(paymentService.replaceAll("-","_")) } transactionRequestTypes <- NewStyle.function.tryons(checkPaymentProductError(paymentProduct),400, callContext) { @@ -474,8 +474,8 @@ Check the transaction status of a payment initiation.""", """.stripMargin - private val generalPaymentSummary = - s"""${mockedDataText(false)} + def generalPaymentSummary (isMockedData :Boolean) = + s"""${mockedDataText(isMockedData)} This method is used to initiate a payment at the ASPSP. ## Variants of Payment Initiation Requests @@ -528,35 +528,28 @@ Check the transaction status of a payment initiation.""", for { (Full(u), callContext) <- authenticatedAccess(cc) _ <- passesPsd2Pisp(callContext) - - _ <- NewStyle.function.tryons(checkPaymentServerError(paymentService), 400, callContext) { + + paymentServiceType <- NewStyle.function.tryons(checkPaymentServerTypeError(paymentService), 400, callContext) { PaymentServiceTypes.withName(paymentService.replaceAll("-", "_")) } - _ <- Helper.booleanToFuture(failMsg= checkPaymentServerError(paymentService), cc=callContext) { - PaymentServiceTypes.withName(paymentService.replaceAll("-", "_")).equals(PaymentServiceTypes.payments) || - PaymentServiceTypes.withName(paymentService.replaceAll("-", "_")).equals(PaymentServiceTypes.periodic_payments) - } - - transactionRequestTypes <- NewStyle.function.tryons(checkPaymentProductError(paymentProduct), 400, callContext) { + + //Berlin Group PaymentProduct is OBP transaction request type + transacitonRequestType <- NewStyle.function.tryons(checkPaymentProductError(paymentProduct), 400, callContext) { TransactionRequestTypes.withName(paymentProduct.replaceAll("-", "_").toUpperCase) } - sepaCreditTransfersBerlinGroupV13 <- if(PaymentServiceTypes.withName(paymentService.replaceAll("-", "_")).equals(PaymentServiceTypes.payments)){ + sepaCreditTransfersBerlinGroupV13 <- if(paymentServiceType.equals(PaymentServiceTypes.payments)){ NewStyle.function.tryons(s"$InvalidJsonFormat The Json body should be the $SepaCreditTransfersBerlinGroupV13 ", 400, callContext) { json.extract[SepaCreditTransfersBerlinGroupV13] } - } else{ + } else if(paymentServiceType.equals(PaymentServiceTypes.periodic_payments)){ NewStyle.function.tryons(s"$InvalidJsonFormat The Json body should be the $PeriodicSepaCreditTransfersBerlinGroupV13 ", 400, callContext) { json.extract[PeriodicSepaCreditTransfersBerlinGroupV13] } + }else{ + Future{throw new RuntimeException(checkPaymentServerTypeError(paymentServiceType.toString))} } - //If it is periodic_payments, we need to make sure, we have more fileds. - - transDetailsSerialized <- NewStyle.function.tryons(s"$UnknownError Can not serialize in request Json ", 400, callContext) { - write(sepaCreditTransfersBerlinGroupV13)(Serialization.formats(NoTypeHints)) - } - - isValidAmountNumber <- NewStyle.function.tryons(s"$InvalidNumber Current input is ${sepaCreditTransfersBerlinGroupV13.instructedAmount.amount} ", 400, callContext) { + isValidAmountNumber <- NewStyle.function.tryons(s"$InvalidNumber Current input is ${sepaCreditTransfersBerlinGroupV13.instructedAmount.amount} ", 400, callContext) { BigDecimal(sepaCreditTransfersBerlinGroupV13.instructedAmount.amount) } @@ -570,51 +563,18 @@ Check the transaction status of a payment initiation.""", } _ <- NewStyle.function.isEnabledTransactionRequests(callContext) - fromAccountIban = sepaCreditTransfersBerlinGroupV13.debtorAccount.iban - toAccountIban = sepaCreditTransfersBerlinGroupV13.creditorAccount.iban - (fromAccount, callContext) <- NewStyle.function.getBankAccountByIban(fromAccountIban, callContext) - (ibanChecker, callContext) <- NewStyle.function.validateAndCheckIbanNumber(toAccountIban, callContext) - _ <- Helper.booleanToFuture(invalidIban, cc = callContext) { - ibanChecker.isValid == true - } - (toAccount, callContext) <- NewStyle.function.getToBankAccountByIban(toAccountIban, callContext) - viewId = ViewId(SYSTEM_INITIATE_PAYMENTS_BERLIN_GROUP_VIEW_ID) - bankIdAccountId = BankIdAccountId(fromAccount.bankId, fromAccount.accountId) - view <- NewStyle.function.checkAccountAccessAndGetView(viewId, bankIdAccountId, Full(u), callContext) - _ <- Helper.booleanToFuture(InsufficientAuthorisationToCreateTransactionRequest, cc = callContext) { - view.canAddTransactionRequestToAnyAccount - } - // Prevent default value for transaction request type (at least). - _ <- Helper.booleanToFuture(s"From Account Currency is ${fromAccount.currency}, but Requested Transaction Currency is: ${sepaCreditTransfersBerlinGroupV13.instructedAmount.currency}", cc = callContext) { - sepaCreditTransfersBerlinGroupV13.instructedAmount.currency == fromAccount.currency - } - - amountOfMoneyJSON = sepaCreditTransfersBerlinGroupV13.instructedAmount - - (createdTransactionRequest, callContext) <- transactionRequestTypes match { + (createdTransactionRequest, callContext) <- transacitonRequestType match { case TransactionRequestTypes.SEPA_CREDIT_TRANSFERS => { for { - (createdTransactionRequest, callContext) <- NewStyle.function.createTransactionRequestv400( - u, - ViewId(Constant.SYSTEM_OWNER_VIEW_ID), //This is the default - fromAccount, - toAccount, - TransactionRequestType(transactionRequestTypes.toString), - TransactionRequestCommonBodyJSONCommons( - amountOfMoneyJSON, - "" - ), - transDetailsSerialized, - "", - Some(BERLIN_GROUP_PAYMENT_CHALLENGE), - None, - None, - Some(paymentService), - Some(sepaCreditTransfersBerlinGroupV13), + (createdTransactionRequest, callContext) <- NewStyle.function.createTransactionRequestBGV1( + initiator = u, + paymentServiceType, + transacitonRequestType, + transactionRequestBody = sepaCreditTransfersBerlinGroupV13, callContext - ) //in SANDBOX_TAN, ChargePolicy set default "SHARED" + ) } yield (createdTransactionRequest, callContext) } } @@ -631,7 +591,7 @@ Check the transaction status of a payment initiation.""", "POST", "/payments/PAYMENT_PRODUCT", "Payment initiation request(payments)", - generalPaymentSummary, + generalPaymentSummary(false), json.parse(s"""{ "debtorAccount": { "iban": "DE123456987480123" @@ -675,7 +635,7 @@ Check the transaction status of a payment initiation.""", "POST", "/periodic-payments/PAYMENT_PRODUCT", "Payment initiation request(periodic-payments)", - generalPaymentSummary, + generalPaymentSummary(false), json.parse(s"""{ "instructedAmount": { "currency": "EUR", @@ -723,7 +683,7 @@ Check the transaction status of a payment initiation.""", "POST", "/bulk-payments/PAYMENT_PRODUCT", "Payment initiation request(bulk-payments)", - generalPaymentSummary, + generalPaymentSummary(true), json.parse(s"""{ "batchBookingPreferred": "true", "debtorAccount": { @@ -937,7 +897,7 @@ This applies in the following scenarios: for { (Full(u), callContext) <- authenticatedAccess(cc) _ <- passesPsd2Pisp(callContext) - _ <- NewStyle.function.tryons(checkPaymentServerError(paymentService), 400, callContext) { + _ <- NewStyle.function.tryons(checkPaymentServerTypeError(paymentService), 400, callContext) { PaymentServiceTypes.withName(paymentService.replaceAll("-", "_")) } _ <- NewStyle.function.tryons(checkPaymentProductError(paymentProduct), 400, callContext) { @@ -1030,7 +990,7 @@ This applies in the following scenarios: for { (Full(u), callContext) <- authenticatedAccess(cc) _ <- passesPsd2Pisp(callContext) - _ <- NewStyle.function.tryons(checkPaymentServerError(paymentService),400, callContext) { + _ <- NewStyle.function.tryons(checkPaymentServerTypeError(paymentService),400, callContext) { PaymentServiceTypes.withName(paymentService.replaceAll("-","_")) } _ <- NewStyle.function.tryons(checkPaymentProductError(paymentProduct),400, callContext) { @@ -1232,7 +1192,7 @@ There are the following request types on this access path: json.extract[TransactionAuthorisation] } - _ <- NewStyle.function.tryons(checkPaymentServerError(paymentService),400, callContext) { + _ <- NewStyle.function.tryons(checkPaymentServerTypeError(paymentService),400, callContext) { PaymentServiceTypes.withName(paymentService.replaceAll("-","_")) } _ <- NewStyle.function.tryons(checkPaymentProductError(paymentProduct),400, callContext) { @@ -1479,7 +1439,7 @@ There are the following request types on this access path: json.extract[TransactionAuthorisation] } - _ <- NewStyle.function.tryons(checkPaymentServerError(paymentService),400, callContext) { + _ <- NewStyle.function.tryons(checkPaymentServerTypeError(paymentService),400, callContext) { PaymentServiceTypes.withName(paymentService.replaceAll("-","_")) } _ <- NewStyle.function.tryons(checkPaymentProductError(paymentProduct),400, callContext) { diff --git a/obp-api/src/main/scala/code/api/dynamic/endpoint/APIMethodsDynamicEndpoint.scala b/obp-api/src/main/scala/code/api/dynamic/endpoint/APIMethodsDynamicEndpoint.scala index 126201d87d..f6877bb604 100644 --- a/obp-api/src/main/scala/code/api/dynamic/endpoint/APIMethodsDynamicEndpoint.scala +++ b/obp-api/src/main/scala/code/api/dynamic/endpoint/APIMethodsDynamicEndpoint.scala @@ -10,7 +10,7 @@ import code.api.util.ErrorMessages._ import code.api.util.NewStyle.HttpCode import code.api.util._ import code.endpointMapping.EndpointMappingCommons -import code.transactionrequests.TransactionRequests.TransactionRequestTypes.{apply => _} +import com.openbankproject.commons.model.enums.TransactionRequestTypes._ import code.util.Helper import com.openbankproject.commons.ExecutionContext.Implicits.global import com.openbankproject.commons.model._ diff --git a/obp-api/src/main/scala/code/api/dynamic/entity/APIMethodsDynamicEntity.scala b/obp-api/src/main/scala/code/api/dynamic/entity/APIMethodsDynamicEntity.scala index 0e4c938d06..c4da3fa697 100644 --- a/obp-api/src/main/scala/code/api/dynamic/entity/APIMethodsDynamicEntity.scala +++ b/obp-api/src/main/scala/code/api/dynamic/entity/APIMethodsDynamicEntity.scala @@ -11,7 +11,8 @@ import code.api.util.ErrorMessages._ import code.api.util.NewStyle.HttpCode import code.api.util._ import code.endpointMapping.EndpointMappingCommons -import code.transactionrequests.TransactionRequests.TransactionRequestTypes.{apply => _} +import com.openbankproject.commons.model.enums.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.PaymentServiceTypes._ import code.util.Helper import com.openbankproject.commons.ExecutionContext.Implicits.global import com.openbankproject.commons.model._ diff --git a/obp-api/src/main/scala/code/api/util/ErrorMessages.scala b/obp-api/src/main/scala/code/api/util/ErrorMessages.scala index 322302c948..a27ef4248a 100644 --- a/obp-api/src/main/scala/code/api/util/ErrorMessages.scala +++ b/obp-api/src/main/scala/code/api/util/ErrorMessages.scala @@ -702,6 +702,7 @@ object ErrorMessages { val InvalidConnectorResponseForGetEndpointTags = "OBP-50218: Connector did not return the set of endpoint tags we requested." val InvalidConnectorResponseForGetBankAccountsWithAttributes = "OBP-50219: Connector did not return the bank accounts we requested." val InvalidConnectorResponseForGetPaymentLimit = "OBP-50220: Connector did not return the payment limit we requested." + val InvalidConnectorResponseForCreateTransactionRequestBGV1 = "OBP-50221: CreateTransactionRequestBGV1 Connector did not return the data we requested." // Adapter Exceptions (OBP-6XXXX) // Reserved for adapter (south of Kafka) messages diff --git a/obp-api/src/main/scala/code/api/util/NewStyle.scala b/obp-api/src/main/scala/code/api/util/NewStyle.scala index ab5944ce17..46eb6572cb 100644 --- a/obp-api/src/main/scala/code/api/util/NewStyle.scala +++ b/obp-api/src/main/scala/code/api/util/NewStyle.scala @@ -44,6 +44,8 @@ import com.github.dwickern.macros.NameOf.nameOf import com.openbankproject.commons.dto.{CustomerAndAttribute, ProductCollectionItemsTree} import com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SCA import com.openbankproject.commons.model.enums.StrongCustomerAuthenticationStatus.SCAStatus +import com.openbankproject.commons.model.enums.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.PaymentServiceTypes._ import com.openbankproject.commons.model.enums._ import com.openbankproject.commons.model.{AccountApplication, Bank, Customer, CustomerAddress, Product, ProductCollection, ProductCollectionItem, TaxResidence, UserAuthContext, UserAuthContextUpdate, _} import com.tesobe.CacheKeyFromArguments @@ -63,6 +65,7 @@ import code.validation.{JsonSchemaValidationProvider, JsonValidation} import net.liftweb.http.JsonResponse import net.liftweb.util.Props import code.api.JsonResponseException +import code.api.builder.PaymentInitiationServicePISApi.APIMethods_PaymentInitiationServicePISApi.{checkPaymentProductError, checkPaymentServerTypeError, checkPaymentServiceType} import code.api.dynamic.endpoint.helper.DynamicEndpointHelper import code.api.v4_0_0.JSONFactory400 import code.api.dynamic.endpoint.helper.DynamicEndpointHelper @@ -1129,8 +1132,6 @@ object NewStyle extends MdcLoggable{ challengeType: Option[ChallengeType.Value], scaMethod: Option[SCA], reasons: Option[List[TransactionRequestReason]], - paymentService: Option[String], - berlinGroupPayments: Option[BerlinGroupTransactionRequestCommonBodyJson], callContext: Option[CallContext]): OBPReturnType[TransactionRequest] = { Connector.connector.vend.createTransactionRequestv400( @@ -1145,13 +1146,41 @@ object NewStyle extends MdcLoggable{ challengeType = challengeType.map(_.toString), scaMethod: Option[SCA], reasons: Option[List[TransactionRequestReason]], - paymentService: Option[String], - berlinGroupPayments: Option[BerlinGroupTransactionRequestCommonBodyJson], callContext: Option[CallContext] ) map { i => (unboxFullOrFail(i._1, callContext, s"$InvalidConnectorResponseForGetTransactionRequests210", 400), i._2) } } + + def createTransactionRequestBGV1( + initiator: User, + paymentServiceType: PaymentServiceTypes, + transactionRequestType: TransactionRequestTypes, + transactionRequestBody: BerlinGroupTransactionRequestCommonBodyJson, + callContext: Option[CallContext] + ): OBPReturnType[TransactionRequestBGV1] = { + val response = if(paymentServiceType.equals(PaymentServiceTypes.payments)){ + Connector.connector.vend.createTransactionRequestSepaCreditTransfersBGV1( + initiator: User, + paymentServiceType: PaymentServiceTypes, + transactionRequestType: TransactionRequestTypes, + transactionRequestBody.asInstanceOf[SepaCreditTransfersBerlinGroupV13], + callContext: Option[CallContext] + ) + }else if(paymentServiceType.equals(PaymentServiceTypes.periodic_payments)){ + Connector.connector.vend.createTransactionRequestPeriodicSepaCreditTransfersBGV1( + initiator: User, + paymentServiceType: PaymentServiceTypes, + transactionRequestType: TransactionRequestTypes, + transactionRequestBody.asInstanceOf[PeriodicSepaCreditTransfersBerlinGroupV13], + callContext: Option[CallContext] + ) + }else Future(throw new RuntimeException(checkPaymentServerTypeError(paymentServiceType.toString))) + + response map { i => + (unboxFullOrFail(i._1, callContext, s"$InvalidConnectorResponseForCreateTransactionRequestBGV1", 400), i._2) + } + } def notifyTransactionRequest(fromAccount: BankAccount, toAccount: BankAccount, transactionRequest: TransactionRequest, callContext: Option[CallContext]): OBPReturnType[TransactionRequestStatusValue] = { Connector.connector.vend.notifyTransactionRequest(fromAccount: BankAccount, toAccount: BankAccount, transactionRequest: TransactionRequest, callContext: Option[CallContext]) map { i => diff --git a/obp-api/src/main/scala/code/api/v1_2_1/APIMethods121.scala b/obp-api/src/main/scala/code/api/v1_2_1/APIMethods121.scala index 968f7f5ed1..0e1274906a 100644 --- a/obp-api/src/main/scala/code/api/v1_2_1/APIMethods121.scala +++ b/obp-api/src/main/scala/code/api/v1_2_1/APIMethods121.scala @@ -15,6 +15,7 @@ import code.util.Helper import code.util.Helper.booleanToBox import code.views.Views import code.views.system.ViewDefinition +import com.github.dwickern.macros.NameOf.nameOf import com.openbankproject.commons.ExecutionContext.Implicits.global import com.openbankproject.commons.model._ import com.openbankproject.commons.util.ApiVersion @@ -481,7 +482,7 @@ trait APIMethods121 { anyViewContainsCanUpdateBankAccountLabelPermission = Views.views.vend.permission(BankIdAccountId(account.bankId, account.accountId), u) .map(_.views.map(_.canUpdateBankAccountLabel).find(_.==(true)).getOrElse(false)).getOrElse(false) _ <- Helper.booleanToFuture( - s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(ViewDefinition.canUpdateBankAccountLabel_.dbColumnName).dropRight(1)}` permission on any your views", + s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canUpdateBankAccountLabel_)).dropRight(1)}` permission on any your views", cc = callContext ) { anyViewContainsCanUpdateBankAccountLabelPermission @@ -545,7 +546,7 @@ trait APIMethods121 { anyViewContainsCanSeeAvailableViewsForBankAccountPermission = permission.views.map(_.canSeeAvailableViewsForBankAccount).find(_.==(true)).getOrElse(false) _ <- Helper.booleanToBox( anyViewContainsCanSeeAvailableViewsForBankAccountPermission, - s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(ViewDefinition.canSeeAvailableViewsForBankAccount_.dbColumnName).dropRight(1)}` permission on any your views" + s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canSeeAvailableViewsForBankAccount_)).dropRight(1)}` permission on any your views" ) views <- Full(Views.views.vend.availableViewsForAccount(BankIdAccountId(bankAccount.bankId, bankAccount.accountId))) } yield { @@ -610,7 +611,7 @@ trait APIMethods121 { .map(_.views.map(_.canCreateCustomView).find(_.==(true)).getOrElse(false)).getOrElse(false) _ <- booleanToBox( anyViewContainsCanCreateCustomViewPermission, - s"${ErrorMessages.CreateCustomViewError} You need the `${StringHelpers.snakify(ViewDefinition.canCreateCustomView_.dbColumnName).dropRight(1)}` permission on any your views" + s"${ErrorMessages.CreateCustomViewError} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canCreateCustomView_)).dropRight(1)}` permission on any your views" ) view <- Views.views.vend.createCustomView(BankIdAccountId(bankId,accountId), createViewJson)?~ CreateCustomViewError } yield { @@ -672,7 +673,7 @@ trait APIMethods121 { .map(_.views.map(_.canUpdateCustomView).find(_.==(true)).getOrElse(false)).getOrElse(false) _ <- booleanToBox( anyViewContainsCanUpdateCustomViewPermission, - s"${ErrorMessages.CreateCustomViewError} You need the `${StringHelpers.snakify(ViewDefinition.canUpdateCustomView_.dbColumnName).dropRight(1)}` permission on any your views" + s"${ErrorMessages.CreateCustomViewError} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canUpdateCustomView_)).dropRight(1)}` permission on any your views" ) updatedView <- Views.views.vend.updateCustomView(BankIdAccountId(bankId, accountId),viewId, updateViewJson) ?~ CreateCustomViewError } yield { @@ -717,7 +718,7 @@ trait APIMethods121 { anyViewContainsCanDeleteCustomViewPermission = Views.views.vend.permission(BankIdAccountId(account.bankId, account.accountId), u) .map(_.views.map(_.canDeleteCustomView).find(_.==(true)).getOrElse(false)).getOrElse(false) _ <- Helper.booleanToFuture( - s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(ViewDefinition.canDeleteCustomView_.dbColumnName).dropRight(1)}` permission on any your views", + s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canDeleteCustomView_)).dropRight(1)}` permission on any your views", cc = callContext ) { anyViewContainsCanDeleteCustomViewPermission @@ -757,7 +758,7 @@ trait APIMethods121 { .map(_.views.map(_.canSeeViewsWithPermissionsForAllUsers).find(_.==(true)).getOrElse(false)).getOrElse(false) _ <- booleanToBox( anyViewContainsCanSeeViewsWithPermissionsForAllUsersPermission, - s"${ErrorMessages.CreateCustomViewError} You need the `${StringHelpers.snakify(ViewDefinition.canSeeViewsWithPermissionsForAllUsers_.dbColumnName).dropRight(1)}` permission on any your views" + s"${ErrorMessages.CreateCustomViewError} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canSeeViewsWithPermissionsForAllUsers_)).dropRight(1)}` permission on any your views" ) permissions = Views.views.vend.permissions(BankIdAccountId(bankId, accountId)) } yield { @@ -802,7 +803,7 @@ trait APIMethods121 { .find(_.==(true)).getOrElse(false)).getOrElse(false) _ <- booleanToBox( anyViewContainsCanSeeViewsWithPermissionsForOneUserPermission, - s"${ErrorMessages.CreateCustomViewError} You need the `${StringHelpers.snakify(ViewDefinition.canSeeViewsWithPermissionsForOneUser_.dbColumnName).dropRight(1)}` permission on any your views" + s"${ErrorMessages.CreateCustomViewError} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canSeeViewsWithPermissionsForOneUser_)).dropRight(1)}` permission on any your views" ) userFromURL <- UserX.findByProviderId(provider, providerId) ?~! UserNotFoundByProviderAndProvideId permission <- Views.views.vend.permission(BankIdAccountId(bankId, accountId), userFromURL) diff --git a/obp-api/src/main/scala/code/api/v1_4_0/APIMethods140.scala b/obp-api/src/main/scala/code/api/v1_4_0/APIMethods140.scala index 9c89b1c17e..b6d5ef0332 100644 --- a/obp-api/src/main/scala/code/api/v1_4_0/APIMethods140.scala +++ b/obp-api/src/main/scala/code/api/v1_4_0/APIMethods140.scala @@ -457,7 +457,7 @@ trait APIMethods140 extends MdcLoggable with APIMethods130 with APIMethods121{ _ <- NewStyle.function.isValidCurrencyISOCode(fromAccount.currency, failMsg, callContext) view <- NewStyle.function.checkViewAccessAndReturnView(viewId, BankIdAccountId(fromAccount.bankId, fromAccount.accountId), Some(u), callContext) _ <- Helper.booleanToFuture( - s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(ViewDefinition.canSeeTransactionRequestTypes_.dbColumnName).dropRight(1)}` permission on the View(${viewId.value} )", + s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canSeeTransactionRequestTypes_)).dropRight(1)}` permission on the View(${viewId.value} )", cc = callContext ) { view.canSeeTransactionRequestTypes @@ -486,7 +486,7 @@ trait APIMethods140 extends MdcLoggable with APIMethods130 with APIMethods121{ "Get all Transaction Requests", "", emptyObjectJson, - transactionRequest, + transactionRequestJson, List( UserNotLoggedIn, BankNotFound, @@ -508,13 +508,13 @@ trait APIMethods140 extends MdcLoggable with APIMethods130 with APIMethods121{ view <- APIUtil.checkViewAccessAndReturnView(viewId, BankIdAccountId(bankId, accountId), Some(u), callContext) _ <- Helper.booleanToBox( view.canSeeTransactionRequests, - s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(ViewDefinition.canSeeTransactionRequests_.dbColumnName).dropRight(1)}` permission on the View(${viewId.value})" + s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canSeeTransactionRequests_)).dropRight(1)}` permission on the View(${viewId.value})" ) transactionRequests <- Connector.connector.vend.getTransactionRequests(u, fromAccount, callContext) + oldTransactionRequest = transactionRequests.map(transforOldTransactionRequest(_).head) } yield { - // TODO return 1.4.0 version of Transaction Requests! - val successJson = Extraction.decompose(transactionRequests) + val successJson = Extraction.decompose(oldTransactionRequest) successJsonResponse(successJson) } } else { diff --git a/obp-api/src/main/scala/code/api/v1_4_0/JSONFactory1_4_0.scala b/obp-api/src/main/scala/code/api/v1_4_0/JSONFactory1_4_0.scala index a8df0e99e4..92816ac80c 100644 --- a/obp-api/src/main/scala/code/api/v1_4_0/JSONFactory1_4_0.scala +++ b/obp-api/src/main/scala/code/api/v1_4_0/JSONFactory1_4_0.scala @@ -139,7 +139,6 @@ object JSONFactory1_4_0 extends MdcLoggable{ is_beneficiary :Boolean ) - def createCustomerJson(cInfo : Customer) : CustomerJsonV140 = { CustomerJsonV140( @@ -913,12 +912,12 @@ object JSONFactory1_4_0 extends MdcLoggable{ `type` = transactionRequest.`type`, from = transactionRequest.from, details = TransactionRequestBodyJson( - transactionRequest.body.to_sandbox_tan.get, + transactionRequest.body.to_sandbox_tan.getOrElse(null), transactionRequest.body.value, transactionRequest.body.description ), body = TransactionRequestBodyJson( - transactionRequest.body.to_sandbox_tan.get, + transactionRequest.body.to_sandbox_tan.getOrElse(null), transactionRequest.body.value, transactionRequest.body.description ), diff --git a/obp-api/src/main/scala/code/api/v2_0_0/APIMethods200.scala b/obp-api/src/main/scala/code/api/v2_0_0/APIMethods200.scala index 2009a08f8e..6f00768f82 100644 --- a/obp-api/src/main/scala/code/api/v2_0_0/APIMethods200.scala +++ b/obp-api/src/main/scala/code/api/v2_0_0/APIMethods200.scala @@ -1,7 +1,6 @@ package code.api.v2_0_0 import java.util.{Calendar, Date} - import code.api.Constant._ import code.TransactionTypes.TransactionType import code.api.{APIFailure, APIFailureNewStyle} @@ -34,6 +33,7 @@ import code.util.Helper import code.util.Helper.{booleanToBox, booleanToFuture} import code.views.Views import code.views.system.ViewDefinition +import com.github.dwickern.macros.NameOf.nameOf import com.openbankproject.commons.model._ import net.liftweb.common.{Full, _} import net.liftweb.http.CurrentReq @@ -1062,7 +1062,7 @@ trait APIMethods200 { anyViewContainsCanSeeViewsWithPermissionsForAllUsersPermission = Views.views.vend.permission(BankIdAccountId(account.bankId, account.accountId), u) .map(_.views.map(_.canSeeViewsWithPermissionsForAllUsers).find(_.==(true)).getOrElse(false)).getOrElse(false) _ <- Helper.booleanToFuture( - s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(ViewDefinition.canSeeViewsWithPermissionsForAllUsers_.dbColumnName).dropRight(1)}` permission on any your views", + s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canSeeViewsWithPermissionsForAllUsers_)).dropRight(1)}` permission on any your views", cc = callContext ) { anyViewContainsCanSeeViewsWithPermissionsForAllUsersPermission @@ -1106,7 +1106,7 @@ trait APIMethods200 { .find(_.==(true)).getOrElse(false)).getOrElse(false) _ <- booleanToBox( anyViewContainsCanSeePermissionForOneUserPermission, - s"${ErrorMessages.CreateCustomViewError} You need the `${StringHelpers.snakify(ViewDefinition.canSeeViewsWithPermissionsForOneUser_.dbColumnName).dropRight(1)}` permission on any your views" + s"${ErrorMessages.CreateCustomViewError} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canSeeViewsWithPermissionsForOneUser_)).dropRight(1)}` permission on any your views" ) userFromURL <- UserX.findByProviderId(provider, providerId) ?~! UserNotFoundByProviderAndProvideId permission <- Views.views.vend.permission(BankIdAccountId(bankId, accountId), userFromURL) @@ -1532,7 +1532,7 @@ trait APIMethods200 { fromAccount <- BankAccountX(bankId, accountId) ?~! AccountNotFound view <-APIUtil.checkViewAccessAndReturnView(viewId, BankIdAccountId(fromAccount.bankId, fromAccount.accountId), Some(u), callContext) _ <- Helper.booleanToBox(view.canSeeTransactionRequests, - s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(ViewDefinition.canSeeTransactionRequests_.dbColumnName).dropRight(1)}` permission on the View(${viewId.value} )") + s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canSeeTransactionRequests_)).dropRight(1)}` permission on the View(${viewId.value} )") transactionRequests <- Connector.connector.vend.getTransactionRequests(u, fromAccount, callContext) } yield { diff --git a/obp-api/src/main/scala/code/api/v2_1_0/APIMethods210.scala b/obp-api/src/main/scala/code/api/v2_1_0/APIMethods210.scala index 81386e4f47..af85c7a96b 100644 --- a/obp-api/src/main/scala/code/api/v2_1_0/APIMethods210.scala +++ b/obp-api/src/main/scala/code/api/v2_1_0/APIMethods210.scala @@ -24,14 +24,16 @@ import code.fx.fx import code.metrics.APIMetrics import code.model.{BankAccountX, BankX, Consumer, UserX, toUserExtended} import code.sandbox.SandboxData -import code.transactionrequests.TransactionRequests.TransactionRequestTypes import code.usercustomerlinks.UserCustomerLink import code.users.Users import code.util.Helper.booleanToBox import code.views.Views import code.views.system.ViewDefinition +import com.github.dwickern.macros.NameOf.nameOf import com.openbankproject.commons.model._ -import com.openbankproject.commons.model.enums.{ChallengeType, SuppliedAnswerType} +import com.openbankproject.commons.model.enums.{ChallengeType, SuppliedAnswerType, TransactionRequestTypes} +import com.openbankproject.commons.model.enums.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.PaymentServiceTypes._ import com.openbankproject.commons.util.ApiVersion import net.liftweb.json.Extraction import net.liftweb.util.Helpers.tryo @@ -47,7 +49,8 @@ import code.api.util.ApiRole._ import code.api.util.ErrorMessages._ import code.api.{APIFailure, ChargePolicy} import code.sandbox.{OBPDataImport, SandboxDataImport} -import code.transactionrequests.TransactionRequests.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.PaymentServiceTypes._ import code.util.Helper import code.util.Helper._ import net.liftweb.common.{Box, Full} @@ -752,7 +755,7 @@ trait APIMethods210 { (fromAccount, callContext) <- BankAccountX(bankId, accountId, Some(cc)) ?~! {AccountNotFound} view <- APIUtil.checkViewAccessAndReturnView(viewId, BankIdAccountId(bankId, accountId), Some(u), callContext) _ <- Helper.booleanToBox(view.canSeeTransactionRequests, - s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(ViewDefinition.canSeeTransactionRequests_.dbColumnName).dropRight(1)}` permission on the View(${viewId.value} )") + s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canSeeTransactionRequests_)).dropRight(1)}` permission on the View(${viewId.value} )") (transactionRequests,callContext) <- Connector.connector.vend.getTransactionRequests210(u, fromAccount, callContext) } yield { diff --git a/obp-api/src/main/scala/code/api/v2_2_0/APIMethods220.scala b/obp-api/src/main/scala/code/api/v2_2_0/APIMethods220.scala index 2ea62793f7..d2fc23e924 100644 --- a/obp-api/src/main/scala/code/api/v2_2_0/APIMethods220.scala +++ b/obp-api/src/main/scala/code/api/v2_2_0/APIMethods220.scala @@ -1,7 +1,6 @@ package code.api.v2_2_0 import java.util.Date - import code.api.ResourceDocs1_4_0.SwaggerDefinitionsJSON._ import code.api.util.APIUtil._ import code.api.util.ApiRole.{canCreateBranch, _} @@ -26,6 +25,7 @@ import code.util.Helper import code.util.Helper._ import code.views.Views import code.views.system.ViewDefinition +import com.github.dwickern.macros.NameOf.nameOf import com.openbankproject.commons.model._ import net.liftweb.common.{Empty, Full} import net.liftweb.http.rest.RestHelper @@ -97,7 +97,8 @@ trait APIMethods220 { s"""#Views | | - |Views in Open Bank Project provide a mechanism for fine grained access control and delegation to Accounts and Transactions. Account holders use the 'owner' view by default. Delegated access is made through other views for example 'accountants', 'share-holders' or 'tagging-application'. Views can be created via the API and each view has a list of entitlements. + |Views in Open Bank Project provide a mechanism for fine grained access control and delegation to Accounts and Transactions. Account holders use the 'owner' view by default. + |Delegated access is made through other views for example 'accountants', 'share-holders' or 'tagging-application'. Views can be created via the API and each view has a list of entitlements. | |Views on accounts and transactions filter the underlying data to redact certain fields for certain users. For instance the balance on an account may be hidden from the public. The way to know what is possible on a view is determined in the following JSON. | @@ -137,7 +138,7 @@ trait APIMethods220 { permission <- NewStyle.function.permission(bankId, accountId, u, callContext) anyViewContainsCanSeeAvailableViewsForBankAccountPermission = permission.views.map(_.canSeeAvailableViewsForBankAccount).find(_.==(true)).getOrElse(false) _ <- Helper.booleanToFuture( - s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(ViewDefinition.canSeeAvailableViewsForBankAccount_.dbColumnName).dropRight(1)}` permission on any your views", + s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canSeeAvailableViewsForBankAccount_)).dropRight(1)}` permission on any your views", cc= callContext ){ anyViewContainsCanSeeAvailableViewsForBankAccountPermission @@ -207,7 +208,7 @@ trait APIMethods220 { .map(_.views.map(_.canCreateCustomView).find(_.==(true)).getOrElse(false)).getOrElse(false) _ <- booleanToBox( anyViewContainsCanCreateCustomViewPermission, - s"${ErrorMessages.CreateCustomViewError} You need the `${StringHelpers.snakify(ViewDefinition.canCreateCustomView_.dbColumnName).dropRight(1)}` permission on any your views" + s"${ErrorMessages.CreateCustomViewError} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canCreateCustomView_)).dropRight(1)}` permission on any your views" ) view <- Views.views.vend.createCustomView(BankIdAccountId(bankId, accountId), createViewJson) ?~ CreateCustomViewError } yield { @@ -266,7 +267,7 @@ trait APIMethods220 { .map(_.views.map(_.canUpdateCustomView).find(_.==(true)).getOrElse(false)).getOrElse(false) _ <- booleanToBox( anyViewContainsCancanUpdateCustomViewPermission, - s"${ErrorMessages.CreateCustomViewError} You need the `${StringHelpers.snakify(ViewDefinition.canUpdateCustomView_.dbColumnName).dropRight(1)}` permission on any your views" + s"${ErrorMessages.CreateCustomViewError} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canUpdateCustomView_)).dropRight(1)}` permission on any your views" ) updatedView <- Views.views.vend.updateCustomView(BankIdAccountId(bankId, accountId), viewId, updateViewJson) ?~ CreateCustomViewError } yield { diff --git a/obp-api/src/main/scala/code/api/v3_0_0/APIMethods300.scala b/obp-api/src/main/scala/code/api/v3_0_0/APIMethods300.scala index 76b1bd651f..0cc72bb052 100644 --- a/obp-api/src/main/scala/code/api/v3_0_0/APIMethods300.scala +++ b/obp-api/src/main/scala/code/api/v3_0_0/APIMethods300.scala @@ -148,8 +148,8 @@ trait APIMethods300 { permission <- NewStyle.function.permission(bankId, accountId, u, callContext) anyViewContainsCanSeeAvailableViewsForBankAccountPermission = permission.views.map(_.canSeeAvailableViewsForBankAccount).find(_.==(true)).getOrElse(false) _ <- Helper.booleanToFuture( - s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${code.views.system.ViewDefinition.canSeeAvailableViewsForBankAccount.toString}` permission on any your views", - cc = callContext + s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canSeeAvailableViewsForBankAccount_)).dropRight(1)}` permission on any your views", + cc = callContext ) { anyViewContainsCanSeeAvailableViewsForBankAccountPermission } @@ -219,7 +219,7 @@ trait APIMethods300 { .map(_.views.map(_.canCreateCustomView).find(_.==(true)).getOrElse(false)).getOrElse(false) _ <- Helper.booleanToFuture( - s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(ViewDefinition.canCreateCustomView_.dbColumnName).dropRight(1)}` permission on any your views", + s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canCreateCustomView_)).dropRight(1)}` permission on any your views", cc = callContext ) {anyViewContainsCanCreateCustomViewPermission} (view, callContext) <- NewStyle.function.createCustomView(BankIdAccountId(bankId, accountId), createViewJson, callContext) @@ -258,7 +258,7 @@ trait APIMethods300 { anyViewContainsCanSeePermissionForOneUserPermission = Views.views.vend.permission(BankIdAccountId(account.bankId, account.accountId), loggedInUser) .map(_.views.map(_.canSeeViewsWithPermissionsForOneUser).find(_.==(true)).getOrElse(false)).getOrElse(false) _ <- Helper.booleanToFuture( - s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(ViewDefinition.canSeeViewsWithPermissionsForOneUser_.dbColumnName).dropRight(1)}` permission on any your views", + s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canSeeViewsWithPermissionsForOneUser_)).dropRight(1)}` permission on any your views", cc = callContext ) { anyViewContainsCanSeePermissionForOneUserPermission @@ -325,7 +325,7 @@ trait APIMethods300 { .map(_.views.map(_.canUpdateCustomView).find(_.==(true)).getOrElse(false)).getOrElse(false) _ <- Helper.booleanToFuture( - s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(ViewDefinition.canUpdateCustomView_.dbColumnName).dropRight(1)}` permission on any your views", + s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canUpdateCustomView_)).dropRight(1)}` permission on any your views", cc = callContext ) { anyViewContainsCancanUpdateCustomViewPermission diff --git a/obp-api/src/main/scala/code/api/v3_1_0/APIMethods310.scala b/obp-api/src/main/scala/code/api/v3_1_0/APIMethods310.scala index ae7ace2235..cebd32e1fc 100644 --- a/obp-api/src/main/scala/code/api/v3_1_0/APIMethods310.scala +++ b/obp-api/src/main/scala/code/api/v3_1_0/APIMethods310.scala @@ -659,7 +659,7 @@ trait APIMethods310 { (_, callContext) <- NewStyle.function.getBank(bankId, callContext) (account, callContext) <- NewStyle.function.checkBankAccountExists(bankId, accountId, callContext) view <- NewStyle.function.checkViewAccessAndReturnView(viewId, BankIdAccountId(bankId, accountId), Some(u), callContext) - _ <- Helper.booleanToFuture(failMsg = ViewDoesNotPermitAccess + " You need the view canQueryAvailableFunds.", cc=callContext) { + _ <- Helper.booleanToFuture(failMsg = s"$ViewDoesNotPermitAccess + You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canQueryAvailableFunds_)).dropRight(1)}` permission on any your views", cc=callContext) { view.canQueryAvailableFunds } httpParams: List[HTTPParam] <- NewStyle.function.extractHttpParamsFromUrl(cc.url) @@ -1130,7 +1130,7 @@ trait APIMethods310 { (fromAccount, callContext) <- NewStyle.function.checkBankAccountExists(bankId, accountId, callContext) view <- NewStyle.function.checkAccountAccessAndGetView(viewId, BankIdAccountId(bankId, accountId), Full(u), callContext) _ <- Helper.booleanToFuture( - s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(ViewDefinition.canSeeTransactionRequests_.dbColumnName).dropRight(1)}` permission on the View(${viewId.value})", + s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canSeeTransactionRequests_)).dropRight(1)}` permission on the View(${viewId.value})", cc=callContext){ view.canSeeTransactionRequests } diff --git a/obp-api/src/main/scala/code/api/v4_0_0/APIMethods400.scala b/obp-api/src/main/scala/code/api/v4_0_0/APIMethods400.scala index 88841a027f..40844db73f 100644 --- a/obp-api/src/main/scala/code/api/v4_0_0/APIMethods400.scala +++ b/obp-api/src/main/scala/code/api/v4_0_0/APIMethods400.scala @@ -67,8 +67,6 @@ import code.scope.Scope import code.snippet.{WebUIPlaceholder, WebUITemplate} import code.transactionChallenge.MappedExpectedChallengeAnswer import code.transactionrequests.MappedTransactionRequestProvider -import code.transactionrequests.TransactionRequests.TransactionRequestTypes -import code.transactionrequests.TransactionRequests.TransactionRequestTypes.{apply => _, _} import code.usercustomerlinks.UserCustomerLink import code.userlocks.UserLocksProvider import code.users.Users @@ -87,6 +85,8 @@ import com.openbankproject.commons.model.enums.ChallengeType.OBP_TRANSACTION_REQ import com.openbankproject.commons.model.enums.DynamicEntityOperation._ import com.openbankproject.commons.model.enums.{TransactionRequestStatus, _} import com.openbankproject.commons.model._ +import com.openbankproject.commons.model.enums.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.PaymentServiceTypes._ import com.openbankproject.commons.util.{ApiVersion, JsonUtils, ScannedApiVersion} import deletion._ import net.liftweb.common._ @@ -1095,8 +1095,6 @@ trait APIMethods400 extends MdcLoggable { Some(OBP_TRANSACTION_REQUEST_CHALLENGE), getScaMethodAtInstance(transactionRequestType.value).toOption, None, - None, - None, callContext) //in ACCOUNT, ChargePolicy set default "SHARED" _ <- NewStyle.function.createOrUpdateTransactionRequestAttribute( @@ -1152,8 +1150,6 @@ trait APIMethods400 extends MdcLoggable { Some(OBP_TRANSACTION_REQUEST_CHALLENGE), getScaMethodAtInstance(transactionRequestType.value).toOption, None, - None, - None, callContext) //in ACCOUNT, ChargePolicy set default "SHARED" } yield (createdTransactionRequest, callContext) } @@ -1182,8 +1178,6 @@ trait APIMethods400 extends MdcLoggable { Some(OBP_TRANSACTION_REQUEST_CHALLENGE), getScaMethodAtInstance(transactionRequestType.value).toOption, None, - None, - None, callContext) //in ACCOUNT, ChargePolicy set default "SHARED" } yield (createdTransactionRequest, callContext) } @@ -1218,8 +1212,6 @@ trait APIMethods400 extends MdcLoggable { Some(OBP_TRANSACTION_REQUEST_CHALLENGE), getScaMethodAtInstance(transactionRequestType.value).toOption, None, - None, - None, callContext) } yield (createdTransactionRequest, callContext) } @@ -1251,8 +1243,6 @@ trait APIMethods400 extends MdcLoggable { Some(OBP_TRANSACTION_REQUEST_CHALLENGE), getScaMethodAtInstance(transactionRequestType.value).toOption, None, - None, - None, callContext) } yield (createdTransactionRequest, callContext) @@ -1304,8 +1294,6 @@ trait APIMethods400 extends MdcLoggable { Some(OBP_TRANSACTION_REQUEST_CHALLENGE), getScaMethodAtInstance(transactionRequestType.value).toOption, None, - None, - None, callContext) } yield (createdTransactionRequest, callContext) @@ -1340,8 +1328,6 @@ trait APIMethods400 extends MdcLoggable { Some(OBP_TRANSACTION_REQUEST_CHALLENGE), getScaMethodAtInstance(transactionRequestType.value).toOption, transDetailsSEPAJson.reasons.map(_.map(_.transform)), - None, - None, callContext) } yield (createdTransactionRequest, callContext) } @@ -1366,8 +1352,6 @@ trait APIMethods400 extends MdcLoggable { Some(OBP_TRANSACTION_REQUEST_CHALLENGE), getScaMethodAtInstance(transactionRequestType.value).toOption, None, - None, - None, callContext) } yield (createdTransactionRequest, callContext) @@ -2780,7 +2764,7 @@ trait APIMethods400 extends MdcLoggable { anyViewContainsCanUpdateBankAccountLabelPermission = Views.views.vend.permission(BankIdAccountId(account.bankId, account.accountId), u) .map(_.views.map(_.canUpdateBankAccountLabel).find(_.==(true)).getOrElse(false)).getOrElse(false) _ <- Helper.booleanToFuture( - s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(ViewDefinition.canUpdateBankAccountLabel_.dbColumnName).dropRight(1)}` permission on any your views", + s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canUpdateBankAccountLabel_)).dropRight(1)}` permission on any your views", cc = callContext ) { anyViewContainsCanUpdateBankAccountLabelPermission @@ -5195,7 +5179,7 @@ trait APIMethods400 extends MdcLoggable { _ <- NewStyle.function.isEnabledTransactionRequests(callContext) view <- NewStyle.function.checkAccountAccessAndGetView(viewId, BankIdAccountId(bankId, accountId), Full(u), callContext) _ <- Helper.booleanToFuture( - s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(ViewDefinition.canSeeTransactionRequests_.dbColumnName).dropRight(1)}` permission on the View(${viewId.value})", + s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canSeeTransactionRequests_)).dropRight(1)}` permission on the View(${viewId.value})", cc = callContext) { view.canSeeTransactionRequests } diff --git a/obp-api/src/main/scala/code/api/v5_0_0/APIMethods500.scala b/obp-api/src/main/scala/code/api/v5_0_0/APIMethods500.scala index 5c80f49743..ab1a94dabb 100644 --- a/obp-api/src/main/scala/code/api/v5_0_0/APIMethods500.scala +++ b/obp-api/src/main/scala/code/api/v5_0_0/APIMethods500.scala @@ -23,7 +23,8 @@ import code.entitlement.Entitlement import code.metrics.APIMetrics import code.model._ import code.model.dataAccess.BankAccountCreation -import code.transactionrequests.TransactionRequests.TransactionRequestTypes.{apply => _} +import com.openbankproject.commons.model.enums.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.TransactionRequestTypes import code.util.Helper import code.util.Helper.{SILENCE_IS_GOLDEN, booleanToFuture} import code.views.Views @@ -32,6 +33,8 @@ import com.openbankproject.commons.ExecutionContext.Implicits.global import com.openbankproject.commons.model.enums.StrongCustomerAuthentication import com.openbankproject.commons.model._ import com.openbankproject.commons.util.ApiVersion +import com.openbankproject.commons.model.enums.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.PaymentServiceTypes._ import net.liftweb.common.{Empty, Full} import net.liftweb.http.Req import net.liftweb.http.rest.RestHelper @@ -1810,7 +1813,7 @@ trait APIMethods500 { permission <- NewStyle.function.permission(bankId, accountId, u, callContext) anyViewContainsCanSeeAvailableViewsForBankAccountPermission = permission.views.map(_.canSeeAvailableViewsForBankAccount).find(_.==(true)).getOrElse(false) _ <- Helper.booleanToFuture( - s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(ViewDefinition.canSeeAvailableViewsForBankAccount_.dbColumnName).dropRight(1)}` permission on any your views", + s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canSeeAvailableViewsForBankAccount_)).dropRight(1)}` permission on any your views", cc = callContext ) { anyViewContainsCanSeeAvailableViewsForBankAccountPermission diff --git a/obp-api/src/main/scala/code/api/v5_1_0/APIMethods510.scala b/obp-api/src/main/scala/code/api/v5_1_0/APIMethods510.scala index ab1aa17571..66214c2870 100644 --- a/obp-api/src/main/scala/code/api/v5_1_0/APIMethods510.scala +++ b/obp-api/src/main/scala/code/api/v5_1_0/APIMethods510.scala @@ -35,7 +35,6 @@ import code.metrics.APIMetrics import code.model.{AppType, BankAccountX} import code.model.dataAccess.MappedBankAccount import code.regulatedentities.MappedRegulatedEntityProvider -import code.transactionrequests.TransactionRequests.TransactionRequestTypes.{apply => _} import code.userlocks.UserLocksProvider import code.users.Users import code.util.Helper @@ -45,6 +44,8 @@ import code.views.system.{AccountAccess, ViewDefinition} import com.github.dwickern.macros.NameOf.nameOf import com.openbankproject.commons.ExecutionContext.Implicits.global import com.openbankproject.commons.model.enums.{AtmAttributeType, UserAttributeType} +import com.openbankproject.commons.model.enums.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.PaymentServiceTypes._ import com.openbankproject.commons.model._ import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} import net.liftweb.common.Full @@ -2256,8 +2257,8 @@ trait APIMethods510 { (Full(u), callContext) <- SS.user bankIdAccountId = BankIdAccountId(bankId, accountId) view <- NewStyle.function.checkViewAccessAndReturnView(viewId, bankIdAccountId, Full(u), callContext) - // Note we do one explicit check here rather than use moderated account because this provide an explicit message - failMsg = ViewDoesNotPermitAccess + " You need the permission canSeeBankAccountBalance." + // Note we do one explicit check here rather than use moderated account because this provides an explicit message + failMsg = ViewDoesNotPermitAccess + s" You need the `${StringHelpers.snakify(nameOf(view.canSeeBankAccountBalance))}` permission on VIEW_ID(${viewId.value})" _ <- Helper.booleanToFuture(failMsg, 403, cc = callContext) { view.canSeeBankAccountBalance } diff --git a/obp-api/src/main/scala/code/bankconnectors/Connector.scala b/obp-api/src/main/scala/code/bankconnectors/Connector.scala index e119115106..1b53325162 100644 --- a/obp-api/src/main/scala/code/bankconnectors/Connector.scala +++ b/obp-api/src/main/scala/code/bankconnectors/Connector.scala @@ -17,7 +17,6 @@ import code.api.v4_0_0.ModeratedFirehoseAccountsJsonV400 import code.api.{APIFailure, APIFailureNewStyle} import code.atmattribute.AtmAttribute import code.bankattribute.BankAttribute -import code.bankconnectors.LocalMappedConnector.setUnimplementedError import code.bankconnectors.akka.AkkaConnector_vDec2018 import code.bankconnectors.rest.RestConnector_vMar2019 import code.bankconnectors.storedprocedure.StoredProcedureConnector_vDec2019 @@ -33,11 +32,13 @@ import code.model.toUserExtended import code.productfee.ProductFeeX import code.standingorders.StandingOrderTrait import code.transactionrequests.TransactionRequests -import code.transactionrequests.TransactionRequests.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.PaymentServiceTypes._ import code.transactionrequests.TransactionRequests._ import code.users.{UserAttribute, Users} import code.util.Helper._ import code.views.Views +import com.github.dwickern.macros.NameOf.nameOf import com.openbankproject.commons.ExecutionContext.Implicits.global import com.openbankproject.commons.dto.{CustomerAndAttribute, GetProductsParam, InBoundTrait, ProductCollectionItemsTree} import com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SCA @@ -298,25 +299,17 @@ trait Connector extends MdcLoggable { (boxedResult, callContext) } - /** - * This method will return the method name of the current calling method. - * The scala compiler will tweak the method name, so we need clean the `getMethodName` return value. - * @return - */ - protected def setUnimplementedError() : String = { - val currentMethodName = Thread.currentThread.getStackTrace()(2).getMethodName - .replaceFirst("""^.*\$(.+?)\$.*$""", "$1") // "$anonfun$getBanksFuture$" --> . - .replace("Future","") //getBanksFuture --> getBanks - NotImplemented + currentMethodName + s" Please check `Get Message Docs`endpoint and implement the process `obp.$currentMethodName` in Adapter side." + private def setUnimplementedError(methodName:String) : String = { + NotImplemented + methodName + s" Please check `Get Message Docs`endpoint and implement the process `obp.$methodName` in Adapter side." } - def getAdapterInfo(callContext: Option[CallContext]) : Future[Box[(InboundAdapterInfoInternal, Option[CallContext])]] = Future{Failure(setUnimplementedError)} + def getAdapterInfo(callContext: Option[CallContext]) : Future[Box[(InboundAdapterInfoInternal, Option[CallContext])]] = Future{Failure(setUnimplementedError(nameOf(getAdapterInfo _)))} - def validateAndCheckIbanNumber(iban: String, callContext: Option[CallContext]): OBPReturnType[Box[IbanChecker]] = Future{(Failure(setUnimplementedError), callContext)} + def validateAndCheckIbanNumber(iban: String, callContext: Option[CallContext]): OBPReturnType[Box[IbanChecker]] = Future{(Failure(setUnimplementedError(nameOf(validateAndCheckIbanNumber _))), callContext)} // Gets current challenge level for transaction request - // Transaction request challenge threshold. Level at which challenge is created and needs to be answered + // challenge threshold. Level at which challenge is created and needs to be answered // before we attempt to create a transaction on the south side // The Currency is EUR. Connector implementations may convert the value to the transaction request currency. // Connector implementation may well provide dynamic response @@ -395,7 +388,7 @@ trait Connector extends MdcLoggable { amount: String, toAccountRoutings: List[AccountRouting], customAttributes: List[CustomAttribute], - callContext: Option[CallContext]): OBPReturnType[Box[AmountOfMoney]] = Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[AmountOfMoney]] = Future{(Failure(setUnimplementedError(nameOf(getChargeLevelC2 _))), callContext)} // Initiate creating a challenge for transaction request and returns an id of the challenge def createChallenge(bankId: BankId, @@ -404,7 +397,7 @@ trait Connector extends MdcLoggable { transactionRequestType: TransactionRequestType, transactionRequestId: String, scaMethod: Option[SCA], - callContext: Option[CallContext]) : OBPReturnType[Box[String]]= Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]) : OBPReturnType[Box[String]]= Future{(Failure(setUnimplementedError(nameOf(createChallenge _))), callContext)} // Initiate creating a challenges for transaction request and returns an ids of the challenges def createChallenges(bankId: BankId, accountId: AccountId, @@ -412,7 +405,7 @@ trait Connector extends MdcLoggable { transactionRequestType: TransactionRequestType, transactionRequestId: String, scaMethod: Option[SCA], - callContext: Option[CallContext]) : OBPReturnType[Box[List[String]]]= Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]) : OBPReturnType[Box[List[String]]]= Future{(Failure(setUnimplementedError(nameOf(createChallenges _))), callContext)} // now, we try to share the same challenges for obp payments, berlin group payments, and berlin group consents def createChallengesC2( @@ -423,7 +416,7 @@ trait Connector extends MdcLoggable { scaStatus: Option[SCAStatus],//Only use for BerlinGroup Now consentId: Option[String], // Note: consentId and transactionRequestId are exclusive here. authenticationMethodId: Option[String], - callContext: Option[CallContext]) : OBPReturnType[Box[List[ChallengeTrait]]]= Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]) : OBPReturnType[Box[List[ChallengeTrait]]]= Future{(Failure(setUnimplementedError(nameOf(createChallengesC2 _))), callContext)} // now, we try to share the same challenges for obp payments, berlin group payments, berlin group consents and signing baskets def createChallengesC3( @@ -435,7 +428,7 @@ trait Connector extends MdcLoggable { consentId: Option[String], // Note: consentId and transactionRequestId and basketId are exclusive here. basketId: Option[String], // Note: consentId and transactionRequestId and basketId are exclusive here. authenticationMethodId: Option[String], - callContext: Option[CallContext]) : OBPReturnType[Box[List[ChallengeTrait]]]= Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]) : OBPReturnType[Box[List[ChallengeTrait]]]= Future{(Failure(setUnimplementedError(nameOf(createChallengesC3 _))), callContext)} @deprecated("Please use @validateChallengeAnswerV2 instead ","01.07.2024") def validateChallengeAnswer(challengeId: String, hashOfSuppliedAnswer: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = Future{(Full(true), callContext)} @@ -457,7 +450,7 @@ trait Connector extends MdcLoggable { challengeId: String, hashOfSuppliedAnswer: String, callContext: Option[CallContext] - ): OBPReturnType[Box[ChallengeTrait]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[ChallengeTrait]] = Future{(Failure(setUnimplementedError(nameOf(validateChallengeAnswerC2 _))), callContext)} @deprecated("Please use @validateChallengeAnswerC5 instead ","04.07.2024") def validateChallengeAnswerC3( @@ -467,7 +460,7 @@ trait Connector extends MdcLoggable { challengeId: String, hashOfSuppliedAnswer: String, callContext: Option[CallContext] - ): OBPReturnType[Box[ChallengeTrait]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[ChallengeTrait]] = Future{(Failure(setUnimplementedError(nameOf(validateChallengeAnswerC3 _))), callContext)} def validateChallengeAnswerC4( transactionRequestId: Option[String], @@ -476,7 +469,7 @@ trait Connector extends MdcLoggable { suppliedAnswer: String, suppliedAnswerType: SuppliedAnswerType.Value, callContext: Option[CallContext] - ): OBPReturnType[Box[ChallengeTrait]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[ChallengeTrait]] = Future{(Failure(setUnimplementedError(nameOf(validateChallengeAnswerC4 _))), callContext)} def validateChallengeAnswerC5( transactionRequestId: Option[String], @@ -486,29 +479,29 @@ trait Connector extends MdcLoggable { suppliedAnswer: String, suppliedAnswerType: SuppliedAnswerType.Value, callContext: Option[CallContext] - ): OBPReturnType[Box[ChallengeTrait]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[ChallengeTrait]] = Future{(Failure(setUnimplementedError(nameOf(validateChallengeAnswerC5 _))), callContext)} - def getChallengesByTransactionRequestId(transactionRequestId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[ChallengeTrait]]] = Future{(Failure(setUnimplementedError), callContext)} + def getChallengesByTransactionRequestId(transactionRequestId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[ChallengeTrait]]] = Future{(Failure(setUnimplementedError(nameOf(getChallengesByTransactionRequestId _))), callContext)} - def getChallengesByConsentId(consentId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[ChallengeTrait]]] = Future{(Failure(setUnimplementedError), callContext)} - def getChallengesByBasketId(basketId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[ChallengeTrait]]] = Future{(Failure(setUnimplementedError), callContext)} + def getChallengesByConsentId(consentId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[ChallengeTrait]]] = Future{(Failure(setUnimplementedError(nameOf(getChallengesByConsentId _))), callContext)} + def getChallengesByBasketId(basketId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[ChallengeTrait]]] = Future{(Failure(setUnimplementedError(nameOf(getChallengesByBasketId _))), callContext)} - def getChallenge(challengeId: String, callContext: Option[CallContext]): OBPReturnType[Box[ChallengeTrait]] = Future{(Failure(setUnimplementedError), callContext)} + def getChallenge(challengeId: String, callContext: Option[CallContext]): OBPReturnType[Box[ChallengeTrait]] = Future{(Failure(setUnimplementedError(nameOf(getChallenge _))), callContext)} //gets a particular bank handled by this connector - def getBankLegacy(bankId : BankId, callContext: Option[CallContext]) : Box[(Bank, Option[CallContext])] = Failure(setUnimplementedError) + def getBankLegacy(bankId : BankId, callContext: Option[CallContext]) : Box[(Bank, Option[CallContext])] = Failure(setUnimplementedError(nameOf(getBankLegacy _))) - def getBank(bankId : BankId, callContext: Option[CallContext]) : Future[Box[(Bank, Option[CallContext])]] = Future(Failure(setUnimplementedError)) + def getBank(bankId : BankId, callContext: Option[CallContext]) : Future[Box[(Bank, Option[CallContext])]] = Future(Failure(setUnimplementedError(nameOf(getBank _)))) //gets banks handled by this connector - def getBanksLegacy(callContext: Option[CallContext]): Box[(List[Bank], Option[CallContext])] = Failure(setUnimplementedError) + def getBanksLegacy(callContext: Option[CallContext]): Box[(List[Bank], Option[CallContext])] = Failure(setUnimplementedError(nameOf(getBanksLegacy _))) - def getBanks(callContext: Option[CallContext]): Future[Box[(List[Bank], Option[CallContext])]] = Future{(Failure(setUnimplementedError))} + def getBanks(callContext: Option[CallContext]): Future[Box[(List[Bank], Option[CallContext])]] = Future{(Failure(setUnimplementedError(nameOf(getBanks _))))} /** * please see @getBankAccountsForUser */ - def getBankAccountsForUserLegacy(provider: String, username:String, callContext: Option[CallContext]) : Box[(List[InboundAccount], Option[CallContext])] = Failure(setUnimplementedError) + def getBankAccountsForUserLegacy(provider: String, username:String, callContext: Option[CallContext]) : Box[(List[InboundAccount], Option[CallContext])] = Failure(setUnimplementedError(nameOf(getBankAccountsForUserLegacy _))) /** * Get Accounts from cbs, this method is mainly used for onboarding Bank Customer to OBP. @@ -525,7 +518,7 @@ trait Connector extends MdcLoggable { * @return all the accounts, get from Main Frame. */ def getBankAccountsForUser(provider: String, username:String, callContext: Option[CallContext]) : Future[Box[(List[InboundAccount], Option[CallContext])]] = Future{ - Failure(setUnimplementedError) + Failure(setUnimplementedError(nameOf(getBankAccountsForUser _))) } /** @@ -535,7 +528,7 @@ trait Connector extends MdcLoggable { * @param password * @return */ - def getUser(name: String, password: String): Box[InboundUser]= Failure(setUnimplementedError) + def getUser(name: String, password: String): Box[InboundUser]= Failure(setUnimplementedError(nameOf(getUser _))) /** * This method is for checking external User via connector @@ -543,14 +536,14 @@ trait Connector extends MdcLoggable { * @param password * @return */ - def checkExternalUserCredentials(username: String, password: String, callContext: Option[CallContext]): Box[InboundExternalUser] = Failure(setUnimplementedError) + def checkExternalUserCredentials(username: String, password: String, callContext: Option[CallContext]): Box[InboundExternalUser] = Failure(setUnimplementedError(nameOf(checkExternalUserCredentials _))) /** * This method is for checking external User via connector * @param username * @return */ - def checkExternalUserExists(username: String, callContext: Option[CallContext]): Box[InboundExternalUser] = Failure(setUnimplementedError) + def checkExternalUserExists(username: String, callContext: Option[CallContext]): Box[InboundExternalUser] = Failure(setUnimplementedError(nameOf(checkExternalUserExists _))) /** * This is a helper method @@ -568,37 +561,37 @@ trait Connector extends MdcLoggable { } //This one just added the callContext in parameters. - def getBankAccountLegacy(bankId : BankId, accountId : AccountId, callContext: Option[CallContext]) : Box[(BankAccount, Option[CallContext])]= Failure(setUnimplementedError) + def getBankAccountLegacy(bankId : BankId, accountId : AccountId, callContext: Option[CallContext]) : Box[(BankAccount, Option[CallContext])]= Failure(setUnimplementedError(nameOf(getBankAccountLegacy _))) - def getBankAccountByIban(iban : String, callContext: Option[CallContext]) : OBPReturnType[Box[BankAccount]]= Future{(Failure(setUnimplementedError),callContext)} - def getBankAccountByRoutingLegacy(bankId: Option[BankId], scheme : String, address : String, callContext: Option[CallContext]) : Box[(BankAccount, Option[CallContext])]= Failure(setUnimplementedError) - def getBankAccountByRouting(bankId: Option[BankId], scheme : String, address : String, callContext: Option[CallContext]) : OBPReturnType[Box[BankAccount]]= Future{(Failure(setUnimplementedError), callContext)} - def getAccountRoutingsByScheme(bankId: Option[BankId], scheme : String, callContext: Option[CallContext]): OBPReturnType[Box[List[BankAccountRouting]]] = Future{(Failure(setUnimplementedError),callContext)} - def getAccountRouting(bankId: Option[BankId], scheme : String, address : String, callContext: Option[CallContext]) : Box[(BankAccountRouting, Option[CallContext])]= Failure(setUnimplementedError) + def getBankAccountByIban(iban : String, callContext: Option[CallContext]) : OBPReturnType[Box[BankAccount]]= Future{(Failure(setUnimplementedError(nameOf(getBankAccountByIban _))),callContext)} + def getBankAccountByRoutingLegacy(bankId: Option[BankId], scheme : String, address : String, callContext: Option[CallContext]) : Box[(BankAccount, Option[CallContext])]= Failure(setUnimplementedError(nameOf(getBankAccountByRoutingLegacy _))) + def getBankAccountByRouting(bankId: Option[BankId], scheme : String, address : String, callContext: Option[CallContext]) : OBPReturnType[Box[BankAccount]]= Future{(Failure(setUnimplementedError(nameOf(getBankAccountByRouting _))), callContext)} + def getAccountRoutingsByScheme(bankId: Option[BankId], scheme : String, callContext: Option[CallContext]): OBPReturnType[Box[List[BankAccountRouting]]] = Future{(Failure(setUnimplementedError(nameOf(getAccountRoutingsByScheme _))),callContext)} + def getAccountRouting(bankId: Option[BankId], scheme : String, address : String, callContext: Option[CallContext]) : Box[(BankAccountRouting, Option[CallContext])]= Failure(setUnimplementedError(nameOf(getAccountRouting _))) - def getBankAccounts(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]) : OBPReturnType[Box[List[BankAccount]]]= Future{(Failure(setUnimplementedError), callContext)} + def getBankAccounts(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]) : OBPReturnType[Box[List[BankAccount]]]= Future{(Failure(setUnimplementedError(nameOf(getBankAccounts _))), callContext)} - def getBankAccountsBalances(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]) : OBPReturnType[Box[AccountsBalances]]= Future{(Failure(setUnimplementedError), callContext)} + def getBankAccountsBalances(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]) : OBPReturnType[Box[AccountsBalances]]= Future{(Failure(setUnimplementedError(nameOf(getBankAccountsBalances _))), callContext)} - def getBankAccountBalances(bankIdAccountId: BankIdAccountId, callContext: Option[CallContext]) : OBPReturnType[Box[AccountBalances]]= Future{(Failure(setUnimplementedError), callContext)} + def getBankAccountBalances(bankIdAccountId: BankIdAccountId, callContext: Option[CallContext]) : OBPReturnType[Box[AccountBalances]]= Future{(Failure(setUnimplementedError(nameOf(getBankAccountBalances _))), callContext)} def getCoreBankAccountsLegacy(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]) : Box[(List[CoreAccount], Option[CallContext])] = - Failure(setUnimplementedError) + Failure(setUnimplementedError(nameOf(getCoreBankAccountsLegacy _))) def getCoreBankAccounts(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]) : Future[Box[(List[CoreAccount], Option[CallContext])]]= - Future{Failure(setUnimplementedError)} + Future{Failure(setUnimplementedError(nameOf(getCoreBankAccounts _)))} def getBankAccountsWithAttributes(bankId: BankId, queryParams: List[OBPQueryParam], callContext: Option[CallContext]): OBPReturnType[Box[List[FastFirehoseAccount]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getBankAccountsWithAttributes _))), callContext)} - def getBankSettlementAccounts(bankId: BankId, callContext: Option[CallContext]): OBPReturnType[Box[List[BankAccount]]] = Future{(Failure(setUnimplementedError), callContext)} + def getBankSettlementAccounts(bankId: BankId, callContext: Option[CallContext]): OBPReturnType[Box[List[BankAccount]]] = Future{(Failure(setUnimplementedError(nameOf(getBankSettlementAccounts _))), callContext)} - def getBankAccountsHeldLegacy(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]) : Box[List[AccountHeld]]= Failure(setUnimplementedError) - def getBankAccountsHeld(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]) : OBPReturnType[Box[List[AccountHeld]]]= Future {(Failure(setUnimplementedError), callContext)} - def getAccountsHeld(bankId: BankId, user: User, callContext: Option[CallContext]): OBPReturnType[Box[List[BankIdAccountId]]]= Future {(Failure(setUnimplementedError), callContext)} + def getBankAccountsHeldLegacy(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]) : Box[List[AccountHeld]]= Failure(setUnimplementedError(nameOf(getBankAccountsHeldLegacy _))) + def getBankAccountsHeld(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]) : OBPReturnType[Box[List[AccountHeld]]]= Future {(Failure(setUnimplementedError(nameOf(getBankAccountsHeld _))), callContext)} + def getAccountsHeld(bankId: BankId, user: User, callContext: Option[CallContext]): OBPReturnType[Box[List[BankIdAccountId]]]= Future {(Failure(setUnimplementedError(nameOf(getAccountsHeld _))), callContext)} - def checkBankAccountExistsLegacy(bankId : BankId, accountId : AccountId, callContext: Option[CallContext] = None) : Box[(BankAccount, Option[CallContext])]= Failure(setUnimplementedError) - def checkBankAccountExists(bankId : BankId, accountId : AccountId, callContext: Option[CallContext] = None) : OBPReturnType[Box[(BankAccount)]] = Future {(Failure(setUnimplementedError), callContext)} + def checkBankAccountExistsLegacy(bankId : BankId, accountId : AccountId, callContext: Option[CallContext] = None) : Box[(BankAccount, Option[CallContext])]= Failure(setUnimplementedError(nameOf(checkBankAccountExistsLegacy _))) + def checkBankAccountExists(bankId : BankId, accountId : AccountId, callContext: Option[CallContext] = None) : OBPReturnType[Box[(BankAccount)]] = Future {(Failure(setUnimplementedError(nameOf(checkBankAccountExists _))), callContext)} /** * This method is just return an empty account to AccountType. @@ -606,7 +599,7 @@ trait Connector extends MdcLoggable { * * @return empty bankAccount */ - def getEmptyBankAccount(): Box[BankAccount]= Failure(setUnimplementedError) + def getEmptyBankAccount(): Box[BankAccount]= Failure(setUnimplementedError(nameOf(getEmptyBankAccount _))) def getCounterpartyFromTransaction(bankId: BankId, accountId: AccountId, counterpartyId: String): Box[Counterparty] = { val transactions = getTransactionsLegacy(bankId, accountId ,None).map(_._1).toList.flatten @@ -632,24 +625,24 @@ trait Connector extends MdcLoggable { Full(counterparties.toSet.toList) //there are many transactions share the same Counterparty, so we need filter the same ones. } - def getCounterparty(thisBankId: BankId, thisAccountId: AccountId, couterpartyId: String): Box[Counterparty]= Failure(setUnimplementedError) + def getCounterparty(thisBankId: BankId, thisAccountId: AccountId, couterpartyId: String): Box[Counterparty]= Failure(setUnimplementedError(nameOf(getCounterparty _))) - def getCounterpartyTrait(bankId: BankId, accountId: AccountId, couterpartyId: String, callContext: Option[CallContext]): OBPReturnType[Box[CounterpartyTrait]]= Future{(Failure(setUnimplementedError), callContext)} + def getCounterpartyTrait(bankId: BankId, accountId: AccountId, couterpartyId: String, callContext: Option[CallContext]): OBPReturnType[Box[CounterpartyTrait]]= Future{(Failure(setUnimplementedError(nameOf(getCounterpartyTrait _))), callContext)} - def getCounterpartyByCounterpartyIdLegacy(counterpartyId: CounterpartyId, callContext: Option[CallContext]): Box[(CounterpartyTrait, Option[CallContext])]= Failure(setUnimplementedError) + def getCounterpartyByCounterpartyIdLegacy(counterpartyId: CounterpartyId, callContext: Option[CallContext]): Box[(CounterpartyTrait, Option[CallContext])]= Failure(setUnimplementedError(nameOf(getCounterpartyByCounterpartyIdLegacy _))) - def getCounterpartyByCounterpartyId(counterpartyId: CounterpartyId, callContext: Option[CallContext]): OBPReturnType[Box[CounterpartyTrait]] = Future{(Failure(setUnimplementedError), callContext)} + def getCounterpartyByCounterpartyId(counterpartyId: CounterpartyId, callContext: Option[CallContext]): OBPReturnType[Box[CounterpartyTrait]] = Future{(Failure(setUnimplementedError(nameOf(getCounterpartyByCounterpartyId _))), callContext)} - def deleteCounterpartyByCounterpartyId(counterpartyId: CounterpartyId, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError), callContext)} + def deleteCounterpartyByCounterpartyId(counterpartyId: CounterpartyId, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError(nameOf(deleteCounterpartyByCounterpartyId _))), callContext)} /** * get Counterparty by iban (OtherAccountRoutingAddress field in MappedCounterparty table) * This is a helper method that assumes OtherAccountRoutingScheme=IBAN */ - def getCounterpartyByIban(iban: String, callContext: Option[CallContext]) : OBPReturnType[Box[CounterpartyTrait]] = Future {(Failure(setUnimplementedError), callContext)} + def getCounterpartyByIban(iban: String, callContext: Option[CallContext]) : OBPReturnType[Box[CounterpartyTrait]] = Future {(Failure(setUnimplementedError(nameOf(getCounterpartyByIban _))), callContext)} - def getCounterpartyByIbanAndBankAccountId(iban: String, bankId: BankId, accountId: AccountId, callContext: Option[CallContext]) : OBPReturnType[Box[CounterpartyTrait]] = Future {(Failure(setUnimplementedError), callContext)} + def getCounterpartyByIbanAndBankAccountId(iban: String, bankId: BankId, accountId: AccountId, callContext: Option[CallContext]) : OBPReturnType[Box[CounterpartyTrait]] = Future {(Failure(setUnimplementedError(nameOf(getCounterpartyByIbanAndBankAccountId _))), callContext)} def getOrCreateCounterparty( name: String, @@ -668,7 +661,7 @@ trait Connector extends MdcLoggable { other_account_secondary_routing_scheme: String, other_account_secondary_routing_address: String, callContext: Option[CallContext] - ): OBPReturnType[Box[CounterpartyTrait]] = Future {(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[CounterpartyTrait]] = Future {(Failure(setUnimplementedError(nameOf(getOrCreateCounterparty _))), callContext)} def getCounterpartyByRoutings( otherBankRoutingScheme: String, @@ -680,35 +673,35 @@ trait Connector extends MdcLoggable { otherAccountSecondaryRoutingScheme: String, otherAccountSecondaryRoutingAddress: String, callContext: Option[CallContext] - ): OBPReturnType[Box[CounterpartyTrait]] = Future {(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[CounterpartyTrait]] = Future {(Failure(setUnimplementedError(nameOf(getCounterpartyByRoutings _))), callContext)} - def getCounterpartiesLegacy(thisBankId: BankId, thisAccountId: AccountId, viewId :ViewId, callContext: Option[CallContext] = None): Box[(List[CounterpartyTrait], Option[CallContext])]= Failure(setUnimplementedError) + def getCounterpartiesLegacy(thisBankId: BankId, thisAccountId: AccountId, viewId :ViewId, callContext: Option[CallContext] = None): Box[(List[CounterpartyTrait], Option[CallContext])]= Failure(setUnimplementedError(nameOf(getCounterpartiesLegacy _))) - def getCounterparties(thisBankId: BankId, thisAccountId: AccountId, viewId: ViewId, callContext: Option[CallContext] = None): OBPReturnType[Box[List[CounterpartyTrait]]] = Future {(Failure(setUnimplementedError), callContext)} + def getCounterparties(thisBankId: BankId, thisAccountId: AccountId, viewId: ViewId, callContext: Option[CallContext] = None): OBPReturnType[Box[List[CounterpartyTrait]]] = Future {(Failure(setUnimplementedError(nameOf(getCounterparties _))), callContext)} //TODO, here is a problem for return value `List[Transaction]`, this is a normal class, not a trait. It is a big class, // it contains thisAccount(BankAccount object) and otherAccount(Counterparty object) - def getTransactionsLegacy(bankId: BankId, accountId: AccountId, callContext: Option[CallContext], queryParams: List[OBPQueryParam] = Nil): Box[(List[Transaction], Option[CallContext])]= Failure(setUnimplementedError) + def getTransactionsLegacy(bankId: BankId, accountId: AccountId, callContext: Option[CallContext], queryParams: List[OBPQueryParam] = Nil): Box[(List[Transaction], Option[CallContext])]= Failure(setUnimplementedError(nameOf(getTransactionsLegacy _))) def getTransactions(bankId: BankId, accountId: AccountId, callContext: Option[CallContext], queryParams: List[OBPQueryParam] = Nil): OBPReturnType[Box[List[Transaction]]] = { val result: Box[(List[Transaction], Option[CallContext])] = getTransactionsLegacy(bankId, accountId, callContext, queryParams) Future(result.map(_._1), result.map(_._2).getOrElse(callContext)) } - def getTransactionsCore(bankId: BankId, accountId: AccountId, queryParams: List[OBPQueryParam] = Nil, callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionCore]]] = Future{(Failure(setUnimplementedError), callContext)} + def getTransactionsCore(bankId: BankId, accountId: AccountId, queryParams: List[OBPQueryParam] = Nil, callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionCore]]] = Future{(Failure(setUnimplementedError(nameOf(getTransactionsCore _))), callContext)} - def getTransactionLegacy(bankId: BankId, accountId : AccountId, transactionId : TransactionId, callContext: Option[CallContext] = None): Box[(Transaction, Option[CallContext])] = Failure(setUnimplementedError) + def getTransactionLegacy(bankId: BankId, accountId : AccountId, transactionId : TransactionId, callContext: Option[CallContext] = None): Box[(Transaction, Option[CallContext])] = Failure(setUnimplementedError(nameOf(getTransactionLegacy _))) - def getTransaction(bankId: BankId, accountId : AccountId, transactionId : TransactionId, callContext: Option[CallContext] = None): OBPReturnType[Box[Transaction]] = Future{(Failure(setUnimplementedError), callContext)} + def getTransaction(bankId: BankId, accountId : AccountId, transactionId : TransactionId, callContext: Option[CallContext] = None): OBPReturnType[Box[Transaction]] = Future{(Failure(setUnimplementedError(nameOf(getTransaction _))), callContext)} - def getPhysicalCardsForUser(user : User, callContext: Option[CallContext] = None) : OBPReturnType[Box[List[PhysicalCard]]] = Future{(Failure(setUnimplementedError), callContext)} + def getPhysicalCardsForUser(user : User, callContext: Option[CallContext] = None) : OBPReturnType[Box[List[PhysicalCard]]] = Future{(Failure(setUnimplementedError(nameOf(getPhysicalCardsForUser _))), callContext)} - def getPhysicalCardForBank(bankId: BankId, cardId: String, callContext:Option[CallContext]) : OBPReturnType[Box[PhysicalCardTrait]] = Future{(Failure(setUnimplementedError), callContext)} + def getPhysicalCardForBank(bankId: BankId, cardId: String, callContext:Option[CallContext]) : OBPReturnType[Box[PhysicalCardTrait]] = Future{(Failure(setUnimplementedError(nameOf(getPhysicalCardForBank _))), callContext)} - def getPhysicalCardByCardNumber(bankCardNumber: String, callContext:Option[CallContext]) : OBPReturnType[Box[PhysicalCardTrait]] = Future{(Failure(setUnimplementedError), callContext)} + def getPhysicalCardByCardNumber(bankCardNumber: String, callContext:Option[CallContext]) : OBPReturnType[Box[PhysicalCardTrait]] = Future{(Failure(setUnimplementedError(nameOf(getPhysicalCardByCardNumber _))), callContext)} - def deletePhysicalCardForBank(bankId: BankId, cardId: String, callContext:Option[CallContext]) : OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError), callContext)} + def deletePhysicalCardForBank(bankId: BankId, cardId: String, callContext:Option[CallContext]) : OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError(nameOf(deletePhysicalCardForBank _))), callContext)} - def getPhysicalCardsForBankLegacy(bank: Bank, user : User, queryParams: List[OBPQueryParam]) : Box[List[PhysicalCard]] = Failure(setUnimplementedError) - def getPhysicalCardsForBank(bank: Bank, user : User, queryParams: List[OBPQueryParam], callContext:Option[CallContext]) : OBPReturnType[Box[List[PhysicalCard]]] = Future{(Failure(setUnimplementedError), callContext)} + def getPhysicalCardsForBankLegacy(bank: Bank, user : User, queryParams: List[OBPQueryParam]) : Box[List[PhysicalCard]] = Failure(setUnimplementedError(nameOf(getPhysicalCardsForBankLegacy _))) + def getPhysicalCardsForBank(bank: Bank, user : User, queryParams: List[OBPQueryParam], callContext:Option[CallContext]) : OBPReturnType[Box[List[PhysicalCard]]] = Future{(Failure(setUnimplementedError(nameOf(getPhysicalCardsForBank _))), callContext)} def createPhysicalCardLegacy( bankCardNumber: String, @@ -734,7 +727,7 @@ trait Connector extends MdcLoggable { cvv: String, brand: String, callContext: Option[CallContext] - ): Box[PhysicalCard] = Failure(setUnimplementedError) + ): Box[PhysicalCard] = Failure(setUnimplementedError("createPhysicalCardLegacy")) def createPhysicalCard( bankCardNumber: String, @@ -760,7 +753,7 @@ trait Connector extends MdcLoggable { cvv: String, brand: String, callContext: Option[CallContext] - ): OBPReturnType[Box[PhysicalCard]] = Future{(Failure{setUnimplementedError}, callContext)} + ): OBPReturnType[Box[PhysicalCard]] = Future{(Failure{setUnimplementedError("createPhysicalCard")}, callContext)} def updatePhysicalCard( cardId: String, @@ -785,7 +778,7 @@ trait Connector extends MdcLoggable { posted: Option[CardPostedInfo], customerId: String, callContext: Option[CallContext] - ): OBPReturnType[Box[PhysicalCardTrait]] = Future{(Failure{setUnimplementedError}, callContext)} + ): OBPReturnType[Box[PhysicalCardTrait]] = Future{(Failure{setUnimplementedError(nameOf(updatePhysicalCard _))}, callContext)} //Payments api: just return Failure("not supported") from makePaymentImpl if you don't want to implement it /** @@ -852,18 +845,18 @@ trait Connector extends MdcLoggable { description: String, transactionRequestType: TransactionRequestType, chargePolicy: String, - callContext: Option[CallContext]): OBPReturnType[Box[TransactionId]]= Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[TransactionId]]= Future{(Failure(setUnimplementedError(nameOf(makePaymentv210 _))), callContext)} def saveDoubleEntryBookTransaction(doubleEntryTransaction: DoubleEntryTransaction, - callContext: Option[CallContext]): OBPReturnType[Box[DoubleEntryTransaction]]= Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[DoubleEntryTransaction]]= Future{(Failure(setUnimplementedError(nameOf(saveDoubleEntryBookTransaction _))), callContext)} def getDoubleEntryBookTransaction(bankId: BankId, accountId: AccountId, transactionId: TransactionId, - callContext: Option[CallContext]): OBPReturnType[Box[DoubleEntryTransaction]]= Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[DoubleEntryTransaction]]= Future{(Failure(setUnimplementedError(nameOf(saveDoubleEntryBookTransaction _))), callContext)} def getBalancingTransaction(transactionId: TransactionId, - callContext: Option[CallContext]): OBPReturnType[Box[DoubleEntryTransaction]]= Future{(Failure(setUnimplementedError), callContext)} - - protected def makePaymentImpl(fromAccount: BankAccount, toAccount: BankAccount, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, amt: BigDecimal, description: String, transactionRequestType: TransactionRequestType, chargePolicy: String): Box[TransactionId]= Failure(setUnimplementedError) + callContext: Option[CallContext]): OBPReturnType[Box[DoubleEntryTransaction]]= Future{(Failure(setUnimplementedError(nameOf(getBalancingTransaction _))), callContext)} + protected def makePaymentImpl(fromAccount: BankAccount, toAccount: BankAccount, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, amt: BigDecimal, description: String, transactionRequestType: TransactionRequestType, chargePolicy: String): Box[TransactionId]= Failure(setUnimplementedError(nameOf(makePaymentImpl _))) + /* @@ -1176,17 +1169,32 @@ trait Connector extends MdcLoggable { challengeType: Option[String], scaMethod: Option[SCA], reasons: Option[List[TransactionRequestReason]], - paymentService: Option[String], - berlinGroupPayments: Option[BerlinGroupTransactionRequestCommonBodyJson], - callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = Future{(Failure(setUnimplementedError(nameOf(createTransactionRequestv400 _))), callContext)} + + def createTransactionRequestSepaCreditTransfersBGV1( + initiator: User, + paymentServiceType: PaymentServiceTypes, + transactionRequestType: TransactionRequestTypes, + transactionRequestBody: SepaCreditTransfersBerlinGroupV13, + callContext: Option[CallContext] + ): OBPReturnType[Box[TransactionRequestBGV1]] = Future{(Failure(setUnimplementedError(nameOf(createTransactionRequestSepaCreditTransfersBGV1 _))), callContext)} + + def createTransactionRequestPeriodicSepaCreditTransfersBGV1( + initiator: User, + paymentServiceType: PaymentServiceTypes, + transactionRequestType: TransactionRequestTypes, + transactionRequestBody: PeriodicSepaCreditTransfersBerlinGroupV13, + callContext: Option[CallContext] + ): OBPReturnType[Box[TransactionRequestBGV1]] = Future{(Failure(setUnimplementedError(nameOf(createTransactionRequestPeriodicSepaCreditTransfersBGV1 _))), callContext)} + //placeholder for various connector methods that overwrite methods like these, does the actual data access protected def createTransactionRequestImpl(transactionRequestId: TransactionRequestId, transactionRequestType: TransactionRequestType, fromAccount : BankAccount, counterparty : BankAccount, body: TransactionRequestBody, - status: String, charge: TransactionRequestCharge) : Box[TransactionRequest] = Failure(setUnimplementedError) + status: String, charge: TransactionRequestCharge) : Box[TransactionRequest] = Failure(setUnimplementedError(nameOf(createTransactionRequestImpl _))) def notifyTransactionRequest(fromAccount: BankAccount, toAccount: BankAccount, transactionRequest: TransactionRequest, callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequestStatusValue]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(notifyTransactionRequest _))), callContext)} def saveTransactionRequestTransaction(transactionRequestId: TransactionRequestId, transactionId: TransactionId): Box[Boolean] = { //put connector agnostic logic here if necessary @@ -1240,7 +1248,7 @@ trait Connector extends MdcLoggable { } - protected def getTransactionRequestStatusesImpl() : Box[TransactionRequestStatus] = Failure(setUnimplementedError) + protected def getTransactionRequestStatusesImpl() : Box[TransactionRequestStatus] = Failure(setUnimplementedError(nameOf(getTransactionRequestStatusesImpl _))) protected def getTransactionRequestsImpl(fromAccount : BankAccount) : Box[List[TransactionRequest]] = TransactionRequests.transactionRequestProvider.vend.getTransactionRequests(fromAccount.bankId, fromAccount.accountId) @@ -1490,7 +1498,7 @@ trait Connector extends MdcLoggable { branchId: String, accountRoutings: List[AccountRouting], callContext: Option[CallContext] - ): OBPReturnType[Box[BankAccount]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[BankAccount]] = Future{(Failure(setUnimplementedError(nameOf(addBankAccount _))), callContext)} def updateBankAccount( @@ -1501,7 +1509,7 @@ trait Connector extends MdcLoggable { branchId: String, accountRoutings: List[AccountRouting], callContext: Option[CallContext] - ): OBPReturnType[Box[BankAccount]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[BankAccount]] = Future{(Failure(setUnimplementedError(nameOf(updateBankAccount _))), callContext)} //creates a bank account (if it doesn't exist) and creates a bank (if it doesn't exist) @@ -1516,7 +1524,7 @@ trait Connector extends MdcLoggable { branchId: String, accountRoutingScheme: String, //added field in V220 accountRoutingAddress: String //added field in V220 - ): Box[(Bank, BankAccount)] = Failure(setUnimplementedError) + ): Box[(Bank, BankAccount)] = Failure(setUnimplementedError(nameOf(createBankAndAccount _))) //generates an unused account number and then creates the sandbox account using that number //TODO, this is new style method, it return future, but do not use it yet. only for messageDoc now. @@ -1531,7 +1539,7 @@ trait Connector extends MdcLoggable { branchId: String, accountRoutings: List[AccountRouting], callContext: Option[CallContext] - ): OBPReturnType[Box[BankAccount]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[BankAccount]] = Future{(Failure(setUnimplementedError(nameOf(createBankAccount _))), callContext)} //generates an unused account number and then creates the sandbox account using that number @deprecated("This return Box, not a future, try to use @createBankAccount instead. ","10-05-2019") @@ -1587,7 +1595,7 @@ trait Connector extends MdcLoggable { accountHolderName: String, branchId: String, accountRoutings: List[AccountRouting] - ): Box[BankAccount] = Failure(setUnimplementedError) + ): Box[BankAccount] = Failure(setUnimplementedError(nameOf(createSandboxBankAccount _))) /** * A sepecil method: @@ -1616,30 +1624,30 @@ trait Connector extends MdcLoggable { } //for sandbox use -> allows us to check if we can generate a new test account with the given number - def accountExists(bankId : BankId, accountNumber : String) : Box[Boolean] = Failure(setUnimplementedError) + def accountExists(bankId : BankId, accountNumber : String) : Box[Boolean] = Failure(setUnimplementedError(nameOf(accountExists _))) //remove an account and associated transactions - def removeAccount(bankId: BankId, accountId: AccountId) : Box[Boolean] = Failure(setUnimplementedError) + def removeAccount(bankId: BankId, accountId: AccountId) : Box[Boolean] = Failure(setUnimplementedError(nameOf(removeAccount _))) //used by transaction import api call to check for duplicates //the implementation is responsible for dealing with the amount as a string - def getMatchingTransactionCount(bankNationalIdentifier : String, accountNumber : String, amount : String, completed : Date, otherAccountHolder : String) : Box[Int] = Failure(setUnimplementedError) - def createImportedTransaction(transaction: ImporterTransaction) : Box[Transaction] = Failure(setUnimplementedError) - def updateAccountBalance(bankId : BankId, accountId : AccountId, newBalance : BigDecimal) : Box[Boolean] = Failure(setUnimplementedError) - def setBankAccountLastUpdated(bankNationalIdentifier: String, accountNumber : String, updateDate: Date) : Box[Boolean] = Failure(setUnimplementedError) + def getMatchingTransactionCount(bankNationalIdentifier : String, accountNumber : String, amount : String, completed : Date, otherAccountHolder : String) : Box[Int] = Failure(setUnimplementedError(nameOf(getMatchingTransactionCount _))) + def createImportedTransaction(transaction: ImporterTransaction) : Box[Transaction] = Failure(setUnimplementedError(nameOf(createImportedTransaction _))) + def updateAccountBalance(bankId : BankId, accountId : AccountId, newBalance : BigDecimal) : Box[Boolean] = Failure(setUnimplementedError(nameOf(updateAccountBalance _))) + def setBankAccountLastUpdated(bankNationalIdentifier: String, accountNumber : String, updateDate: Date) : Box[Boolean] = Failure(setUnimplementedError(nameOf(setBankAccountLastUpdated _))) - def updateAccountLabel(bankId: BankId, accountId: AccountId, label: String): Box[Boolean] = Failure(setUnimplementedError) + def updateAccountLabel(bankId: BankId, accountId: AccountId, label: String): Box[Boolean] = Failure(setUnimplementedError(nameOf(updateAccountLabel _))) - def updateAccount(bankId: BankId, accountId: AccountId, label: String): Box[Boolean] = Failure(setUnimplementedError) + def updateAccount(bankId: BankId, accountId: AccountId, label: String): Box[Boolean] = Failure(setUnimplementedError(nameOf(updateAccount _))) - def getProducts(bankId : BankId, params: List[GetProductsParam] = Nil) : Box[List[Product]] = Failure(setUnimplementedError) + def getProducts(bankId : BankId, params: List[GetProductsParam] = Nil) : Box[List[Product]] = Failure(setUnimplementedError(nameOf(getProducts _))) - def getProduct(bankId : BankId, productCode : ProductCode) : Box[Product] = Failure(setUnimplementedError) + def getProduct(bankId : BankId, productCode : ProductCode) : Box[Product] = Failure(setUnimplementedError(nameOf(getProduct _))) //Note: this is a temporary way for compatibility //It is better to create the case class for all the connector methods - def createOrUpdateBranch(branch: BranchT): Box[BranchT] = Failure(setUnimplementedError) + def createOrUpdateBranch(branch: BranchT): Box[BranchT] = Failure(setUnimplementedError(nameOf(createOrUpdateBranch _))) def createOrUpdateBank( bankId: String, @@ -1651,34 +1659,34 @@ trait Connector extends MdcLoggable { national_identifier: String, bankRoutingScheme: String, bankRoutingAddress: String - ): Box[Bank] = Failure(setUnimplementedError) + ): Box[Bank] = Failure(setUnimplementedError(nameOf(createOrUpdateBank _))) - def createOrUpdateAtmLegacy(atm: AtmT): Box[AtmT] = Failure(setUnimplementedError) + def createOrUpdateAtmLegacy(atm: AtmT): Box[AtmT] = Failure(setUnimplementedError(nameOf(createOrUpdateAtmLegacy _))) - def createOrUpdateAtm(atm: AtmT, callContext: Option[CallContext]): OBPReturnType[Box[AtmT]] = Future{Failure(setUnimplementedError)} + def createOrUpdateAtm(atm: AtmT, callContext: Option[CallContext]): OBPReturnType[Box[AtmT]] = Future{Failure(setUnimplementedError(nameOf(createOrUpdateAtm _)))} - def deleteAtm(atm: AtmT, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = Future{Failure(setUnimplementedError)} + def deleteAtm(atm: AtmT, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = Future{Failure(setUnimplementedError(nameOf(deleteAtm _)))} - def createSystemLevelEndpointTag(operationId:String, tagName:String, callContext: Option[CallContext]): OBPReturnType[Box[EndpointTagT]] = Future{Failure(setUnimplementedError)} + def createSystemLevelEndpointTag(operationId:String, tagName:String, callContext: Option[CallContext]): OBPReturnType[Box[EndpointTagT]] = Future{Failure(setUnimplementedError(nameOf(createSystemLevelEndpointTag _)))} - def updateSystemLevelEndpointTag(endpointTagId:String, operationId:String, tagName:String, callContext: Option[CallContext]): OBPReturnType[Box[EndpointTagT]] = Future{Failure(setUnimplementedError)} + def updateSystemLevelEndpointTag(endpointTagId:String, operationId:String, tagName:String, callContext: Option[CallContext]): OBPReturnType[Box[EndpointTagT]] = Future{Failure(setUnimplementedError(nameOf(updateSystemLevelEndpointTag _)))} - def createBankLevelEndpointTag(bankId:String, operationId:String, tagName:String, callContext: Option[CallContext]): OBPReturnType[Box[EndpointTagT]] = Future{Failure(setUnimplementedError)} + def createBankLevelEndpointTag(bankId:String, operationId:String, tagName:String, callContext: Option[CallContext]): OBPReturnType[Box[EndpointTagT]] = Future{Failure(setUnimplementedError(nameOf(createBankLevelEndpointTag _)))} - def updateBankLevelEndpointTag(bankId:String, endpointTagId:String, operationId:String, tagName:String, callContext: Option[CallContext]): OBPReturnType[Box[EndpointTagT]] = Future{Failure(setUnimplementedError)} + def updateBankLevelEndpointTag(bankId:String, endpointTagId:String, operationId:String, tagName:String, callContext: Option[CallContext]): OBPReturnType[Box[EndpointTagT]] = Future{Failure(setUnimplementedError(nameOf(updateBankLevelEndpointTag _)))} - def getSystemLevelEndpointTag(operationId: String, tagName:String, callContext: Option[CallContext]): OBPReturnType[Box[EndpointTagT]] = Future{Failure(setUnimplementedError)} + def getSystemLevelEndpointTag(operationId: String, tagName:String, callContext: Option[CallContext]): OBPReturnType[Box[EndpointTagT]] = Future{Failure(setUnimplementedError(nameOf(getSystemLevelEndpointTag _)))} - def getBankLevelEndpointTag(bankId: String, operationId: String, tagName:String, callContext: Option[CallContext]): OBPReturnType[Box[EndpointTagT]] = Future{Failure(setUnimplementedError)} + def getBankLevelEndpointTag(bankId: String, operationId: String, tagName:String, callContext: Option[CallContext]): OBPReturnType[Box[EndpointTagT]] = Future{Failure(setUnimplementedError(nameOf(getBankLevelEndpointTag _)))} - def getEndpointTagById(endpointTagId : String, callContext: Option[CallContext]) : OBPReturnType[Box[EndpointTagT]] = Future(Failure(setUnimplementedError)) + def getEndpointTagById(endpointTagId : String, callContext: Option[CallContext]) : OBPReturnType[Box[EndpointTagT]] = Future(Failure(setUnimplementedError(nameOf(getEndpointTagById _)))) - def deleteEndpointTag(endpointTagId : String, callContext: Option[CallContext]) : OBPReturnType[Box[Boolean]] = Future(Failure(setUnimplementedError)) + def deleteEndpointTag(endpointTagId : String, callContext: Option[CallContext]) : OBPReturnType[Box[Boolean]] = Future(Failure(setUnimplementedError(nameOf(deleteEndpointTag _)))) - def getSystemLevelEndpointTags(operationId : String, callContext: Option[CallContext]) : OBPReturnType[Box[List[EndpointTagT]]] = Future(Failure(setUnimplementedError)) + def getSystemLevelEndpointTags(operationId : String, callContext: Option[CallContext]) : OBPReturnType[Box[List[EndpointTagT]]] = Future(Failure(setUnimplementedError(nameOf(getSystemLevelEndpointTags _)))) - def getBankLevelEndpointTags(bankId:String, operationId : String, callContext: Option[CallContext]) : OBPReturnType[Box[List[EndpointTagT]]] = Future(Failure(setUnimplementedError)) + def getBankLevelEndpointTags(bankId:String, operationId : String, callContext: Option[CallContext]) : OBPReturnType[Box[List[EndpointTagT]]] = Future(Failure(setUnimplementedError(nameOf(getBankLevelEndpointTags _)))) def createOrUpdateProduct( bankId : String, @@ -1694,7 +1702,7 @@ trait Connector extends MdcLoggable { description : String, metaLicenceId : String, metaLicenceName : String - ): Box[Product] = Failure(setUnimplementedError) + ): Box[Product] = Failure(setUnimplementedError(nameOf(createOrUpdateProduct _))) def createOrUpdateProductFee( bankId: BankId, @@ -1708,23 +1716,23 @@ trait Connector extends MdcLoggable { frequency: String, `type`: String, callContext: Option[CallContext] - ): OBPReturnType[Box[ProductFeeTrait]]= Future(Failure(setUnimplementedError)) + ): OBPReturnType[Box[ProductFeeTrait]]= Future(Failure(setUnimplementedError(nameOf(createOrUpdateProductFee _)))) def getProductFeesFromProvider( bankId: BankId, productCode: ProductCode, callContext: Option[CallContext] - ): OBPReturnType[Box[List[ProductFeeTrait]]] = Future(Failure(setUnimplementedError)) + ): OBPReturnType[Box[List[ProductFeeTrait]]] = Future(Failure(setUnimplementedError(nameOf(getProductFeesFromProvider _)))) def getProductFeeById( productFeeId: String, callContext: Option[CallContext] - ): OBPReturnType[Box[ProductFeeTrait]] = Future(Failure(setUnimplementedError)) + ): OBPReturnType[Box[ProductFeeTrait]] = Future(Failure(setUnimplementedError(nameOf(getProductFeeById _)))) def deleteProductFee( productFeeId: String, callContext: Option[CallContext] - ): OBPReturnType[Box[Boolean]] = Future(Failure(setUnimplementedError)) + ): OBPReturnType[Box[Boolean]] = Future(Failure(setUnimplementedError(nameOf(deleteProductFee _)))) def createOrUpdateFXRate( @@ -1734,54 +1742,54 @@ trait Connector extends MdcLoggable { conversionValue: Double, inverseConversionValue: Double, effectiveDate: Date - ): Box[FXRate] = Failure(setUnimplementedError) + ): Box[FXRate] = Failure(setUnimplementedError(nameOf(createOrUpdateFXRate _))) - def getBranchLegacy(bankId : BankId, branchId: BranchId) : Box[BranchT] = Failure(setUnimplementedError) + def getBranchLegacy(bankId : BankId, branchId: BranchId) : Box[BranchT] = Failure(setUnimplementedError(nameOf(getBranchLegacy _))) def getBranch(bankId : BankId, branchId: BranchId, callContext: Option[CallContext]) : Future[Box[(BranchT, Option[CallContext])]] = Future { - Failure(setUnimplementedError) + Failure(setUnimplementedError(nameOf(getBranch _))) } def getBranches(bankId: BankId, callContext: Option[CallContext], queryParams: List[OBPQueryParam] = Nil): Future[Box[(List[BranchT], Option[CallContext])]] = Future { - Failure(setUnimplementedError) + Failure(setUnimplementedError(nameOf(getBranches _))) } - def getAtmLegacy(bankId : BankId, atmId: AtmId) : Box[AtmT] = Failure(setUnimplementedError) + def getAtmLegacy(bankId : BankId, atmId: AtmId) : Box[AtmT] = Failure(setUnimplementedError(nameOf(getAtmLegacy _))) def getAtm(bankId : BankId, atmId: AtmId, callContext: Option[CallContext]) : Future[Box[(AtmT, Option[CallContext])]] = Future { - Failure(setUnimplementedError) + Failure(setUnimplementedError(nameOf(getAtm _))) } def updateAtmSupportedLanguages(bankId : BankId, atmId: AtmId, supportedLanguages: List[String], callContext: Option[CallContext]) : Future[Box[(AtmT, Option[CallContext])]] = Future { - Failure(setUnimplementedError) + Failure(setUnimplementedError(nameOf(updateAtmSupportedLanguages _))) } def updateAtmSupportedCurrencies(bankId : BankId, atmId: AtmId, supportedCurrencies: List[String], callContext: Option[CallContext]) : Future[Box[(AtmT, Option[CallContext])]] = Future { - Failure(setUnimplementedError) + Failure(setUnimplementedError(nameOf(updateAtmSupportedCurrencies _))) } def updateAtmAccessibilityFeatures(bankId : BankId, atmId: AtmId, accessibilityFeatures: List[String], callContext: Option[CallContext]) : Future[Box[(AtmT, Option[CallContext])]] = Future { - Failure(setUnimplementedError) + Failure(setUnimplementedError(nameOf(updateAtmAccessibilityFeatures _))) } def updateAtmServices(bankId : BankId, atmId: AtmId, supportedCurrencies: List[String], callContext: Option[CallContext]) : Future[Box[(AtmT, Option[CallContext])]] = Future { - Failure(setUnimplementedError) + Failure(setUnimplementedError(nameOf(updateAtmServices _))) } def updateAtmNotes(bankId : BankId, atmId: AtmId, notes: List[String], callContext: Option[CallContext]) : Future[Box[(AtmT, Option[CallContext])]] = Future { - Failure(setUnimplementedError) + Failure(setUnimplementedError(nameOf(updateAtmNotes _))) } def updateAtmLocationCategories(bankId : BankId, atmId: AtmId, locationCategories: List[String], callContext: Option[CallContext]) : Future[Box[(AtmT, Option[CallContext])]] = Future { - Failure(setUnimplementedError) + Failure(setUnimplementedError(nameOf(updateAtmLocationCategories _))) } def getAtms(bankId: BankId, callContext: Option[CallContext], queryParams: List[OBPQueryParam] = Nil): Future[Box[(List[AtmT], Option[CallContext])]] = Future { - Failure(setUnimplementedError) + Failure(setUnimplementedError(nameOf(getAtms _))) } def getAllAtms(callContext: Option[CallContext], queryParams: List[OBPQueryParam] = Nil): Future[Box[(List[AtmT], Option[CallContext])]] = Future { - Failure(setUnimplementedError) + Failure(setUnimplementedError(nameOf(getAllAtms _))) } //This method is only existing in mapper @@ -1835,9 +1843,9 @@ trait Connector extends MdcLoggable { // def resetBadLoginAttempts(username:String):Unit - def getCurrentCurrencies(bankId: BankId, callContext: Option[CallContext]): OBPReturnType[Box[List[String]]] = Future{Failure(setUnimplementedError)} + def getCurrentCurrencies(bankId: BankId, callContext: Option[CallContext]): OBPReturnType[Box[List[String]]] = Future{Failure(setUnimplementedError(nameOf(getCurrentCurrencies _)))} - def getCurrentFxRate(bankId: BankId, fromCurrencyCode: String, toCurrencyCode: String): Box[FXRate] = Failure(setUnimplementedError) + def getCurrentFxRate(bankId: BankId, fromCurrencyCode: String, toCurrencyCode: String): Box[FXRate] = Failure(setUnimplementedError(nameOf(getCurrentFxRate _))) def getCurrentFxRateCached(bankId: BankId, fromCurrencyCode: String, toCurrencyCode: String): Box[FXRate] = { /** * Please note that "var cacheKey = (randomUUID().toString, randomUUID().toString, randomUUID().toString)" @@ -1856,14 +1864,14 @@ trait Connector extends MdcLoggable { /** * get transaction request type charge specified by: bankId, accountId, viewId, transactionRequestType. */ - def getTransactionRequestTypeCharge(bankId: BankId, accountId: AccountId, viewId: ViewId, transactionRequestType: TransactionRequestType): Box[TransactionRequestTypeCharge] = Failure(setUnimplementedError) + def getTransactionRequestTypeCharge(bankId: BankId, accountId: AccountId, viewId: ViewId, transactionRequestType: TransactionRequestType): Box[TransactionRequestTypeCharge] = Failure(setUnimplementedError(nameOf(getTransactionRequestTypeCharge _))) def createTransactionAfterChallengev300( initiator: User, fromAccount: BankAccount, transReqId: TransactionRequestId, transactionRequestType: TransactionRequestType, - callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = Future{(Failure(setUnimplementedError(nameOf(createTransactionAfterChallengev300 _))), callContext)} def makePaymentv300( initiator: User, @@ -1873,7 +1881,7 @@ trait Connector extends MdcLoggable { transactionRequestCommonBody: TransactionRequestCommonBodyJSON, transactionRequestType: TransactionRequestType, chargePolicy: String, - callContext: Option[CallContext]): Future[Box[(TransactionId, Option[CallContext])]] = Future{Failure(setUnimplementedError)} + callContext: Option[CallContext]): Future[Box[(TransactionId, Option[CallContext])]] = Future{Failure(setUnimplementedError(nameOf(makePaymentv300 _)))} def createTransactionRequestv300( initiator: User, @@ -1885,17 +1893,17 @@ trait Connector extends MdcLoggable { transactionRequestCommonBody: TransactionRequestCommonBodyJSON, detailsPlain: String, chargePolicy: String, - callContext: Option[CallContext]): Future[Box[(TransactionRequest, Option[CallContext])]] = Future{Failure(setUnimplementedError)} + callContext: Option[CallContext]): Future[Box[(TransactionRequest, Option[CallContext])]] = Future{Failure(setUnimplementedError(nameOf(createTransactionRequestv300 _)))} def makePaymentV400(transactionRequest: TransactionRequest, reasons: Option[List[TransactionRequestReason]], callContext: Option[CallContext]): Future[Box[(TransactionId, Option[CallContext])]] = Future { - Failure(setUnimplementedError) + Failure(setUnimplementedError(nameOf(makePaymentV400 _))) } def cancelPaymentV400(transactionId: TransactionId, callContext: Option[CallContext]): OBPReturnType[Box[CancelPayment]] = Future { - (Failure(setUnimplementedError), callContext) + (Failure(setUnimplementedError(nameOf(cancelPaymentV400 _))), callContext) } @@ -1933,7 +1941,7 @@ trait Connector extends MdcLoggable { otherBranchRoutingAddress: String, isBeneficiary:Boolean, bespoke: List[CounterpartyBespoke], - callContext: Option[CallContext] = None): Box[(CounterpartyTrait, Option[CallContext])] = Failure(setUnimplementedError) + callContext: Option[CallContext] = None): Box[(CounterpartyTrait, Option[CallContext])] = Failure(setUnimplementedError(nameOf(createCounterparty _))) def checkCounterpartyExists( name: String, @@ -1941,13 +1949,13 @@ trait Connector extends MdcLoggable { thisAccountId: String, thisViewId: String, callContext: Option[CallContext] - ): OBPReturnType[Box[CounterpartyTrait]]= Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[CounterpartyTrait]]= Future{(Failure(setUnimplementedError(nameOf(checkCounterpartyExists _))), callContext)} def checkCustomerNumberAvailable( bankId: BankId, customerNumber: String, callContext: Option[CallContext] - ): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError(nameOf(checkCustomerNumberAvailable _))), callContext)} def createCustomer( bankId: BankId, @@ -1970,7 +1978,7 @@ trait Connector extends MdcLoggable { branchId: String, nameSuffix: String, callContext: Option[CallContext], - ): OBPReturnType[Box[Customer]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[Customer]] = Future{(Failure(setUnimplementedError(nameOf(createCustomer _))), callContext)} def createCustomerC2( bankId: BankId, @@ -1994,21 +2002,21 @@ trait Connector extends MdcLoggable { branchId: String, nameSuffix: String, callContext: Option[CallContext], - ): OBPReturnType[Box[Customer]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[Customer]] = Future{(Failure(setUnimplementedError(nameOf(createCustomerC2 _))), callContext)} def updateCustomerScaData(customerId: String, mobileNumber: Option[String], email: Option[String], customerNumber: Option[String], callContext: Option[CallContext]): OBPReturnType[Box[Customer]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(updateCustomerScaData _))), callContext)} def updateCustomerCreditData(customerId: String, creditRating: Option[String], creditSource: Option[String], creditLimit: Option[AmountOfMoney], callContext: Option[CallContext]): OBPReturnType[Box[Customer]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(updateCustomerCreditData _))), callContext)} def updateCustomerGeneralData(customerId: String, legalName: Option[String], @@ -2023,20 +2031,20 @@ trait Connector extends MdcLoggable { nameSuffix: Option[String], callContext: Option[CallContext]): OBPReturnType[Box[Customer]] = Future { - (Failure(setUnimplementedError), callContext) + (Failure(setUnimplementedError(nameOf(updateCustomerGeneralData _))), callContext) } - def getCustomersByUserId(userId: String, callContext: Option[CallContext]): Future[Box[(List[Customer],Option[CallContext])]] = Future{Failure(setUnimplementedError)} + def getCustomersByUserId(userId: String, callContext: Option[CallContext]): Future[Box[(List[Customer],Option[CallContext])]] = Future{Failure(setUnimplementedError(nameOf(getCustomersByUserId _)))} - def getCustomerByCustomerIdLegacy(customerId: String, callContext: Option[CallContext]): Box[(Customer,Option[CallContext])]= Failure(setUnimplementedError) + def getCustomerByCustomerIdLegacy(customerId: String, callContext: Option[CallContext]): Box[(Customer,Option[CallContext])]= Failure(setUnimplementedError(nameOf(getCustomerByCustomerIdLegacy _))) - def getCustomerByCustomerId(customerId: String, callContext: Option[CallContext]): Future[Box[(Customer,Option[CallContext])]] = Future{Failure(setUnimplementedError)} + def getCustomerByCustomerId(customerId: String, callContext: Option[CallContext]): Future[Box[(Customer,Option[CallContext])]] = Future{Failure(setUnimplementedError(nameOf(getCustomerByCustomerId _)))} def getCustomerByCustomerNumber(customerNumber: String, bankId : BankId, callContext: Option[CallContext]): Future[Box[(Customer, Option[CallContext])]] = - Future{Failure(setUnimplementedError)} + Future{Failure(setUnimplementedError(nameOf(getCustomerByCustomerNumber _)))} def getCustomerAddress(customerId : String, callContext: Option[CallContext]): OBPReturnType[Box[List[CustomerAddress]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getCustomerAddress _))), callContext)} def createCustomerAddress(customerId: String, line1: String, @@ -2049,7 +2057,7 @@ trait Connector extends MdcLoggable { countryCode: String, tags: String, status: String, - callContext: Option[CallContext]): OBPReturnType[Box[CustomerAddress]] = Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[CustomerAddress]] = Future{(Failure(setUnimplementedError(nameOf(createCustomerAddress _))), callContext)} def updateCustomerAddress(customerAddressId: String, line1: String, @@ -2062,33 +2070,33 @@ trait Connector extends MdcLoggable { countryCode: String, tags: String, status: String, - callContext: Option[CallContext]): OBPReturnType[Box[CustomerAddress]] = Future{(Failure(setUnimplementedError), callContext)} - def deleteCustomerAddress(customerAddressId : String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[CustomerAddress]] = Future{(Failure(setUnimplementedError(nameOf(updateCustomerAddress _))), callContext)} + def deleteCustomerAddress(customerAddressId : String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError(nameOf(deleteCustomerAddress _))), callContext)} - def createTaxResidence(customerId : String, domain: String, taxNumber: String, callContext: Option[CallContext]): OBPReturnType[Box[TaxResidence]] = Future{(Failure(setUnimplementedError), callContext)} + def createTaxResidence(customerId : String, domain: String, taxNumber: String, callContext: Option[CallContext]): OBPReturnType[Box[TaxResidence]] = Future{(Failure(setUnimplementedError(nameOf(createTaxResidence _))), callContext)} - def getTaxResidence(customerId : String, callContext: Option[CallContext]): OBPReturnType[Box[List[TaxResidence]]] = Future{(Failure(setUnimplementedError), callContext)} + def getTaxResidence(customerId : String, callContext: Option[CallContext]): OBPReturnType[Box[List[TaxResidence]]] = Future{(Failure(setUnimplementedError(nameOf(getTaxResidence _))), callContext)} - def deleteTaxResidence(taxResourceId : String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError), callContext)} + def deleteTaxResidence(taxResourceId : String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError(nameOf(deleteTaxResidence _))), callContext)} - def getCustomersAtAllBanks(callContext: Option[CallContext], queryParams: List[OBPQueryParam] = Nil): OBPReturnType[Box[List[Customer]]] = Future{Failure(setUnimplementedError)} + def getCustomersAtAllBanks(callContext: Option[CallContext], queryParams: List[OBPQueryParam] = Nil): OBPReturnType[Box[List[Customer]]] = Future{Failure(setUnimplementedError(nameOf(getCustomersAtAllBanks _)))} - def getCustomers(bankId : BankId, callContext: Option[CallContext], queryParams: List[OBPQueryParam] = Nil): Future[Box[List[Customer]]] = Future{Failure(setUnimplementedError)} + def getCustomers(bankId : BankId, callContext: Option[CallContext], queryParams: List[OBPQueryParam] = Nil): Future[Box[List[Customer]]] = Future{Failure(setUnimplementedError(nameOf(getCustomers _)))} - def getCustomersByCustomerPhoneNumber(bankId : BankId, phoneNumber: String, callContext: Option[CallContext]): OBPReturnType[Box[List[Customer]]] = Future{(Failure(setUnimplementedError), callContext)} + def getCustomersByCustomerPhoneNumber(bankId : BankId, phoneNumber: String, callContext: Option[CallContext]): OBPReturnType[Box[List[Customer]]] = Future{(Failure(setUnimplementedError(nameOf(getCustomersByCustomerPhoneNumber _))), callContext)} def getCheckbookOrders( bankId: String, accountId: String, callContext: Option[CallContext] - ): Future[Box[(CheckbookOrdersJson, Option[CallContext])]] = Future{Failure(setUnimplementedError)} + ): Future[Box[(CheckbookOrdersJson, Option[CallContext])]] = Future{Failure(setUnimplementedError(nameOf(getCheckbookOrders _)))} def getStatusOfCreditCardOrder( bankId: String, accountId: String, callContext: Option[CallContext] - ): Future[Box[(List[CardObjectJson], Option[CallContext])]] = Future{Failure(setUnimplementedError)} + ): Future[Box[(List[CardObjectJson], Option[CallContext])]] = Future{Failure(setUnimplementedError(nameOf(getStatusOfCreditCardOrder _)))} //This method is normally used in obp side, so it has the default mapped implementation def createUserAuthContext(userId: String, @@ -2135,7 +2143,7 @@ trait Connector extends MdcLoggable { value: String, isActive: Option[Boolean], callContext: Option[CallContext] - ): OBPReturnType[Box[ProductAttribute]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[ProductAttribute]] = Future{(Failure(setUnimplementedError(nameOf(createOrUpdateProductAttribute _))), callContext)} def createOrUpdateBankAttribute(bankId: BankId, bankAttributeId: Option[String], @@ -2144,7 +2152,7 @@ trait Connector extends MdcLoggable { value: String, isActive: Option[Boolean], callContext: Option[CallContext] - ): OBPReturnType[Box[BankAttribute]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[BankAttribute]] = Future{(Failure(setUnimplementedError(nameOf(createOrUpdateBankAttribute _))), callContext)} def createOrUpdateAtmAttribute(bankId: BankId, atmId: AtmId, @@ -2154,54 +2162,54 @@ trait Connector extends MdcLoggable { value: String, isActive: Option[Boolean], callContext: Option[CallContext] - ): OBPReturnType[Box[AtmAttribute]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[AtmAttribute]] = Future{(Failure(setUnimplementedError(nameOf(createOrUpdateAtmAttribute _))), callContext)} def getBankAttributesByBank(bank: BankId, callContext: Option[CallContext]): OBPReturnType[Box[List[BankAttribute]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getBankAttributesByBank _))), callContext)} def getAtmAttributesByAtm(bank: BankId, atm: AtmId, callContext: Option[CallContext]): OBPReturnType[Box[List[AtmAttribute]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getAtmAttributesByAtm _))), callContext)} def getBankAttributeById(bankAttributeId: String, callContext: Option[CallContext] - ): OBPReturnType[Box[BankAttribute]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[BankAttribute]] = Future{(Failure(setUnimplementedError(nameOf(getBankAttributeById _))), callContext)} def getAtmAttributeById(atmAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[AtmAttribute]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getAtmAttributeById _))), callContext)} def getProductAttributeById( productAttributeId: String, callContext: Option[CallContext] - ): OBPReturnType[Box[ProductAttribute]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[ProductAttribute]] = Future{(Failure(setUnimplementedError(nameOf(getProductAttributeById _))), callContext)} def getProductAttributesByBankAndCode( bank: BankId, productCode: ProductCode, callContext: Option[CallContext] ): OBPReturnType[Box[List[ProductAttribute]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getProductAttributesByBankAndCode _))), callContext)} def deleteBankAttribute(bankAttributeId: String, callContext: Option[CallContext] - ): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError(nameOf(deleteBankAttribute _))), callContext)} def deleteAtmAttribute(atmAttributeId: String, callContext: Option[CallContext] - ): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError(nameOf(deleteAtmAttribute _))), callContext)} def deleteAtmAttributesByAtmId(atmId: AtmId, callContext: Option[CallContext] - ): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError(nameOf(deleteAtmAttributesByAtmId _))), callContext)} def deleteProductAttribute( productAttributeId: String, callContext: Option[CallContext] - ): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError(nameOf(deleteProductAttribute _))), callContext)} - def getAccountAttributeById(accountAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[AccountAttribute]] = Future{(Failure(setUnimplementedError), callContext)} - def getTransactionAttributeById(transactionAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[TransactionAttribute]] = Future{(Failure(setUnimplementedError), callContext)} + def getAccountAttributeById(accountAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[AccountAttribute]] = Future{(Failure(setUnimplementedError(nameOf(getAccountAttributeById _))), callContext)} + def getTransactionAttributeById(transactionAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[TransactionAttribute]] = Future{(Failure(setUnimplementedError(nameOf(getTransactionAttributeById _))), callContext)} def createOrUpdateAccountAttribute( bankId: BankId, @@ -2213,7 +2221,7 @@ trait Connector extends MdcLoggable { value: String, productInstanceCode: Option[String], callContext: Option[CallContext] - ): OBPReturnType[Box[AccountAttribute]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[AccountAttribute]] = Future{(Failure(setUnimplementedError(nameOf(createOrUpdateAccountAttribute _))), callContext)} def createOrUpdateCustomerAttribute(bankId: BankId, customerId: CustomerId, @@ -2222,7 +2230,7 @@ trait Connector extends MdcLoggable { attributeType: CustomerAttributeType.Value, value: String, callContext: Option[CallContext] - ): OBPReturnType[Box[CustomerAttribute]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[CustomerAttribute]] = Future{(Failure(setUnimplementedError(nameOf(createOrUpdateCustomerAttribute _))), callContext)} def createOrUpdateAttributeDefinition(bankId: BankId, name: String, @@ -2235,7 +2243,7 @@ trait Connector extends MdcLoggable { callContext: Option[CallContext] ): OBPReturnType[Box[AttributeDefinition]] = Future { - (Failure(setUnimplementedError), callContext) + (Failure(setUnimplementedError(nameOf(createOrUpdateAttributeDefinition _))), callContext) } def deleteAttributeDefinition(attributeDefinitionId: String, @@ -2243,27 +2251,27 @@ trait Connector extends MdcLoggable { callContext: Option[CallContext] ): OBPReturnType[Box[Boolean]] = Future { - (Failure(setUnimplementedError), callContext) + (Failure(setUnimplementedError(nameOf(deleteAttributeDefinition _))), callContext) } def getAttributeDefinition(category: AttributeCategory.Value, callContext: Option[CallContext] ): OBPReturnType[Box[List[AttributeDefinition]]] = Future { - (Failure(setUnimplementedError), callContext) + (Failure(setUnimplementedError(nameOf(getAttributeDefinition _))), callContext) } def getUserAttributes(userId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[UserAttribute]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getUserAttributes _))), callContext)} def getPersonalUserAttributes(userId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[UserAttribute]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getPersonalUserAttributes _))), callContext)} def getNonPersonalUserAttributes(userId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[UserAttribute]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getNonPersonalUserAttributes _))), callContext)} def getUserAttributesByUsers(userIds: List[String], callContext: Option[CallContext]): OBPReturnType[Box[List[UserAttribute]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getUserAttributesByUsers _))), callContext)} def createOrUpdateUserAttribute( userId: String, @@ -2273,12 +2281,12 @@ trait Connector extends MdcLoggable { value: String, isPersonal: Boolean, callContext: Option[CallContext] - ): OBPReturnType[Box[UserAttribute]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[UserAttribute]] = Future{(Failure(setUnimplementedError(nameOf(createOrUpdateUserAttribute _))), callContext)} def deleteUserAttribute( userAttributeId: String, callContext: Option[CallContext] - ): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError(nameOf(deleteUserAttribute _))), callContext)} def createOrUpdateTransactionAttribute( bankId: BankId, @@ -2288,7 +2296,7 @@ trait Connector extends MdcLoggable { attributeType: TransactionAttributeType.Value, value: String, callContext: Option[CallContext] - ): OBPReturnType[Box[TransactionAttribute]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[TransactionAttribute]] = Future{(Failure(setUnimplementedError(nameOf(createOrUpdateTransactionAttribute _))), callContext)} def createAccountAttributes(bankId: BankId, @@ -2297,38 +2305,38 @@ trait Connector extends MdcLoggable { accountAttributes: List[ProductAttribute], productInstanceCode: Option[String], callContext: Option[CallContext]): OBPReturnType[Box[List[AccountAttribute]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(createAccountAttributes _))), callContext)} def getAccountAttributesByAccount(bankId: BankId, accountId: AccountId, callContext: Option[CallContext]): OBPReturnType[Box[List[AccountAttribute]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getAccountAttributesByAccount _))), callContext)} def getAccountAttributesByAccountCanBeSeenOnView(bankId: BankId, accountId: AccountId, viewId: ViewId, callContext: Option[CallContext] ): OBPReturnType[Box[List[AccountAttribute]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getAccountAttributesByAccountCanBeSeenOnView _))), callContext)} def getAccountAttributesByAccountsCanBeSeenOnView(accounts: List[BankIdAccountId], viewId: ViewId, callContext: Option[CallContext] ): OBPReturnType[Box[List[AccountAttribute]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getAccountAttributesByAccountsCanBeSeenOnView _))), callContext)} def getTransactionAttributesByTransactionsCanBeSeenOnView(bankId: BankId, transactionIds: List[TransactionId], viewId: ViewId, callContext: Option[CallContext] ): OBPReturnType[Box[List[TransactionAttribute]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getTransactionAttributesByTransactionsCanBeSeenOnView _))), callContext)} def getCustomerAttributes( bankId: BankId, customerId: CustomerId, callContext: Option[CallContext]): OBPReturnType[Box[List[CustomerAttribute]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getCustomerAttributes _))), callContext)} /** * get CustomerAttribute according name and values @@ -2343,36 +2351,36 @@ trait Connector extends MdcLoggable { bankId: BankId, nameValues: Map[String, List[String]], callContext: Option[CallContext]): OBPReturnType[Box[List[String]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getCustomerIdsByAttributeNameValues _))), callContext)} def getCustomerAttributesForCustomers( customers: List[Customer], callContext: Option[CallContext]): OBPReturnType[Box[List[CustomerAndAttribute]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getCustomerAttributesForCustomers _))), callContext)} def getTransactionIdsByAttributeNameValues( bankId: BankId, nameValues: Map[String, List[String]], callContext: Option[CallContext]): OBPReturnType[Box[List[String]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getTransactionIdsByAttributeNameValues _))), callContext)} def getTransactionAttributes( bankId: BankId, transactionId: TransactionId, callContext: Option[CallContext] - ): OBPReturnType[Box[List[TransactionAttribute]]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[List[TransactionAttribute]]] = Future{(Failure(setUnimplementedError(nameOf(getTransactionAttributes _))), callContext)} def getTransactionAttributesCanBeSeenOnView(bankId: BankId, transactionId: TransactionId, viewId: ViewId, callContext: Option[CallContext] - ): OBPReturnType[Box[List[TransactionAttribute]]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[List[TransactionAttribute]]] = Future{(Failure(setUnimplementedError(nameOf(getTransactionAttributesCanBeSeenOnView _))), callContext)} def getCustomerAttributeById( customerAttributeId: String, callContext: Option[CallContext] ): OBPReturnType[Box[CustomerAttribute]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getCustomerAttributeById _))), callContext)} def createOrUpdateCardAttribute( @@ -2383,29 +2391,29 @@ trait Connector extends MdcLoggable { cardAttributeType: CardAttributeType.Value, value: String, callContext: Option[CallContext] - ): OBPReturnType[Box[CardAttribute]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[CardAttribute]] = Future{(Failure(setUnimplementedError(nameOf(createOrUpdateCardAttribute _))), callContext)} - def getCardAttributeById(cardAttributeId: String, callContext:Option[CallContext]): OBPReturnType[Box[CardAttribute]] = Future{(Failure(setUnimplementedError), callContext)} + def getCardAttributeById(cardAttributeId: String, callContext:Option[CallContext]): OBPReturnType[Box[CardAttribute]] = Future{(Failure(setUnimplementedError(nameOf(getCardAttributeById _))), callContext)} - def getCardAttributesFromProvider(cardId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[CardAttribute]]] = Future{(Failure(setUnimplementedError), callContext)} + def getCardAttributesFromProvider(cardId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[CardAttribute]]] = Future{(Failure(setUnimplementedError(nameOf(getCardAttributesFromProvider _))), callContext)} def getTransactionRequestAttributesFromProvider(transactionRequestId: TransactionRequestId, - callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionRequestAttributeTrait]]] = Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionRequestAttributeTrait]]] = Future{(Failure(setUnimplementedError(nameOf(getTransactionRequestAttributesFromProvider _))), callContext)} def getTransactionRequestAttributes(bankId: BankId, transactionRequestId: TransactionRequestId, - callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionRequestAttributeTrait]]] = Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionRequestAttributeTrait]]] = Future{(Failure(setUnimplementedError(nameOf(getTransactionRequestAttributes _))), callContext)} def getTransactionRequestAttributesCanBeSeenOnView(bankId: BankId, transactionRequestId: TransactionRequestId, viewId: ViewId, - callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionRequestAttributeTrait]]] = Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionRequestAttributeTrait]]] = Future{(Failure(setUnimplementedError(nameOf(getTransactionRequestAttributesCanBeSeenOnView _))), callContext)} def getTransactionRequestAttributeById(transactionRequestAttributeId: String, - callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequestAttributeTrait]] = Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequestAttributeTrait]] = Future{(Failure(setUnimplementedError(nameOf(getTransactionRequestAttributeById _))), callContext)} def getTransactionRequestIdsByAttributeNameValues(bankId: BankId, params: Map[String, List[String]], - callContext: Option[CallContext]): OBPReturnType[Box[List[String]]] = Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[List[String]]] = Future{(Failure(setUnimplementedError(nameOf(getTransactionRequestIdsByAttributeNameValues _))), callContext)} def createOrUpdateTransactionRequestAttribute(bankId: BankId, transactionRequestId: TransactionRequestId, @@ -2413,53 +2421,53 @@ trait Connector extends MdcLoggable { name: String, attributeType: TransactionRequestAttributeType.Value, value: String, - callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequestAttributeTrait]] = Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequestAttributeTrait]] = Future{(Failure(setUnimplementedError(nameOf(createOrUpdateTransactionRequestAttribute _))), callContext)} def createTransactionRequestAttributes(bankId: BankId, transactionRequestId: TransactionRequestId, transactionRequestAttributes: List[TransactionRequestAttributeTrait], - callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionRequestAttributeTrait]]] = Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionRequestAttributeTrait]]] = Future{(Failure(setUnimplementedError(nameOf(createTransactionRequestAttributes _))), callContext)} def deleteTransactionRequestAttribute(transactionRequestAttributeId: String, - callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError(nameOf(deleteTransactionRequestAttribute _))), callContext)} def createAccountApplication( productCode: ProductCode, userId: Option[String], customerId: Option[String], callContext: Option[CallContext] - ): OBPReturnType[Box[AccountApplication]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[AccountApplication]] = Future{(Failure(setUnimplementedError(nameOf(createAccountApplication _))), callContext)} def getAllAccountApplication(callContext: Option[CallContext]): OBPReturnType[Box[List[AccountApplication]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getAllAccountApplication _))), callContext)} def getAccountApplicationById(accountApplicationId: String, callContext: Option[CallContext]): OBPReturnType[Box[AccountApplication]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getAccountApplicationById _))), callContext)} def updateAccountApplicationStatus(accountApplicationId:String, status: String, callContext: Option[CallContext]): OBPReturnType[Box[AccountApplication]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(updateAccountApplicationStatus _))), callContext)} def getOrCreateProductCollection(collectionCode: String, productCodes: List[String], callContext: Option[CallContext]): OBPReturnType[Box[List[ProductCollection]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getOrCreateProductCollection _))), callContext)} def getProductCollection(collectionCode: String, callContext: Option[CallContext]): OBPReturnType[Box[List[ProductCollection]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getProductCollection _))), callContext)} def getOrCreateProductCollectionItem(collectionCode: String, memberProductCodes: List[String], callContext: Option[CallContext]): OBPReturnType[Box[List[ProductCollectionItem]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getOrCreateProductCollectionItem _))), callContext)} def getProductCollectionItem(collectionCode: String, callContext: Option[CallContext]): OBPReturnType[Box[List[ProductCollectionItem]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getProductCollectionItem _))), callContext)} def getProductCollectionItemsTree(collectionCode: String, bankId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[ProductCollectionItemsTree]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getProductCollectionItemsTree _))), callContext)} def createMeeting( bankId: BankId, @@ -2475,21 +2483,21 @@ trait Connector extends MdcLoggable { invitees: List[Invitee], callContext: Option[CallContext] ): OBPReturnType[Box[Meeting]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(createMeeting _))), callContext)} def getMeetings( bankId : BankId, user: User, callContext: Option[CallContext] ): OBPReturnType[Box[List[Meeting]]] = - Future{(Failure(setUnimplementedError), callContext)} + Future{(Failure(setUnimplementedError(nameOf(getMeetings _))), callContext)} def getMeeting( bankId: BankId, user: User, meetingId : String, callContext: Option[CallContext] - ): OBPReturnType[Box[Meeting]]=Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[Meeting]]=Future{(Failure(setUnimplementedError(nameOf(getMeeting _))), callContext)} def createOrUpdateKycCheck(bankId: String, customerId: String, @@ -2501,7 +2509,7 @@ trait Connector extends MdcLoggable { mStaffName: String, mSatisfied: Boolean, comments: String, - callContext: Option[CallContext]): OBPReturnType[Box[KycCheck]] = Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[KycCheck]] = Future{(Failure(setUnimplementedError(nameOf(createOrUpdateKycCheck _))), callContext)} def createOrUpdateKycDocument(bankId: String, customerId: String, @@ -2512,7 +2520,7 @@ trait Connector extends MdcLoggable { issueDate: Date, issuePlace: String, expiryDate: Date, - callContext: Option[CallContext]): OBPReturnType[Box[KycDocument]] = Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[KycDocument]] = Future{(Failure(setUnimplementedError(nameOf(createOrUpdateKycDocument _))), callContext)} def createOrUpdateKycMedia(bankId: String, customerId: String, @@ -2523,37 +2531,37 @@ trait Connector extends MdcLoggable { date: Date, relatesToKycDocumentId: String, relatesToKycCheckId: String, - callContext: Option[CallContext]): OBPReturnType[Box[KycMedia]] = Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[KycMedia]] = Future{(Failure(setUnimplementedError(nameOf(createOrUpdateKycDocument _))), callContext)} def createOrUpdateKycStatus(bankId: String, customerId: String, customerNumber: String, ok: Boolean, date: Date, - callContext: Option[CallContext]): OBPReturnType[Box[KycStatus]] = Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[KycStatus]] = Future{(Failure(setUnimplementedError(nameOf(createOrUpdateKycStatus _))), callContext)} def getKycChecks(customerId: String, callContext: Option[CallContext] - ): OBPReturnType[Box[List[KycCheck]]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[List[KycCheck]]] = Future{(Failure(setUnimplementedError(nameOf(getKycChecks _))), callContext)} def getKycDocuments(customerId: String, callContext: Option[CallContext] - ): OBPReturnType[Box[List[KycDocument]]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[List[KycDocument]]] = Future{(Failure(setUnimplementedError(nameOf(getKycDocuments _))), callContext)} def getKycMedias(customerId: String, callContext: Option[CallContext] - ): OBPReturnType[Box[List[KycMedia]]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[List[KycMedia]]] = Future{(Failure(setUnimplementedError(nameOf(getKycMedias _))), callContext)} def getKycStatuses(customerId: String, callContext: Option[CallContext] - ): OBPReturnType[Box[List[KycStatus]]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[List[KycStatus]]] = Future{(Failure(setUnimplementedError(nameOf(getKycStatuses _))), callContext)} def createMessage(user : User, bankId : BankId, message : String, fromDepartment : String, fromPerson : String, - callContext: Option[CallContext]) : OBPReturnType[Box[CustomerMessage]] = Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]) : OBPReturnType[Box[CustomerMessage]] = Future{(Failure(setUnimplementedError(nameOf(createMessage _))), callContext)} def createCustomerMessage(customer: Customer, bankId : BankId, @@ -2561,13 +2569,13 @@ trait Connector extends MdcLoggable { message : String, fromDepartment : String, fromPerson : String, - callContext: Option[CallContext]) : OBPReturnType[Box[CustomerMessage]] = Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]) : OBPReturnType[Box[CustomerMessage]] = Future{(Failure(setUnimplementedError(nameOf(createCustomerMessage _))), callContext)} def getCustomerMessages( customer: Customer, bankId: BankId, callContext: Option[CallContext] - ): OBPReturnType[Box[List[CustomerMessage]]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[List[CustomerMessage]]] = Future{(Failure(setUnimplementedError(nameOf(getCustomerMessages _))), callContext)} def makeHistoricalPayment(fromAccount: BankAccount, toAccount: BankAccount, @@ -2578,7 +2586,7 @@ trait Connector extends MdcLoggable { description: String, transactionRequestType: String, chargePolicy: String, - callContext: Option[CallContext]): OBPReturnType[Box[TransactionId]] = Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[TransactionId]] = Future{(Failure(setUnimplementedError(nameOf(makeHistoricalPayment _))), callContext)} /** * DynamicEntity process function @@ -2599,10 +2607,10 @@ trait Connector extends MdcLoggable { queryParameters: Option[Map[String, List[String]]], userId: Option[String], isPersonalEntity: Boolean, - callContext: Option[CallContext]): OBPReturnType[Box[JValue]] = Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[JValue]] = Future{(Failure(setUnimplementedError(nameOf(dynamicEntityProcess _))), callContext)} def dynamicEndpointProcess(url: String, jValue: JValue, method: HttpMethod, params: Map[String, List[String]], pathParams: Map[String, String], - callContext: Option[CallContext]): OBPReturnType[Box[JValue]] = Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[JValue]] = Future{(Failure(setUnimplementedError(nameOf(dynamicEndpointProcess _))), callContext)} def createDirectDebit(bankId: String, accountId: String, @@ -2612,7 +2620,7 @@ trait Connector extends MdcLoggable { dateSigned: Date, dateStarts: Date, dateExpires: Option[Date], - callContext: Option[CallContext]): OBPReturnType[Box[DirectDebitTrait]] = Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[DirectDebitTrait]] = Future{(Failure(setUnimplementedError(nameOf(createDirectDebit _))), callContext)} def createStandingOrder(bankId: String, accountId: String, @@ -2627,11 +2635,11 @@ trait Connector extends MdcLoggable { dateStarts: Date, dateExpires: Option[Date], callContext: Option[CallContext]): OBPReturnType[Box[StandingOrderTrait]] = Future { - (Failure(setUnimplementedError), callContext) + (Failure(setUnimplementedError(nameOf(createStandingOrder _))), callContext) } def deleteCustomerAttribute(customerAttributeId: String, - callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError), callContext)} + callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError(nameOf(deleteCustomerAttribute _))), callContext)} /** @@ -2652,9 +2660,9 @@ trait Connector extends MdcLoggable { value: String, scaMethod: String, callContext: Option[CallContext] - ): OBPReturnType[Box[UserAuthContextUpdate]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[UserAuthContextUpdate]] = Future{(Failure(setUnimplementedError(nameOf(validateUserAuthContextUpdateRequest _))), callContext)} - def checkAnswer(authContextUpdateId: String, challenge: String, callContext: Option[CallContext]): OBPReturnType[Box[UserAuthContextUpdate]] = Future{(Failure(setUnimplementedError), callContext)} + def checkAnswer(authContextUpdateId: String, challenge: String, callContext: Option[CallContext]): OBPReturnType[Box[UserAuthContextUpdate]] = Future{(Failure(setUnimplementedError(nameOf(checkAnswer _))), callContext)} def sendCustomerNotification( scaMethod: StrongCustomerAuthentication, @@ -2662,23 +2670,23 @@ trait Connector extends MdcLoggable { subject: Option[String], //Only for EMAIL, SMS do not need it, so here it is Option message: String, callContext: Option[CallContext] - ): OBPReturnType[Box[String]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[String]] = Future{(Failure(setUnimplementedError(nameOf(sendCustomerNotification _))), callContext)} - def getCustomerAccountLink(customerId: String, accountId: String, callContext: Option[CallContext]): OBPReturnType[Box[CustomerAccountLinkTrait]] = Future{(Failure(setUnimplementedError), callContext)} + def getCustomerAccountLink(customerId: String, accountId: String, callContext: Option[CallContext]): OBPReturnType[Box[CustomerAccountLinkTrait]] = Future{(Failure(setUnimplementedError(nameOf(getCustomerAccountLink _))), callContext)} - def getCustomerAccountLinksByCustomerId(customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[CustomerAccountLinkTrait]]] = Future{(Failure(setUnimplementedError), callContext)} + def getCustomerAccountLinksByCustomerId(customerId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[CustomerAccountLinkTrait]]] = Future{(Failure(setUnimplementedError(nameOf(getCustomerAccountLinksByCustomerId _))), callContext)} - def getCustomerAccountLinksByBankIdAccountId(bankId: String, accountId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[CustomerAccountLinkTrait]]] = Future{(Failure(setUnimplementedError), callContext)} + def getCustomerAccountLinksByBankIdAccountId(bankId: String, accountId: String, callContext: Option[CallContext]): OBPReturnType[Box[List[CustomerAccountLinkTrait]]] = Future{(Failure(setUnimplementedError(nameOf(getCustomerAccountLinksByBankIdAccountId _))), callContext)} - def getCustomerAccountLinkById(customerAccountLinkId: String, callContext: Option[CallContext]): OBPReturnType[Box[CustomerAccountLinkTrait]] = Future{(Failure(setUnimplementedError), callContext)} + def getCustomerAccountLinkById(customerAccountLinkId: String, callContext: Option[CallContext]): OBPReturnType[Box[CustomerAccountLinkTrait]] = Future{(Failure(setUnimplementedError(nameOf(getCustomerAccountLinkById _))), callContext)} - def deleteCustomerAccountLinkById(customerAccountLinkId: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError), callContext)} + def deleteCustomerAccountLinkById(customerAccountLinkId: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError(nameOf(deleteCustomerAccountLinkById _))), callContext)} - def createCustomerAccountLink(customerId: String, bankId: String, accountId: String, relationshipType: String, callContext: Option[CallContext]): OBPReturnType[Box[CustomerAccountLinkTrait]] = Future{(Failure(setUnimplementedError), callContext)} + def createCustomerAccountLink(customerId: String, bankId: String, accountId: String, relationshipType: String, callContext: Option[CallContext]): OBPReturnType[Box[CustomerAccountLinkTrait]] = Future{(Failure(setUnimplementedError(nameOf(createCustomerAccountLink _))), callContext)} - def updateCustomerAccountLinkById(customerAccountLinkId: String, relationshipType: String, callContext: Option[CallContext]): OBPReturnType[Box[CustomerAccountLinkTrait]] = Future{(Failure(setUnimplementedError), callContext)} + def updateCustomerAccountLinkById(customerAccountLinkId: String, relationshipType: String, callContext: Option[CallContext]): OBPReturnType[Box[CustomerAccountLinkTrait]] = Future{(Failure(setUnimplementedError(nameOf(updateCustomerAccountLinkById _))), callContext)} - def getConsentImplicitSCA(user: User, callContext: Option[CallContext]): OBPReturnType[Box[ConsentImplicitSCAT]] = Future{(Failure(setUnimplementedError), callContext)} + def getConsentImplicitSCA(user: User, callContext: Option[CallContext]): OBPReturnType[Box[ConsentImplicitSCAT]] = Future{(Failure(setUnimplementedError(nameOf(getConsentImplicitSCA _))), callContext)} def createOrUpdateCounterpartyLimit( bankId: String, @@ -2691,7 +2699,7 @@ trait Connector extends MdcLoggable { maxNumberOfMonthlyTransactions: Int, maxYearlyAmount: Int, maxNumberOfYearlyTransactions: Int, callContext: Option[CallContext] - ): OBPReturnType[Box[CounterpartyLimitTrait]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[CounterpartyLimitTrait]] = Future{(Failure(setUnimplementedError(nameOf(createOrUpdateCounterpartyLimit _))), callContext)} def getCounterpartyLimit( bankId: String, @@ -2699,7 +2707,7 @@ trait Connector extends MdcLoggable { viewId: String, counterpartyId: String, callContext: Option[CallContext] - ): OBPReturnType[Box[CounterpartyLimitTrait]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[CounterpartyLimitTrait]] = Future{(Failure(setUnimplementedError(nameOf(getCounterpartyLimit _))), callContext)} def deleteCounterpartyLimit( bankId: String, @@ -2707,7 +2715,7 @@ trait Connector extends MdcLoggable { viewId: String, counterpartyId: String, callContext: Option[CallContext] - ): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError), callContext)} + ): OBPReturnType[Box[Boolean]] = Future{(Failure(setUnimplementedError(nameOf(deleteCounterpartyLimit _))), callContext)} } diff --git a/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala b/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala index 9ca171aac5..42f39ce1b1 100644 --- a/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala +++ b/obp-api/src/main/scala/code/bankconnectors/ConnectorBuilderUtil.scala @@ -345,6 +345,9 @@ object ConnectorBuilderUtil { //"getCustomerByCustomerIdLegacy", // should not generate for Legacy methods "createChallenges", + "createTransactionRequestv400", + "createTransactionRequestSepaCreditTransfersBGV1", + "createTransactionRequestPeriodicSepaCreditTransfersBGV1", "getCustomersByCustomerPhoneNumber", "getTransactionAttributeById", "createOrUpdateCustomerAttribute", @@ -389,7 +392,6 @@ object ConnectorBuilderUtil { "makePaymentv200", "createTransactionRequest", "createTransactionRequestv200", - "createTransactionRequestv400", "getStatus", "getChargeValue", "saveTransactionRequestTransaction", diff --git a/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnector.scala b/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnector.scala index 8f1b649bea..6070559dab 100644 --- a/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnector.scala +++ b/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnector.scala @@ -67,8 +67,10 @@ import code.transaction.MappedTransaction import code.transactionChallenge.{Challenges, MappedExpectedChallengeAnswer} import code.transactionRequestAttribute.TransactionRequestAttributeX import code.transactionattribute.TransactionAttributeX -import code.transactionrequests.TransactionRequests.TransactionRequestTypes._ -import code.transactionrequests.TransactionRequests.TransactionRequestTypes +import com.openbankproject.commons.model.enums.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.TransactionRequestTypes +import com.openbankproject.commons.model.enums.PaymentServiceTypes._ +import com.openbankproject.commons.model.enums.PaymentServiceTypes import code.transactionrequests._ import code.users.{UserAttribute, UserAttributeProvider, Users} import code.util.Helper @@ -83,6 +85,8 @@ 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.{TransactionRequestStatus, _} +import com.openbankproject.commons.model.enums.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.PaymentServiceTypes._ import com.openbankproject.commons.model.{AccountApplication, AccountAttribute, ConsentImplicitSCAT, DirectDebitTrait, FXRate, Product, ProductAttribute, ProductCollectionItem, TaxResidence, TransactionRequestCommonBodyJSON, _} import com.tesobe.CacheKeyFromArguments import com.tesobe.model.UpdateBankAccount @@ -5113,8 +5117,6 @@ object LocalMappedConnector extends Connector with MdcLoggable { challengeType: Option[String], scaMethod: Option[SCA], reasons: Option[List[TransactionRequestReason]], - paymentService: Option[String], - berlinGroupPayments: Option[BerlinGroupTransactionRequestCommonBodyJson], callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = { for { @@ -5180,8 +5182,8 @@ object LocalMappedConnector extends Connector with MdcLoggable { status.toString, charge, chargePolicy, - paymentService, - berlinGroupPayments + None, + None ) saveTransactionRequestReasons(reasons, transactionRequest) transactionRequest @@ -5285,6 +5287,39 @@ object LocalMappedConnector extends Connector with MdcLoggable { (Full(transactionRequest), callContext) } } + + override def createTransactionRequestSepaCreditTransfersBGV1( + initiator: User, + paymentServiceType: PaymentServiceTypes, + transactionRequestType: TransactionRequestTypes, + transactionRequestBody: SepaCreditTransfersBerlinGroupV13, + callContext: Option[CallContext] + ): OBPReturnType[Box[TransactionRequestBGV1]] = { + LocalMappedConnectorHelper.createTransactionRequestBGInternal( + initiator: User, + paymentServiceType: PaymentServiceTypes, + transactionRequestType: TransactionRequestTypes, + transactionRequestBody: SepaCreditTransfersBerlinGroupV13, + callContext: Option[CallContext] + ) + } + + override def createTransactionRequestPeriodicSepaCreditTransfersBGV1( + initiator: User, + paymentServiceType: PaymentServiceTypes, + transactionRequestType: TransactionRequestTypes, + transactionRequestBody: PeriodicSepaCreditTransfersBerlinGroupV13, + callContext: Option[CallContext] + ): OBPReturnType[Box[TransactionRequestBGV1]] = { + LocalMappedConnectorHelper.createTransactionRequestBGInternal( + initiator: User, + paymentServiceType: PaymentServiceTypes, + transactionRequestType: TransactionRequestTypes, + transactionRequestBody: PeriodicSepaCreditTransfersBerlinGroupV13, + callContext: Option[CallContext] + ) + } + private def saveTransactionRequestReasons(reasons: Option[List[TransactionRequestReason]], transactionRequest: Box[TransactionRequest]) = { for (reason <- reasons.getOrElse(Nil)) { diff --git a/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnectorHelper.scala b/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnectorHelper.scala new file mode 100644 index 0000000000..817b277b59 --- /dev/null +++ b/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnectorHelper.scala @@ -0,0 +1,193 @@ +package code.bankconnectors + +import code.api.Constant._ +import code.api.util.APIUtil._ +import code.api.util.ErrorMessages._ +import code.api.util._ +import code.bankconnectors.LocalMappedConnector._ +import code.transactionrequests._ +import code.util.Helper +import code.util.Helper._ +import com.openbankproject.commons.ExecutionContext.Implicits.global +import com.openbankproject.commons.model._ +import com.openbankproject.commons.model.enums.TransactionRequestStatus +import com.openbankproject.commons.model.enums.TransactionRequestTypes +import com.openbankproject.commons.model.enums.PaymentServiceTypes +import net.liftweb.common._ +import net.liftweb.json.Serialization.write +import net.liftweb.json.{NoTypeHints, Serialization} +import scala.concurrent._ +import scala.language.postfixOps + + + +//Try to keep LocalMappedConnector smaller, so put comment methods in new file. +object LocalMappedConnectorHelper extends MdcLoggable { + + def createTransactionRequestBGInternal( + initiator: User, + paymentServiceType: PaymentServiceTypes, + transactionRequestType: TransactionRequestTypes, + transactionRequestBody: BerlinGroupTransactionRequestCommonBodyJson, + callContext: Option[CallContext] + ) = { + for { + transDetailsSerialized <- NewStyle.function.tryons(s"$UnknownError Can not serialize in request Json ", 400, callContext) { + write(transactionRequestBody)(Serialization.formats(NoTypeHints)) + } + + //for Berlin Group, the account routing address is the IBAN. + fromAccountIban = transactionRequestBody.debtorAccount.iban + toAccountIban = transactionRequestBody.creditorAccount.iban + + (fromAccount, callContext) <- NewStyle.function.getBankAccountByIban(fromAccountIban, callContext) + (ibanChecker, callContext) <- NewStyle.function.validateAndCheckIbanNumber(toAccountIban, callContext) + _ <- Helper.booleanToFuture(invalidIban, cc = callContext) { + ibanChecker.isValid == true + } + (toAccount, callContext) <- NewStyle.function.getToBankAccountByIban(toAccountIban, callContext) + + viewId = ViewId(SYSTEM_INITIATE_PAYMENTS_BERLIN_GROUP_VIEW_ID) + fromBankIdAccountId = BankIdAccountId(fromAccount.bankId, fromAccount.accountId) + view <- NewStyle.function.checkAccountAccessAndGetView(viewId, fromBankIdAccountId, Full(initiator), callContext) + _ <- Helper.booleanToFuture(InsufficientAuthorisationToCreateTransactionRequest, cc = callContext) { + view.canAddTransactionRequestToAnyAccount + } + + (paymentLimit, callContext) <- Connector.connector.vend.getPaymentLimit( + fromAccount.bankId.value, + fromAccount.accountId.value, + viewId.value, + transactionRequestType.toString, + transactionRequestBody.instructedAmount.currency, + initiator.userId, + initiator.name, + callContext + ) map { i => + (unboxFullOrFail(i._1, callContext, s"$InvalidConnectorResponseForGetPaymentLimit ", 400), i._2) + } + + paymentLimitAmount <- NewStyle.function.tryons(s"$InvalidConnectorResponseForGetPaymentLimit. payment limit amount ${paymentLimit.amount} not convertible to number", 400, callContext) { + BigDecimal(paymentLimit.amount) + } + + //We already checked the value in API level. + transactionAmount = BigDecimal(transactionRequestBody.instructedAmount.amount) + + _ <- Helper.booleanToFuture(s"$InvalidJsonValue the payment amount is over the payment limit($paymentLimit)", 400, callContext) { + transactionAmount <= paymentLimitAmount + } + + // Prevent default value for transaction request type (at least). + _ <- Helper.booleanToFuture(s"From Account Currency is ${fromAccount.currency}, but Requested instructedAmount.currency is: ${transactionRequestBody.instructedAmount.currency}", cc = callContext) { + transactionRequestBody.instructedAmount.currency == fromAccount.currency + } + + // Get the threshold for a challenge. i.e. over what value do we require an out of Band security challenge to be sent? + (challengeThreshold, callContext) <- Connector.connector.vend.getChallengeThreshold( + fromAccount.bankId.value, + fromAccount.accountId.value, + viewId.value, + transactionRequestType.toString, + transactionRequestBody.instructedAmount.currency, + initiator.userId, initiator.name, + callContext + ) map { i => + (unboxFullOrFail(i._1, callContext, s"$InvalidConnectorResponseForGetChallengeThreshold ", 400), i._2) + } + challengeThresholdAmount <- NewStyle.function.tryons(s"$InvalidConnectorResponseForGetChallengeThreshold. challengeThreshold amount ${challengeThreshold.amount} not convertible to number", 400, callContext) { + BigDecimal(challengeThreshold.amount) + } + status <- getStatus( + challengeThresholdAmount, + transactionAmount, + TransactionRequestType(transactionRequestType.toString) + ) + (chargeLevel, callContext) <- Connector.connector.vend.getChargeLevelC2( + BankId(fromAccount.bankId.value), + AccountId(fromAccount.accountId.value), + viewId, + initiator.userId, + initiator.name, + transactionRequestType.toString, + transactionRequestBody.instructedAmount.currency, + transactionRequestBody.instructedAmount.amount, + toAccount.accountRoutings, + Nil, + callContext + ) map { i => + (unboxFullOrFail(i._1, callContext, s"$InvalidConnectorResponseForGetChargeLevel ", 400), i._2) + } + + chargeLevelAmount <- NewStyle.function.tryons(s"$InvalidNumber chargeLevel.amount: ${chargeLevel.amount} can not be transferred to decimal !", 400, callContext) { + BigDecimal(chargeLevel.amount) + } + + chargeValue <- getChargeValue(chargeLevelAmount, transactionAmount) + charge = TransactionRequestCharge("Total charges for completed transaction", AmountOfMoney(transactionRequestBody.instructedAmount.currency, chargeValue)) + + // Always create a new Transaction Request + transactionRequest <- Future { + val transactionRequest = TransactionRequests.transactionRequestProvider.vend.createTransactionRequestImpl210( + TransactionRequestId(generateUUID()), + TransactionRequestType(transactionRequestType.toString), + fromAccount, + toAccount, + TransactionRequestCommonBodyJSONCommons( + transactionRequestBody.instructedAmount, + "" + ), + transDetailsSerialized, + status.toString, + charge, + "", // chargePolicy is not used in BG so far. + Some(paymentServiceType.toString), + Some(transactionRequestBody) + ) + transactionRequest + } map { + unboxFullOrFail(_, callContext, s"$InvalidConnectorResponseForCreateTransactionRequestImpl210") + } + + // If no challenge necessary, create Transaction immediately and put in data store and object to return + (transactionRequest, callContext) <- status match { + case TransactionRequestStatus.COMPLETED => + for { + (createdTransactionId, callContext) <- NewStyle.function.makePaymentv210( + fromAccount, + toAccount, + transactionRequest.id, + TransactionRequestCommonBodyJSONCommons( + transactionRequestBody.instructedAmount, + "" //BG no description so far + ), + transactionAmount, + "", //BG no description so far + TransactionRequestType(transactionRequestType.toString), + "", // chargePolicy is not used in BG so far., + callContext + ) + //set challenge to null, otherwise it have the default value "challenge": {"id": "","allowed_attempts": 0,"challenge_type": ""} + transactionRequest <- Future(transactionRequest.copy(challenge = null)) + + //save transaction_id into database + _ <- Future { + saveTransactionRequestTransaction(transactionRequest.id, createdTransactionId) + } + //update transaction_id field for variable 'transactionRequest' + transactionRequest <- Future(transactionRequest.copy(transaction_ids = createdTransactionId.value)) + + } yield { + logger.debug(s"createTransactionRequestv210.createdTransactionId return: $transactionRequest") + (transactionRequest, callContext) + } + case _ => Future(transactionRequest, callContext) + } + } yield { + logger.debug(transactionRequest) + (Full(TransactionRequestBGV1(transactionRequest.id, transactionRequest.status)), callContext) + } + } + + +} diff --git a/obp-api/src/main/scala/code/bankconnectors/akka/AkkaConnector_vDec2018.scala b/obp-api/src/main/scala/code/bankconnectors/akka/AkkaConnector_vDec2018.scala index 9f8db54123..a7d511a23e 100644 --- a/obp-api/src/main/scala/code/bankconnectors/akka/AkkaConnector_vDec2018.scala +++ b/obp-api/src/main/scala/code/bankconnectors/akka/AkkaConnector_vDec2018.scala @@ -2195,35 +2195,7 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { documentNumber=Some(documentNumberExample.value), amount=Some(amountExample.value), currency=Some(currencyExample.value), - description=Some(descriptionExample.value)))), - paymentService = Some(paymentServiceExample.value), - berlinGroupPayments=Some( SepaCreditTransfersBerlinGroupV13(endToEndIdentification=Some("string"), - instructionIdentification=Some("string"), - debtorName=Some("string"), - debtorAccount=PaymentAccount("string"), - debtorId=Some("string"), - ultimateDebtor=Some("string"), - instructedAmount= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount=amountExample.value), - currencyOfTransfer=Some("string"), - exchangeRateInformation=Some("string"), - creditorAccount=PaymentAccount("string"), - creditorAgent=Some("string"), - creditorAgentName=Some("string"), - creditorName="string", - creditorId=Some("string"), - creditorAddress=Some("string"), - creditorNameAndAddress=Some("string"), - ultimateCreditor=Some("string"), - purposeCode=Some("string"), - chargeBearer=Some("string"), - serviceLevel=Some("string"), - remittanceInformationUnstructured=Some("string"), - remittanceInformationUnstructuredArray=Some("string"), - remittanceInformationStructured=Some("string"), - remittanceInformationStructuredArray=Some("string"), - requestedExecutionDate=Some("string"), - requestedExecutionTime=Some("string")))) + description=Some(descriptionExample.value))))) ), exampleInboundMessage = ( InBoundCreateTransactionRequestv400(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, @@ -2306,9 +2278,9 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - override def createTransactionRequestv400(initiator: User, viewId: ViewId, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, detailsPlain: String, chargePolicy: String, challengeType: Option[String], scaMethod: Option[StrongCustomerAuthentication.SCA], reasons: Option[List[TransactionRequestReason]], paymentService: Option[String], berlinGroupPayments: Option[BerlinGroupTransactionRequestCommonBodyJson], callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = { + override def createTransactionRequestv400(initiator: User, viewId: ViewId, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, detailsPlain: String, chargePolicy: String, challengeType: Option[String], scaMethod: Option[StrongCustomerAuthentication.SCA], reasons: Option[List[TransactionRequestReason]], callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = { import com.openbankproject.commons.dto.{InBoundCreateTransactionRequestv400 => InBound, OutBoundCreateTransactionRequestv400 => OutBound} - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, viewId, fromAccount, toAccount, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy, challengeType, scaMethod, reasons, paymentService, berlinGroupPayments) + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, viewId, fromAccount, toAccount, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy, challengeType, scaMethod, reasons) val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) response.map(convertToTuple[TransactionRequest](callContext)) } diff --git a/obp-api/src/main/scala/code/bankconnectors/rest/RestConnector_vMar2019.scala b/obp-api/src/main/scala/code/bankconnectors/rest/RestConnector_vMar2019.scala index 7bc7f5d4ce..187e1f8bde 100644 --- a/obp-api/src/main/scala/code/bankconnectors/rest/RestConnector_vMar2019.scala +++ b/obp-api/src/main/scala/code/bankconnectors/rest/RestConnector_vMar2019.scala @@ -2336,35 +2336,7 @@ trait RestConnector_vMar2019 extends Connector with KafkaHelper with MdcLoggable documentNumber=Some(documentNumberExample.value), amount=Some(amountExample.value), currency=Some(currencyExample.value), - description=Some(descriptionExample.value)))), - paymentService = Some(paymentServiceExample.value), - berlinGroupPayments=Some( SepaCreditTransfersBerlinGroupV13(endToEndIdentification=Some("string"), - instructionIdentification=Some("string"), - debtorName=Some("string"), - debtorAccount=PaymentAccount("string"), - debtorId=Some("string"), - ultimateDebtor=Some("string"), - instructedAmount= AmountOfMoneyJsonV121(currency=currencyExample.value, - amount=amountExample.value), - currencyOfTransfer=Some("string"), - exchangeRateInformation=Some("string"), - creditorAccount=PaymentAccount("string"), - creditorAgent=Some("string"), - creditorAgentName=Some("string"), - creditorName="string", - creditorId=Some("string"), - creditorAddress=Some("string"), - creditorNameAndAddress=Some("string"), - ultimateCreditor=Some("string"), - purposeCode=Some("string"), - chargeBearer=Some("string"), - serviceLevel=Some("string"), - remittanceInformationUnstructured=Some("string"), - remittanceInformationUnstructuredArray=Some("string"), - remittanceInformationStructured=Some("string"), - remittanceInformationStructuredArray=Some("string"), - requestedExecutionDate=Some("string"), - requestedExecutionTime=Some("string")))) + description=Some(descriptionExample.value))))) ), exampleInboundMessage = ( InBoundCreateTransactionRequestv400(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, @@ -2447,9 +2419,9 @@ trait RestConnector_vMar2019 extends Connector with KafkaHelper with MdcLoggable adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - override def createTransactionRequestv400(initiator: User, viewId: ViewId, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, detailsPlain: String, chargePolicy: String, challengeType: Option[String], scaMethod: Option[StrongCustomerAuthentication.SCA], reasons: Option[List[TransactionRequestReason]], paymentService: Option[String], berlinGroupPayments: Option[BerlinGroupTransactionRequestCommonBodyJson], callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = { + override def createTransactionRequestv400(initiator: User, viewId: ViewId, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, detailsPlain: String, chargePolicy: String, challengeType: Option[String], scaMethod: Option[StrongCustomerAuthentication.SCA], reasons: Option[List[TransactionRequestReason]], callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = { import com.openbankproject.commons.dto.{InBoundCreateTransactionRequestv400 => InBound, OutBoundCreateTransactionRequestv400 => OutBound} - val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, viewId, fromAccount, toAccount, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy, challengeType, scaMethod, reasons, paymentService, berlinGroupPayments) + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, viewId, fromAccount, toAccount, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy, challengeType, scaMethod, reasons) val response: Future[Box[InBound]] = sendRequest[InBound](getUrl(callContext, "createTransactionRequestv400"), HttpMethods.POST, req, callContext) response.map(convertToTuple[TransactionRequest](callContext)) } diff --git a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnector_vDec2019.scala b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnector_vDec2019.scala index 24f95bc0a7..0cdfb49e9b 100644 --- a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnector_vDec2019.scala +++ b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnector_vDec2019.scala @@ -75,7 +75,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { val connectorName = "stored_procedure_vDec2019" //---------------- dynamic start -------------------please don't modify this line -// ---------- created on 2024-09-10T12:17:56Z +// ---------- created on 2024-09-20T12:17:12Z messageDocs += getAdapterInfoDoc def getAdapterInfoDoc = MessageDoc( @@ -2440,6 +2440,304 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { response.map(convertToTuple[TransactionRequest](callContext)) } + messageDocs += createTransactionRequestv400Doc + def createTransactionRequestv400Doc = MessageDoc( + process = "obp.createTransactionRequestv400", + messageFormat = messageFormat, + description = "Create Transaction Requestv400", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateTransactionRequestv400(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + initiator= 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))), + viewId=ViewId(viewIdExample.value), + fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=toDate(bankAccountLastUpdateExample), + branchId=branchIdExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value, + attributes=Some(List( Attribute(name=attributeNameExample.value, + `type`=attributeTypeExample.value, + value=attributeValueExample.value)))), + toAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value), + accountType=accountTypeExample.value, + balance=BigDecimal(balanceExample.value), + currency=currencyExample.value, + name=bankAccountNameExample.value, + label=labelExample.value, + number=bankAccountNumberExample.value, + bankId=BankId(bankIdExample.value), + lastUpdate=toDate(bankAccountLastUpdateExample), + branchId=branchIdExample.value, + accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value, + address=accountRoutingAddressExample.value)), + accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, + value=accountRuleValueExample.value)), + accountHolder=bankAccountAccountHolderExample.value, + attributes=Some(List( Attribute(name=attributeNameExample.value, + `type`=attributeTypeExample.value, + value=attributeValueExample.value)))), + transactionRequestType=TransactionRequestType(transactionRequestTypeExample.value), + transactionRequestCommonBody= TransactionRequestCommonBodyJSONCommons(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount=amountExample.value), + description=descriptionExample.value), + detailsPlain="string", + chargePolicy=chargePolicyExample.value, + challengeType=Some(challengeTypeExample.value), + scaMethod=Some(com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SMS), + reasons=Some(List( TransactionRequestReason(code=codeExample.value, + documentNumber=Some(documentNumberExample.value), + amount=Some(amountExample.value), + currency=Some(currencyExample.value), + description=Some(descriptionExample.value))))) + ), + exampleInboundMessage = ( + InBoundCreateTransactionRequestv400(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= TransactionRequest(id=TransactionRequestId(transactionRequestIdExample.value), + `type`=transactionRequestTypeExample.value, + from= TransactionRequestAccount(bank_id=bank_idExample.value, + account_id=account_idExample.value), + body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id=bank_idExample.value, + account_id=account_idExample.value)), + to_sepa=Some(TransactionRequestIban(transactionRequestIban.value)), + to_counterparty=Some(TransactionRequestCounterpartyId(transactionRequestCounterpartyIdExample.value)), + to_simple=Some( TransactionRequestSimple(otherBankRoutingScheme=otherBankRoutingSchemeExample.value, + otherBankRoutingAddress=otherBankRoutingAddressExample.value, + otherBranchRoutingScheme=otherBranchRoutingSchemeExample.value, + otherBranchRoutingAddress=otherBranchRoutingAddressExample.value, + otherAccountRoutingScheme=otherAccountRoutingSchemeExample.value, + otherAccountRoutingAddress=otherAccountRoutingAddressExample.value, + otherAccountSecondaryRoutingScheme=otherAccountSecondaryRoutingSchemeExample.value, + otherAccountSecondaryRoutingAddress=otherAccountSecondaryRoutingAddressExample.value)), + to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount=amountExample.value), + description=descriptionExample.value, + message=messageExample.value, + from= FromAccountTransfer(mobile_phone_number="string", + nickname=nicknameExample.value), + to=ToAccountTransferToPhone(toExample.value))), + to_transfer_to_atm=Some( TransactionRequestTransferToAtm(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount=amountExample.value), + description=descriptionExample.value, + message=messageExample.value, + from= FromAccountTransfer(mobile_phone_number="string", + nickname=nicknameExample.value), + to= ToAccountTransferToAtm(legal_name="string", + date_of_birth="string", + mobile_phone_number="string", + kyc_document= ToAccountTransferToAtmKycDocument(`type`=typeExample.value, + number=numberExample.value)))), + to_transfer_to_account=Some( TransactionRequestTransferToAccount(value= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount=amountExample.value), + description=descriptionExample.value, + transfer_type="string", + future_date="string", + to= ToAccountTransferToAccount(name=nameExample.value, + bank_code="string", + branch_number="string", + account= ToAccountTransferToAccountAccount(number=accountNumberExample.value, + iban=ibanExample.value)))), + to_sepa_credit_transfers=Some( SepaCreditTransfers(debtorAccount=PaymentAccount("string"), + instructedAmount= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount=amountExample.value), + creditorAccount=PaymentAccount("string"), + creditorName="string")), + value= AmountOfMoney(currency=currencyExample.value, + amount=amountExample.value), + description=descriptionExample.value), + transaction_ids="string", + status=statusExample.value, + start_date=toDate(transactionRequestStartDateExample), + end_date=toDate(transactionRequestEndDateExample), + challenge= TransactionRequestChallenge(id=challengeIdExample.value, + allowed_attempts=123, + challenge_type="string"), + charge= TransactionRequestCharge(summary=summaryExample.value, + value= AmountOfMoney(currency=currencyExample.value, + amount=amountExample.value)), + charge_policy="string", + counterparty_id=CounterpartyId(transactionRequestCounterpartyIdExample.value), + name=nameExample.value, + this_bank_id=BankId(bankIdExample.value), + this_account_id=AccountId(accountIdExample.value), + this_view_id=ViewId(viewIdExample.value), + other_account_routing_scheme="string", + other_account_routing_address="string", + other_bank_routing_scheme="string", + other_bank_routing_address="string", + is_beneficiary=true, + future_date=Some("string"), + payment_start_date=Some(toDate(dateExample)), + payment_end_date=Some(toDate(dateExample)), + payment_execution_Rule=Some("string"), + payment_frequency=Some("string"), + payment_day_of_execution=Some("string"))) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createTransactionRequestv400(initiator: User, viewId: ViewId, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, detailsPlain: String, chargePolicy: String, challengeType: Option[String], scaMethod: Option[StrongCustomerAuthentication.SCA], reasons: Option[List[TransactionRequestReason]], callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = { + import com.openbankproject.commons.dto.{InBoundCreateTransactionRequestv400 => InBound, OutBoundCreateTransactionRequestv400 => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, viewId, fromAccount, toAccount, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy, challengeType, scaMethod, reasons) + val response: Future[Box[InBound]] = sendRequest[InBound]("obp_create_transaction_requestv400", req, callContext) + response.map(convertToTuple[TransactionRequest](callContext)) + } + + messageDocs += createTransactionRequestSepaCreditTransfersBGV1Doc + def createTransactionRequestSepaCreditTransfersBGV1Doc = MessageDoc( + process = "obp.createTransactionRequestSepaCreditTransfersBGV1", + messageFormat = messageFormat, + description = "Create Transaction Request Sepa Credit Transfers BG V1", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateTransactionRequestSepaCreditTransfersBGV1(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + initiator= 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))), + paymentServiceType=com.openbankproject.commons.model.enums.PaymentServiceTypes.example, + transactionRequestType=com.openbankproject.commons.model.enums.TransactionRequestTypes.example, + transactionRequestBody= SepaCreditTransfersBerlinGroupV13(endToEndIdentification=Some("string"), + instructionIdentification=Some("string"), + debtorName=Some("string"), + debtorAccount=PaymentAccount("string"), + debtorId=Some("string"), + ultimateDebtor=Some("string"), + instructedAmount= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount=amountExample.value), + currencyOfTransfer=Some("string"), + exchangeRateInformation=Some("string"), + creditorAccount=PaymentAccount("string"), + creditorAgent=Some("string"), + creditorAgentName=Some("string"), + creditorName="string", + creditorId=Some("string"), + creditorAddress=Some("string"), + creditorNameAndAddress=Some("string"), + ultimateCreditor=Some("string"), + purposeCode=Some("string"), + chargeBearer=Some("string"), + serviceLevel=Some("string"), + remittanceInformationUnstructured=Some("string"), + remittanceInformationUnstructuredArray=Some("string"), + remittanceInformationStructured=Some("string"), + remittanceInformationStructuredArray=Some("string"), + requestedExecutionDate=Some("string"), + requestedExecutionTime=Some("string"))) + ), + exampleInboundMessage = ( + InBoundCreateTransactionRequestSepaCreditTransfersBGV1(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= TransactionRequestBGV1(id=TransactionRequestId(idExample.value), + status=statusExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createTransactionRequestSepaCreditTransfersBGV1(initiator: User, paymentServiceType: PaymentServiceTypes, transactionRequestType: TransactionRequestTypes, transactionRequestBody: SepaCreditTransfersBerlinGroupV13, callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequestBGV1]] = { + import com.openbankproject.commons.dto.{InBoundCreateTransactionRequestSepaCreditTransfersBGV1 => InBound, OutBoundCreateTransactionRequestSepaCreditTransfersBGV1 => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, paymentServiceType, transactionRequestType, transactionRequestBody) + val response: Future[Box[InBound]] = sendRequest[InBound]("obp_create_transaction_request_sepa_credit_transfers_bgv1", req, callContext) + response.map(convertToTuple[TransactionRequestBGV1](callContext)) + } + + messageDocs += createTransactionRequestPeriodicSepaCreditTransfersBGV1Doc + def createTransactionRequestPeriodicSepaCreditTransfersBGV1Doc = MessageDoc( + process = "obp.createTransactionRequestPeriodicSepaCreditTransfersBGV1", + messageFormat = messageFormat, + description = "Create Transaction Request Periodic Sepa Credit Transfers BG V1", + outboundTopic = None, + inboundTopic = None, + exampleOutboundMessage = ( + OutBoundCreateTransactionRequestPeriodicSepaCreditTransfersBGV1(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, + initiator= 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))), + paymentServiceType=com.openbankproject.commons.model.enums.PaymentServiceTypes.example, + transactionRequestType=com.openbankproject.commons.model.enums.TransactionRequestTypes.example, + transactionRequestBody= PeriodicSepaCreditTransfersBerlinGroupV13(endToEndIdentification=Some("string"), + instructionIdentification=Some("string"), + debtorName=Some("string"), + debtorAccount=PaymentAccount("string"), + debtorId=Some("string"), + ultimateDebtor=Some("string"), + instructedAmount= AmountOfMoneyJsonV121(currency=currencyExample.value, + amount=amountExample.value), + currencyOfTransfer=Some("string"), + exchangeRateInformation=Some("string"), + creditorAccount=PaymentAccount("string"), + creditorAgent=Some("string"), + creditorAgentName=Some("string"), + creditorName="string", + creditorId=Some("string"), + creditorAddress=Some("string"), + creditorNameAndAddress=Some("string"), + ultimateCreditor=Some("string"), + purposeCode=Some("string"), + chargeBearer=Some("string"), + serviceLevel=Some("string"), + remittanceInformationUnstructured=Some("string"), + remittanceInformationUnstructuredArray=Some("string"), + remittanceInformationStructured=Some("string"), + remittanceInformationStructuredArray=Some("string"), + requestedExecutionDate=Some("string"), + requestedExecutionTime=Some("string"), + startDate=startDateExample.value, + executionRule=Some("string"), + endDate=Some(endDateExample.value), + frequency=frequencyExample.value, + dayOfExecution=Some("string"))) + ), + exampleInboundMessage = ( + InBoundCreateTransactionRequestPeriodicSepaCreditTransfersBGV1(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, + status=MessageDocsSwaggerDefinitions.inboundStatus, + data= TransactionRequestBGV1(id=TransactionRequestId(idExample.value), + status=statusExample.value)) + ), + adapterImplementation = Some(AdapterImplementation("- Core", 1)) + ) + + override def createTransactionRequestPeriodicSepaCreditTransfersBGV1(initiator: User, paymentServiceType: PaymentServiceTypes, transactionRequestType: TransactionRequestTypes, transactionRequestBody: PeriodicSepaCreditTransfersBerlinGroupV13, callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequestBGV1]] = { + import com.openbankproject.commons.dto.{InBoundCreateTransactionRequestPeriodicSepaCreditTransfersBGV1 => InBound, OutBoundCreateTransactionRequestPeriodicSepaCreditTransfersBGV1 => OutBound} + val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, paymentServiceType, transactionRequestType, transactionRequestBody) + val response: Future[Box[InBound]] = sendRequest[InBound]("obp_create_transaction_request_periodic_sepa_credit_transfers_bgv1", req, callContext) + response.map(convertToTuple[TransactionRequestBGV1](callContext)) + } + messageDocs += getTransactionRequests210Doc def getTransactionRequests210Doc = MessageDoc( process = "obp.getTransactionRequests210", @@ -6630,8 +6928,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { response.map(convertToTuple[Boolean](callContext)) } -// ---------- created on 2024-09-10T12:17:56Z -//---------------- dynamic end ---------------------please don't modify this line +// ---------- created on 2024-09-20T12:17:12Z +//---------------- dynamic end ---------------------please don't modify this line private val availableOperation = DynamicEntityOperation.values.map(it => s""""$it"""").mkString("[", ", ", "]") diff --git a/obp-api/src/main/scala/code/model/View.scala b/obp-api/src/main/scala/code/model/View.scala index aed6d412ed..a775633dfe 100644 --- a/obp-api/src/main/scala/code/model/View.scala +++ b/obp-api/src/main/scala/code/model/View.scala @@ -32,9 +32,12 @@ import java.util.Date import code.api.util.ErrorMessages import code.metadata.counterparties.Counterparties +import code.views.system.ViewDefinition +import com.github.dwickern.macros.NameOf.nameOf import com.openbankproject.commons.model._ import com.openbankproject.commons.model.enums.AccountRoutingScheme import net.liftweb.common._ +import net.liftweb.util.StringHelpers case class ViewExtended(val view: View) { @@ -354,7 +357,7 @@ case class ViewExtended(val view: View) { ) } else - Failure(s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `canSeeTransactionThisBankAccount` permission on the view(${view.viewId.value})") + Failure(s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canSeeTransactionThisBankAccount_)).dropRight(1)}` permission on the view(${view.viewId.value})") } @deprecated("This have the performance issue, call `Connector.connector.vend.getBankLegacy` four times in the backend. use @moderateAccount instead ","08-01-2020") @@ -402,7 +405,7 @@ case class ViewExtended(val view: View) { ) } else - Failure(s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `canSeeTransactionThisBankAccount` permission on the view(${view.viewId.value})") + Failure(s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canSeeTransactionThisBankAccount_)).dropRight(1)}` permission on the view(${view.viewId.value})") } def moderateAccountCore(bankAccount: BankAccount) : Box[ModeratedBankAccountCore] = { @@ -435,7 +438,7 @@ case class ViewExtended(val view: View) { ) } else - Failure(s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `canSeeTransactionThisBankAccount` permission on the view(${view.viewId.value})") + Failure(s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canSeeTransactionThisBankAccount_)).dropRight(1)}` permission on the view(${view.viewId.value})") } // Moderate the Counterparty side of the Transaction (i.e. the Other Account involved in the transaction) @@ -558,7 +561,7 @@ case class ViewExtended(val view: View) { ) } else - Failure(s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `canSeeTransactionOtherBankAccount` permission on the view(${view.viewId.value})") + Failure(s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canSeeTransactionOtherBankAccount_)).dropRight(1)}` permission on the view(${view.viewId.value})") } def moderateCore(counterpartyCore : CounterpartyCore) : Box[ModeratedOtherBankAccountCore] = { @@ -607,6 +610,6 @@ case class ViewExtended(val view: View) { ) } else - Failure(s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `canSeeTransactionOtherBankAccount` permission on the view(${view.viewId.value})") + Failure(s"${ErrorMessages.ViewDoesNotPermitAccess} You need the `${StringHelpers.snakify(nameOf(ViewDefinition.canSeeTransactionOtherBankAccount_)).dropRight(1)}` permission on the view(${view.viewId.value})") } } diff --git a/obp-api/src/main/scala/code/transactionrequests/MappedTransactionRequestProvider.scala b/obp-api/src/main/scala/code/transactionrequests/MappedTransactionRequestProvider.scala index 262f19e98b..3c7b178096 100644 --- a/obp-api/src/main/scala/code/transactionrequests/MappedTransactionRequestProvider.scala +++ b/obp-api/src/main/scala/code/transactionrequests/MappedTransactionRequestProvider.scala @@ -5,10 +5,12 @@ import code.api.util.CustomJsonFormats import code.api.util.ErrorMessages._ import code.bankconnectors.Connector import code.model._ -import code.transactionrequests.TransactionRequests.{TransactionRequestTypes, _} import code.util.{AccountIdString, UUIDString} import com.openbankproject.commons.model._ import com.openbankproject.commons.model.enums.{AccountRoutingScheme, TransactionRequestStatus} +import com.openbankproject.commons.model.enums.TransactionRequestTypes +import com.openbankproject.commons.model.enums.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.PaymentServiceTypes._ import net.liftweb.common.{Box, Failure, Full, Logger} import net.liftweb.json import net.liftweb.json.JsonAST.{JField, JObject, JString} diff --git a/obp-api/src/main/scala/code/transactionrequests/TransactionRequests.scala b/obp-api/src/main/scala/code/transactionrequests/TransactionRequests.scala index 16a6736785..80f4766d8a 100644 --- a/obp-api/src/main/scala/code/transactionrequests/TransactionRequests.scala +++ b/obp-api/src/main/scala/code/transactionrequests/TransactionRequests.scala @@ -7,20 +7,6 @@ import net.liftweb.common.{Box, Logger} import net.liftweb.util.SimpleInjector object TransactionRequests extends SimpleInjector { - - //These are berlin Group Standard - object PaymentServiceTypes extends Enumeration { - type PaymentServiceTypes = Value - val payments, bulk_payments, periodic_payments = Value - } - - object TransactionRequestTypes extends Enumeration { - type TransactionRequestTypes = Value - val SANDBOX_TAN, ACCOUNT, ACCOUNT_OTP, COUNTERPARTY, SEPA, FREE_FORM, SIMPLE, CARD, - TRANSFER_TO_PHONE, TRANSFER_TO_ATM, TRANSFER_TO_ACCOUNT, TRANSFER_TO_REFERENCE_ACCOUNT, - //The following are BerlinGroup Standard - SEPA_CREDIT_TRANSFERS, INSTANT_SEPA_CREDIT_TRANSFERS, TARGET_2_PAYMENTS, CROSS_BORDER_CREDIT_TRANSFERS, REFUND = Value - } def updatestatus(newStatus: String) = {} diff --git a/obp-api/src/test/scala/code/api/berlin/group/v1_3/PaymentInitiationServicePISApiTest.scala b/obp-api/src/test/scala/code/api/berlin/group/v1_3/PaymentInitiationServicePISApiTest.scala index 277b9e7426..e9385aed7e 100644 --- a/obp-api/src/test/scala/code/api/berlin/group/v1_3/PaymentInitiationServicePISApiTest.scala +++ b/obp-api/src/test/scala/code/api/berlin/group/v1_3/PaymentInitiationServicePISApiTest.scala @@ -12,7 +12,10 @@ import code.api.util.APIUtil.extractErrorMessageCode import code.api.util.ErrorMessages.{AuthorisationNotFound, InvalidJsonFormat, NotPositiveAmount, _} import code.model.dataAccess.{BankAccountRouting, MappedBankAccount} import code.setup.{APIResponse, DefaultUsers} -import code.transactionrequests.TransactionRequests.{PaymentServiceTypes, TransactionRequestTypes} +import com.openbankproject.commons.model.enums.TransactionRequestTypes +import com.openbankproject.commons.model.enums.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.PaymentServiceTypes +import com.openbankproject.commons.model.enums.PaymentServiceTypes._ import code.views.Views import com.github.dwickern.macros.NameOf.nameOf import com.openbankproject.commons.model.enums.AccountRoutingScheme diff --git a/obp-api/src/test/scala/code/api/v1_4_0/TransactionRequestsTest.scala b/obp-api/src/test/scala/code/api/v1_4_0/TransactionRequestsTest.scala index 9ab5301ec8..e9d52ec6ac 100644 --- a/obp-api/src/test/scala/code/api/v1_4_0/TransactionRequestsTest.scala +++ b/obp-api/src/test/scala/code/api/v1_4_0/TransactionRequestsTest.scala @@ -7,13 +7,15 @@ import com.openbankproject.commons.model.AmountOfMoneyJsonV121 import code.api.v1_4_0.JSONFactory1_4_0._ import code.bankconnectors.Connector import code.setup.DefaultUsers -import code.transactionrequests.TransactionRequests.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.TransactionRequestTypes import com.openbankproject.commons.model.enums.{ChallengeType, TransactionRequestStatus} import net.liftweb.json.JsonAST.JString import net.liftweb.json.Serialization.write import org.scalatest.Tag import code.api.util.ErrorMessages._ import code.model.BankAccountX +import com.openbankproject.commons.model.enums.TransactionRequestTypes.SANDBOX_TAN import com.openbankproject.commons.model.{AccountId, BankAccount, TransactionRequestId} import scala.collection.immutable.List diff --git a/obp-api/src/test/scala/code/api/v2_0_0/TransactionRequestsTest.scala b/obp-api/src/test/scala/code/api/v2_0_0/TransactionRequestsTest.scala index fd6a573699..de9644a920 100644 --- a/obp-api/src/test/scala/code/api/v2_0_0/TransactionRequestsTest.scala +++ b/obp-api/src/test/scala/code/api/v2_0_0/TransactionRequestsTest.scala @@ -10,7 +10,8 @@ import code.bankconnectors.Connector import code.fx.fx import code.setup.DefaultUsers import com.openbankproject.commons.model.enums.TransactionRequestStatus -import code.transactionrequests.TransactionRequests.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.TransactionRequestTypes import net.liftweb.json.JsonAST.JString import net.liftweb.json.Serialization.write import net.liftweb.util.Props diff --git a/obp-api/src/test/scala/code/api/v2_1_0/TransactionRequestsTest.scala b/obp-api/src/test/scala/code/api/v2_1_0/TransactionRequestsTest.scala index 4d2eae3a5b..0466c4d137 100644 --- a/obp-api/src/test/scala/code/api/v2_1_0/TransactionRequestsTest.scala +++ b/obp-api/src/test/scala/code/api/v2_1_0/TransactionRequestsTest.scala @@ -17,7 +17,8 @@ import code.fx.fx import code.model.BankAccountX import code.setup.{APIResponse, DefaultUsers} import com.openbankproject.commons.model.enums.TransactionRequestStatus -import code.transactionrequests.TransactionRequests.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.TransactionRequestTypes import com.openbankproject.commons.model.{AccountId, BankAccount, TransactionRequestId} import net.liftweb.json.Serialization.write import org.scalatest.Tag diff --git a/obp-api/src/test/scala/code/api/v4_0_0/TransactionRequestsTest.scala b/obp-api/src/test/scala/code/api/v4_0_0/TransactionRequestsTest.scala index 7a09a0a2d2..7dde15ebb4 100644 --- a/obp-api/src/test/scala/code/api/v4_0_0/TransactionRequestsTest.scala +++ b/obp-api/src/test/scala/code/api/v4_0_0/TransactionRequestsTest.scala @@ -22,7 +22,8 @@ import code.fx.fx import code.model.BankAccountX import code.setup.{APIResponse, DefaultUsers} import com.openbankproject.commons.model.enums.TransactionRequestStatus -import code.transactionrequests.TransactionRequests.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.TransactionRequestTypes._ +import com.openbankproject.commons.model.enums.TransactionRequestTypes import com.github.dwickern.macros.NameOf.nameOf import com.openbankproject.commons.model._ import com.openbankproject.commons.util.ApiVersion diff --git a/obp-api/src/test/scala/code/connector/RestConnector_vMar2019_frozen_meta_data b/obp-api/src/test/scala/code/connector/RestConnector_vMar2019_frozen_meta_data index 25923a7f9e..e5c0237175 100644 Binary files a/obp-api/src/test/scala/code/connector/RestConnector_vMar2019_frozen_meta_data and b/obp-api/src/test/scala/code/connector/RestConnector_vMar2019_frozen_meta_data differ 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 24349e20fd..cff2c084d5 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,7 +27,7 @@ TESOBE (http://www.tesobe.com/) package com.openbankproject.commons.dto import java.util.Date -import com.openbankproject.commons.model.enums.{CardAttributeType, ChallengeType, CustomerAttributeType, DynamicEntityOperation, StrongCustomerAuthentication, SuppliedAnswerType, TransactionAttributeType, TransactionRequestStatus} +import com.openbankproject.commons.model.enums.{CardAttributeType, ChallengeType, CustomerAttributeType, DynamicEntityOperation, PaymentServiceTypes, StrongCustomerAuthentication, SuppliedAnswerType, TransactionAttributeType, 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 @@ -1102,11 +1102,27 @@ case class OutBoundCreateTransactionRequestv400(outboundAdapterCallContext: Outb challengeType: Option[String], scaMethod: Option[StrongCustomerAuthentication.SCA], reasons: Option[List[TransactionRequestReason]], - paymentService: Option[String], - berlinGroupPayments: Option[BerlinGroupTransactionRequestCommonBodyJson] ) extends TopicTrait case class InBoundCreateTransactionRequestv400(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] +case class OutBoundCreateTransactionRequestSepaCreditTransfersBGV1( + outboundAdapterCallContext: OutboundAdapterCallContext, initiator: User, + paymentServiceType: PaymentServiceTypes.Value, + transactionRequestType: TransactionRequestTypes.Value, + transactionRequestBody: SepaCreditTransfersBerlinGroupV13, +) extends TopicTrait + +case class InBoundCreateTransactionRequestSepaCreditTransfersBGV1 (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequestBGV1) extends InBoundTrait[TransactionRequestBGV1] + +case class OutBoundCreateTransactionRequestPeriodicSepaCreditTransfersBGV1( + outboundAdapterCallContext: OutboundAdapterCallContext, initiator: User, + paymentServiceType: PaymentServiceTypes.Value, + transactionRequestType: TransactionRequestTypes.Value, + transactionRequestBody: PeriodicSepaCreditTransfersBerlinGroupV13, +) extends TopicTrait + +case class InBoundCreateTransactionRequestPeriodicSepaCreditTransfersBGV1(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequestBGV1) extends InBoundTrait[TransactionRequestBGV1] + case class OutBoundCreateTransactionRequestImpl(transactionRequestId: TransactionRequestId, transactionRequestType: TransactionRequestType, fromAccount: BankAccount, counterparty: BankAccount, body: TransactionRequestBody, status: String, charge: TransactionRequestCharge) extends TopicTrait case class InBoundCreateTransactionRequestImpl(status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest] { override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext() diff --git a/obp-commons/src/main/scala/com/openbankproject/commons/model/CommonModel.scala b/obp-commons/src/main/scala/com/openbankproject/commons/model/CommonModel.scala index 1bd331dc7a..a29c6853fe 100644 --- a/obp-commons/src/main/scala/com/openbankproject/commons/model/CommonModel.scala +++ b/obp-commons/src/main/scala/com/openbankproject/commons/model/CommonModel.scala @@ -388,6 +388,37 @@ case class TransactionRequestCommonBodyJSONCommons( object TransactionRequestCommonBodyJSONCommons extends Converter[TransactionRequestCommonBodyJSON, TransactionRequestCommonBodyJSONCommons] +case class BerlinGroupTransactionRequestCommonBodyJsonCommons( + endToEndIdentification: Option[String], + instructionIdentification: Option[String], + debtorName: Option[String], + debtorAccount: PaymentAccount, + debtorId: Option[String], + ultimateDebtor: Option[String], + instructedAmount: AmountOfMoneyJsonV121, + currencyOfTransfer: Option[String], + exchangeRateInformation: Option[String], + creditorAccount: PaymentAccount, + creditorAgent: Option[String], + creditorAgentName: Option[String], + creditorName: String, + creditorId: Option[String], + creditorAddress: Option[String], + creditorNameAndAddress: Option[String], + ultimateCreditor: Option[String], + purposeCode: Option[String], + chargeBearer: Option[String], + serviceLevel: Option[String], + remittanceInformationUnstructured: Option[String], + remittanceInformationUnstructuredArray: Option[String], + remittanceInformationStructured: Option[String], + remittanceInformationStructuredArray: Option[String], + requestedExecutionDate: Option[String], + requestedExecutionTime: Option[String], +) extends BerlinGroupTransactionRequestCommonBodyJson + +object BerlinGroupTransactionRequestCommonBodyJsonCommons extends Converter[BerlinGroupTransactionRequestCommonBodyJson, BerlinGroupTransactionRequestCommonBodyJsonCommons] + case class TransactionRequestStatusCommons( transactionRequestId: String, bulkTransactionsStatus: List[TransactionStatus] @@ -827,6 +858,12 @@ case class TransactionRequest ( @optional payment_day_of_execution :Option[String] = None, ) + +case class TransactionRequestBGV1( + id: TransactionRequestId, + status: String, +) + case class TransactionRequestBody ( val to: TransactionRequestAccount, val value : AmountOfMoney, diff --git a/obp-commons/src/main/scala/com/openbankproject/commons/model/enums/Enumerations.scala b/obp-commons/src/main/scala/com/openbankproject/commons/model/enums/Enumerations.scala index 38a604467b..e65d502d3f 100644 --- a/obp-commons/src/main/scala/com/openbankproject/commons/model/enums/Enumerations.scala +++ b/obp-commons/src/main/scala/com/openbankproject/commons/model/enums/Enumerations.scala @@ -79,6 +79,34 @@ object TransactionRequestAttributeType extends OBPEnumeration[TransactionReques } //------api enumerations ---- +sealed trait PaymentServiceTypes extends EnumValue +object PaymentServiceTypes extends OBPEnumeration[PaymentServiceTypes]{ + object payments extends Value + object bulk_payments extends Value + object periodic_payments extends Value +} + +sealed trait TransactionRequestTypes extends EnumValue +object TransactionRequestTypes extends OBPEnumeration[TransactionRequestTypes]{ + object SANDBOX_TAN extends Value + object ACCOUNT extends Value + object ACCOUNT_OTP extends Value + object COUNTERPARTY extends Value + object SEPA extends Value + object FREE_FORM extends Value + object SIMPLE extends Value + object CARD extends Value + object TRANSFER_TO_PHONE extends Value + object TRANSFER_TO_ATM extends Value + object TRANSFER_TO_ACCOUNT extends Value + object TRANSFER_TO_REFERENCE_ACCOUNT extends Value + object SEPA_CREDIT_TRANSFERS extends Value + object INSTANT_SEPA_CREDIT_TRANSFERS extends Value + object TARGET_2_PAYMENTS extends Value + object CROSS_BORDER_CREDIT_TRANSFERS extends Value + object REFUND extends Value +} + sealed trait StrongCustomerAuthentication extends EnumValue object StrongCustomerAuthentication extends OBPEnumeration[StrongCustomerAuthentication] { type SCA = Value