From b8fde2c32098307c65040546695ab4a7eff4ddbc Mon Sep 17 00:00:00 2001 From: VivianDee <115420678+VivianDee@users.noreply.github.com> Date: Wed, 11 Mar 2026 11:14:31 +0100 Subject: [PATCH 1/4] Update verify_account_balance.py --- app/api/services/verify_account_balance.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/api/services/verify_account_balance.py b/app/api/services/verify_account_balance.py index 7314e0b..68c8a74 100644 --- a/app/api/services/verify_account_balance.py +++ b/app/api/services/verify_account_balance.py @@ -3,8 +3,6 @@ from flask import request, jsonify from marshmallow import ValidationError from app.utils.logger import logger from app.api.helpers.response_helper import ResponseHelper -from datetime import datetime -from decimal import Decimal class VerifyAccountBalanceService: @staticmethod @@ -30,7 +28,6 @@ class VerifyAccountBalanceService: amount = validated_data["amount"] - # response_schema = RACCheckResponseSchema() result = { "responseCode": "00", "responseMessage": "Operation Successful", From bb5237797df176b59a86ed89f4e8c5a65c4e4580 Mon Sep 17 00:00:00 2001 From: VivianDee <115420678+VivianDee@users.noreply.github.com> Date: Wed, 11 Mar 2026 11:16:23 +0100 Subject: [PATCH 2/4] Update verify_account_balance.py --- app/api/services/verify_account_balance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/services/verify_account_balance.py b/app/api/services/verify_account_balance.py index 68c8a74..b24099d 100644 --- a/app/api/services/verify_account_balance.py +++ b/app/api/services/verify_account_balance.py @@ -17,7 +17,7 @@ class VerifyAccountBalanceService: tuple: JSON response and status code. """ try: - logger.info("Processing RACCheck request") + logger.info("Processing VerifyBalance request") # Validate input data schema = VerifyAccountBalanceSchema() From ab7cd0bedff0c122275a597ae34941bff0d6f3d2 Mon Sep 17 00:00:00 2001 From: VivianDee <115420678+VivianDee@users.noreply.github.com> Date: Wed, 11 Mar 2026 13:54:56 +0100 Subject: [PATCH 3/4] [fix]: Verify balance --- app/api/routes/routes.py | 5 +++-- app/api/services/__init__.py | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/api/routes/routes.py b/app/api/routes/routes.py index e39b85a..c88b6c7 100644 --- a/app/api/routes/routes.py +++ b/app/api/routes/routes.py @@ -11,7 +11,8 @@ from app.api.services import ( TokenValidationService, LienCheckService, NewTransactionCheckService, - CompleteRACcheckService + CompleteRACcheckService, + VerifyAccountBalanceService ) from app.utils.logger import logger from app.api.middlewares import enforce_json @@ -59,7 +60,7 @@ def rac_check(): -# RACCheck Endpoint +# VerifyAccountBalance Endpoint @api.route('/VerifyAccountBalance', methods=['POST']) @jwt_required() def verify_account_balance(): diff --git a/app/api/services/__init__.py b/app/api/services/__init__.py index d98163f..b8a5213 100644 --- a/app/api/services/__init__.py +++ b/app/api/services/__init__.py @@ -9,3 +9,4 @@ from app.api.services.lien_check import LienCheckService from app.api.services.new_transaction_check import NewTransactionCheckService from app.api.services.complete_rac_check_service import CompleteRACcheckService from app.api.services.generate_token import GenerateTokenService +from app.api.services.verify_account_balance import VerifyAccountBalanceService From 473d9568d2a528923e3b4d49562bbdea17cbd7b8 Mon Sep 17 00:00:00 2001 From: VivianDee <115420678+VivianDee@users.noreply.github.com> Date: Wed, 11 Mar 2026 14:07:15 +0100 Subject: [PATCH 4/4] [fix]: Vrifyy balance --- app/api/services/verify_account_balance.py | 4 +- app/swagger/digifi_swagger.json | 17 ++++++ app/swagger/paths/VerifyAccountBalance.json | 56 +++++++++++++++++++ .../schemas/VerifyAccountBalanceRequest.json | 25 +++++++++ .../schemas/VerifyAccountBalanceResponse.json | 15 +++++ 5 files changed, 115 insertions(+), 2 deletions(-) create mode 100644 app/swagger/paths/VerifyAccountBalance.json create mode 100644 app/swagger/schemas/VerifyAccountBalanceRequest.json create mode 100644 app/swagger/schemas/VerifyAccountBalanceResponse.json diff --git a/app/api/services/verify_account_balance.py b/app/api/services/verify_account_balance.py index b24099d..e4e83cb 100644 --- a/app/api/services/verify_account_balance.py +++ b/app/api/services/verify_account_balance.py @@ -23,8 +23,8 @@ class VerifyAccountBalanceService: schema = VerifyAccountBalanceSchema() validated_data = schema.load(data) - account_id = validated_data["account_id"] - request_id = validated_data["request_id"] + account_id = validated_data["accountId"] + request_id = validated_data["requestId"] amount = validated_data["amount"] diff --git a/app/swagger/digifi_swagger.json b/app/swagger/digifi_swagger.json index 524d78e..c87de6a 100644 --- a/app/swagger/digifi_swagger.json +++ b/app/swagger/digifi_swagger.json @@ -45,6 +45,14 @@ "url": "https://www.simbrellang.net" } }, + { + "name": "VerifyAccountBalance", + "description": "Verify Account Balance Request", + "externalDocs": { + "description": "Find out more", + "url": "https://www.simbrellang.net" + } + }, { "name": "CompleteRACcheck", "description": "Complete Risk Acceptance Criteria Request", @@ -127,6 +135,9 @@ }, "/api/rac-check": { "$ref": "swagger/paths/RACCheck.json" + }, + "/api/VerifyAccountBalance": { + "$ref": "swagger/paths/VerifyAccountBalance.json" }, "/api/CompleteRACcheck": { "$ref": "swagger/paths/CompleteRACcheck.json" @@ -170,6 +181,12 @@ "RACCheckResponse": { "$ref": "./schemas/RACCheckResponse.json" }, + "VerifyAccountBalanceRequest": { + "$ref": "./schemas/VerifyAccountBalanceRequest.json" + }, + "VerifyAccountBalanceResponse": { + "$ref": "./schemas/VerifyAccountBalanceResponse.json" + }, "CompleteRACcheckRequest": { "$ref": "./schemas/CompleteRACcheckRequest.json" }, diff --git a/app/swagger/paths/VerifyAccountBalance.json b/app/swagger/paths/VerifyAccountBalance.json new file mode 100644 index 0000000..9c6dbc1 --- /dev/null +++ b/app/swagger/paths/VerifyAccountBalance.json @@ -0,0 +1,56 @@ +{ + "post": { + "tags": [ + "VerifyAccountBalance" + ], + "summary": "Risk Acceptance Criteria Check", + "description": "Check if a customer passes the Risk Acceptance Criteria defined by the bank", + "operationId": "verifyAccountBalance", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "../schemas/VerifyAccountBalanceRequest.json" + } + }, + "application/xml": { + "schema": { + "$ref": "../schemas/VerifyAccountBalanceRequest.json" + } + }, + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "../schemas/VerifyAccountBalanceRequest.json" + } + } + } + }, + "responses": { + "200": { + "description": "Verify Account Balance Successful", + "content": { + "application/json": { + "schema": { + "$ref": "../schemas/VerifyAccountBalanceResponse.json" + } + }, + "application/xml": { + "schema": { + "$ref": "../schemas/VerifyAccountBalanceResponse.json" + } + } + } + }, + "400": { + "description": "Invalid request" + }, + "422": { + "description": "Validation exception" + }, + "500": { + "description": "Internal server error" + } + } + } + } \ No newline at end of file diff --git a/app/swagger/schemas/VerifyAccountBalanceRequest.json b/app/swagger/schemas/VerifyAccountBalanceRequest.json new file mode 100644 index 0000000..b1f721b --- /dev/null +++ b/app/swagger/schemas/VerifyAccountBalanceRequest.json @@ -0,0 +1,25 @@ +{ + "type": "object", + "properties": { + "amount": { + "type": "string", + "example": "200" + }, + "requestId": { + "type": "string", + "example": "RQ621868" + }, + "accountId": { + "type": "string", + "example": "2017821799" + } + }, + "required": [ + "accountId", + "requestId", + "amount" + ], + "xml": { + "name": "VerifyAccountBalanceRequest" + } +} \ No newline at end of file diff --git a/app/swagger/schemas/VerifyAccountBalanceResponse.json b/app/swagger/schemas/VerifyAccountBalanceResponse.json new file mode 100644 index 0000000..cb1b01d --- /dev/null +++ b/app/swagger/schemas/VerifyAccountBalanceResponse.json @@ -0,0 +1,15 @@ +{ + "type": "object", + "properties": { + "isSufficient": { + "type": "string", + "example": "true" + } + }, + "required": [ + "isSufficient" + ], + "xml": { + "name": "VerifyAccountBalanceResponse" + } +}