Update: nueva version Horux Despachos
This commit is contained in:
37
apps/web/lib/api/audit-log.ts
Normal file
37
apps/web/lib/api/audit-log.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { apiClient } from './client';
|
||||
|
||||
export interface AuditLogEntry {
|
||||
id: string;
|
||||
userId: string | null;
|
||||
tenantId: string | null;
|
||||
action: string;
|
||||
entityType: string | null;
|
||||
entityId: string | null;
|
||||
metadata: Record<string, any> | null;
|
||||
createdAt: string;
|
||||
user: { id: string; email: string; nombre: string } | null;
|
||||
tenant: { id: string; nombre: string; rfc: string } | null;
|
||||
}
|
||||
|
||||
export interface AuditLogFilters {
|
||||
action?: string;
|
||||
tenantId?: string;
|
||||
userId?: string;
|
||||
from?: string;
|
||||
to?: string;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export interface AuditLogResponse {
|
||||
data: AuditLogEntry[];
|
||||
page: number;
|
||||
limit: number;
|
||||
total: number;
|
||||
totalPages: number;
|
||||
}
|
||||
|
||||
export async function listAuditLog(filters: AuditLogFilters = {}): Promise<AuditLogResponse> {
|
||||
const response = await apiClient.get<AuditLogResponse>('/audit-log', { params: filters });
|
||||
return response.data;
|
||||
}
|
||||
Reference in New Issue
Block a user