"""Blueprint for Payment Group Payment Batch Account API.""" from http import HTTPStatus from common_apispec import doc, marshal_with, use_kwargs from flask import Blueprint from payment.logic import payment_group_payment_batch_account as logic from payment.schemas.payment_group_payment_batch_account import ( PaymentGroupPaymentBatchAccountSchema, ) from payment.utils.authorization import check_access payment_group_payment_batch_account_api = Blueprint( 'payment_group_payment_batch_account_api', __name__, url_prefix='/payment-group-payment-batch-account', ) @payment_group_payment_batch_account_api.route('/bulk/', methods=['POST']) @doc( tags=['payment group payment batch account'], description='Bulk create payment group payment batch account records.', ) @check_access @use_kwargs( PaymentGroupPaymentBatchAccountSchema( exclude=('payment_group_payment_batch_account_id',), many=True ), location='json', ) @marshal_with( PaymentGroupPaymentBatchAccountSchema(many=True), code=HTTPStatus.CREATED, description=HTTPStatus.CREATED.phrase, ) def bulk_create_payment_group_payment_batch_account(*create_params: dict): """Bulk create payment_group_payment_batch_account records.""" return logic.bulk_create(create_params), HTTPStatus.CREATED