Added Transaction
This commit is contained in:
@@ -8,6 +8,7 @@ from app.api.services import (
|
||||
CustomerConsentService,
|
||||
NotificationCallbackService,
|
||||
AuthorizationService,
|
||||
TransactionService,
|
||||
)
|
||||
from app.utils.logger import logger
|
||||
from app.api.middlewares import enforce_json, require_auth
|
||||
@@ -20,7 +21,6 @@ from flask_jwt_extended import (
|
||||
create_refresh_token,
|
||||
)
|
||||
|
||||
|
||||
api = Blueprint("api", __name__)
|
||||
|
||||
|
||||
@@ -119,6 +119,24 @@ def health_check():
|
||||
return {"status": "ok"}, 200
|
||||
|
||||
|
||||
# Get All Transactions Endpoint
|
||||
@api.route("/transactions", methods=["GET"])
|
||||
@jwt_required()
|
||||
def get_transactions():
|
||||
# Extract query parameters for filtering
|
||||
filters = {
|
||||
'account_id': request.args.get('account_id'),
|
||||
'type': request.args.get('type'),
|
||||
'channel': request.args.get('channel'),
|
||||
'start_date': request.args.get('start_date'),
|
||||
'end_date': request.args.get('end_date')
|
||||
}
|
||||
|
||||
# logger.info(f"Get transactions request received with filters: {filters}")
|
||||
response = TransactionService.process_request(filters)
|
||||
return response
|
||||
|
||||
|
||||
# Authorize endpoint
|
||||
@api.route("/Authorize", methods=["POST"])
|
||||
def authorize():
|
||||
|
||||
Reference in New Issue
Block a user