diff --git a/app/models/repayment.py b/app/models/repayment.py index 933a290..138f86a 100644 --- a/app/models/repayment.py +++ b/app/models/repayment.py @@ -51,8 +51,8 @@ class Repayment(db.Model): @classmethod def create_repayment(cls, repayment_data): - if loan.status not in [LoanStatus.ACTIVE, LoanStatus.START_REPAY]: - raise ValueError(f"Repayment cannot be processed. Loan status: ({loan.status})") + if repayment_data.LoanStatus not in [LoanStatus.ACTIVE, LoanStatus.START_REPAY]: + raise ValueError(f"Repayment cannot be processed. Loan status: ({repayment_data.LoanStatus})") repayment = cls( customer_id=repayment_data.customerId, diff --git a/app/routes/autocall.py b/app/routes/autocall.py index 155e940..e39b862 100644 --- a/app/routes/autocall.py +++ b/app/routes/autocall.py @@ -176,6 +176,7 @@ def salary_detect(): "transactionId": loan.transaction_id, "initiatedBy": "SALARY_DETECT", "salaryAmount": pending_salary.amount, + "LoanStatus": loan.status, } # repayment_data = {