feat(core-audit): createAuditErasureHook Payload afterDelete factory

Adds createAuditErasureHook in core-audit/src/hooks/. The factory returns
a CollectionAfterDeleteHook that calls auditLog.eraseSubject() when a
document is deleted. Defaults to "pseudonymize" mode; coerces numeric ids
to string; skips undefined/null/object ids. Barrel at hooks/index.ts.
6 unit tests cover all guard branches.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-11 16:23:08 +02:00
parent 18fddcc45f
commit 270897c550
3 changed files with 107 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
export {
createAuditErasureHook,
type AuditErasureHookOpts,
} from "./audit-erasure-hook";