[backend] Fix Loan Repayment Rounding: Amounts Always Rounded Down
Description: Loan repayment calculations in backend/src/services/loanController.ts use Math.floor() causing systematic underpayment. Borrowers pay less than owed; lenders lose interest over time.
Impact: Financial discrepancy accumulates across all loans; regulatory compliance issue; trust erosion.
Suggested Fix:
- Replace
Math.floor() with banker's rounding (Math.round()) or configurable rounding mode
- Add rounding policy constant in
backend/src/config/money.ts
- Write property-based tests for rounding edge cases
- Create migration to recalculate outstanding balances
- Add audit log for rounding adjustments
Points: 200
Type: bug
Definition of Done
📋 Before working on this issue, please read our Contributing Guidelines — it covers branching, commits, PR standards, testing, and style guides.
Join our Telegram community to connect with other contributors, ask questions, and stay updated:
💬 Telegram: https://t.me/+eRqhka27TVo0NzM8
All official decisions, reviews, and coordination happen right here on GitHub. The Telegram group is a space for informal discussion and peer support.
[backend] Fix Loan Repayment Rounding: Amounts Always Rounded Down
Description: Loan repayment calculations in
backend/src/services/loanController.tsuseMath.floor()causing systematic underpayment. Borrowers pay less than owed; lenders lose interest over time.Impact: Financial discrepancy accumulates across all loans; regulatory compliance issue; trust erosion.
Suggested Fix:
Math.floor()with banker's rounding (Math.round()) or configurable rounding modebackend/src/config/money.tsPoints: 200
Type: bug
Definition of Done
📋 Before working on this issue, please read our Contributing Guidelines — it covers branching, commits, PR standards, testing, and style guides.
Join our Telegram community to connect with other contributors, ask questions, and stay updated:
💬 Telegram: https://t.me/+eRqhka27TVo0NzM8
All official decisions, reviews, and coordination happen right here on GitHub. The Telegram group is a space for informal discussion and peer support.