Skip to content

[Contracts] No lightweight loan-status view; get_loan triggers accrual and per-id calls are required #19

@grantfox-oss

Description

@grantfox-oss

Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0

Why this matters

loan_manager/src/lib.rs exposes get_loan, get_borrower_loans, and get_total_loans, but no view to list loans by status or fetch a lightweight status without triggering accrual via get_loan. Off-chain indexers and the frontend must call get_loan per id. A simple get_loan_status(loan_id) -> LoanStatus and/or pending-loans accessor would reduce calls and avoid the accrual side effect.

Acceptance criteria

  • Add a lightweight get_loan_status(loan_id) view returning the stored LoanStatus without running accrual
  • Optionally add a paginated accessor for a borrower's loans filtered by status
  • Add tests for the new view(s)
  • Document the new view(s) in the contract README section

Files to touch

  • loan_manager/src/lib.rs

Out of scope

  • Global loan enumeration across all borrowers
  • Indexer infrastructure

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions