export const queryKeys = {
  auth: {
    user: ["auth", "user"] as const,
  },
  users: {
    all: ["users"] as const,
    list: (params: object) => ["users", "list", params] as const,
    detail: (id: number) => ["users", id] as const,
  },
  entities: {
    all: ["entities"] as const,
    list: (params?: object) => ["entities", "list", params] as const,
    detail: (id: number) => ["entities", id] as const,
    roles: (entityId: number) => ["entities", entityId, "roles"] as const,
    permissions: (entityId: number) => ["entities", entityId, "permissions"] as const,
  },
  exams: {
    all: ["exams"] as const,
    list: (module: string, params?: object) => ["exams", module, params] as const,
    detail: (module: string, id: number) => ["exams", module, id] as const,
    rubrics: (params?: object) => ["exams", "rubrics", params] as const,
    rubricGroups: (params?: object) => ["exams", "rubric-groups", params] as const,
    structures: (params?: object) => ["exams", "structures", params] as const,
    avatars: ["exams", "avatars"] as const,
    reviewQueue: (params?: object) => ["exams", "review", "queue", params] as const,
    reviewDetail: (id: number) => ["exams", "review", "detail", id] as const,
  },
  assignments: {
    all: ["assignments"] as const,
    list: (params?: object) => ["assignments", "list", params] as const,
    detail: (id: number) => ["assignments", id] as const,
  },
  classrooms: {
    all: ["classrooms"] as const,
    list: (params?: object) => ["classrooms", "list", params] as const,
    detail: (id: number) => ["classrooms", id] as const,
  },
  stats: {
    sessions: (params?: object) => ["stats", "sessions", params] as const,
    stats: (params?: object) => ["stats", "stats", params] as const,
    statistical: (params?: object) => ["stats", "statistical", params] as const,
    performance: (params?: object) => ["stats", "performance", params] as const,
  },
  training: {
    all: ["training"] as const,
    tips: (params?: object) => ["training", "tips", params] as const,
    walkthroughs: (module?: string) => ["training", "walkthroughs", module] as const,
  },
  subscriptions: {
    packages: ["subscriptions", "packages"] as const,
    payments: (params?: object) => ["subscriptions", "payments", params] as const,
    discounts: (params?: object) => ["subscriptions", "discounts", params] as const,
  },
  tickets: {
    all: ["tickets"] as const,
    list: (params?: object) => ["tickets", "list", params] as const,
    assigned: ["tickets", "assigned"] as const,
  },
  approvals: {
    all: ["approvals"] as const,
    list: (params?: object) => ["approvals", "list", params] as const,
  },
  taxonomy: {
    subjects: ["taxonomy", "subjects"] as const,
    subject: (id: number) => ["taxonomy", "subjects", id] as const,
    tree: (subjectId: number) => ["taxonomy", "tree", subjectId] as const,
    domains: (params?: object) => ["taxonomy", "domains", params] as const,
    topics: (params?: object) => ["taxonomy", "topics", params] as const,
  },
  adaptive: {
    proficiency: (params?: object) => ["adaptive", "proficiency", params] as const,
    summary: ["adaptive", "proficiency", "summary"] as const,
    plan: (params?: object) => ["adaptive", "plan", params] as const,
    topicContent: (topicId: number) => ["adaptive", "topic", topicId, "content"] as const,
    diagnostic: (sessionId: number) => ["adaptive", "diagnostic", sessionId] as const,
  },
  resources: {
    all: ["resources"] as const,
    list: (params?: object) => ["resources", "list", params] as const,
  },
  lms: {
    courses: (params?: object) => ["lms", "courses", params] as const,
    course: (id: number) => ["lms", "courses", id] as const,
    myCourses: ["lms", "my-courses"] as const,
    students: (params?: object) => ["lms", "students", params] as const,
    teachers: (params?: object) => ["lms", "teachers", params] as const,
    batches: (params?: object) => ["lms", "batches", params] as const,
    batch: (id: number) => ["lms", "batches", id] as const,
    timetable: (params?: object) => ["lms", "timetable", params] as const,
    attendance: (params?: object) => ["lms", "attendance", params] as const,
    grades: (params?: object) => ["lms", "grades", params] as const,
  },
  analytics: {
    student: (params?: object) => ["analytics", "student", params] as const,
    class: (params?: object) => ["analytics", "class", params] as const,
    subject: (params?: object) => ["analytics", "subject", params] as const,
    contentGaps: (params?: object) => ["analytics", "content-gaps", params] as const,
    alerts: ["analytics", "alerts"] as const,
  },
  academicYears: {
    all: ["academic-years"] as const,
    list: (params?: object) => ["academic-years", "list", params] as const,
    detail: (id: number) => ["academic-years", id] as const,
  },
  academicTerms: {
    all: ["academic-terms"] as const,
    list: (params?: object) => ["academic-terms", "list", params] as const,
    detail: (id: number) => ["academic-terms", id] as const,
  },
  departments: {
    all: ["departments"] as const,
    list: (params?: object) => ["departments", "list", params] as const,
    detail: (id: number) => ["departments", id] as const,
  },
  admissionRegisters: {
    all: ["admission-registers"] as const,
    list: (params?: object) => ["admission-registers", "list", params] as const,
    detail: (id: number) => ["admission-registers", id] as const,
  },
  admissions: {
    all: ["admissions"] as const,
    list: (params?: object) => ["admissions", "list", params] as const,
    detail: (id: number) => ["admissions", id] as const,
  },
  instExamSessions: {
    all: ["inst-exam-sessions"] as const,
    list: (params?: object) => ["inst-exam-sessions", "list", params] as const,
    detail: (id: number) => ["inst-exam-sessions", id] as const,
  },
  examTypes: {
    all: ["exam-types"] as const,
    list: (params?: object) => ["exam-types", "list", params] as const,
  },
  gradeConfigs: {
    all: ["grade-configs"] as const,
    list: (params?: object) => ["grade-configs", "list", params] as const,
  },
  resultTemplates: {
    all: ["result-templates"] as const,
    list: (params?: object) => ["result-templates", "list", params] as const,
  },
  marksheets: {
    all: ["marksheets"] as const,
    list: (params?: object) => ["marksheets", "list", params] as const,
    detail: (id: number) => ["marksheets", id] as const,
  },
  courseAssignments: {
    all: ["course-assignments"] as const,
    list: (params?: object) => ["course-assignments", "list", params] as const,
    detail: (id: number) => ["course-assignments", id] as const,
  },
  assignmentTypes: {
    all: ["assignment-types"] as const,
    list: (params?: object) => ["assignment-types", "list", params] as const,
  },
  subjectRegistrations: {
    all: ["subject-registrations"] as const,
    list: (params?: object) => ["subject-registrations", "list", params] as const,
    available: (params?: object) => ["subject-registrations", "available", params] as const,
  },
  courseCompletion: (courseId: number) => ["course-completion", courseId] as const,
  chapters: (courseId: number) => ["chapters", "list", courseId] as const,
  chapter: (id: number) => ["chapters", "detail", id] as const,
  chapterMaterials: (chapterId: number) => ["chapter-materials", chapterId] as const,
  chapterProgress: (chapterId: number) => ["chapter-progress", chapterId] as const,
  discussionBoards: (params?: object) => ["discussion-boards", params] as const,
  posts: (boardId: number, params?: object) => ["posts", boardId, params] as const,
  announcements: (params?: object) => ["announcements", params] as const,
  messages: (params?: object) => ["messages", params] as const,
  sentMessages: (params?: object) => ["messages", "sent", params] as const,
  unreadMessages: ["messages", "unread-count"] as const,
  notifications: (params?: object) => ["notifications", params] as const,
  unreadNotifications: ["notifications", "unread-count"] as const,
  notificationRules: ["notification-rules"] as const,
  notificationPreferences: ["notification-preferences"] as const,
  faqCategories: (audience?: string) => ["faq", "categories", audience] as const,
  faqItems: (params?: object) => ["faq", "items", params] as const,
  studentLeaves: {
    all: ["student-leaves"] as const,
    list: (params?: object) => ["student-leaves", "list", params] as const,
  },
  studentLeaveTypes: {
    all: ["student-leave-types"] as const,
    list: (params?: object) => ["student-leave-types", "list", params] as const,
  },
  feesPlans: {
    all: ["fees-plans"] as const,
    list: (params?: object) => ["fees-plans", "list", params] as const,
    detail: (id: number) => ["fees-plans", id] as const,
  },
  studentFees: {
    all: ["student-fees"] as const,
    list: (params?: object) => ["student-fees", "list", params] as const,
  },
  feesTerms: {
    all: ["fees-terms"] as const,
    list: (params?: object) => ["fees-terms", "list", params] as const,
  },
  lessons: {
    all: ["lessons"] as const,
    list: (params?: object) => ["lessons", "list", params] as const,
  },
  gradebooks: {
    all: ["gradebooks"] as const,
    list: (params?: object) => ["gradebooks", "list", params] as const,
  },
  gradebookLines: {
    all: ["gradebook-lines"] as const,
    list: (params?: object) => ["gradebook-lines", "list", params] as const,
  },
  gradingAssignments: {
    all: ["grading-assignments"] as const,
    list: (params?: object) => ["grading-assignments", "list", params] as const,
  },
  studentProgress: {
    all: ["student-progress"] as const,
    list: (params?: object) => ["student-progress", "list", params] as const,
    detail: (id: number) => ["student-progress", "detail", id] as const,
  },
  libraryMedia: {
    all: ["library-media"] as const,
    list: (params?: object) => ["library-media", "list", params] as const,
  },
  libraryMovements: {
    all: ["library-movements"] as const,
    list: (params?: object) => ["library-movements", "list", params] as const,
  },
  libraryCards: {
    all: ["library-cards"] as const,
    list: (params?: object) => ["library-cards", "list", params] as const,
  },
  activities: {
    all: ["activities"] as const,
    list: (params?: object) => ["activities", "list", params] as const,
  },
  activityTypes: {
    all: ["activity-types"] as const,
    list: (params?: object) => ["activity-types", "list", params] as const,
  },
  facilities: {
    all: ["facilities"] as const,
    list: (params?: object) => ["facilities", "list", params] as const,
  },
  assets: {
    all: ["assets"] as const,
    list: (params?: object) => ["assets", "list", params] as const,
  },
  signup: {
    goals: ["signup", "goals"] as const,
  },
  placement: {
    results: (sessionId: string) => ["placement", "results", sessionId] as const,
    speakingStatus: (sessionId: string) => ["placement", "speaking-status", sessionId] as const,
    learningPath: (sessionId: string) => ["placement", "learning-path", sessionId] as const,
  },
  examTemplates: {
    international: ["exam-templates", "international"] as const,
    custom: ["exam-templates", "custom"] as const,
    detail: (id: number) => ["exam-templates", id] as const,
  },
  ieltsExam: {
    skills: (examId: number) => ["ielts-exam", examId, "skills"] as const,
    contentPool: (examId: number, filters?: object) => ["ielts-exam", examId, "content-pool", filters] as const,
    validation: (examId: number) => ["ielts-exam", examId, "validation"] as const,
  },
  examSession: {
    session: (examId: number) => ["exam-session", examId] as const,
    status: (examId: number) => ["exam-session", examId, "status"] as const,
  },
  grading: {
    queue: (params?: object) => ["grading", "queue", params] as const,
    response: (attemptId: number, skill: string) => ["grading", attemptId, "response", skill] as const,
    rubric: (attemptId: number, skill: string) => ["grading", attemptId, "rubric", skill] as const,
  },
  courseGeneration: {
    gapAnalysis: (source: string, sourceId: number) => ["course-gen", "gap", source, sourceId] as const,
    course: (id: number) => ["course-gen", "course", id] as const,
  },
  aiCourse: {
    course: (id: number) => ["ai-course", id] as const,
    tracks: (id: number) => ["ai-course", id, "tracks"] as const,
    quality: (id: number) => ["ai-course", id, "quality"] as const,
    ieltsValidation: (id: number) => ["ai-course", id, "ielts-validation"] as const,
    englishTaxonomy: ["ai-course", "english", "taxonomy"] as const,
  },
  entityOnboarding: {
    credentials: (params?: object) => ["entity-onboarding", "credentials", params] as const,
  },
  adaptiveEngine: {
    dashboard: ["adaptive-engine", "dashboard"] as const,
    students: (params?: object) => ["adaptive-engine", "students", params] as const,
    signals: (studentId: number) => ["adaptive-engine", "signals", studentId] as const,
    ability: (studentId: number) => ["adaptive-engine", "ability", studentId] as const,
    settings: ["adaptive-engine", "settings"] as const,
  },
  levelMapping: {
    get: (entityId: number) => ["level-mapping", entityId] as const,
  },
  branding: {
    get: (entityId: number) => ["branding", entityId] as const,
    current: ["branding", "current"] as const,
  },
  scoreRelease: {
    pending: (params?: object) => ["score-release", "pending", params] as const,
  },
  verification: {
    verify: (hash: string) => ["verification", hash] as const,
  },
};
