layered found loan
This commit is contained in:
+11
-5
@@ -125,12 +125,18 @@ def direct_loan():
|
|||||||
|
|
||||||
loan = LoanService.get_loan_by_transaction_id(transaction_id=transaction_id)
|
loan = LoanService.get_loan_by_transaction_id(transaction_id=transaction_id)
|
||||||
if not loan:
|
if not loan:
|
||||||
logger.warning(f"Loan with transaction id {transaction_id} does not exist")
|
first_error = f"Loan with transaction id {transaction_id} does not exist"
|
||||||
return jsonify({
|
logger.warning(first_error)
|
||||||
"status": "error",
|
loan = LoanService.get_latest_loan_without_disburse_date()
|
||||||
"message": f"Loan with transaction id {transaction_id} does not exist"
|
if not loan:
|
||||||
}), 400
|
logger.info(f"No loan found without disbursement date")
|
||||||
|
return jsonify({
|
||||||
|
"status": "error",
|
||||||
|
"first_error": first_error,
|
||||||
|
"message": f"No loan found without disbursement date"
|
||||||
|
}), 400
|
||||||
|
|
||||||
|
# Tried 2 method to get the loan record at this point
|
||||||
loan_data = loan.to_dict()
|
loan_data = loan.to_dict()
|
||||||
|
|
||||||
# Prevent double disbursement
|
# Prevent double disbursement
|
||||||
|
|||||||
Reference in New Issue
Block a user