Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a3fcba00b4 | |||
| 60b928221a |
@@ -62,7 +62,7 @@ class EventServiceIntegration:
|
||||
logger.info(f"Health Check URL: {url}")
|
||||
|
||||
try:
|
||||
response = httpx.get(url, timeout=EventServiceIntegration.TIMEOUT)
|
||||
response = httpx.get(url, timeout=5.0)
|
||||
logger.info(f"Health Check Response: {response.text}")
|
||||
return response
|
||||
except Exception as e:
|
||||
|
||||
@@ -62,26 +62,24 @@ class RepaymentService(BaseService):
|
||||
if response.status_code != 200:
|
||||
return ResponseHelper.error(result_description="Balance Check failed")
|
||||
|
||||
|
||||
try:
|
||||
response = response.json()
|
||||
except Exception as e:
|
||||
logger.error(f"Balance Check failed: Invalid JSON response - {str(e)}")
|
||||
return ResponseHelper.error(result_description="Balance Check failed")
|
||||
response = response.json()
|
||||
|
||||
logger.info(f"This is Response (Balance Check): {str(response)}", exc_info=True)
|
||||
|
||||
|
||||
verify_account_balance_response = response.get('isSufficient', None) if response else None
|
||||
|
||||
if verify_account_balance_response is None:
|
||||
return ResponseHelper.error(result_description="Balance Check failed")
|
||||
|
||||
if verify_account_balance_response in [False, "false"]:
|
||||
logger.error("Balance Check failed: Insufficient Account Balance")
|
||||
return ResponseHelper.error(result_description="Insufficient Account Balance")
|
||||
|
||||
|
||||
if not response or response['responseCode'] != '00':
|
||||
|
||||
if response:
|
||||
logger.error(f"{response['responseMessage']}")
|
||||
|
||||
return ResponseHelper.error(result_description=f"Balance Check failed")
|
||||
|
||||
verify_account_balance_response = response['isSufficient']
|
||||
|
||||
if not verify_account_balance_response or verify_account_balance_response in [False, "false"]:
|
||||
logger.error(f"Balance Check failed: Insufficient Account Balance")
|
||||
return ResponseHelper.error(result_description=f"Insufficient Account Balance")
|
||||
|
||||
|
||||
# Save the repayment details
|
||||
repayment = Repayment.create_repayment(
|
||||
|
||||
@@ -21,7 +21,7 @@ def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column(
|
||||
"loan_repayment_schedules",
|
||||
sa.Column("last_penal_date", sa.Float(), nullable=True),
|
||||
sa.Column("last_penal_date", sa.DateTime(), nullable=True),
|
||||
)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
Reference in New Issue
Block a user