fix(medications): give back the doses an End took when the End is undone

End course tombstones the pending placeholders at or after its instant.
Moving or removing the end clears the instant, but the tombstoned rows
kept their unique slots, so the today projector treated them as present
and minted nothing: the later dose of that day was neither listed,
reminded nor missed.

The window's one writer now revives the placeholders the End stamped
with its instant once that instant is gone, when the slot is inside the
courses as they stand and no live row holds it.

Refs #1280
This commit is contained in:
Marc-André Bombeck committed 2026-10-25 00:37:35 +02:00
1 parent f0b6854a91
commit 5cfaf4869d
4 files changed
+199 -9

No files matched your search

@@ -74,6 +74,8 @@ const INTAKE_MAY_SEE_EVERY_ROW: Record<string, string> = {
"deletes rows the person chose",
"lib/medications/update-medication/write.ts":
"one medication's open slots, tombstoned on a schedule replace or the tracking switch",
"lib/medications/course-end-placeholders.ts":
"gives back the open slots one medication's End course took, no rate",
"lib/medications/intake-bulk/ingest.ts": "writes recorded doses",
"lib/medications/scheduling/slot-upsert.ts":
"binds a recorded dose to its slot",