feat(illness): add the condition-journal MVP behind a born-gated module

Introduce a retrospective illness/condition journal: episodes with a
lifecycle (acute / chronic-ongoing / recurring / flare) and a daily
symptom timeline forked structurally from the cycle log-day surface. The
journal is a record, not a medical device — no prediction or diagnosis UI.

- Register `illness` as a born-gated (opt-in / default-off) module. The
  gate resolver flips the disabled-allowlist default to off for born-gated
  keys, so the surface stays dark until the account opts in from the
  Modules hub. `isIllnessEnabled` + `requireIllnessEnabled` delegate to the
  module foundation (one source of truth) and re-stamp an illness errorCode.
- Episode CRUD under /api/illness: list / create / get / edit / resolve /
  delete, plus a per-episode-day day-log upsert on (episodeId, date). Every
  route wraps apiHandler, Zod-validates with returnAllZodIssues, narrows
  userId from auth, builds data field-by-field, and gates the module.
  Free-text notes encrypt at rest through the shared Bytes codec.
- Log-day sheet (cycle fork): ~8 Jackson/WURSS symptom chips 0-3 + a
  functional-impact group + fever + an encrypted note, one row per day.
- Episode history page + a born-gated nav entry, neutral palette, status
  via a neutral Badge, retrospective-only copy. i18n across all six locales.
- Cover the new routes in the module-route-gate inventory; unit tests for
  the day-log upsert, the gate enforcement, and the born-gated resolver.

The /api/auth/me module map now projects the `illness` flag (openapi.yaml
regenerated).
This commit is contained in:
Marc-André Bombeck committed 2026-06-16 21:09:35 +02:00
1 parent bee7295b19
commit b079431a8d
34 files changed
+2799 -6

No files matched your search

+80 -1
View File
@@ -266,7 +266,8 @@
"cycle": "Zyklus",
"labs": "Laborwerte",
"recovery": "Erholung",
"vorsorge": "Vorsorge"
"vorsorge": "Vorsorge",
"illness": "Krankheit"
},
"auth": {
"login": "Anmelden",
@@ -6606,6 +6607,84 @@
"medications": {
"label": "Medikamente",
"description": "Pläne, Einnahmen und Compliance."
},
"illness": {
"label": "Krankheitstagebuch",
"description": "Krankheits- und Beschwerde-Episoden mit täglichem Symptomverlauf festhalten."
}
},
"illness": {
"title": "Krankheitstagebuch",
"subtitle": "Ein rückblickendes Protokoll deiner Krankheits- und Beschwerde-Episoden.",
"disclaimer": "Ein persönliches Tagebuch — kein Medizinprodukt. Es stellt keine Diagnose und keine Prognose.",
"newEpisode": "Neue Episode",
"logDay": "Tag erfassen",
"markRecovered": "Als genesen markieren",
"onsetOn": "Begonnen am {date}",
"recoveredOn": "genesen {date}",
"status": {
"active": "Aktiv",
"ongoing": "Andauernd",
"recovered": "Genesen"
},
"empty": {
"title": "Noch keine Episoden",
"body": "Beginne eine Episode, um einen täglichen Symptomverlauf zu führen und nachzusehen, wie sie verlief."
},
"type": {
"INFECTION": "Infektion",
"ALLERGY": "Allergie",
"INJURY": "Verletzung",
"MENTAL_HEALTH": "Psychische Gesundheit",
"AUTOIMMUNE": "Autoimmun",
"CHRONIC": "Chronisch",
"OTHER": "Sonstiges"
},
"lifecycle": {
"ACUTE": "Akut",
"CHRONIC_ONGOING": "Chronisch / andauernd",
"RECURRING": "Wiederkehrend",
"FLARE": "Schub"
},
"new": {
"title": "Neue Episode",
"description": "Erfasse eine Krankheit oder Beschwerde. Tägliche Symptome kannst du danach festhalten.",
"label": "Bezeichnung",
"labelPlaceholder": "z. B. Erkältung",
"type": "Art",
"lifecycle": "Verlauf",
"onset": "Begonnen am",
"note": "Notiz",
"notePlaceholder": "Was erwähnenswert ist (verschlüsselt).",
"saveError": "Die Episode konnte nicht gespeichert werden. Bitte erneut versuchen."
},
"sheet": {
"title": "{date} erfassen",
"description": "Halte die heutigen Symptome, deine Belastbarkeit und ggf. Fieber fest.",
"symptoms": "Symptome",
"functionalImpact": "Belastbarkeit",
"fever": "Temperatur",
"note": "Notiz",
"noteSet": "Gesetzt",
"notePlaceholder": "Wie sich der Tag anfühlte (verschlüsselt).",
"severityFor": "Stärke für {symptom}",
"saveError": "Der Tag konnte nicht gespeichert werden. Bitte erneut versuchen."
},
"impact": {
"0": "Voll belastbar",
"1": "Leicht eingeschränkt",
"2": "Überwiegend ruhend",
"3": "Bettlägerig"
},
"symptom": {
"runnyNose": "Laufende Nase",
"stuffyNose": "Verstopfte Nase",
"sneezing": "Niesen",
"soreThroat": "Halsschmerzen",
"cough": "Husten",
"headache": "Kopfschmerzen",
"bodyAches": "Gliederschmerzen",
"fatigue": "Erschöpfung"
}
}
}
+80 -1
View File
@@ -266,7 +266,8 @@
"cycle": "Cycle",
"labs": "Labs",
"recovery": "Recovery",
"vorsorge": "Preventive Care"
"vorsorge": "Preventive Care",
"illness": "Illness"
},
"auth": {
"login": "Sign in",
@@ -6606,6 +6607,84 @@
"medications": {
"label": "Medications",
"description": "Schedules, intakes, and compliance."
},
"illness": {
"label": "Illness journal",
"description": "Track illness and condition episodes with a daily symptom timeline."
}
},
"illness": {
"title": "Illness journal",
"subtitle": "A retrospective log of your illness and condition episodes.",
"disclaimer": "A personal journal — not a medical device. It does not diagnose or predict.",
"newEpisode": "New episode",
"logDay": "Log a day",
"markRecovered": "Mark recovered",
"onsetOn": "Started {date}",
"recoveredOn": "recovered {date}",
"status": {
"active": "Active",
"ongoing": "Ongoing",
"recovered": "Recovered"
},
"empty": {
"title": "No episodes yet",
"body": "Start an episode to keep a daily symptom timeline and look back on how it unfolded."
},
"type": {
"INFECTION": "Infection",
"ALLERGY": "Allergy",
"INJURY": "Injury",
"MENTAL_HEALTH": "Mental health",
"AUTOIMMUNE": "Autoimmune",
"CHRONIC": "Chronic",
"OTHER": "Other"
},
"lifecycle": {
"ACUTE": "Acute",
"CHRONIC_ONGOING": "Chronic / ongoing",
"RECURRING": "Recurring",
"FLARE": "Flare"
},
"new": {
"title": "New episode",
"description": "Record an illness or condition. You can log daily symptoms afterwards.",
"label": "Name",
"labelPlaceholder": "e.g. Common cold",
"type": "Type",
"lifecycle": "Course",
"onset": "Started on",
"note": "Note",
"notePlaceholder": "Anything worth remembering (encrypted).",
"saveError": "Could not save the episode. Please try again."
},
"sheet": {
"title": "Log {date}",
"description": "Record today's symptoms, how you function, and any fever.",
"symptoms": "Symptoms",
"functionalImpact": "How you function",
"fever": "Temperature",
"note": "Note",
"noteSet": "Set",
"notePlaceholder": "How the day felt (encrypted).",
"severityFor": "Severity for {symptom}",
"saveError": "Could not save the day. Please try again."
},
"impact": {
"0": "Fully functional",
"1": "Slightly limited",
"2": "Mostly resting",
"3": "Bedbound"
},
"symptom": {
"runnyNose": "Runny nose",
"stuffyNose": "Stuffy nose",
"sneezing": "Sneezing",
"soreThroat": "Sore throat",
"cough": "Cough",
"headache": "Headache",
"bodyAches": "Body aches",
"fatigue": "Fatigue"
}
}
}
+80 -1
View File
@@ -266,7 +266,8 @@
"cycle": "Ciclo",
"labs": "Análisis",
"recovery": "Recuperación",
"vorsorge": "Prevención"
"vorsorge": "Prevención",
"illness": "Enfermedad"
},
"auth": {
"login": "Iniciar sesión",
@@ -6606,6 +6607,84 @@
"medications": {
"label": "Medicamentos",
"description": "Pautas, tomas y cumplimiento."
},
"illness": {
"label": "Diario de enfermedad",
"description": "Registra episodios de enfermedad y dolencias con un historial diario de síntomas."
}
},
"illness": {
"title": "Diario de enfermedad",
"subtitle": "Un registro retrospectivo de tus episodios de enfermedad y dolencias.",
"disclaimer": "Un diario personal, no un dispositivo médico. No diagnostica ni predice.",
"newEpisode": "Nuevo episodio",
"logDay": "Registrar un día",
"markRecovered": "Marcar como recuperado",
"onsetOn": "Comenzó el {date}",
"recoveredOn": "recuperado {date}",
"status": {
"active": "Activo",
"ongoing": "En curso",
"recovered": "Recuperado"
},
"empty": {
"title": "Aún no hay episodios",
"body": "Inicia un episodio para llevar un historial diario de síntomas y revisar cómo evolucionó."
},
"type": {
"INFECTION": "Infección",
"ALLERGY": "Alergia",
"INJURY": "Lesión",
"MENTAL_HEALTH": "Salud mental",
"AUTOIMMUNE": "Autoinmune",
"CHRONIC": "Crónica",
"OTHER": "Otro"
},
"lifecycle": {
"ACUTE": "Aguda",
"CHRONIC_ONGOING": "Crónica / en curso",
"RECURRING": "Recurrente",
"FLARE": "Brote"
},
"new": {
"title": "Nuevo episodio",
"description": "Registra una enfermedad o dolencia. Luego podrás anotar síntomas diarios.",
"label": "Nombre",
"labelPlaceholder": "p. ej. Resfriado común",
"type": "Tipo",
"lifecycle": "Curso",
"onset": "Comenzó el",
"note": "Nota",
"notePlaceholder": "Algo que valga la pena recordar (cifrado).",
"saveError": "No se pudo guardar el episodio. Inténtalo de nuevo."
},
"sheet": {
"title": "Registrar {date}",
"description": "Anota los síntomas de hoy, cómo funcionas y la fiebre, si la hay.",
"symptoms": "Síntomas",
"functionalImpact": "Cómo funcionas",
"fever": "Temperatura",
"note": "Nota",
"noteSet": "Definida",
"notePlaceholder": "Cómo te sentiste hoy (cifrado).",
"severityFor": "Gravedad de {symptom}",
"saveError": "No se pudo guardar el día. Inténtalo de nuevo."
},
"impact": {
"0": "Plenamente funcional",
"1": "Algo limitado",
"2": "Mayormente en reposo",
"3": "En cama"
},
"symptom": {
"runnyNose": "Goteo nasal",
"stuffyNose": "Congestión nasal",
"sneezing": "Estornudos",
"soreThroat": "Dolor de garganta",
"cough": "Tos",
"headache": "Dolor de cabeza",
"bodyAches": "Dolores musculares",
"fatigue": "Fatiga"
}
}
}
+80 -1
View File
@@ -266,7 +266,8 @@
"cycle": "Cycle",
"labs": "Analyses",
"recovery": "Récupération",
"vorsorge": "Prévention"
"vorsorge": "Prévention",
"illness": "Maladie"
},
"auth": {
"login": "Se connecter",
@@ -6606,6 +6607,84 @@
"medications": {
"label": "Médicaments",
"description": "Schémas, prises et observance."
},
"illness": {
"label": "Journal de maladie",
"description": "Suivez les épisodes de maladie et d'affections avec un historique quotidien des symptômes."
}
},
"illness": {
"title": "Journal de maladie",
"subtitle": "Un suivi rétrospectif de vos épisodes de maladie et d'affections.",
"disclaimer": "Un journal personnel, pas un dispositif médical. Il ne diagnostique ni ne prédit.",
"newEpisode": "Nouvel épisode",
"logDay": "Enregistrer un jour",
"markRecovered": "Marquer comme rétabli",
"onsetOn": "Débuté le {date}",
"recoveredOn": "rétabli {date}",
"status": {
"active": "En cours",
"ongoing": "Persistant",
"recovered": "Rétabli"
},
"empty": {
"title": "Aucun épisode pour l'instant",
"body": "Démarrez un épisode pour tenir un historique quotidien des symptômes et revoir son évolution."
},
"type": {
"INFECTION": "Infection",
"ALLERGY": "Allergie",
"INJURY": "Blessure",
"MENTAL_HEALTH": "Santé mentale",
"AUTOIMMUNE": "Auto-immune",
"CHRONIC": "Chronique",
"OTHER": "Autre"
},
"lifecycle": {
"ACUTE": "Aiguë",
"CHRONIC_ONGOING": "Chronique / persistante",
"RECURRING": "Récurrente",
"FLARE": "Poussée"
},
"new": {
"title": "Nouvel épisode",
"description": "Enregistrez une maladie ou une affection. Vous pourrez ensuite noter les symptômes au quotidien.",
"label": "Nom",
"labelPlaceholder": "p. ex. Rhume",
"type": "Type",
"lifecycle": "Évolution",
"onset": "Débuté le",
"note": "Note",
"notePlaceholder": "Ce qui mérite d'être noté (chiffré).",
"saveError": "Impossible d'enregistrer l'épisode. Veuillez réessayer."
},
"sheet": {
"title": "Enregistrer {date}",
"description": "Notez les symptômes du jour, votre forme et une éventuelle fièvre.",
"symptoms": "Symptômes",
"functionalImpact": "Votre forme",
"fever": "Température",
"note": "Note",
"noteSet": "Définie",
"notePlaceholder": "Comment s'est passée la journée (chiffré).",
"severityFor": "Intensité de {symptom}",
"saveError": "Impossible d'enregistrer la journée. Veuillez réessayer."
},
"impact": {
"0": "Pleinement fonctionnel",
"1": "Légèrement limité",
"2": "Surtout au repos",
"3": "Alité"
},
"symptom": {
"runnyNose": "Nez qui coule",
"stuffyNose": "Nez bouché",
"sneezing": "Éternuements",
"soreThroat": "Mal de gorge",
"cough": "Toux",
"headache": "Mal de tête",
"bodyAches": "Courbatures",
"fatigue": "Fatigue"
}
}
}
+80 -1
View File
@@ -266,7 +266,8 @@
"cycle": "Ciclo",
"labs": "Esami",
"recovery": "Recupero",
"vorsorge": "Prevenzione"
"vorsorge": "Prevenzione",
"illness": "Malattia"
},
"auth": {
"login": "Accedi",
@@ -6606,6 +6607,84 @@
"medications": {
"label": "Farmaci",
"description": "Schemi, assunzioni e aderenza."
},
"illness": {
"label": "Diario delle malattie",
"description": "Registra episodi di malattia e disturbi con una cronologia giornaliera dei sintomi."
}
},
"illness": {
"title": "Diario delle malattie",
"subtitle": "Un registro retrospettivo dei tuoi episodi di malattia e disturbi.",
"disclaimer": "Un diario personale, non un dispositivo medico. Non diagnostica né prevede.",
"newEpisode": "Nuovo episodio",
"logDay": "Registra un giorno",
"markRecovered": "Segna come guarito",
"onsetOn": "Iniziato il {date}",
"recoveredOn": "guarito {date}",
"status": {
"active": "Attivo",
"ongoing": "In corso",
"recovered": "Guarito"
},
"empty": {
"title": "Ancora nessun episodio",
"body": "Avvia un episodio per tenere una cronologia giornaliera dei sintomi e rivedere come si è evoluto."
},
"type": {
"INFECTION": "Infezione",
"ALLERGY": "Allergia",
"INJURY": "Infortunio",
"MENTAL_HEALTH": "Salute mentale",
"AUTOIMMUNE": "Autoimmune",
"CHRONIC": "Cronica",
"OTHER": "Altro"
},
"lifecycle": {
"ACUTE": "Acuta",
"CHRONIC_ONGOING": "Cronica / in corso",
"RECURRING": "Ricorrente",
"FLARE": "Riacutizzazione"
},
"new": {
"title": "Nuovo episodio",
"description": "Registra una malattia o un disturbo. Potrai annotare i sintomi giornalieri in seguito.",
"label": "Nome",
"labelPlaceholder": "es. Raffreddore",
"type": "Tipo",
"lifecycle": "Decorso",
"onset": "Iniziato il",
"note": "Nota",
"notePlaceholder": "Qualcosa da ricordare (cifrato).",
"saveError": "Impossibile salvare l'episodio. Riprova."
},
"sheet": {
"title": "Registra {date}",
"description": "Annota i sintomi di oggi, come funzioni e l'eventuale febbre.",
"symptoms": "Sintomi",
"functionalImpact": "Come funzioni",
"fever": "Temperatura",
"note": "Nota",
"noteSet": "Impostata",
"notePlaceholder": "Com'è andata la giornata (cifrato).",
"severityFor": "Intensità di {symptom}",
"saveError": "Impossibile salvare la giornata. Riprova."
},
"impact": {
"0": "Pienamente funzionale",
"1": "Leggermente limitato",
"2": "Per lo più a riposo",
"3": "A letto"
},
"symptom": {
"runnyNose": "Naso che cola",
"stuffyNose": "Naso chiuso",
"sneezing": "Starnuti",
"soreThroat": "Mal di gola",
"cough": "Tosse",
"headache": "Mal di testa",
"bodyAches": "Dolori muscolari",
"fatigue": "Affaticamento"
}
}
}
+80 -1
View File
@@ -266,7 +266,8 @@
"cycle": "Cykl",
"labs": "Wyniki badań",
"recovery": "Regeneracja",
"vorsorge": "Profilaktyka"
"vorsorge": "Profilaktyka",
"illness": "Choroba"
},
"auth": {
"login": "Zaloguj się",
@@ -6606,6 +6607,84 @@
"medications": {
"label": "Leki",
"description": "Schematy, przyjęcia i zgodność."
},
"illness": {
"label": "Dziennik chorób",
"description": "Zapisuj epizody chorób i dolegliwości z dziennym przebiegiem objawów."
}
},
"illness": {
"title": "Dziennik chorób",
"subtitle": "Retrospektywny zapis Twoich epizodów chorób i dolegliwości.",
"disclaimer": "Osobisty dziennik — nie wyrób medyczny. Nie diagnozuje ani nie przewiduje.",
"newEpisode": "Nowy epizod",
"logDay": "Zapisz dzień",
"markRecovered": "Oznacz jako wyleczone",
"onsetOn": "Początek {date}",
"recoveredOn": "wyleczono {date}",
"status": {
"active": "Aktywny",
"ongoing": "Trwający",
"recovered": "Wyleczony"
},
"empty": {
"title": "Brak epizodów",
"body": "Rozpocznij epizod, aby prowadzić dzienny przebieg objawów i prześledzić, jak się rozwijał."
},
"type": {
"INFECTION": "Infekcja",
"ALLERGY": "Alergia",
"INJURY": "Uraz",
"MENTAL_HEALTH": "Zdrowie psychiczne",
"AUTOIMMUNE": "Autoimmunologiczna",
"CHRONIC": "Przewlekła",
"OTHER": "Inne"
},
"lifecycle": {
"ACUTE": "Ostra",
"CHRONIC_ONGOING": "Przewlekła / trwająca",
"RECURRING": "Nawracająca",
"FLARE": "Zaostrzenie"
},
"new": {
"title": "Nowy epizod",
"description": "Zapisz chorobę lub dolegliwość. Codzienne objawy możesz notować później.",
"label": "Nazwa",
"labelPlaceholder": "np. Przeziębienie",
"type": "Typ",
"lifecycle": "Przebieg",
"onset": "Początek",
"note": "Notatka",
"notePlaceholder": "Cokolwiek wartego zapamiętania (zaszyfrowane).",
"saveError": "Nie udało się zapisać epizodu. Spróbuj ponownie."
},
"sheet": {
"title": "Zapisz {date}",
"description": "Zanotuj dzisiejsze objawy, swoją sprawność i ewentualną gorączkę.",
"symptoms": "Objawy",
"functionalImpact": "Sprawność",
"fever": "Temperatura",
"note": "Notatka",
"noteSet": "Ustawiona",
"notePlaceholder": "Jak minął dzień (zaszyfrowane).",
"severityFor": "Nasilenie: {symptom}",
"saveError": "Nie udało się zapisać dnia. Spróbuj ponownie."
},
"impact": {
"0": "Pełna sprawność",
"1": "Lekko ograniczona",
"2": "Głównie odpoczynek",
"3": "W łóżku"
},
"symptom": {
"runnyNose": "Katar",
"stuffyNose": "Zatkany nos",
"sneezing": "Kichanie",
"soreThroat": "Ból gardła",
"cough": "Kaszel",
"headache": "Ból głowy",
"bodyAches": "Bóle ciała",
"fatigue": "Zmęczenie"
}
}
}