Hugo Fund Formation Platform14 Jun, 03:54 CET

Fund Lifecycle

Status model and route behavior for active vs closed fund workflows.

Status model

Fund status is stored in funds.status and typed as OPEN or closed in src/lib/types.ts.

StatusSurface behavior
OPEN All page and API handlers run normally (read and write flows).
closed Closed-fund guard applies at routing level before handler logic.

Closed-fund guard behavior

Read vs write split
  • Write-capable requests (non-GET/HEAD): blocked with 403 Closed funds are read-only.
  • Unknown or disallowed fund routes: blocked with 404 This view is not available for closed funds.
  • The policy is centralized in src/lib/fund-view-policy.ts and enforced by src/middleware/closed-fund-policy.ts on /funds/:fundSlug and /api/funds/:fundSlug.

Closed-fund read-only allowlist

The following fund-scoped views remain available for review and reporting:

Fund pages
  • /funds/:fundSlug (closed overview)
  • /funds/:fundSlug/overview/closing-tracker
  • /funds/:fundSlug/search
  • /funds/:fundSlug/investors and /funds/:fundSlug/investors/:investorId
  • /funds/:fundSlug/mfn (read surfaces)
  • /funds/:fundSlug/mfn/clause-exclusions-list
  • /funds/:fundSlug/setup?tab=structure and related setup reads
  • /funds/:fundSlug/clause-text-variables plus /funds/:fundSlug/clause-text-variables/:id/row
  • /funds/:fundSlug/library/compare-group when clause IDs are provided
  • /funds/:fundSlug/groups
  • /funds/:fundSlug/library with master-side-letter mode redirect to ?msl=true
Fund-scoped APIs
  • /api/funds/:fundSlug and descendants for read and calculation-style handlers
  • /api/funds/:fundSlug/commitments
  • /api/funds/:fundSlug/clauses
  • /api/funds/:fundSlug/mfn/calculate
  • /api/funds/:fundSlug/clauses/search
  • /api/funds/:fundSlug/signals

Closed fund redirect rule

Requests to /funds/:fundSlug/library without msl=true are redirected to /funds/:fundSlug/library?msl=true.

Implementation note: this is intentionally strict. If you need workflow changes for closed funds, update src/lib/fund-view-policy.ts so routes stay centralized and predictable.
Ctrl+K to open · ↑↓ navigate · Enter go · Esc close
Copied