This commit is contained in:
2026-09-19 22:19:35 +02:00
commit 231b3e006a
124 changed files with 13816 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
import { Injectable, Logger } from '@nestjs/common';
import { v4 as uuidv4 } from 'uuid';
import { PrismaService } from '../prisma/prisma.service';
@Injectable()
export class AuditService {
private readonly logger = new Logger(AuditService.name);
constructor(private prisma: PrismaService) {}
async log(venueId: string, actorType: string, actorId: string, action: string, details?: Record<string, any>) {
try {
await this.prisma.auditLog.create({
data: {
id: uuidv4(),
venueId,
actorType,
actorId,
action,
details: details ? JSON.stringify(details) : null,
},
});
} catch (error) {
this.logger.error(`Failed to write audit log: ${error}`);
}
}
}