first commit
هذا الالتزام موجود في:
24
src/modules/audit/audit.service.ts
Normal file
24
src/modules/audit/audit.service.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { AuditRepository } from './audit.repository';
|
||||
|
||||
@Injectable()
|
||||
export class AuditService {
|
||||
constructor(private readonly auditRepository: AuditRepository) {}
|
||||
|
||||
async logSuperAdminAction(
|
||||
actorIdentifier: string,
|
||||
action: string,
|
||||
targetType: string,
|
||||
targetId?: string,
|
||||
metadata?: Record<string, unknown>,
|
||||
): Promise<void> {
|
||||
await this.auditRepository.create({
|
||||
actorType: 'superadmin',
|
||||
actorIdentifier,
|
||||
action,
|
||||
targetType,
|
||||
targetId,
|
||||
metadata,
|
||||
});
|
||||
}
|
||||
}
|
||||
المرجع في مشكلة جديدة
حظر مستخدم