repayment status

This commit is contained in:
CHIEFSOFT\ameye
2025-05-25 06:33:46 -04:00
parent 9e22e0fcf3
commit f6c98d9bfd
2 changed files with 3 additions and 7 deletions
+1
View File
@@ -3,4 +3,5 @@ from enum import Enum
class LoanStatus(str, Enum): class LoanStatus(str, Enum):
PENDING = "pending" PENDING = "pending"
ACTIVE = "active" ACTIVE = "active"
START_REPAY = "start_repay"
REPAID = "repaid" REPAID = "repaid"
+2 -7
View File
@@ -45,17 +45,14 @@ class RepaymentService(BaseService):
loan_id = loan_id, loan_id = loan_id,
product_id = product_id, product_id = product_id,
transaction_id=transaction_id transaction_id=transaction_id
) )
if not repayment: if not repayment:
logger.error(f"Failed to save repayment details") logger.error(f"Failed to save repayment details")
return ResponseHelper.error(result_description="Failed to save repayment details.") return ResponseHelper.error(result_description="Failed to save repayment details.")
#Update Loan status #Update Loan status
Loan.update_status(loan_id = loan_id, status = LoanStatus.REPAID) Loan.update_status(loan_id = loan_id, status = LoanStatus.START_REPAY) # repay started bu user
transaction = RepaymentService.log_transaction(validated_data = validated_data) transaction = RepaymentService.log_transaction(validated_data = validated_data)
if not transaction: if not transaction:
@@ -63,8 +60,6 @@ class RepaymentService(BaseService):
return ResponseHelper.error(result_description="Failed to log transaction.") return ResponseHelper.error(result_description="Failed to log transaction.")
else: else:
return ResponseHelper.error(result_description="Invalid Customer or Account") return ResponseHelper.error(result_description="Invalid Customer or Account")
# Simulated processing logic # Simulated processing logic
response_data = { response_data = {