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.
| Status | Surface 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.tsand enforced bysrc/middleware/closed-fund-policy.tson/funds/:fundSlugand/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/investorsand/funds/:fundSlug/investors/:investorId/funds/:fundSlug/mfn(read surfaces)/funds/:fundSlug/mfn/clause-exclusions-list/funds/:fundSlug/setup?tab=structureand related setup reads/funds/:fundSlug/clause-text-variablesplus/funds/:fundSlug/clause-text-variables/:id/row/funds/:fundSlug/library/compare-groupwhen clause IDs are provided/funds/:fundSlug/groups/funds/:fundSlug/librarywith master-side-letter mode redirect to?msl=true
Fund-scoped APIs
/api/funds/:fundSlugand 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.