Files
encoach_frontend_new_v3/src/services/adaptive-engine.service.ts
Yamen Ahmad f17c94ccd6 fix: resolve all QA/UAT report issues (P0-P3)
Made-with: Cursor
2026-04-12 01:35:50 +04:00

31 lines
1.1 KiB
TypeScript

import { api } from "@/lib/api-client";
import type {
AdaptiveDashboardMetrics,
AdaptiveEngineStudentRow,
AdaptiveThresholdSettings,
StudentAbilityModel,
StudentAdaptiveSignal,
} from "@/types";
import type { ApiSuccessResponse } from "@/types";
export const adaptiveEngineService = {
getDashboard: () => api.get<AdaptiveDashboardMetrics>("/adaptive/dashboard"),
getStudents: (params?: { page?: number; limit?: number }) =>
api.get<{ data: AdaptiveEngineStudentRow[]; pagination?: { total: number; page: number } }>(
"/adaptive/students",
params as Record<string, string | number | boolean | undefined>,
),
getStudentSignals: (studentId: number) =>
api.get<StudentAdaptiveSignal[]>(`/adaptive/student/${studentId}/signals`),
getStudentAbility: (studentId: number) =>
api.get<StudentAbilityModel>(`/adaptive/student/${studentId}/ability`),
getSettings: () => api.get<AdaptiveThresholdSettings>("/adaptive/settings"),
updateSettings: (data: AdaptiveThresholdSettings) =>
api.put<ApiSuccessResponse>("/adaptive/settings", data),
};