diff --git a/README.md b/README.md index 11dbc38..712b197 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ This command will build the Docker image and start the Flask application in a co You can check if the Flask application is running by accessing the `/health` endpoint. To perform a health check, run the following command: ```bash -curl http://localhost:5000/health +curl http://localhost:6337/health ``` If the application is running properly, you should receive a response similar to this: diff --git a/Swagger Draft First Advance Integration Details v1.3.docx - Google Docs.pdf b/Swagger Draft First Advance Integration Details v1.3.docx - Google Docs.pdf new file mode 100644 index 0000000..5c472ea Binary files /dev/null and b/Swagger Draft First Advance Integration Details v1.3.docx - Google Docs.pdf differ diff --git a/app/__init__.py b/app/__init__.py index 2bf7f5d..e7b7836 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -1,8 +1,10 @@ from flask import Flask +import os +from flask_swagger_ui import get_swaggerui_blueprint from flask_cors import CORS from app.config import Config -from app.routes import api -from app.errors import method_not_allowed, unsupported_media_type +from app.api.routes import api +from app.errors import register_error_handlers def create_app(): """ Factory function to create a Flask app instance """ @@ -14,12 +16,22 @@ def create_app(): CORS(app) + # Swagger Doc + SWAGGER_URL = app.config.get("SWAGGER_URL") + API_URL = app.config.get("API_URL") + + # Register blueprints app.register_blueprint(api) + swagger_ui_blueprint = get_swaggerui_blueprint(SWAGGER_URL, API_URL) + app.register_blueprint(swagger_ui_blueprint, url_prefix=SWAGGER_URL) + # Error Handlers - app.register_error_handler(405, method_not_allowed) - app.register_error_handler(415, unsupported_media_type) + register_error_handlers(app) + + + return app diff --git a/app/helpers/response_helper.py b/app/api/helpers/response_helper.py similarity index 100% rename from app/helpers/response_helper.py rename to app/api/helpers/response_helper.py diff --git a/app/middlewares/__init__.py b/app/api/middlewares/__init__.py similarity index 100% rename from app/middlewares/__init__.py rename to app/api/middlewares/__init__.py diff --git a/app/middlewares/app_id_checker.py b/app/api/middlewares/app_id_checker.py similarity index 100% rename from app/middlewares/app_id_checker.py rename to app/api/middlewares/app_id_checker.py diff --git a/app/middlewares/cors.py b/app/api/middlewares/cors.py similarity index 100% rename from app/middlewares/cors.py rename to app/api/middlewares/cors.py diff --git a/app/middlewares/verify_api_key.py b/app/api/middlewares/verify_api_key.py similarity index 98% rename from app/middlewares/verify_api_key.py rename to app/api/middlewares/verify_api_key.py index 81644b1..f2bcf22 100644 --- a/app/middlewares/verify_api_key.py +++ b/app/api/middlewares/verify_api_key.py @@ -11,6 +11,7 @@ def require_api_key(f): @wraps(f) def decorated_function(*args, **kwargs): api_key = request.headers.get("X-API-KEY") + if not api_key: logger.error("Unauthorized access: Missing API key.") diff --git a/app/routes/__init__.py b/app/api/routes/__init__.py similarity index 100% rename from app/routes/__init__.py rename to app/api/routes/__init__.py diff --git a/app/routes/routes.py b/app/api/routes/routes.py similarity index 84% rename from app/routes/routes.py rename to app/api/routes/routes.py index 4629a00..874fde0 100644 --- a/app/routes/routes.py +++ b/app/api/routes/routes.py @@ -1,5 +1,6 @@ -from flask import Blueprint, request, jsonify -from app.services import ( +from flask import Flask, Blueprint, request, jsonify, send_from_directory +import os +from app.api.services import ( RACCheckService, DisbursementService, CollectLoanService, @@ -11,19 +12,30 @@ from app.services import ( NewTransactionCheckService, ) from app.utils.logger import logger -from app.middlewares import require_api_key, require_app_id, enforce_json +from app.api.middlewares import require_api_key, require_app_id, enforce_json api = Blueprint("api", __name__) - +# Enforce json @api.before_request def cors_middleware(): """Middleware applied globally to all API routes in this blueprint""" return enforce_json() +# Swagger JSON file +@api.route("/swagger.json", methods=['GET']) +def swagger_json(): + swagger_dir = os.path.join("swagger") + return send_from_directory(swagger_dir, "digifi_swagger.json") + + +@api.route('/swagger/') +def serve_paths(filename): + swagger_dir = os.path.join("swagger") + return send_from_directory(swagger_dir, filename) # RACCheck Endpoint @api.route('/RACCheck', methods=['POST']) diff --git a/app/schemas/__init__.py b/app/api/schemas/__init__.py similarity index 100% rename from app/schemas/__init__.py rename to app/api/schemas/__init__.py diff --git a/app/schemas/collect_loan.py b/app/api/schemas/collect_loan.py similarity index 100% rename from app/schemas/collect_loan.py rename to app/api/schemas/collect_loan.py diff --git a/app/schemas/customer_consent.py b/app/api/schemas/customer_consent.py similarity index 100% rename from app/schemas/customer_consent.py rename to app/api/schemas/customer_consent.py diff --git a/app/schemas/disbursement.py b/app/api/schemas/disbursement.py similarity index 100% rename from app/schemas/disbursement.py rename to app/api/schemas/disbursement.py diff --git a/app/schemas/lien_check.py b/app/api/schemas/lien_check.py similarity index 100% rename from app/schemas/lien_check.py rename to app/api/schemas/lien_check.py diff --git a/app/schemas/new_transaction_check.py b/app/api/schemas/new_transaction_check.py similarity index 100% rename from app/schemas/new_transaction_check.py rename to app/api/schemas/new_transaction_check.py diff --git a/app/schemas/penal_charge.py b/app/api/schemas/penal_charge.py similarity index 100% rename from app/schemas/penal_charge.py rename to app/api/schemas/penal_charge.py diff --git a/app/schemas/rac_check.py b/app/api/schemas/rac_check.py similarity index 100% rename from app/schemas/rac_check.py rename to app/api/schemas/rac_check.py diff --git a/app/schemas/revoke_enable_consent.py b/app/api/schemas/revoke_enable_consent.py similarity index 100% rename from app/schemas/revoke_enable_consent.py rename to app/api/schemas/revoke_enable_consent.py diff --git a/app/schemas/token_validation.py b/app/api/schemas/token_validation.py similarity index 100% rename from app/schemas/token_validation.py rename to app/api/schemas/token_validation.py diff --git a/app/schemas/transaction_verify.py b/app/api/schemas/transaction_verify.py similarity index 100% rename from app/schemas/transaction_verify.py rename to app/api/schemas/transaction_verify.py diff --git a/app/api/services/__init__.py b/app/api/services/__init__.py new file mode 100644 index 0000000..085ead8 --- /dev/null +++ b/app/api/services/__init__.py @@ -0,0 +1,9 @@ +from app.api.services.rac_check import RACCheckService +from app.api.services.disbursement import DisbursementService +from app.api.services.collect_loan import CollectLoanService +from app.api.services.transaction_verify import TransactionVerifyService +from app.api.services.penal_charge import PenalChargeService +from app.api.services.revoke_enable_consent import RevokeEnableConsentService +from app.api.services.token_validation import TokenValidationService +from app.api.services.lien_check import LienCheckService +from app.api.services.new_transaction_check import NewTransactionCheckService diff --git a/app/services/collect_loan.py b/app/api/services/collect_loan.py similarity index 93% rename from app/services/collect_loan.py rename to app/api/services/collect_loan.py index cb0d17e..1c99a4c 100644 --- a/app/services/collect_loan.py +++ b/app/api/services/collect_loan.py @@ -1,8 +1,8 @@ from flask import request, jsonify from marshmallow import ValidationError from app.utils.logger import logger -from app.helpers.response_helper import ResponseHelper -from app.schemas.collect_loan import CollectLoanSchema +from app.api.helpers.response_helper import ResponseHelper +from app.api.schemas.collect_loan import CollectLoanSchema class CollectLoanService: @staticmethod diff --git a/app/services/customer_consent.py b/app/api/services/customer_consent.py similarity index 89% rename from app/services/customer_consent.py rename to app/api/services/customer_consent.py index 1164c94..654485c 100644 --- a/app/services/customer_consent.py +++ b/app/api/services/customer_consent.py @@ -1,8 +1,8 @@ -from flask import request +from flask import request, jsonify from marshmallow import ValidationError from app.utils.logger import logger -from app.helpers.response_helper import ResponseHelper -from app.schemas.customer_consent import CustomerConsentSchema +from app.api.helpers.response_helper import ResponseHelper +from app.api.schemas.customer_consent import CustomerConsentSchema class CustomerConsentService: diff --git a/app/services/disbursement.py b/app/api/services/disbursement.py similarity index 94% rename from app/services/disbursement.py rename to app/api/services/disbursement.py index 4005077..c94c910 100644 --- a/app/services/disbursement.py +++ b/app/api/services/disbursement.py @@ -1,8 +1,8 @@ from flask import request, jsonify from marshmallow import ValidationError from app.utils.logger import logger -from app.helpers.response_helper import ResponseHelper -from app.schemas.disbursement import DisbursementSchema +from app.api.helpers.response_helper import ResponseHelper +from app.api.schemas.disbursement import DisbursementSchema class DisbursementService: @staticmethod diff --git a/app/services/lien_check.py b/app/api/services/lien_check.py similarity index 90% rename from app/services/lien_check.py rename to app/api/services/lien_check.py index 2265adb..eae8e6a 100644 --- a/app/services/lien_check.py +++ b/app/api/services/lien_check.py @@ -1,7 +1,8 @@ from marshmallow import ValidationError from app.utils.logger import logger -from app.helpers.response_helper import ResponseHelper -from app.schemas.lien_check import LienCheckSchema +from app.api.helpers.response_helper import ResponseHelper +from app.api.schemas.lien_check import LienCheckSchema +from flask import request, jsonify class LienCheckService: @staticmethod diff --git a/app/services/new_transaction_check.py b/app/api/services/new_transaction_check.py similarity index 91% rename from app/services/new_transaction_check.py rename to app/api/services/new_transaction_check.py index 35382a9..68e8e56 100644 --- a/app/services/new_transaction_check.py +++ b/app/api/services/new_transaction_check.py @@ -1,7 +1,8 @@ from marshmallow import ValidationError from app.utils.logger import logger -from app.helpers.response_helper import ResponseHelper -from app.schemas.new_transaction_check import NewTransactionCheckSchema +from app.api.helpers.response_helper import ResponseHelper +from app.api.schemas.new_transaction_check import NewTransactionCheckSchema +from flask import request, jsonify class NewTransactionCheckService: @staticmethod diff --git a/app/services/penal_charge.py b/app/api/services/penal_charge.py similarity index 89% rename from app/services/penal_charge.py rename to app/api/services/penal_charge.py index 41aa9de..8a4924c 100644 --- a/app/services/penal_charge.py +++ b/app/api/services/penal_charge.py @@ -1,8 +1,8 @@ -from flask import request +from flask import request, jsonify from marshmallow import ValidationError from app.utils.logger import logger -from app.helpers.response_helper import ResponseHelper -from app.schemas.penal_charge import PenalChargeSchema +from app.api.helpers.response_helper import ResponseHelper +from app.api.schemas.penal_charge import PenalChargeSchema class PenalChargeService: diff --git a/app/services/rac_check.py b/app/api/services/rac_check.py similarity index 92% rename from app/services/rac_check.py rename to app/api/services/rac_check.py index aa40dab..cdc6295 100644 --- a/app/services/rac_check.py +++ b/app/api/services/rac_check.py @@ -1,8 +1,8 @@ -from flask import request +from flask import request, jsonify from marshmallow import ValidationError from app.utils.logger import logger -from app.helpers.response_helper import ResponseHelper -from app.schemas.rac_check import RACCheckSchema +from app.api.helpers.response_helper import ResponseHelper +from app.api.schemas.rac_check import RACCheckSchema class RACCheckService: @staticmethod diff --git a/app/services/revoke_enable_consent.py b/app/api/services/revoke_enable_consent.py similarity index 90% rename from app/services/revoke_enable_consent.py rename to app/api/services/revoke_enable_consent.py index 0cf89d7..6030934 100644 --- a/app/services/revoke_enable_consent.py +++ b/app/api/services/revoke_enable_consent.py @@ -1,8 +1,8 @@ -from flask import request +from flask import request, jsonify from marshmallow import ValidationError from app.utils.logger import logger -from app.helpers.response_helper import ResponseHelper -from app.schemas.revoke_enable_consent import RevokeEnableConsentSchema +from app.api.helpers.response_helper import ResponseHelper +from app.api.schemas.revoke_enable_consent import RevokeEnableConsentSchema class RevokeEnableConsentService: diff --git a/app/services/token_validation.py b/app/api/services/token_validation.py similarity index 90% rename from app/services/token_validation.py rename to app/api/services/token_validation.py index 9147ee5..4e446cd 100644 --- a/app/services/token_validation.py +++ b/app/api/services/token_validation.py @@ -1,8 +1,8 @@ -from flask import request +from flask import request, jsonify from marshmallow import ValidationError from app.utils.logger import logger -from app.helpers.response_helper import ResponseHelper -from app.schemas.token_validation import TokenValidationSchema +from app.api.helpers.response_helper import ResponseHelper +from app.api.schemas.token_validation import TokenValidationSchema class TokenValidationService: diff --git a/app/services/transaction_verify.py b/app/api/services/transaction_verify.py similarity index 91% rename from app/services/transaction_verify.py rename to app/api/services/transaction_verify.py index 37c39cb..e55e2de 100644 --- a/app/services/transaction_verify.py +++ b/app/api/services/transaction_verify.py @@ -1,8 +1,8 @@ -from flask import request +from flask import request, jsonify from marshmallow import ValidationError from app.utils.logger import logger -from app.helpers.response_helper import ResponseHelper -from app.schemas.transaction_verify import TransactionVerifySchema +from app.api.helpers.response_helper import ResponseHelper +from app.api.schemas.transaction_verify import TransactionVerifySchema class TransactionVerifyService: diff --git a/app/config.py b/app/config.py index 6d1ea9c..48c319a 100644 --- a/app/config.py +++ b/app/config.py @@ -3,8 +3,11 @@ import os class Config: """Base configuration for Flask app""" + SWAGGER_URL = os.getenv("SWAGGER_URL", "/documentation") + API_URL = os.getenv("API_URL", "/swagger.json") + # SQLALCHEMY_DATABASE_URI =os.environ.get("DATABASE_URL", "database_url") # SQLALCHEMY_TRACK_MODIFICATIONS = False # SECRET_KEY = os.environ.get("SECRET_KEY", "your_secret_key") - DEBUG = True \ No newline at end of file + DEBUG = True diff --git a/app/errors/__init__.py b/app/errors/__init__.py index 15c380c..77d4fe1 100644 --- a/app/errors/__init__.py +++ b/app/errors/__init__.py @@ -1 +1 @@ -from .handlers import method_not_allowed, unsupported_media_type \ No newline at end of file +from .handlers import register_error_handlers \ No newline at end of file diff --git a/app/errors/handlers.py b/app/errors/handlers.py index 0b4cbdf..02b665f 100644 --- a/app/errors/handlers.py +++ b/app/errors/handlers.py @@ -1,14 +1,24 @@ +from werkzeug.exceptions import HTTPException from flask import jsonify -from app.helpers.response_helper import ResponseHelper +from app.api.helpers.response_helper import ResponseHelper -def method_not_allowed(error): - return jsonify({"message": "Method Not Allowed"}), 405 +def register_error_handlers(app): + @app.errorhandler(HTTPException) + def handle_http_exception(e): + return jsonify({'error': e.description}), e.code + + @app.errorhandler(405) + def method_not_allowed(error): + return jsonify({"message": "Method Not Allowed"}), 405 -def not_found(error): - return jsonify({"message": "Resource not found"}), 404 + @app.errorhandler(404) + def not_found(error): + return jsonify({"message": "Resource not found"}), 404 -def bad_request(error): - return jsonify({"message": "Bad Request"}), 400 + @app.errorhandler(400) + def bad_request(error): + return jsonify({"message": "Bad Request"}), 400 -def unsupported_media_type(error): - return jsonify({"message": "Unsupported Media Type"}), 415 + @app.errorhandler(415) + def unsupported_media_type(error): + return jsonify({"message": "Unsupported Media Type"}), 415 diff --git a/app/services/__init__.py b/app/services/__init__.py deleted file mode 100644 index deedc7a..0000000 --- a/app/services/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -from app.services.rac_check import RACCheckService -from app.services.disbursement import DisbursementService -from app.services.collect_loan import CollectLoanService -from app.services.transaction_verify import TransactionVerifyService -from app.services.penal_charge import PenalChargeService -from app.services.revoke_enable_consent import RevokeEnableConsentService -from app.services.token_validation import TokenValidationService -from app.services.lien_check import LienCheckService -from app.services.new_transaction_check import NewTransactionCheckService diff --git a/app/static/css/main.css b/app/static/css/main.css deleted file mode 100644 index e69de29..0000000 diff --git a/app/static/js/main.js b/app/static/js/main.js deleted file mode 100644 index e69de29..0000000 diff --git a/app/swagger/digifi_swagger.json b/app/swagger/digifi_swagger.json new file mode 100644 index 0000000..c5862c6 --- /dev/null +++ b/app/swagger/digifi_swagger.json @@ -0,0 +1,211 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Swagger Simbrella FirstAdvance - OpenAPI 3.0", + "description": "This is a Simbrella FirstAdvance Backend Server with the OpenAPI 3.0 specification. \n\n\nSome useful links:\n- [Web Simulated Demo Page](https://digifi-salaryloan.chiefsoft.net/)\n- [Web Management Support Portal](https://digifi-office.chiefsoft.net/auth/login)", + "termsOfService": "http://swagger.io/terms/", + "contact": { + "email": "support@chiefsoft.com" + }, + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + }, + "version": "1.0.11" + }, + "servers": [ + { + "url": "http://localhost:6337" + } + ], + "tags": [ + { + "name": "RACCheck", + "description": "Risk Acceptance Criteria Request", + "externalDocs": { + "description": "Find out more", + "url": "https://www.simbrellang.net" + } + }, + { + "name": "Disbursement", + "description": "Loan Disbursement Request", + "externalDocs": { + "description": "Find out more", + "url": "https://www.simbrellang.net" + } + }, + { + "name": "CollectLoan", + "description": "Collect Loan Request", + "externalDocs": { + "description": "Find out more", + "url": "https://www.simbrellang.net" + } + }, + { + "name": "TransactionVerify", + "description": "Transaction Verify Request", + "externalDocs": { + "description": "Find out more", + "url": "https://www.simbrellang.net" + } + }, + { + "name": "PenalCharge", + "description": "Penal Charge Request", + "externalDocs": { + "description": "Find out more", + "url": "https://www.simbrellang.net" + } + }, + { + "name": "RevokeEnableConsent", + "description": "Revoke Enable Consent Request", + "externalDocs": { + "description": "Find out more", + "url": "https://www.simbrellang.net" + } + }, + { + "name": "TokenValidation", + "description": "Token Validation", + "externalDocs": { + "description": "Find out more", + "url": "https://www.simbrellang.net" + } + }, + { + "name": "LienCheck", + "description": "Lien Check", + "externalDocs": { + "description": "Find out more", + "url": "https://www.simbrellang.net" + } + }, + { + "name": "NewTransactionCheck", + "description": "New Transaction Check", + "externalDocs": { + "description": "Find out more", + "url": "https://www.simbrellang.net" + } + } + ], + "paths": { + "/RACCheck": { + "$ref": "swagger/paths/RACCheck.json" + }, + "/Disbursement": { + "$ref": "swagger/paths/Disbursement.json" + }, + "/CollectLoan": { + "$ref": "swagger/paths/CollectLoan.json" + }, + "/TransactionVerify": { + "$ref": "swagger/paths/TransactionVerify.json" + }, + "/PenalCharge": { + "$ref": "swagger/paths/PenalCharge.json" + }, + "/RevokeEnableConsent": { + "$ref": "swagger/paths/RevokeEnableConsent.json" + }, + "/TokenValidation": { + "$ref": "swagger/paths/TokenValidation.json" + }, + "/LienCheck": { + "$ref": "swagger/paths/LienCheck.json" + }, + "/NewTransactionCheck": { + "$ref": "swagger/paths/NewTransactionCheck.json" + } + }, + "components": { + "schemas": { + "RACCheckRequest": { + "$ref": "swagger/schemas/RACCheckRequest.json" + }, + "RACCheckResponse": { + "$ref": "swagger/schemas/RACCheckResponse.json" + }, + "CustomerConsentRequest": { + "$ref": "swagger/schemas/CustomerConsentRequest.json" + }, + "CustomerConsentResponse": { + "$ref": "swagger/schemas/CustomerConsentResponse.json" + }, + "DisbursementRequest": { + "$ref": "swagger/schemas/DisbursementRequest.json" + }, + "DisbursementResponse": { + "$ref": "swagger/schemas/DisbursementResponse.json" + }, + "CollectLoanRequest": { + "$ref": "swagger/schemas/CollectLoanRequest.json" + }, + "CollectLoanResponse": { + "$ref": "swagger/schemas/CollectLoanResponse.json" + }, + "TransactionVerifyRequest": { + "$ref": "swagger/schemas/TransactionVerifyRequest.json" + }, + "TransactionVerifyResponse": { + "$ref": "swagger/schemas/TransactionVerifyResponse.json" + }, + "PenalChargeRequest": { + "$ref": "swagger/schemas/PenalChargeRequest.json" + }, + "PenalChargeResponse": { + "$ref": "swagger/schemas/PenalChargeResponse.json" + }, + "RevokeEnableConsentRequest": { + "$ref": "swagger/schemas/RevokeEnableConsentRequest.json" + }, + "RevokeEnableConsentResponse": { + "$ref": "swagger/schemas/RevokeEnableConsentResponse.json" + }, + "TokenValidationRequest": { + "$ref": "swagger/schemas/TokenValidationRequest.json" + }, + "TokenValidationResponse": { + "$ref": "swagger/schemas/TokenValidationResponse.json" + }, + "NewTransactionCheckRequest": { + "$ref": "swagger/schemas/NewTransactionCheckRequest.json" + }, + "NewTransactionCheckResponse": { + "$ref": "swagger/schemas/NewTransactionCheckResponse.json" + }, + "LienCheckRequest": { + "$ref": "swagger/schemas/LienCheckRequest.json" + }, + "LienCheckResponse": { + "$ref": "swagger/schemas/LienCheckResponse.json" + }, + "ApiResponse": { + "$ref": "swagger/schemas/ApiResponse.json" + } + }, + "securitySchemes": { + "api_key": { + "type": "apiKey", + "name": "x-api-key", + "in": "header" + }, + "app_id": { + "type": "apiKey", + "name": "App-Id", + "in": "header" + } + } + }, + "security": [ + { + "api_key": [] + }, + { + "app_id": [] + } + ] +} \ No newline at end of file diff --git a/app/swagger/paths/CollectLoan.json b/app/swagger/paths/CollectLoan.json new file mode 100644 index 0000000..16fee80 --- /dev/null +++ b/app/swagger/paths/CollectLoan.json @@ -0,0 +1,53 @@ +{ + "post": { + "tags": [ + "CollectLoan" + ], + "summary": "Collect Loan Request", + "description": "Collect Loan Request", + "operationId": "CollectLoan", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "../schemas/CollectLoanRequest.json" + } + }, + "application/xml": { + "schema": { + "$ref": "../schemas/CollectLoanRequest.json" + } + }, + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "../schemas/CollectLoanRequest.json" + } + } + } + }, + "responses": { + "200": { + "description": "CollectLoan Successful", + "content": { + "application/json": { + "schema": { + "$ref": "../schemas/CollectLoanResponse.json" + } + }, + "application/xml": { + "schema": { + "$ref": "../schemas/CollectLoanResponse.json" + } + } + } + }, + "400": { + "description": "Invalid request parameters" + }, + "500": { + "description": "Internal server error" + } + } + } + } \ No newline at end of file diff --git a/app/swagger/paths/CustomerConsent.json b/app/swagger/paths/CustomerConsent.json new file mode 100644 index 0000000..29d7cc0 --- /dev/null +++ b/app/swagger/paths/CustomerConsent.json @@ -0,0 +1,53 @@ +{ + "post": { + "tags": [ + "CustomerConsent" + ], + "summary": "Customer Consent Request", + "description": "Customer Consent Request", + "operationId": "CustomerConsent", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "../schemas/CustomerConsentRequest.json" + } + }, + "application/xml": { + "schema": { + "$ref": "../schemas/CustomerConsentRequest.json" + } + }, + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "../schemas/CustomerConsentRequest.json" + } + } + } + }, + "responses": { + "200": { + "description": "Successful", + "content": { + "application/json": { + "schema": { + "$ref": "../schemas/CustomerConsentResponse.json" + } + }, + "application/xml": { + "schema": { + "$ref": "../schemas/CustomerConsentResponse.json" + } + } + } + }, + "400": { + "description": "Invalid request parameters" + }, + "500": { + "description": "Internal server error" + } + } + } + } \ No newline at end of file diff --git a/app/swagger/paths/Disbursement.json b/app/swagger/paths/Disbursement.json new file mode 100644 index 0000000..ca4b85e --- /dev/null +++ b/app/swagger/paths/Disbursement.json @@ -0,0 +1,53 @@ +{ + "post": { + "tags": [ + "Disbursement" + ], + "summary": "Disbursement Request", + "description": "Disbursement Request", + "operationId": "Disbursement", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "../schemas/DisbursementRequest.json" + } + }, + "application/xml": { + "schema": { + "$ref": "../schemas/DisbursementRequest.json" + } + }, + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "../schemas/DisbursementRequest.json" + } + } + } + }, + "responses": { + "200": { + "description": "Disbursement Successful", + "content": { + "application/json": { + "schema": { + "$ref": "../schemas/DisbursementResponse.json" + } + }, + "application/xml": { + "schema": { + "$ref": "../schemas/DisbursementResponse.json" + } + } + } + }, + "400": { + "description": "Invalid request parameters" + }, + "500": { + "description": "Internal server error" + } + } + } + } \ No newline at end of file diff --git a/app/swagger/paths/LienCheck.json b/app/swagger/paths/LienCheck.json new file mode 100644 index 0000000..15069ad --- /dev/null +++ b/app/swagger/paths/LienCheck.json @@ -0,0 +1,53 @@ +{ + "post": { + "tags": [ + "LienCheck" + ], + "summary": "Lien Check Request", + "description": "Lien Check Request", + "operationId": "LienCheck", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "../schemas/LienCheckRequest.json" + } + }, + "application/xml": { + "schema": { + "$ref": "../schemas/LienCheckRequest.json" + } + }, + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "../schemas/LienCheckRequest.json" + } + } + } + }, + "responses": { + "200": { + "description": "LienCheck Successful", + "content": { + "application/json": { + "schema": { + "$ref": "../schemas/LienCheckResponse.json" + } + }, + "application/xml": { + "schema": { + "$ref": "../schemas/LienCheckResponse.json" + } + } + } + }, + "400": { + "description": "Invalid request parameters" + }, + "500": { + "description": "Internal server error" + } + } + } + } \ No newline at end of file diff --git a/app/swagger/paths/NewTransactionCheck.json b/app/swagger/paths/NewTransactionCheck.json new file mode 100644 index 0000000..57227a9 --- /dev/null +++ b/app/swagger/paths/NewTransactionCheck.json @@ -0,0 +1,53 @@ +{ + "post": { + "tags": [ + "NewTransactionCheck" + ], + "summary": "New Transaction Check Request", + "description": "New Transaction Check Request", + "operationId": "NewTransactionCheck", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "../schemas/NewTransactionCheckRequest.json" + } + }, + "application/xml": { + "schema": { + "$ref": "../schemas/NewTransactionCheckRequest.json" + } + }, + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "../schemas/NewTransactionCheckRequest.json" + } + } + } + }, + "responses": { + "200": { + "description": "NewTransactionCheck Successful", + "content": { + "application/json": { + "schema": { + "$ref": "../schemas/NewTransactionCheckResponse.json" + } + }, + "application/xml": { + "schema": { + "$ref": "../schemas/NewTransactionCheckResponse.json" + } + } + } + }, + "400": { + "description": "Invalid request parameters" + }, + "500": { + "description": "Internal server error" + } + } + } + } \ No newline at end of file diff --git a/app/swagger/paths/PenalCharge.json b/app/swagger/paths/PenalCharge.json new file mode 100644 index 0000000..7f0bebb --- /dev/null +++ b/app/swagger/paths/PenalCharge.json @@ -0,0 +1,53 @@ +{ + "post": { + "tags": [ + "PenalCharge" + ], + "summary": "Penal Charge Request", + "description": "Penal Charge Request", + "operationId": "PenalCharge", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "../schemas/PenalChargeRequest.json" + } + }, + "application/xml": { + "schema": { + "$ref": "../schemas/PenalChargeRequest.json" + } + }, + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "../schemas/PenalChargeRequest.json" + } + } + } + }, + "responses": { + "200": { + "description": "PenalCharge Successful", + "content": { + "application/json": { + "schema": { + "$ref": "../schemas/PenalChargeResponse.json" + } + }, + "application/xml": { + "schema": { + "$ref": "../schemas/PenalChargeResponse.json" + } + } + } + }, + "400": { + "description": "Invalid request parameters" + }, + "500": { + "description": "Internal server error" + } + } + } + } \ No newline at end of file diff --git a/app/swagger/paths/RACCheck.json b/app/swagger/paths/RACCheck.json new file mode 100644 index 0000000..4536da9 --- /dev/null +++ b/app/swagger/paths/RACCheck.json @@ -0,0 +1,53 @@ +{ + "post": { + "tags": [ + "RACCheck" + ], + "summary": "Risk Acceptance Criteria Check", + "description": "Check if a customer passes the Risk Acceptance Criteria defined by the bank", + "operationId": "racCheck", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "../schemas/RACCheckRequest.json" + } + }, + "application/xml": { + "schema": { + "$ref": "../schemas/RACCheckRequest.json" + } + }, + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "../schemas/RACCheckRequest.json" + } + } + } + }, + "responses": { + "200": { + "description": "RAC Check Successful", + "content": { + "application/json": { + "schema": { + "$ref": "../schemas/RACCheckResponse.json" + } + }, + "application/xml": { + "schema": { + "$ref": "../schemas/RACCheckResponse.json" + } + } + } + }, + "400": { + "description": "Invalid request parameters" + }, + "500": { + "description": "Internal server error" + } + } + } + } \ No newline at end of file diff --git a/app/swagger/paths/RevokeEnableConsent.json b/app/swagger/paths/RevokeEnableConsent.json new file mode 100644 index 0000000..59389df --- /dev/null +++ b/app/swagger/paths/RevokeEnableConsent.json @@ -0,0 +1,53 @@ +{ + "post": { + "tags": [ + "RevokeEnableConsent" + ], + "summary": "Revoke Enable Consent Request", + "description": "Revoke Enable Consent Request", + "operationId": "RevokeEnableConsent", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "../schemas/RevokeEnableConsentRequest.json" + } + }, + "application/xml": { + "schema": { + "$ref": "../schemas/RevokeEnableConsentRequest.json" + } + }, + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "../schemas/RevokeEnableConsentRequest.json" + } + } + } + }, + "responses": { + "200": { + "description": "RevokeEnableConsent Successful", + "content": { + "application/json": { + "schema": { + "$ref": "../schemas/RevokeEnableConsentResponse.json" + } + }, + "application/xml": { + "schema": { + "$ref": "../schemas/RevokeEnableConsentResponse.json" + } + } + } + }, + "400": { + "description": "Invalid request parameters" + }, + "500": { + "description": "Internal server error" + } + } + } + } \ No newline at end of file diff --git a/app/swagger/paths/TokenValidation.json b/app/swagger/paths/TokenValidation.json new file mode 100644 index 0000000..07c5b80 --- /dev/null +++ b/app/swagger/paths/TokenValidation.json @@ -0,0 +1,53 @@ +{ + "post": { + "tags": [ + "TokenValidation" + ], + "summary": "Token Validation Request", + "description": "Token Validation Request", + "operationId": "TokenValidation", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "../schemas/TokenValidationRequest.json" + } + }, + "application/xml": { + "schema": { + "$ref": "../schemas/TokenValidationRequest.json" + } + }, + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "../schemas/TokenValidationRequest.json" + } + } + } + }, + "responses": { + "200": { + "description": "TokenValidation Successful", + "content": { + "application/json": { + "schema": { + "$ref": "../schemas/TokenValidationResponse.json" + } + }, + "application/xml": { + "schema": { + "$ref": "../schemas/TokenValidationResponse.json" + } + } + } + }, + "400": { + "description": "Invalid request parameters" + }, + "500": { + "description": "Internal server error" + } + } + } + } \ No newline at end of file diff --git a/app/swagger/paths/TransactionVerify.json b/app/swagger/paths/TransactionVerify.json new file mode 100644 index 0000000..1238d8d --- /dev/null +++ b/app/swagger/paths/TransactionVerify.json @@ -0,0 +1,53 @@ +{ + "post": { + "tags": [ + "TransactionVerify" + ], + "summary": "Transaction Verify Request", + "description": "Transaction Verify Request", + "operationId": "TransactionVerify", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "../schemas/TransactionVerifyRequest.json" + } + }, + "application/xml": { + "schema": { + "$ref": "../schemas/TransactionVerifyRequest.json" + } + }, + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "../schemas/TransactionVerifyRequest.json" + } + } + } + }, + "responses": { + "200": { + "description": "TransactionVerify Successful", + "content": { + "application/json": { + "schema": { + "$ref": "../schemas/TransactionVerifyResponse.json" + } + }, + "application/xml": { + "schema": { + "$ref": "../schemas/TransactionVerifyResponse.json" + } + } + } + }, + "400": { + "description": "Invalid request parameters" + }, + "500": { + "description": "Internal server error" + } + } + } + } \ No newline at end of file diff --git a/app/swagger/schemas/ApiResponse.json b/app/swagger/schemas/ApiResponse.json new file mode 100644 index 0000000..2cd2bdd --- /dev/null +++ b/app/swagger/schemas/ApiResponse.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "type": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "xml": { + "name": "##default" + } +} \ No newline at end of file diff --git a/app/swagger/schemas/CollectLoanRequest.json b/app/swagger/schemas/CollectLoanRequest.json new file mode 100644 index 0000000..5409b8f --- /dev/null +++ b/app/swagger/schemas/CollectLoanRequest.json @@ -0,0 +1,65 @@ +{ + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "example": "T002" + }, + "debtId": { + "type": "string", + "example": "273194670" + }, + "customerId": { + "type": "string", + "example": "CN621868" + }, + "accountId": { + "type": "string", + "example": "2017821799" + }, + "productId": { + "type": "string", + "example": "101" + }, + "collectAmount": { + "type": "number", + "format": "double", + "example": 80000.0 + }, + "penalCharge": { + "type": "number", + "format": "double", + "example": 0.0 + }, + "collectionMethod": { + "type": "integer", + "example": 1 + }, + "lienAmount": { + "type": "number", + "format": "double", + "example": 80000.0 + }, + "countryId": { + "type": "string", + "example": "01" + }, + "comment": { + "type": "string", + "example": "Testing CollectionLoanRequest" + } + }, + "required": [ + "transactionId", + "debtId", + "customerId", + "accountId", + "productId", + "collectAmount", + "penalCharge", + "collectionMethod", + "lienAmount", + "countryId", + "comment" + ] +} \ No newline at end of file diff --git a/app/swagger/schemas/CollectLoanResponse.json b/app/swagger/schemas/CollectLoanResponse.json new file mode 100644 index 0000000..523a49f --- /dev/null +++ b/app/swagger/schemas/CollectLoanResponse.json @@ -0,0 +1,70 @@ +{ + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "example": "T002" + }, + "debtId": { + "type": "string", + "example": "273194670" + }, + "customerId": { + "type": "string", + "example": "CN621868" + }, + "accountId": { + "type": "string", + "example": "2017821799" + }, + "productId": { + "type": "string", + "example": "101" + }, + "collectAmount": { + "type": "number", + "format": "double", + "example": 60000.0 + }, + "penalCharge": { + "type": "number", + "format": "double", + "example": 0.0 + }, + "lienAmount": { + "type": "number", + "format": "double", + "example": 20000.0 + }, + "countryId": { + "type": "string", + "example": "01" + }, + "comment": { + "type": "string", + "example": "Testing CollectionLoanRequest" + }, + "resultCode": { + "type": "string", + "example": "00" + }, + "resultDescription": { + "type": "string", + "example": "Loan Collection Successful" + } + }, + "required": [ + "transactionId", + "debtId", + "customerId", + "accountId", + "productId", + "collectAmount", + "penalCharge", + "lienAmount", + "countryId", + "comment", + "resultCode", + "resultDescription" + ] +} \ No newline at end of file diff --git a/app/swagger/schemas/CustomerConsentRequest.json b/app/swagger/schemas/CustomerConsentRequest.json new file mode 100644 index 0000000..c3566b1 --- /dev/null +++ b/app/swagger/schemas/CustomerConsentRequest.json @@ -0,0 +1,43 @@ +{ + "type": "object", + "properties": { + "$type": { + "type": "string", + "example": "CustomerConsentRequest" + }, + "transactionId": { + "type": "string", + "example": "20171209232177" + }, + "customerId": { + "type": "string", + "example": "CN621868" + }, + "accountId": { + "type": "string", + "example": "ACN8263457" + }, + "requestTime": { + "type": "string", + "format": "date-time", + "example": "2019-10-18 14:26:21.063" + }, + "consentType": { + "type": "string", + "example": "Revoke" + }, + "channel": { + "type": "string", + "example": "USSD" + } + }, + "required": [ + "$type", + "transactionId", + "customerId", + "accountId", + "requestTime", + "consentType", + "channel" + ] +} \ No newline at end of file diff --git a/app/swagger/schemas/CustomerConsentResponse.json b/app/swagger/schemas/CustomerConsentResponse.json new file mode 100644 index 0000000..4f52996 --- /dev/null +++ b/app/swagger/schemas/CustomerConsentResponse.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "resultCode": { + "type": "string", + "example": "00" + }, + "resultDescription": { + "type": "string", + "example": "Request is received" + } + }, + "required": [ + "resultCode", + "resultDescription" + ] +} \ No newline at end of file diff --git a/app/swagger/schemas/DisbursementRequest.json b/app/swagger/schemas/DisbursementRequest.json new file mode 100644 index 0000000..88ce7a6 --- /dev/null +++ b/app/swagger/schemas/DisbursementRequest.json @@ -0,0 +1,77 @@ +{ + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "example": "T001" + }, + "TransactionId": { + "type": "string", + "example": "Tr201712RK9232P115" + }, + "debtId": { + "type": "string", + "example": "273194670" + }, + "customerId": { + "type": "string", + "example": "CN621868" + }, + "accountId": { + "type": "string", + "example": "2017821799" + }, + "productId": { + "type": "string", + "example": "101" + }, + "provideAmount": { + "type": "number", + "format": "double", + "example": 100000.0 + }, + "collectAmountInterest": { + "type": "number", + "format": "double", + "example": 5000.0 + }, + "collectAmountMgtFee": { + "type": "number", + "format": "double", + "example": 1000.0 + }, + "collectAmountInsurance": { + "type": "number", + "format": "double", + "example": 1000.0 + }, + "collectAmountVAT": { + "type": "number", + "format": "double", + "example": 75.0 + }, + "countryId": { + "type": "string", + "example": "01" + }, + "comment": { + "type": "string", + "example": "Testing LoanRequest" + } + }, + "required": [ + "transactionId", + "TransactionId", + "debtId", + "customerId", + "accountId", + "productId", + "provideAmount", + "collectAmountInterest", + "collectAmountMgtFee", + "collectAmountInsurance", + "collectAmountVAT", + "countryId", + "comment" + ] +} \ No newline at end of file diff --git a/app/swagger/schemas/DisbursementResponse.json b/app/swagger/schemas/DisbursementResponse.json new file mode 100644 index 0000000..ac12c6e --- /dev/null +++ b/app/swagger/schemas/DisbursementResponse.json @@ -0,0 +1,82 @@ +{ + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "example": "T001" + }, + "TransactionId": { + "type": "string", + "example": "Tr201712RK9232P115" + }, + "debtId": { + "type": "string", + "example": "273194670" + }, + "customerId": { + "type": "string", + "example": "CN621868" + }, + "accountId": { + "type": "string", + "example": "2017821799" + }, + "productId": { + "type": "string", + "example": "101" + }, + "provideAmount": { + "type": "number", + "format": "double", + "example": 100000.0 + }, + "collectAmountInterest": { + "type": "number", + "format": "double", + "example": 5000.0 + }, + "collectAmountMgtFee": { + "type": "number", + "format": "double", + "example": 1000.0 + }, + "collectAmountInsurance": { + "type": "number", + "format": "double", + "example": 1000.0 + }, + "collectAmountVAT": { + "type": "number", + "format": "double", + "example": 75.0 + }, + "countryId": { + "type": "string", + "example": "01" + }, + "resultCode": { + "type": "string", + "example": "00" + }, + "resultDescription": { + "type": "string", + "example": "Loan Request Completed Successfully!" + } + }, + "required": [ + "transactionId", + "TransactionId", + "debtId", + "customerId", + "accountId", + "productId", + "provideAmount", + "collectAmountInterest", + "collectAmountMgtFee", + "collectAmountInsurance", + "collectAmountVAT", + "countryId", + "resultCode", + "resultDescription" + ] +} \ No newline at end of file diff --git a/app/swagger/schemas/LienCheckRequest.json b/app/swagger/schemas/LienCheckRequest.json new file mode 100644 index 0000000..ebe13be --- /dev/null +++ b/app/swagger/schemas/LienCheckRequest.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "example": "SMB1234567" + }, + "customerId": { + "type": "string", + "example": "123456" + }, + "accountId": { + "type": "string", + "example": "E9F77222920BAAB1C5ACF2253C6D6113" + }, + "countryId": { + "type": "string", + "example": "01" + } + } +} \ No newline at end of file diff --git a/app/swagger/schemas/LienCheckResponse.json b/app/swagger/schemas/LienCheckResponse.json new file mode 100644 index 0000000..3509d88 --- /dev/null +++ b/app/swagger/schemas/LienCheckResponse.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "lienAmount": { + "type": "number", + "example": 20000.0 + }, + "resultCode": { + "type": "string", + "example": "00" + }, + "resultDescription": { + "type": "string", + "example": "Successful" + } + } +} \ No newline at end of file diff --git a/app/swagger/schemas/NewTransactionCheckRequest.json b/app/swagger/schemas/NewTransactionCheckRequest.json new file mode 100644 index 0000000..b7d79c4 --- /dev/null +++ b/app/swagger/schemas/NewTransactionCheckRequest.json @@ -0,0 +1,29 @@ +{ + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "example": "173021" + }, + "debtId": { + "type": "string", + "example": "173021" + }, + "transactionType": { + "type": "string", + "example": "Disbursement" + }, + "fbnTransactionId": { + "type": "string", + "example": "FBN2411011411413A74960" + }, + "origTransactionId": { + "type": "string", + "example": "2411011411413A74960" + }, + "customerId": { + "type": "string", + "example": "CN621868" + } + } +} \ No newline at end of file diff --git a/app/swagger/schemas/NewTransactionCheckResponse.json b/app/swagger/schemas/NewTransactionCheckResponse.json new file mode 100644 index 0000000..086cbc0 --- /dev/null +++ b/app/swagger/schemas/NewTransactionCheckResponse.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "status": { + "type": "string", + "example": "Success" + }, + "message": { + "type": "string", + "example": "Transaction check completed successfully." + } + } +} \ No newline at end of file diff --git a/app/swagger/schemas/PenalChargeRequest.json b/app/swagger/schemas/PenalChargeRequest.json new file mode 100644 index 0000000..64af9c8 --- /dev/null +++ b/app/swagger/schemas/PenalChargeRequest.json @@ -0,0 +1,41 @@ +{ + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "example": "T004" + }, + "fbnTransactionId": { + "type": "string", + "example": "Tr201712RK9232P115" + }, + "debtId": { + "type": "string", + "example": "273194670" + }, + "customerId": { + "type": "string", + "example": "CN621868" + }, + "accountId": { + "type": "string", + "example": "2017821799" + }, + "penalCharge": { + "type": "number", + "example": 1.2 + }, + "lienAmount": { + "type": "number", + "example": 101.2 + }, + "countryId": { + "type": "string", + "example": "01" + }, + "comment": { + "type": "string", + "example": "Testing PenalChargeRequest" + } + } +} \ No newline at end of file diff --git a/app/swagger/schemas/PenalChargeResponse.json b/app/swagger/schemas/PenalChargeResponse.json new file mode 100644 index 0000000..0cc2482 --- /dev/null +++ b/app/swagger/schemas/PenalChargeResponse.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "resultCode": { + "type": "string", + "example": "00" + }, + "resultDescription": { + "type": "string", + "example": "Penal charge debited successfully" + } + } +} \ No newline at end of file diff --git a/app/swagger/schemas/RACCheckRequest.json b/app/swagger/schemas/RACCheckRequest.json new file mode 100644 index 0000000..2cf59d5 --- /dev/null +++ b/app/swagger/schemas/RACCheckRequest.json @@ -0,0 +1,91 @@ +{ + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "example": "T001" + }, + "fbnTransactionId": { + "type": "string", + "example": "Tr201712RK9232P115" + }, + "customerId": { + "type": "string", + "example": "CN621868" + }, + "accountId": { + "type": "string", + "example": "2017821799" + }, + "RAC_Array": { + "type": "array", + "items": { + "type": "object", + "properties": { + "salaryAccount": { + "type": "boolean", + "example": true + }, + "bvn": { + "type": "string", + "example": "12345678901" + }, + "crc": { + "type": "boolean", + "example": false + }, + "crms": { + "type": "boolean", + "example": true + }, + "accountStatus": { + "type": "string", + "example": "active" + }, + "lien": { + "type": "boolean", + "example": false + }, + "noBouncedCheck": { + "type": "boolean", + "example": true + }, + "existingLoan": { + "type": "boolean", + "example": false + }, + "whitelist": { + "type": "boolean", + "example": true + }, + "noPastDueSalaryLoan": { + "type": "boolean", + "example": true + }, + "noPastDueOtherLoans": { + "type": "boolean", + "example": false + } + } + }, + "example": [ + { + "salaryAccount": true, + "bvn": "12345678901", + "crc": false, + "crms": true, + "accountStatus": "active", + "lien": false, + "noBouncedCheck": true, + "existingLoan": false, + "whitelist": true, + "noPastDueSalaryLoan": true, + "noPastDueOtherLoans": false + } + ] + } + }, + "xml": { + "name": "RACCheckRequest" + } +} \ No newline at end of file diff --git a/app/swagger/schemas/RACCheckResponse.json b/app/swagger/schemas/RACCheckResponse.json new file mode 100644 index 0000000..110b555 --- /dev/null +++ b/app/swagger/schemas/RACCheckResponse.json @@ -0,0 +1,65 @@ +{ + "type": "object", + "properties": { + "resultCode": { + "type": "string", + "example": "00" + }, + "RACResponse": { + "type": "object", + "properties": { + "Salary account": { + "type": "string", + "example": "1" + }, + "BVN": { + "type": "string", + "example": "1" + }, + "BVNAttachedtoAccount": { + "type": "string", + "example": "1" + }, + "CRMS": { + "type": "string", + "example": "1" + }, + "CRC": { + "type": "string", + "example": "1" + }, + "AccountStatus": { + "type": "string", + "example": "1" + }, + "Lien": { + "type": "string", + "example": "1" + }, + "NoBouncedCheck": { + "type": "string", + "example": "1" + }, + "Whitelist": { + "type": "string", + "example": "1" + }, + "NoPastDueSalaryLoan": { + "type": "string", + "example": "1" + }, + "NoPastDueOtherLoan": { + "type": "string", + "example": "1" + } + } + }, + "resultDescription": { + "type": "string", + "example": "RAC Check Successful" + } + }, + "xml": { + "name": "RACCheckResponse" + } +} \ No newline at end of file diff --git a/app/swagger/schemas/RevokeEnableConsentRequest.json b/app/swagger/schemas/RevokeEnableConsentRequest.json new file mode 100644 index 0000000..a148151 --- /dev/null +++ b/app/swagger/schemas/RevokeEnableConsentRequest.json @@ -0,0 +1,38 @@ +{ + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "example": "T0014" + }, + "fbnTransactionId": { + "type": "string", + "example": "20171209232177" + }, + "customerId": { + "type": "string", + "example": "CN621868" + }, + "accountId": { + "type": "string", + "example": "2017821799" + }, + "processTime": { + "type": "string", + "format": "date-time", + "example": "2019-10-18 14:26:21.063" + }, + "consentType": { + "type": "string", + "example": "Revoke" + }, + "countryId": { + "type": "string", + "example": "01" + }, + "comment": { + "type": "string", + "example": "Testing RevokeEnableConsentRequest" + } + } +} \ No newline at end of file diff --git a/app/swagger/schemas/RevokeEnableConsentResponse.json b/app/swagger/schemas/RevokeEnableConsentResponse.json new file mode 100644 index 0000000..0d1bdba --- /dev/null +++ b/app/swagger/schemas/RevokeEnableConsentResponse.json @@ -0,0 +1,25 @@ +{ + "type": "object", + "properties": { + "$type": { + "type": "string", + "example": "RevokeEnableConsentResponse" + }, + "customerId": { + "type": "string", + "example": "CN621868" + }, + "accountId": { + "type": "string", + "example": "2017821799" + }, + "resultCode": { + "type": "string", + "example": "00" + }, + "resultDescription": { + "type": "string", + "example": "Success" + } + } +} \ No newline at end of file diff --git a/app/swagger/schemas/TokenValidationRequest.json b/app/swagger/schemas/TokenValidationRequest.json new file mode 100644 index 0000000..65a3407 --- /dev/null +++ b/app/swagger/schemas/TokenValidationRequest.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "properties": { + "UserId": { + "type": "string", + "example": "TMP0840" + }, + "TokenCode": { + "type": "string", + "example": "32365214" + }, + "RequestId": { + "type": "string", + "example": "SMB1234567" + }, + "CountryId": { + "type": "string", + "example": "01" + } + } +} \ No newline at end of file diff --git a/app/swagger/schemas/TokenValidationResponse.json b/app/swagger/schemas/TokenValidationResponse.json new file mode 100644 index 0000000..c3ff2c7 --- /dev/null +++ b/app/swagger/schemas/TokenValidationResponse.json @@ -0,0 +1,25 @@ +{ + "type": "object", + "properties": { + "Authenticated": { + "type": "boolean", + "example": true + }, + "AuthenticatedMessage": { + "type": "string", + "example": "The user Oluwole Olusoga has successfully authenticated!" + }, + "ResponseCode": { + "type": "string", + "example": "00" + }, + "ResponseMessage": { + "type": "string", + "example": "Successful" + }, + "RequestId": { + "type": "string", + "example": "SMB1234567" + } + } +} \ No newline at end of file diff --git a/app/swagger/schemas/TransactionVerifyRequest.json b/app/swagger/schemas/TransactionVerifyRequest.json new file mode 100644 index 0000000..beff068 --- /dev/null +++ b/app/swagger/schemas/TransactionVerifyRequest.json @@ -0,0 +1,33 @@ +{ + "type": "object", + "properties": { + "counter": { + "type": "string", + "example": "2" + }, + "TransactionId": { + "type": "string", + "example": "T002" + }, + "RequestId": { + "type": "string", + "example": "R02802" + }, + "customerId": { + "type": "string", + "example": "CN621868" + }, + "accountId": { + "type": "string", + "example": "2017821799" + }, + "countryId": { + "type": "string", + "example": "01" + }, + "transactionType": { + "type": "string", + "example": "Disbursement" + } + } +} \ No newline at end of file diff --git a/app/swagger/schemas/TransactionVerifyResponse.json b/app/swagger/schemas/TransactionVerifyResponse.json new file mode 100644 index 0000000..8bff555 --- /dev/null +++ b/app/swagger/schemas/TransactionVerifyResponse.json @@ -0,0 +1,37 @@ +{ + "type": "object", + "properties": { + "$type": { + "type": "string", + "example": "TransactionCheckResponse" + }, + "nativeId": { + "type": "string", + "example": "FBN20191031104405CN621868" + }, + "customerId": { + "type": "string", + "example": "CN621868" + }, + "accountId": { + "type": "string", + "example": "2017821799" + }, + "providedAmount": { + "type": "number", + "example": 0.0 + }, + "collectedAmount": { + "type": "number", + "example": 7.50 + }, + "resultCode": { + "type": "string", + "example": "00" + }, + "resultDescription": { + "type": "string", + "example": "Collect Status retrieved successfully." + } + } +} \ No newline at end of file diff --git a/app/templates/index.html b/app/templates/index.html deleted file mode 100644 index f29a4e2..0000000 --- a/app/templates/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 737f663..71361e5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,8 @@ Flask-Marshmallow==0.15.0 marshmallow==3.19.0 Flask-Cors==3.0.10 gunicorn +flask-swagger-ui +