mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-10 05:12:14 +00:00
feat(insights): read the persisted wellness scores through the derived contract
Register RECOVERY_SCORE / STRESS_SCORE / STRAIN_SCORE as derived metrics that read the nightly-persisted COMPUTED Measurement rows — a passthrough, never a recompute. The dispatcher routes the three ids to a thin reader that returns the latest score, a trailing-window trend, and a direction-aware band (stress and strain invert, so a high stress reads red). This lets every surface — the dashboard, the Coach snapshot, the doctor report — consume the scores through the one Derived<T> route + hook rather than each growing its own read path. Regenerate the OpenAPI enum, which picks up the three ids from the registry.
This commit is contained in:
1 parent
02c50acd46
commit
a8daef7376
7 files changed
+308
-2
No files matched your search
@@ -2445,6 +2445,9 @@ paths:
|
||||
- COINCIDENT_DEVIATION
|
||||
- HRV_BALANCE
|
||||
- BMI
|
||||
- RECOVERY_SCORE
|
||||
- STRESS_SCORE
|
||||
- STRAIN_SCORE
|
||||
description: "Derived-metric id to compute (e.g. VITALS_BASELINE, FITNESS_AGE, VASCULAR_AGE_DELTA, HRV_BALANCE, BMI,
|
||||
READINESS). Closed enum: an unknown id 422s. Metrics whose compute has not yet landed return an
|
||||
`insufficient` value with reason `not_implemented`."
|
||||
@@ -7592,6 +7595,9 @@ components:
|
||||
- COINCIDENT_DEVIATION
|
||||
- HRV_BALANCE
|
||||
- BMI
|
||||
- RECOVERY_SCORE
|
||||
- STRESS_SCORE
|
||||
- STRAIN_SCORE
|
||||
description: Echoes the requested derived-metric id (tags the union).
|
||||
status:
|
||||
type: string
|
||||
|
||||
Reference in new issue
Block a user