Repayment data

This commit is contained in:
CHIEFSOFT\ameye
2025-06-20 20:39:37 -04:00
parent 6200fc4dba
commit 08a0c8a933
2 changed files with 12 additions and 10 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ class Salary(db.Model):
""" """
Add a new salary data entry. Add a new salary data entry.
""" """
logger.info(f"receieved data:{data}") logger.info(f"Received data:{data}")
try: try:
new_data = cls( new_data = cls(
customer_id=data.get('customerId'), customer_id=data.get('customerId'),
+4 -2
View File
@@ -123,8 +123,9 @@ def salary_detect():
if payload is None: if payload is None:
logger.warning("No payload received in request") logger.warning("No payload received in request")
return ResponseHelper.error("Missing request payload", status_code=400) #- Sometimes no paylod return ResponseHelper.error("Missing request payload", status_code=400)
if payload:
# Step 1: Try to add new salary data # Step 1: Try to add new salary data
try: try:
new_salary = SalaryService.add_salary_data(payload) new_salary = SalaryService.add_salary_data(payload)
@@ -174,7 +175,8 @@ def salary_detect():
"initiatedBy": "SALARY_DETECT", "initiatedBy": "SALARY_DETECT",
"salaryAmount": pending_salary.amount, "salaryAmount": pending_salary.amount,
} }
logger.info(f"Creating repayment for loan ID {loan_dict['debtId']}") logger.info(f"Saving/Creating Repayment Data:{repayment_data}")
#logger.info(f"Creating repayment for loan ID {loan_dict['debtId']}")
# repayment = RepaymentService.add_repayment(repayment_data) # repayment = RepaymentService.add_repayment(repayment_data)
repayment = RepaymentService.create_repayment(repayment_data) repayment = RepaymentService.create_repayment(repayment_data)
Loan.update_status(loan_id=repayment_data.loanId, Loan.update_status(loan_id=repayment_data.loanId,