loan apply

This commit is contained in:
CHIEFSOFT\ameye
2025-02-17 13:59:00 -05:00
parent 586364c31a
commit 137427c9a5
2 changed files with 15 additions and 4 deletions
+5 -4
View File
@@ -282,16 +282,17 @@ def salary_loanapply2():
data = request.json
if not data:
return {
"message": "Please provide bvn and loan",
"message": "Please provide bvn and loan and amount",
"data": None,
"error": "Bad request"
}, 400
# validate input
loan = data["loan"]
bvn = data["bvn"]
if loan != '' and bvn != '' :
amount = data["amount"]
if loan != '' and bvn != '' and amount > 0 :
loan = load_offer(loan,bvn)
INSERT_LOAN ="INSERT INTO loan_select (loan, bvn) VALUES(%s, %s)"
INSERT_LOAN ="INSERT INTO loan_apply (loan, bvn, amount) VALUES(%s, %s, %s)"
return {
"message": "REQUEST_PIN",
"loan": loan,
@@ -300,7 +301,7 @@ def salary_loanapply2():
}, 201
else:
return {
"message": "Error fetching loan!, invalid bvn or loan",
"message": "Error fetching loan!, invalid bvn or loan or amount",
"data": None,
"error": "Unauthorized"
}, 404