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 | 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 { const response = await apiClient.get('/audit-log', { params: filters }); return response.data; }