feat(modules): default the illness journal on

The illness module shipped opt-in/default-off via a bornGated flag, the
inverse of the standard disabled-allowlist. Make it a normal optional
module that defaults on (opt-out), matching labs and its siblings.

No module used bornGated other than illness, so drop the flag, its
isBornGatedModule helper, and the gate resolver's born-gated branch
entirely. The module stays a normal toggle under What you track and the
operator-level availability override is unchanged; an account that wants
it off sets an explicit false. Refresh the gate, doctor-report, labs and
biomarkers comments plus the OpenAPI route descriptions accordingly.
This commit is contained in:
Marc-André Bombeck committed 2026-06-17 14:10:46 +02:00
1 parent b5c1d1fc4e
commit bc94a5893f
10 files changed
+37 -72

No files matched your search

@@ -78,12 +78,12 @@ const MODULE_ROUTE_TREES: ReadonlyArray<string> = [
"src/app/api/biomarkers",
"src/app/api/cycle",
// v1.18.1 (W-B) — the illness/condition journal. Every `/api/illness/*`
// route gates on the born-gated `illness` module via the thin
// route gates on the `illness` module via the thin
// `requireIllnessEnabled(...)` wrapper (which re-stamps the
// illness-specific errorCode over `requireModuleEnabled("illness")`),
// recognised below as a delegated gate. Walking the tree means a NEW
// ungated illness route fails this test BY NAME rather than leaking the
// surface over a Bearer token when the account never opted in.
// surface over a Bearer token when the account turned the module off.
"src/app/api/illness",
"src/app/api/gamification",
// v1.18.1 (D3) — medications graduated from CORE to a toggleable module.
+1 -1
View File
@@ -26,7 +26,7 @@ import { createBiomarkerSchema } from "@/lib/validations/biomarkers";
* The Labs module toggle is a UX-only nav preference; the data is owner-scoped
* and read by cross-feature surfaces (Vorsorge reminder resolution, the
* doctor-report PDF) regardless of the toggle. Deliberate opt-out, in contrast
* to the born-gated `/api/illness/*` routes.
* to the gated `/api/illness/*` routes.
*
* The catalog is the Labs feature's primary object: a marker is defined ONCE
* (name, unit, reference bounds, optional context) and every later reading
+1 -1
View File
@@ -28,7 +28,7 @@ import {
/**
* v1.17.1 — structured lab-result store (`/api/labs`).
*
* Module gate: unlike `/api/illness/*` (born-gated, every route 403s when the
* Module gate: unlike `/api/illness/*` (gated, every route 403s when the
* module is off), Labs is intentionally NOT server-gated. The Labs module
* toggle is a UX-only nav/visibility preference — the data is always
* owner-scoped and safe to read/write, and the Vorsorge lab-panel reminder