44 lines
1.3 KiB
Python
44 lines
1.3 KiB
Python
from flask import Blueprint, request, jsonify, current_app
|
|
import requests
|
|
from app.utils.auth import get_headers
|
|
|
|
loan_bp = Blueprint("loan", __name__)
|
|
|
|
|
|
@loan_bp.route("/select-offer", methods=["POST"])
|
|
def select_offer():
|
|
data = request.json
|
|
api_url = f"{current_app.config['API_BASE_URL']}/SelectOffer"
|
|
|
|
# response = requests.post(api_url, json=data, headers=get_headers())
|
|
# return jsonify(response.json()), response.status_code
|
|
response = {
|
|
"transactionId": "1231231321232",
|
|
"customerId": "1256907",
|
|
"accountId": "5948306019",
|
|
"outstandingDebtAmount": 0,
|
|
"loan": [
|
|
{
|
|
"offerId": "14451",
|
|
"productId": "2030",
|
|
"amount": 10000,
|
|
"upfrontPayment": 1000,
|
|
"interestRate": 3,
|
|
"Interest": 300,
|
|
"ManagementRate": 1,
|
|
"ManagementFee": 100,
|
|
"InsuranceRate": 1,
|
|
"InsuranceFee": 100,
|
|
"VATRate": 7.5,
|
|
"VATamount": 100,
|
|
"recommendedRepaymentDates": ["2022-11-30"],
|
|
"installmentAmount": 11000,
|
|
"totalRepaymentAmount": 11000,
|
|
}
|
|
],
|
|
"resultCode": "00",
|
|
"resultDescription": "Successful",
|
|
}
|
|
|
|
return jsonify(response), 200
|