some updates

This commit is contained in:
lennyaiko
2025-04-10 16:46:46 +01:00
parent cd613579f7
commit 26cf9307d2
5 changed files with 131 additions and 18 deletions
+13 -12
View File
@@ -1,16 +1,17 @@
from flask import Blueprint, request, jsonify, current_app
import requests
from app.config import settings
from app.utils.auth import get_headers
from app.integrations import KafkaIntegration
from threading import Thread
loan_bp = Blueprint("loan", __name__)
BASE_URL = settings.SIMBRELLA_BASE_URL
@loan_bp.route("/select-offer", methods=["POST"])
def select_offer():
data = request.json
api_url = f"{current_app.config['API_BASE_URL']}/SelectOffer"
api_url = f"{BASE_URL}/SelectOffer"
# response = requests.post(api_url, json=data, headers=get_headers())
# return jsonify(response.json()), response.status_code
@@ -48,7 +49,7 @@ def select_offer():
@loan_bp.route("/provide-loan", methods=["POST"])
def provide_loan():
data = request.json
api_url = f"{current_app.config['API_BASE_URL']}/ProvideLoan"
api_url = f"{BASE_URL}/ProvideLoan"
# response = requests.post(api_url, json=data, headers=get_headers())
# return jsonify(response.json()), response.status_code
@@ -68,7 +69,7 @@ def provide_loan():
@loan_bp.route("/status", methods=["POST"])
def status():
data = request.json
api_url = f"{current_app.config['API_BASE_URL']}/LoanStatus"
api_url = f"{BASE_URL}/LoanStatus"
# response = requests.post(api_url, json=data, headers=get_headers())
# return jsonify(response.json()), response.status_code
@@ -98,7 +99,7 @@ def status():
@loan_bp.route("/repayment", methods=["POST"])
def repayment():
data = request.json
api_url = f"{current_app.config['API_BASE_URL']}/Repayment"
api_url = f"{BASE_URL}/Repayment"
# response = requests.post(api_url, json=data, headers=get_headers())
# return jsonify(response.json()), response.status_code
@@ -124,7 +125,7 @@ def repayment():
@loan_bp.route("/rac-check", methods=["POST"])
def rac_check():
data = request.json
api_url = f"{current_app.config['API_BASE_URL']}/RACCheck"
api_url = f"{BASE_URL}/RACCheck"
# response = requests.post(api_url, json=data, headers=get_headers())
# return jsonify(response.json()), response.status_code
@@ -154,7 +155,7 @@ def rac_check():
@loan_bp.route("/disbursement", methods=["POST"])
def disbursement():
data = request.json
api_url = f"{current_app.config['API_BASE_URL']}/Disbursement"
api_url = f"{BASE_URL}/Disbursement"
return jsonify({"requestId": data["requestId"]}), 200
@@ -165,7 +166,7 @@ def disbursement():
@loan_bp.route("/collect-loan", methods=["POST"])
def collect_loan():
data = request.json
api_url = f"{current_app.config['API_BASE_URL']}/CollectLoan"
api_url = f"{BASE_URL}/CollectLoan"
# response = requests.post(api_url, json=data, headers=get_headers())
# return jsonify(response.json()), response.status_code
@@ -190,7 +191,7 @@ def collect_loan():
@loan_bp.route("/transaction-verify", methods=["POST"])
def transaction_verify():
data = request.json
api_url = f"{current_app.config['API_BASE_URL']}/TransactionVerify"
api_url = f"{BASE_URL}/TransactionVerify"
# response = requests.post(api_url, json=data, headers=get_headers())
# return jsonify(response.json()), response.status_code
@@ -213,7 +214,7 @@ def transaction_verify():
@loan_bp.route("/penal-charge", methods=["POST"])
def penal_charge():
data = request.json
api_url = f"{current_app.config['API_BASE_URL']}/PenalCharge"
api_url = f"{BASE_URL}/PenalCharge"
# response = requests.post(api_url, json=data, headers=get_headers())
# return jsonify(response.json()), response.status_code
@@ -228,7 +229,7 @@ def penal_charge():
@loan_bp.route("/lien-check", methods=["POST"])
def lien_check():
data = request.json
api_url = f"{current_app.config['API_BASE_URL']}/LienCheck"
api_url = f"{BASE_URL}/LienCheck"
# response = requests.post(api_url, json=data, headers=get_headers())
# return jsonify(response.json()), response.status_code