📋 Description
quicklendx-contracts/src/investment.rs defines InvestmentStatus::{Active, Withdrawn, Completed, Defaulted, Refunded} with a validate_transition enforcing that Active is the only non-terminal state (terminals cannot transition again). This state machine is the backbone of investor position tracking, but there is no developer doc explaining the legal transitions, which protocol action drives each, or how it stays in lockstep with invoice and escrow status.
Why this matters: investment status is what an investor's portfolio is built on, and it is tightly coupled to invoice/escrow transitions. Without a clear state-machine doc, integrators misread a Refunded vs Defaulted position and contributors risk adding an illegal transition. An authoritative diagram + guide makes the coupling explicit and the invariant teachable.
🎯 Requirements & Context
Functional requirements
Context & constraints
- Documentation only; optionally add
/// doc comments on validate_transition and the status enum.
- Keep variant names and transition rules verbatim from the source.
- Soroban SDK
25.1.1.
🛠️ Suggested Execution
1. Fork & branch
git checkout -b docs/investment-lifecycle
2. Implement changes
- Trace the real transition sites in
investment.rs/escrow.rs/settlement.rs/defaults.rs; write the doc and diagram.
3. Test & commit
cargo build -p quicklendx-contracts
cargo clippy -p quicklendx-contracts
- Verify the documented transitions match
validate_transition and the entrypoint mapping is accurate.
Example commit message
docs(investment): add InvestmentStatus lifecycle guide with transition diagram
Documents legal transitions, driving entrypoints, and coupling to invoice/escrow status.
✅ Acceptance Criteria & Guidelines
| Requirement |
Target |
| All statuses + legal transitions documented |
Required |
| Driving entrypoint per transition |
Required |
| Coupling to invoice/escrow documented |
Required |
| Diagram included; names verbatim |
Required |
cargo clippy clean (if doc comments added) |
Required |
| Timeframe |
96 hours from assignment |
💬 Community & Support
Questions, design discussion, and help getting your environment running — join the QuickLendX contributor community on Discord: https://discord.gg/VpngvTjWa
Please drop a note in the channel when you pick this up so we can avoid duplicate work and unblock you fast. Clear communication during the PR keeps the review fast and friction-free. 🚀
📋 Description
quicklendx-contracts/src/investment.rsdefinesInvestmentStatus::{Active, Withdrawn, Completed, Defaulted, Refunded}with avalidate_transitionenforcing thatActiveis the only non-terminal state (terminals cannot transition again). This state machine is the backbone of investor position tracking, but there is no developer doc explaining the legal transitions, which protocol action drives each, or how it stays in lockstep with invoice and escrow status.🎯 Requirements & Context
Functional requirements
quicklendx-contracts/docs/investment-lifecycle.mddocumenting everyInvestmentStatusand the legal transitions enforced byvalidate_transition.accept_bid_and_fund->Active; settlement ->Completed;refund_escrow_funds->Refunded; default handling ->Defaulted; withdrawal ->Withdrawn).Context & constraints
///doc comments onvalidate_transitionand the status enum.25.1.1.🛠️ Suggested Execution
1. Fork & branch
2. Implement changes
investment.rs/escrow.rs/settlement.rs/defaults.rs; write the doc and diagram.3. Test & commit
validate_transitionand the entrypoint mapping is accurate.Example commit message
✅ Acceptance Criteria & Guidelines
cargo clippyclean (if doc comments added)💬 Community & Support
Questions, design discussion, and help getting your environment running — join the QuickLendX contributor community on Discord: https://discord.gg/VpngvTjWa
Please drop a note in the channel when you pick this up so we can avoid duplicate work and unblock you fast. Clear communication during the PR keeps the review fast and friction-free. 🚀