You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cancelled, // Cancelled by borrower before approval
228
+
Rejected, // Rejected by admin
229
+
Liquidated, // Liquidated by liquidator
215
230
}
216
231
```
217
232
233
+
**View Functions**:
234
+
-`get_loan_status(loan_id)` - Returns only the status enum without running accrual calculations. Use this for lightweight queries when you only need to know loan state.
235
+
-`get_borrower_loans_by_status(borrower, status)` - Returns loan IDs filtered by status. Useful for indexers to query specific loan states without fetching full loan data.
236
+
218
237
**Business Logic**:
219
-
- Minimum credit score: 600
220
-
- Maximum loan-to-value: 80%
221
-
- Interest rate: Based on credit score
222
-
- Repayment period: Configurable
238
+
- Minimum credit score: 500 (configurable via `set_min_score`)
239
+
- Maximum loans per borrower: 3 (configurable via `set_max_loans_per_borrower`)
240
+
- Interest rate: Oracle-based or configurable default (1200 BPS)
241
+
- Late fee rate: Configurable (500 BPS default)
242
+
- Maximum extensions: 3 (configurable by calling `extend_loan`)
223
243
224
244
**Tests**:
225
245
- ✅ Loan request flow
@@ -228,6 +248,8 @@ pub enum LoanStatus {
228
248
- ✅ Low score rejection
229
249
- ✅ Unauthorized repayment prevention
230
250
- ✅ Access controls
251
+
- ✅ get_loan_status returns correct status without accrual
0 commit comments