mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 17:17:09 +00:00
feature/Add BG view InitiatePaymentsBerlinGroup
This commit is contained in:
parent
b0259ee0b4
commit
d9b0f14fa6
@ -294,7 +294,8 @@ class Boot extends MdcLoggable {
|
||||
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_READ_TRANSACTIONS_BERLIN_GROUP_VIEW_ID,
|
||||
SYSTEM_INITIATE_PAYMENTS_BERLIN_GROUP_VIEW_ID
|
||||
)
|
||||
for {
|
||||
systemView <- viewSetUKOpenBanking
|
||||
|
||||
@ -568,7 +568,7 @@ Check the transaction status of a payment initiation.""",
|
||||
}
|
||||
(toAccount, callContext) <- NewStyle.function.getToBankAccountByIban(toAccountIban, callContext)
|
||||
|
||||
viewId = ViewId(SYSTEM_READ_TRANSACTIONS_BERLIN_GROUP_VIEW_ID)
|
||||
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) {
|
||||
|
||||
@ -60,6 +60,7 @@ object Constant extends MdcLoggable {
|
||||
final val SYSTEM_READ_ACCOUNTS_BERLIN_GROUP_VIEW_ID = "ReadAccountsBerlinGroup"
|
||||
final val SYSTEM_READ_BALANCES_BERLIN_GROUP_VIEW_ID = "ReadBalancesBerlinGroup"
|
||||
final val SYSTEM_READ_TRANSACTIONS_BERLIN_GROUP_VIEW_ID = "ReadTransactionsBerlinGroup"
|
||||
final val SYSTEM_INITIATE_PAYMENTS_BERLIN_GROUP_VIEW_ID = "InitiatePaymentsBerlinGroup"
|
||||
|
||||
//This is used for the canRevokeAccessToViews_ and canGrantAccessToViews_ fields of SYSTEM_OWNER_VIEW_ID or SYSTEM_STANDARD_VIEW_ID.
|
||||
final val DEFAULT_CAN_GRANT_AND_REVOKE_ACCESS_TO_VIEWS =
|
||||
@ -78,7 +79,8 @@ object Constant extends MdcLoggable {
|
||||
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 :: Nil
|
||||
SYSTEM_READ_TRANSACTIONS_BERLIN_GROUP_VIEW_ID ::
|
||||
SYSTEM_INITIATE_PAYMENTS_BERLIN_GROUP_VIEW_ID :: Nil
|
||||
|
||||
//We allow CBS side to generate views by getBankAccountsForUser.viewsToGenerate filed.
|
||||
// viewsToGenerate can be any views, and OBP will check the following list, to make sure only allowed views are generated
|
||||
@ -92,7 +94,8 @@ object Constant extends MdcLoggable {
|
||||
SYSTEM_MANAGE_CUSTOM_VIEWS_VIEW_ID::
|
||||
SYSTEM_READ_ACCOUNTS_BERLIN_GROUP_VIEW_ID::
|
||||
SYSTEM_READ_BALANCES_BERLIN_GROUP_VIEW_ID::
|
||||
SYSTEM_READ_TRANSACTIONS_BERLIN_GROUP_VIEW_ID :: Nil
|
||||
SYSTEM_READ_TRANSACTIONS_BERLIN_GROUP_VIEW_ID ::
|
||||
SYSTEM_INITIATE_PAYMENTS_BERLIN_GROUP_VIEW_ID :: Nil
|
||||
|
||||
//These are the default incoming and outgoing account ids. we will create both during the boot.scala.
|
||||
final val INCOMING_SETTLEMENT_ACCOUNT_ID = "OBP-INCOMING-SETTLEMENT-ACCOUNT"
|
||||
|
||||
@ -411,10 +411,27 @@ trait OBPDataImport extends MdcLoggable {
|
||||
val readAccountsBerlinGroupView = Views.views.vend.getOrCreateSystemView(SYSTEM_READ_ACCOUNTS_BERLIN_GROUP_VIEW_ID).asInstanceOf[Box[ViewType]]
|
||||
val readBalancesBerlinGroupView = Views.views.vend.getOrCreateSystemView(SYSTEM_READ_BALANCES_BERLIN_GROUP_VIEW_ID).asInstanceOf[Box[ViewType]]
|
||||
val readTransactionsBerlinGroupView = Views.views.vend.getOrCreateSystemView(SYSTEM_READ_TRANSACTIONS_BERLIN_GROUP_VIEW_ID).asInstanceOf[Box[ViewType]]
|
||||
val initiatePaymentsBerlinGroupView = Views.views.vend.getOrCreateSystemView(SYSTEM_INITIATE_PAYMENTS_BERLIN_GROUP_VIEW_ID).asInstanceOf[Box[ViewType]]
|
||||
|
||||
|
||||
|
||||
List(accountFirehose, ownerView, accountantsView, auditorsView, publicView, readAccountsBasicView, readAccountsDetailView, readBalancesView, readTransactionsBasicView, readTransactionsDebitsView, readTransactionsDetailView, readAccountsBerlinGroupView, readBalancesBerlinGroupView, readTransactionsBerlinGroupView).flatten
|
||||
List(
|
||||
accountFirehose,
|
||||
ownerView,
|
||||
accountantsView,
|
||||
auditorsView,
|
||||
publicView,
|
||||
readAccountsBasicView,
|
||||
readAccountsDetailView,
|
||||
readBalancesView,
|
||||
readTransactionsBasicView,
|
||||
readTransactionsDebitsView,
|
||||
readTransactionsDetailView,
|
||||
readAccountsBerlinGroupView,
|
||||
readBalancesBerlinGroupView,
|
||||
readTransactionsBerlinGroupView,
|
||||
initiatePaymentsBerlinGroupView
|
||||
).flatten
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -970,6 +970,13 @@ object MapperViews extends Views with MdcLoggable {
|
||||
.canSeeTransactionStartDate_(true)
|
||||
.canSeeTransactionFinishDate_(true)
|
||||
.canSeeTransactionDescription_(true)
|
||||
case SYSTEM_INITIATE_PAYMENTS_BERLIN_GROUP_VIEW_ID =>
|
||||
create // A new one
|
||||
.isSystem_(true)
|
||||
.isFirehose_(false)
|
||||
.name_(StringHelpers.capify(viewId))
|
||||
.view_id(viewId)
|
||||
.description_(viewId)
|
||||
.canAddTransactionRequestToAnyAccount_(true)
|
||||
case _ =>
|
||||
entity
|
||||
|
||||
@ -23,6 +23,7 @@ trait BerlinGroupServerSetupV1_3 extends ServerSetupWithTestData {
|
||||
Views.views.vend.getOrCreateSystemView(SYSTEM_READ_ACCOUNTS_BERLIN_GROUP_VIEW_ID)
|
||||
Views.views.vend.getOrCreateSystemView(Constant.SYSTEM_READ_BALANCES_BERLIN_GROUP_VIEW_ID)
|
||||
Views.views.vend.getOrCreateSystemView(Constant.SYSTEM_READ_TRANSACTIONS_BERLIN_GROUP_VIEW_ID)
|
||||
Views.views.vend.getOrCreateSystemView(Constant.SYSTEM_INITIATE_PAYMENTS_BERLIN_GROUP_VIEW_ID)
|
||||
}
|
||||
|
||||
def grantUserAccessToViewViaEndpoint(bankId: String,
|
||||
|
||||
@ -2,7 +2,7 @@ package code.api.berlin.group.v1_3
|
||||
|
||||
import code.api.BerlinGroup.ScaStatus
|
||||
import code.api.Constant
|
||||
import code.api.Constant.SYSTEM_READ_TRANSACTIONS_BERLIN_GROUP_VIEW_ID
|
||||
import code.api.Constant.{SYSTEM_INITIATE_PAYMENTS_BERLIN_GROUP_VIEW_ID, SYSTEM_READ_TRANSACTIONS_BERLIN_GROUP_VIEW_ID}
|
||||
import code.api.berlin.group.v1_3.JSONFactory_BERLIN_GROUP_1_3.{CancellationJsonV13, InitiatePaymentResponseJson, StartPaymentAuthorisationJson}
|
||||
import code.api.berlin.group.v1_3.model.{PsuData, ScaStatusResponse, UpdatePsuAuthenticationResponse}
|
||||
import code.api.berlin.group.v1_3.JSONFactory_BERLIN_GROUP_1_3.{CancellationJsonV13, ErrorMessagesBG, InitiatePaymentResponseJson, StartPaymentAuthorisationJson}
|
||||
@ -206,7 +206,8 @@ class PaymentInitiationServicePISApiTest extends BerlinGroupServerSetupV1_3 with
|
||||
}
|
||||
|
||||
private def grantAccountAccess(acountRoutingIbanFrom: BankAccountRouting) = {
|
||||
Views.views.vend.systemView(ViewId(SYSTEM_READ_TRANSACTIONS_BERLIN_GROUP_VIEW_ID)).flatMap(view =>
|
||||
org.scalameta.logger.elem(Views.views.vend.systemView(ViewId(SYSTEM_INITIATE_PAYMENTS_BERLIN_GROUP_VIEW_ID)))
|
||||
Views.views.vend.systemView(ViewId(SYSTEM_INITIATE_PAYMENTS_BERLIN_GROUP_VIEW_ID)).flatMap(view =>
|
||||
// Grant account access
|
||||
Views.views.vend.grantAccessToSystemView(acountRoutingIbanFrom.bankId,
|
||||
acountRoutingIbanFrom.accountId,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user