Description
Tax reports require per-lot cost-basis tracking with pluggable disposal strategies (FIFO, LIFO, HIFO). Add lot lifecycle tables and a strategy selector per investor jurisdiction with immutable historical evaluations.
Requirements and context
- Must be secure, tested, and documented
- Should be efficient and easy to review
- Relevant code: taxation service under
src/services/
- Strategy changes require dual-control and are effective forward-only
Suggested execution
- Fork the repo and create a branch
git checkout -b feat/tax-cost-basis-strategies
- Implement changes
- Add
investment_lots and disposals migrations
- Implement
CostBasisStrategy interface with FIFO/LIFO/HIFO
- Emit per-jurisdiction gains totals
- Validate security and correctness assumptions
Test and commit
- Run tests
- Cover edge cases
- Fractional-share disposal splits lots correctly
- Include test output and notes
Example commit message
feat: per-lot cost-basis strategies for tax reports
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Description
Tax reports require per-lot cost-basis tracking with pluggable disposal strategies (FIFO, LIFO, HIFO). Add lot lifecycle tables and a strategy selector per investor jurisdiction with immutable historical evaluations.
Requirements and context
src/services/Suggested execution
git checkout -b feat/tax-cost-basis-strategiesinvestment_lotsanddisposalsmigrationsCostBasisStrategyinterface with FIFO/LIFO/HIFOTest and commit
npm testExample commit message
feat: per-lot cost-basis strategies for tax reportsGuidelines