This commit is contained in:
VivianDee
2025-10-20 16:49:11 +01:00
6 changed files with 68 additions and 19 deletions
+14 -11
View File
@@ -22,19 +22,17 @@ def create_app():
# import oracledb # import oracledb
# oracledb.init_oracle_client(lib_dir=None) # oracledb.init_oracle_client(lib_dir=None)
app = Flask(__name__)
# Load configuration
app.config.from_object(Config)
CORS(app)
JWTManager(app)
CORS(app, supports_credentials=True)
try: try:
app = Flask(__name__)
# Load configuration
app.config.from_object(Config)
CORS(app)
JWTManager(app)
CORS(app, supports_credentials=True)
# Swagger Doc # Swagger Doc
SWAGGER_URL = app.config.get("SWAGGER_URL") SWAGGER_URL = app.config.get("SWAGGER_URL")
API_URL = app.config.get("API_URL") API_URL = app.config.get("API_URL")
@@ -45,6 +43,11 @@ def create_app():
swagger_ui_blueprint = get_swaggerui_blueprint(SWAGGER_URL, API_URL) swagger_ui_blueprint = get_swaggerui_blueprint(SWAGGER_URL, API_URL)
app.register_blueprint(swagger_ui_blueprint, url_prefix=SWAGGER_URL) app.register_blueprint(swagger_ui_blueprint, url_prefix=SWAGGER_URL)
except Exception as e:
print(f"Swagger Unexpected error occurred: {e}")
try:
# Error Handlers # Error Handlers
register_error_handlers(app) register_error_handlers(app)
+5 -5
View File
@@ -42,10 +42,10 @@ def swagger_json():
return send_from_directory(swagger_dir, "digifi_swagger.json") return send_from_directory(swagger_dir, "digifi_swagger.json")
# @api.route("/swagger/<path:filename>") @api.route("/swagger/<path:filename>")
# def serve_paths(filename): def serve_paths(filename):
# swagger_dir = os.path.join("swagger") swagger_dir = os.path.join("swagger")
# return send_from_directory(swagger_dir, filename) return send_from_directory(swagger_dir, filename)
# EligibilityCheck Endpoint # EligibilityCheck Endpoint
@@ -140,7 +140,7 @@ def health_check():
# Check database connection # Check database connection
try: try:
logger.info(f"Database Health == : {SQLALCHEMY_DATABASE_URI}") logger.info(f"Database Health == : {SQLALCHEMY_DATABASE_URI}")
db.session.execute(text("SELECT 1")) db.session.execute(text("SELECT table_name FROM user_tables ORDER BY table_name"))
except Exception as e: except Exception as e:
db_status = "Connection Failed" db_status = "Connection Failed"
errors.append(f"Database Error: {str(e)}") errors.append(f"Database Error: {str(e)}")
+1 -1
View File
@@ -17,6 +17,7 @@ from app.api.integrations import EventServiceIntegration
from app.models import LoanRepaymentSchedule from app.models import LoanRepaymentSchedule
from app.api.services.offer_analysis import OfferAnalysis from app.api.services.offer_analysis import OfferAnalysis
from app.api.helpers.response_helper import ResponseHelper from app.api.helpers.response_helper import ResponseHelper
from datetime import datetime, timezone, timedelta
class ProvideLoanService(BaseService): class ProvideLoanService(BaseService):
TRANSACTION_TYPE = TransactionType.PROVIDE_LOAN TRANSACTION_TYPE = TransactionType.PROVIDE_LOAN
@@ -229,7 +230,6 @@ class ProvideLoanService(BaseService):
"startDate": now.isoformat(), "startDate": now.isoformat(),
}) })
for idx, charge in enumerate(loan_charges, start=len(charge_schedule_items) + 1): for idx, charge in enumerate(loan_charges, start=len(charge_schedule_items) + 1):
item = { item = {
"id": idx, "id": idx,
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"post": { "post": {
"tags": ["Authorize Refresh"], "tags": ["AuthorizeRefresh"],
"summary": "Customer Authorize Refresh Request", "summary": "Customer Authorize Refresh Request",
"description": "Customer Authorize Refresh Request", "description": "Customer Authorize Refresh Request",
"operationId": "AuthorizeRefresh", "operationId": "AuthorizeRefresh",
@@ -25,6 +25,41 @@
"type": "string", "type": "string",
"example": "98016510058" "example": "98016510058"
}, },
"schedule": {
"type": "array",
"description": "List of loan repayment components with due dates and amounts.",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 1
},
"amountDue": {
"type": "number",
"example": 2000.0
},
"componentName": {
"type": "string",
"example": "INTEREST"
},
"dueDate": {
"type": "string",
"format": "date-time",
"example": "2026-01-13T11:36:39.890747+00:00"
},
"startDate": {
"type": "string",
"format": "date-time",
"example": "2025-10-15T11:36:39.890747+00:00"
},
"loanRef": {
"type": "string",
"example": "TRX1760528156816285USSD3MPC"
}
}
}
},
"resultCode": { "resultCode": {
"type": "string", "type": "string",
"example": "00" "example": "00"
+11
View File
@@ -1,3 +1,4 @@
version: '3.8'
services: services:
digifi-bank-to-product-core: digifi-bank-to-product-core:
build: . build: .
@@ -12,3 +13,13 @@ services:
volumes: volumes:
- .:/app - .:/app
restart: always restart: always
networks:
- my_custom_network
networks:
my_custom_network:
driver: bridge
ipam:
config:
- subnet: 10.244.0.0/26