feat: add server modules (audit, upload, email, content, tracking)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-26 11:59:00 -05:00
co-authored by Claude Sonnet 4.6
parent 649c324f37
commit 3669c0d4f8
5 changed files with 371 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
import { db } from './db';
import { auditLog } from './schema';
export async function logAudit(params: {
userId?: number;
action: string;
entity?: string;
entityId?: number;
diff?: Record<string, unknown>;
ipAddress?: string;
}): Promise<void> {
await db.insert(auditLog).values({
userId: params.userId ?? null,
action: params.action,
entity: params.entity ?? null,
entityId: params.entityId ?? null,
diff: params.diff ?? null,
ipAddress: params.ipAddress ?? null
});
}