import { api } from "@/lib/api-client";
import type { StudentProgression, StudentProgressDetail } from "@/types/student-progress";
import type { PaginatedResponse, PaginationParams } from "@/types";

export interface StudentProgressFilters extends PaginationParams {
  q?: string;
  batch_id?: number;
  course_id?: number;
}

export const studentProgressService = {
  async listProgress(params?: StudentProgressFilters): Promise<PaginatedResponse<StudentProgression>> {
    return api.get<PaginatedResponse<StudentProgression>>("/student-progress", params as Record<string, string | number | boolean | undefined>);
  },
  async getProgress(id: number): Promise<StudentProgressDetail> {
    return api.get<StudentProgressDetail>(`/student-progress/${id}`);
  },
};
