feat(illness): add date-less day-log list and full-history timeline

The episode day-logs endpoint only accepted a single `date`, so the
detail timeline could anchor on today alone. Add a date-less LIST variant
to GET /api/illness/episodes/{id}/day-logs: when no `date` is given,
return the episode's day-logs newest-first with limit/offset/sortDir
paging and meta.total (mirrors the Labs list envelope). The single-date
read stays intact, selected by the param's presence.

Wire the detail timeline onto the list for a full historical scroll
instead of today only, keeping the neutral palette and retrospective
copy. Register the list response in the OpenAPI contract for the iOS
client.
This commit is contained in:
Marc-André Bombeck committed 2026-06-17 14:07:16 +02:00
1 parent b5c1d1fc4e
commit cdf43c3669
16 files changed
+482 -104

No files matched your search

+18
View File
@@ -162,6 +162,24 @@ export type IllnessDayLogInput = z.infer<typeof illnessDayLogInputSchema>;
/** The single-day read query: `GET .../day-logs?date=YYYY-MM-DD`. */
export const illnessDayLogQuerySchema = z.object({ date: dateString });
/**
* The date-less LIST query: `GET .../day-logs` with NO `date` param returns
* the episode's day-logs newest-first, paginated. Mirrors the Labs
* limit/offset/sortDir + `meta.total` pattern so iOS (healthlog-iOS#30) can
* page a full history without anchoring on today. `date` and the list params
* are mutually exclusive at the route: a `date` triggers the single-day read,
* its absence triggers the list.
*/
export const illnessDayLogListQuerySchema = z.object({
limit: z.coerce.number().int().min(1).max(200).default(60),
offset: z.coerce.number().int().min(0).default(0),
sortDir: z.enum(["asc", "desc"]).default("desc"),
});
export type IllnessDayLogListQuery = z.infer<
typeof illnessDayLogListQuerySchema
>;
/* ── P3 retrospective insight window ─────────────────────────────────── */
/**