mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-11 22:02:16 +00:00
merge(oura): real sleep timeline, SpO2, sleep score, temperature deviation, contributors + reconcile
# Conflicts: # docs/api/openapi.yaml # messages/de.json # messages/en.json # messages/es.json # messages/fr.json # messages/it.json # messages/pl.json # prisma/schema.prisma # src/components/measurements/measurement-list-meta.ts # src/lib/__tests__/measurement-type-enum-coverage.test.ts # src/lib/insights/chart-tokens.ts # src/lib/measurements/__tests__/apple-health-mapping.test.ts # src/lib/measurements/categories.ts # src/lib/personal-records/pr-direction.ts # src/lib/validations/measurement.ts
This commit is contained in:
commit
2736e23092
26 files changed
+873
-50
No files matched your search
@@ -107,6 +107,15 @@ export const measurementTypeEnum = z.enum([
|
||||
// from WHOOP DAY_STRAIN and the COMPUTED STRAIN_SCORE).
|
||||
"ANS_CHARGE",
|
||||
"CARDIO_LOAD",
|
||||
// ── v1.17.1 — Oura coverage completion (additive) ──
|
||||
// Oura's headline 0–100 Sleep Score (`daily_sleep.score`), distinct from the
|
||||
// WHOOP SLEEP_PERFORMANCE / SLEEP_EFFICIENCY sub-scores. The body-temperature
|
||||
// deviation is a SIGNED °C offset from the user's baseline
|
||||
// (`daily_readiness.temperature_deviation`), not an absolute reading, so it
|
||||
// never shares the BODY_TEMPERATURE / SKIN_TEMPERATURE / WRIST_TEMPERATURE
|
||||
// buckets. Both ingest server-side as `source = OURA`.
|
||||
"SLEEP_SCORE",
|
||||
"BODY_TEMPERATURE_DEVIATION",
|
||||
]);
|
||||
|
||||
/**
|
||||
@@ -322,6 +331,11 @@ const unitMap: Record<string, string> = {
|
||||
// ── v1.17.1 — Polar Nightly Recharge + Training Load Pro components ──
|
||||
ANS_CHARGE: "score",
|
||||
CARDIO_LOAD: "score",
|
||||
// ── v1.17.1 — Oura coverage completion ──
|
||||
// Oura's headline 0–100 Sleep Score — bare "score" like the other 0–100 scores.
|
||||
SLEEP_SCORE: "score",
|
||||
// Signed body-temperature deviation in °C (Oura nightly baseline offset).
|
||||
BODY_TEMPERATURE_DEVIATION: "celsius",
|
||||
};
|
||||
|
||||
export function getUnitForType(type: string): string {
|
||||
@@ -504,6 +518,14 @@ const VALUE_RANGES: Record<string, { min: number; max: number }> = {
|
||||
// ceiling over any plausible single-day training load.
|
||||
ANS_CHARGE: { min: -100, max: 100 },
|
||||
CARDIO_LOAD: { min: 0, max: 1000 },
|
||||
// ── v1.17.1 — Oura coverage completion ──
|
||||
// Sleep Score (0–100), same band as the other score classes.
|
||||
SLEEP_SCORE: { min: 0, max: 100 },
|
||||
// Body-temperature deviation (°C) — a signed nightly offset centred on 0.
|
||||
// Oura clamps its own display near ±1 °C; ±5 °C is a generous band that
|
||||
// rejects an obvious sensor glitch while keeping every real illness /
|
||||
// luteal-phase swing.
|
||||
BODY_TEMPERATURE_DEVIATION: { min: -5, max: 5 },
|
||||
};
|
||||
|
||||
export function validateMeasurementRange(
|
||||
|
||||
Reference in new issue
Block a user