Skip to content

Fix #1369: Add accrued interest instead of subtracting it - #1580

Open
T-kesh wants to merge 1 commit into
LabsCrypt:mainfrom
T-kesh:fix-issue-1369
Open

Fix #1369: Add accrued interest instead of subtracting it#1580
T-kesh wants to merge 1 commit into
LabsCrypt:mainfrom
T-kesh:fix-issue-1369

Conversation

@T-kesh

@T-kesh T-kesh commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Description: closes #1369.

The getLoanDetails function in backend/src/controllers/loanController.ts contained a logic defect where accrued interest was being incorrectly subtracted from the total owed amount, rather than being added to it.

This PR corrects the calculation logic from: const totalOwed = principal - accruedInterest - totalRepaid; to const totalOwed = principal + accruedInterest - totalRepaid;

This ensures borrowers must properly pay accrued interest to fully repay their loan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Backend] Owed amount ignores accrued interest

1 participant