mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-13 14:32:03 +00:00
Cases covered: - POST 401 unauth, 400 invalid kind, 400 non-ISO signedAt, 400 oversize artefact (>64 KB), 200 inserts row + strips artefact from response. - GET 401, 400 invalid kind, null when nothing granted, latest row by kind, full keyspace projection when ?kind is omitted. - DELETE 401, flips revokedAt on the latest active row, idempotent no-op when nothing to revoke, master toggle revokes per-kind. The headline test is the append-only invariant: a revoke + re-grant cycle leaves the original row in place (with revokedAt set), mints a fresh row, and a subsequent GET points at the re-grant — never at the revoked predecessor. Prisma's `delete` is asserted to never be called on a receipt, which is the legal-team guarantee the audit trail relies on. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>