feat(medications,coach,admin,perf): era corrections, a truthful weekly status and one card language everywhere

The dashboard snapshot fires the moment login succeeds instead of
waiting for the page chunk (start ~670 to ~200 ms throttled). Guided
follow-ups are personalised from the user's snapshot and an answer gets
the coach's streamed reaction before the next question. Archived
schedule eras can be corrected through a superseding revision that
keeps the original as an audit trail, era writes serialise per
medication, and duplicate dose times collapse in validation. A rolling
medication whose next dose is tomorrow can no longer read as heavily
overdue — the card status derives strictly from the served next-due —
and the adherence bars keep a fixed geometry in every state. The
server-wide assistant key gains its admin card, the one duplicated
coach preference collapses onto a single owner, twenty-seven admin and
settings card headers move onto the shared pattern with sixty
containers normalised, and the remaining hydration warnings are gone.
This commit is contained in:
Marc-André Bombeck committed 2026-06-11 13:57:15 +02:00
1 parent a4b3d2fcd0
commit 40f7196c20
115 files changed
+3014 -1084

No files matched your search

+32 -2
View File
@@ -35,13 +35,22 @@ export const scheduleRevisionCreateSchema = z
.describe(
"Exclusive end instant of the manual era (ISO 8601). Must precede the current plan.",
),
/** Daily dose times the era ran at. Same cap as live schedules. */
/**
* Daily dose times the era ran at. Same cap as live schedules.
* Duplicates collapse and the result sorts ascending — "07:00,
* 07:00, 19:00" and "19:00, 07:00" both normalise to
* ["07:00", "19:00"], so a double-tapped chip never mints a
* double-counted slot.
*/
timesOfDay: z
.array(z.string().regex(timeRegex, "Format: HH:mm"))
.min(1)
.max(8)
.transform((times) =>
[...new Set(times)].sort((a, b) => a.localeCompare(b)),
)
.describe(
"Daily dose times (HH:mm, user local) the era ran at. 1–8 entries.",
"Daily dose times (HH:mm, user local) the era ran at. 1–8 entries; duplicates are collapsed.",
),
})
.refine(
@@ -60,3 +69,24 @@ export const scheduleRevisionCreateSchema = z
export type ScheduleRevisionCreateInput = z.infer<
typeof scheduleRevisionCreateSchema
>;
/**
* v1.16.6 — request schema for
* `PATCH /api/medications/{id}/schedule-revisions/{revisionId}`.
*
* A correction carries the same full era shape as a create: bounds plus
* daily times. MANUAL eras update in place; ARCHIVED eras stay as the
* audit record and the correction is minted as a superseding MANUAL
* row. Field-for-field identical to the create schema — only the meta
* id differs so the OpenAPI document names the two requests apart.
*/
export const scheduleRevisionUpdateSchema = scheduleRevisionCreateSchema
.meta({
id: "UpdateScheduleRevisionRequest",
description:
"Corrected schedule-era payload: replacement era bounds plus the daily dose times that were live during the era.",
});
export type ScheduleRevisionUpdateInput = z.infer<
typeof scheduleRevisionUpdateSchema
>;