added failed loans endpoint
This commit was merged in pull request #70.
This commit is contained in:
@@ -137,6 +137,8 @@ class SimbrellaClient:
|
||||
logger.error("")
|
||||
LoanService.set_disbursement_loan_description(loan_data['debtId'],
|
||||
"Disbursement Service url not found (404)")
|
||||
logger.info(f"Loan status updated to {LoanStatus.FAILED} for loan ID {loan_data['debtId']} due to disbursement failure")
|
||||
LoanService.update_status(loan_data['debtId'], LoanStatus.FAILED)
|
||||
return ResponseHelper.error("Disbursement Service url not found (404)", status_code=404)
|
||||
|
||||
logger.info(f"Disbursement response: {response.json()}")
|
||||
@@ -165,6 +167,8 @@ class SimbrellaClient:
|
||||
errorMessage = "Unable to complete Disbursement Service with HTTP status code: " + str(
|
||||
response.status_code)
|
||||
LoanService.set_disbursement_loan_description(loan_data['debtId'], errorMessage)
|
||||
updatedLoan = LoanService.update_status(loan_data['debtId'], LoanStatus.FAILED)
|
||||
logger.info(f"Loan status updated to {updatedLoan.get('status')} for loan ID {loan_data['debtId']} due to disbursement failure")
|
||||
return ResponseHelper.error(errorMessage, status_code=response.status_code)
|
||||
|
||||
except requests.exceptions.HTTPError as errh:
|
||||
|
||||
Reference in New Issue
Block a user