feat(db): add deletedAt audit timestamp to soft-deletable models

Add deletedAt DateTime? to User, Client, Role, Resource, and Blueprint
models for GDPR-compliant deactivation audit trail. Soft-delete mutations
now stamp deletedAt: new Date() on deactivation and clear it on
reactivation. Migration and test assertions updated accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-09 20:03:38 +02:00
parent f7407bd882
commit 1a8ea11331
10 changed files with 43 additions and 25 deletions
@@ -199,7 +199,7 @@ export async function updateClient(ctx: ClientProcedureContext, input: ClientUpd
export async function deactivateClient(ctx: ClientProcedureContext, input: ClientIdInput) {
const updated = await ctx.db.client.update({
where: { id: input.id },
data: { isActive: false },
data: { isActive: false, deletedAt: new Date() },
});
void createAuditEntry({