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:
@@ -192,7 +192,7 @@ export async function deleteBlueprint(ctx: BlueprintProcedureContext, input: Blu
|
||||
const audit = makeAuditLogger(ctx.db, ctx.dbUser?.id);
|
||||
const deleted = await ctx.db.blueprint.update({
|
||||
where: { id: input.id },
|
||||
data: { isActive: false },
|
||||
data: { isActive: false, deletedAt: new Date() },
|
||||
});
|
||||
|
||||
audit({
|
||||
@@ -214,7 +214,7 @@ export async function batchDeleteBlueprints(
|
||||
input.ids.map((id) =>
|
||||
ctx.db.blueprint.update({
|
||||
where: { id },
|
||||
data: { isActive: false },
|
||||
data: { isActive: false, deletedAt: new Date() },
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user