feat(platform): harden access scoping and delivery baseline

This commit is contained in:
2026-03-30 00:27:31 +02:00
parent 00b936fa1f
commit 819345acfa
109 changed files with 26142 additions and 8081 deletions
+6 -1
View File
@@ -92,6 +92,11 @@ export function generateSummary(
export async function createAuditEntry(params: CreateAuditEntryParams): Promise<void> {
try {
const { db, entityType, entityId, entityName, action, userId, before, after, source, metadata } = params;
const auditLog = (db as Partial<PrismaClient>).auditLog;
if (!auditLog || typeof auditLog.create !== "function") {
return;
}
// Compute diff if both snapshots are available
const diff = before && after ? computeDiff(before, after) : undefined;
@@ -111,7 +116,7 @@ export async function createAuditEntry(params: CreateAuditEntryParams): Promise<
if (diff) changes.diff = diff;
if (metadata) changes.metadata = metadata;
await db.auditLog.create({
await auditLog.create({
data: {
entityType,
entityId,