Skip to content

Add per-investor exposure cap aggregation across offerings with realtime checks #448

Description

@thlpkee20-wq

Description

Investor exposure caps currently apply per-offering. Add cross-offering aggregation that enforces a global cap per investor identity, evaluated at submission time using a serializable read against current commitments.

Requirements and context

  • Must be secure, tested, and documented
  • Should be efficient and easy to review
  • Relevant code: src/services/investmentService.ts, src/db/repositories/investmentRepository.ts
  • Aggregate must include pending and confirmed states

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feat/global-investor-cap
  • Implement changes
    • Add investor_cap_config with effective date
    • Add aggregator query with serializable isolation
    • Reject submission with structured error code
  • Validate security and correctness assumptions

Test and commit

  • Run tests
    • npm test
  • Cover edge cases
    • Concurrent submissions across offerings, cap reduction mid-flight
  • Include test output and notes

Example commit message

feat: global per-investor exposure cap enforcement

Guidelines

  • Minimum 95 percent test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

No one assigned

    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