/** Mirrors the C# DTOs.Shared.PagedResult<T>. */
export interface PagedResult<T> {
  items: T[];
  totalCount: number;
  page: number;
  pageSize: number;
  totalPages: number;
}

// ── System logs ───────────────────────────────────────────────────────────────

export interface SystemLogListItem {
  id: number;
  timestamp: string;
  level: string;
  category: string;
  message: string;
  hasException: boolean;
  statusCode?: number | null;
  requestPath?: string | null;
  httpMethod?: string | null;
  userId?: string | null;
  correlationId?: string | null;
}

export interface SystemLogDetail extends SystemLogListItem {
  eventId?: number | null;
  exception?: string | null;
  ipAddress?: string | null;
}

export interface SystemLogQuery {
  page?: number;
  pageSize?: number;
  from?: string;
  to?: string;
  minLevel?: string;
  level?: string;
  search?: string;
  userId?: string;
  correlationId?: string;
}

// ── Audit logs ────────────────────────────────────────────────────────────────

export interface AuditLogListItem {
  id: number;
  timestamp: string;
  level: string;
  action: string;
  category: string;
  entityName?: string | null;
  entityId?: string | null;
  summary?: string | null;
  userId?: string | null;
  userEmail?: string | null;
}

export interface AuditLogDetail extends AuditLogListItem {
  changes?: string | null;
  ipAddress?: string | null;
  correlationId?: string | null;
}

export interface AuditLogQuery {
  page?: number;
  pageSize?: number;
  from?: string;
  to?: string;
  category?: string;
  action?: string;
  entityName?: string;
  entityId?: string;
  userId?: string;
  minLevel?: string;
  search?: string;
}

export interface AuditCatalog {
  categories: string[];
  actions: string[];
  levels: string[];
}
