docs(investment): add InvestmentStatus lifecycle guide, state transition diagram and code doc comments#1385
Merged
Baskarayelu merged 1 commit intoJun 19, 2026
Conversation
…ion diagram and code doc comments
Contributor
|
the InvestmentStatus lifecycle guide + state diagram + doc comments make that state machine much easier to reason about. merging 📚 |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Template
📝 Description
This PR documents the
InvestmentStatusstate machine (Active,Withdrawn,Completed,Defaulted,Refunded) and its transition invariants enforced byvalidate_transition. It adds a developer guide with a Mermaid lifecycle diagram and updates Rust doc comments on the enum/methods.🎯 Type of Change
🔧 Changes Made
Files Modified
///doc comments to theInvestmentStatusenum and its variants.validate_transitionto reference the new guide and detail arguments, return values, errors, and driving entrypoints.New Files Added
InvestmentStatusstate machine, containing description of states, allowed transition matrix, coupling matrix, and Mermaid diagram.Key Changes
ActivetoCompleted,Defaulted,Refunded, andWithdrawn.InvoiceStatusand escrow state.🧪 Testing
Test Coverage
Validated changes compile cleanly with
cargo build -p quicklendx-contracts. Existing test coverage intest_investment_terminal_states.rsandtest_investment_transitions.rsalready validates these transitions; this PR only documents them.📋 Contract-Specific Checks
Contract Testing Details
Verified that the contract builds successfully with the updated doc comments.
📋 Review Checklist
🔍 Code Quality
🚀 Performance & Security
📚 Documentation
🔗 Related Issues
Closes #1345
📋 Additional Notes
Documentation-only updates with inline comments for codebase clarity and an external guide.
🧪 How to Test
cargo build -p quicklendx-contractsto ensure compiler doc comment checks pass.quicklendx-contracts/docs/investment-lifecycle.mdand check the rendering of the Mermaid diagram.📸 Screenshots (if applicable)
N/A
None
🔄 Migration Steps (if applicable)
N/A