fix(records): show a deleted practitioner on the live visits that name it

The web record and the doctor report named the practitioner of a live
visit after the address-book entry was deleted; the MCP read, the search
and the appointment reminder did not. All of them now name it, the entry
stays out of the address book and the pickers, and a portable backup
carries it as a tombstone instead of dropping the visit's reference.
This commit is contained in:
Marc-André Bombeck committed 2026-10-20 16:01:13 +02:00
1 parent ec2c067e60
commit a275a5bb65
11 files changed
+159 -47

No files matched your search

+4 -3
View File
@@ -7,9 +7,10 @@
* read by id and then checked against the resolved user, so a foreign id and a
* missing id give the same 404 and probing learns nothing.
*
* Deleting a practitioner keeps every visit that named it. The foreign key is
* SetNull, so the visits survive with no practice attached rather than
* disappearing with the address-book entry.
* Deleting a practitioner takes it out of the address book and the pickers,
* not out of the history: every live visit and dose that named it keeps
* showing it, and the nightly purge keeps the tombstone for as long as one
* does (`soft-delete-retention.ts`).
*/
import { NextRequest } from "next/server";