import { queryOptions } from '@tanstack/react-query';
import { getAuditLogs } from './service';
import type { AuditLog, AuditLogFilters } from './types';

export type { AuditLog };

export const auditLogKeys = {
  all: ['audit-logs'] as const,
  list: (filters: AuditLogFilters) => [...auditLogKeys.all, 'list', filters] as const
};

export const auditLogsQueryOptions = (filters: AuditLogFilters) =>
  queryOptions({
    queryKey: auditLogKeys.list(filters),
    queryFn: () => getAuditLogs(filters)
  });
