added a new penal charge endpoint

This commit is contained in:
Chinenye Nmoh
2026-01-23 11:14:17 +01:00
parent 03c12fd9b5
commit 0f4455e738
4 changed files with 35 additions and 6 deletions
+3 -2
View File
@@ -445,10 +445,11 @@ def report():
def process_penal_charges():
try:
OVERDUE_GRACE_PERIOD_DAYS = settings.OVERDUE_GRACE_PERIOD_DAYS
OVERDUE_PROCESSING_LIST_LIMIT = settings.OVERDUE_PROCESSING_LIST_LIMIT
overdue_loans = (
LoanRepaymentScheduleService
.get_overdue_repayment_schedule_with_grace_period(OVERDUE_GRACE_PERIOD_DAYS)
.get_overdue_repayment_schedule_with_grace_period(OVERDUE_GRACE_PERIOD_DAYS,OVERDUE_PROCESSING_LIST_LIMIT)
)
logger.info(f"Found {len(overdue_loans)} overdue loans.")
@@ -464,7 +465,7 @@ def process_penal_charges():
for loan in overdue_loans:
# TODO: apply penal charge logic here
# PenalChargeService.apply_penal_charge(loan)
LoanRepaymentScheduleService.update_due_process_date_and_count(loan.id)
processed_loans.append(loan.to_dict())
return ResponseHelper.success(