Added Transaction

This commit is contained in:
Azeez Muibi
2025-04-11 09:01:27 +01:00
parent 075f953dbc
commit 9116d54b4f
14 changed files with 436 additions and 25 deletions
+19 -1
View File
@@ -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():