import { type SessionsPaginationParams } from './types';

export const sessionsKeys = {
  all: () => ['sessions'],
  sessions: {
    all: () => [...sessionsKeys.all(), 'table-list'],
    list: (search: string) => [...sessionsKeys.sessions.all(), search],
    detail: (sessionId: number) => [...sessionsKeys.sessions.all(), sessionId],
  },
  stats: () => [...sessionsKeys.all(), 'stats'],
  showSessionsTutorial: () => [...sessionsKeys.all(), 'show-sessions-tutorial'],
  attendance: {
    all: () => [...sessionsKeys.all(), 'attendance'],
    stats: (sessionId: number) => [
      ...sessionsKeys.attendance.all(),
      'stats',
      sessionId,
    ],
    table: (sessionId: number, params: SessionsPaginationParams) => [
      ...sessionsKeys.attendance.all(),
      'table',
      sessionId,
      JSON.stringify(params),
    ],
  },
} as const;
