Purging a tenant now first erases its Prüfwerk data through Prüfwerk's platform API (service token, confirm = tenant id). A failure answers 502 pruefwerk_error and removes nothing; without Prüfwerk in the catalog the step is skipped. The tenant.purged audit records the outcome.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Purging an archived workspace deleted its intake reports with it: every
intake table cascaded from tenants. Benjamin's decision Nr. 17 (docgen#6
17878, V-g): no automatic deletion of the reports when a workspace is
deleted.
The purge now refuses first, before any file or account is removed:
409 intake_retained while the workspace has reports. Migration 0030 makes
the database refuse as well (intake_reports → tenants ON DELETE RESTRICT),
and DeleteTenant maps that to ErrConflict. CountIntakeReports on both
stores.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014aRnCGqELxoix5TfpX8Ejf