📋 Description
investment.rs tracks insurance policies and exposes total_active_coverage_percentage and has_active_insurance, but there is no read returning a per-policy breakdown (provider, coverage bps, premium, active flag) for a given investment. Clients can only see the aggregate.
Why this matters: when coverage is stacked across providers, users need to see the constituent policies — who covers what and at what premium. A per-policy breakdown read makes stacked insurance transparent. Read-only and self-contained.
🎯 Requirements & Context
Context & constraints
🛠️ Suggested Execution
git checkout -b feature/insurance-breakdown-query
cargo test -p quicklendx-contracts insurance_breakdown -- --nocapture
cargo clippy -p quicklendx-contracts --all-targets -- -D warnings
- Edge cases: no policies (empty); single policy; multiple stacked policies (order stable); claimed/inactive policy flagged.
Example commit message
feat(insurance): add per-policy get_insurance_breakdown read
Surfaces provider/coverage/premium/active per policy so stacked coverage is
transparent.
✅ Acceptance Criteria & Guidelines
| Requirement |
Target |
| Per-policy breakdown from stored data |
Required |
| Empty vec for no insurance |
Required |
| Test coverage |
≥ 95% |
cargo clippy clean |
Required |
| Timeframe |
96 hours from assignment |
💬 Community & Support
Join Discord: https://discord.gg/VpngvTjWa — comment to claim. 🚀
📋 Description
investment.rstracks insurance policies and exposestotal_active_coverage_percentageandhas_active_insurance, but there is no read returning a per-policy breakdown (provider, coverage bps, premium, active flag) for a given investment. Clients can only see the aggregate.🎯 Requirements & Context
get_insurance_breakdown(env, investment_id) -> Vec<(Address, u32, i128, bool)>(provider, coverage_bps, premium, active).total_active_coverage_percentage.///doc comments.Context & constraints
25.1.1. Pure read; no auth. Reuseget_investment.🛠️ Suggested Execution
git checkout -b feature/insurance-breakdown-query cargo test -p quicklendx-contracts insurance_breakdown -- --nocapture cargo clippy -p quicklendx-contracts --all-targets -- -D warningsExample commit message
✅ Acceptance Criteria & Guidelines
cargo clippyclean💬 Community & Support
Join Discord: https://discord.gg/VpngvTjWa — comment to claim. 🚀