some updates
This commit is contained in:
+2
-1
@@ -5,7 +5,8 @@ class Config:
|
||||
"""Base configuration for Flask app"""
|
||||
|
||||
SECRET_KEY = os.getenv("SECRET_KEY", "supersecretkey")
|
||||
API_BASE_URL = "https://coreapi.dev.simbrellang.net/v1/api/salary"
|
||||
SIMBRELLA_AUTH_BASE_URL = "https://coreapi.dev.simbrellang.net/v1/api/auth"
|
||||
SIMBRELLA_BASE_URL = "https://coreapi.dev.simbrellang.net/v1/api/salary"
|
||||
JWT_SECRET_KEY = os.getenv("JWT_SECRET_KEY", "your_jwt_secret")
|
||||
DEBUG = True
|
||||
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
from flask import Blueprint, request, jsonify, current_app
|
||||
import requests
|
||||
from app.utils.auth import get_headers
|
||||
from app.config import settings
|
||||
|
||||
auth_bp = Blueprint("auth", __name__)
|
||||
|
||||
AUTH_BASE_URL = settings.SIMBRELLA_AUTH_BASE_URL
|
||||
BASE_URL = settings.SIMBRELLA_BASE_URL
|
||||
|
||||
|
||||
@auth_bp.route("/health", methods=["GET"])
|
||||
def health():
|
||||
@@ -13,7 +17,7 @@ def health():
|
||||
@auth_bp.route("/login", methods=["POST"])
|
||||
def login():
|
||||
data = request.json
|
||||
api_url = "https://coreapi.dev.simbrellang.net/api/auth/login"
|
||||
api_url = f"{AUTH_BASE_URL}/login"
|
||||
|
||||
response = requests.post(api_url, json=data)
|
||||
if response.status_code == 200:
|
||||
@@ -24,7 +28,7 @@ def login():
|
||||
@auth_bp.route("/status-call", methods=["POST"])
|
||||
def status_call():
|
||||
data = request.json
|
||||
api_url = f"{current_app.config['API_BASE_URL']}/StatusCall"
|
||||
api_url = f"{BASE_URL}/StatusCall"
|
||||
|
||||
# response = requests.post(api_url, json=data, headers=get_headers())
|
||||
# return jsonify(response.json()), response.status_code
|
||||
@@ -47,7 +51,7 @@ def status_call():
|
||||
@auth_bp.route("/sms", methods=["POST"])
|
||||
def sms():
|
||||
data = request.json
|
||||
api_url = f"{current_app.config['API_BASE_URL']}/SMS"
|
||||
api_url = f"{BASE_URL}/SMS"
|
||||
|
||||
# response = requests.post(api_url, json=data, headers=get_headers())
|
||||
# return jsonify(response.json()), response.status_code
|
||||
@@ -64,7 +68,7 @@ def sms():
|
||||
@auth_bp.route("/bulk-sms", methods=["POST"])
|
||||
def bulk_sms():
|
||||
data = request.json
|
||||
api_url = f"{current_app.config['API_BASE_URL']}/BulkSMS"
|
||||
api_url = f"{BASE_URL}/BulkSMS"
|
||||
|
||||
# response = requests.post(api_url, json=data, headers=get_headers())
|
||||
# return jsonify(response.json()), response.status_code
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
from flask import Blueprint, request, jsonify, current_app
|
||||
from app.config import settings
|
||||
import requests
|
||||
from app.utils.auth import get_headers
|
||||
|
||||
eligibility_bp = Blueprint("eligibility", __name__)
|
||||
|
||||
BASE_URL = settings.SIMBRELLA_BASE_URL
|
||||
|
||||
|
||||
@eligibility_bp.route("/check", methods=["POST"])
|
||||
def eligibility_check():
|
||||
data = request.json
|
||||
api_url = f"{current_app.config['API_BASE_URL']}/EligibilityCheck"
|
||||
api_url = f"{BASE_URL}/EligibilityCheck"
|
||||
|
||||
# response = requests.post(api_url, json=data, headers=get_headers())
|
||||
# return jsonify(response.json()), response.status_code
|
||||
|
||||
+13
-12
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user