feat: Ajout d'un système d'historisation et d'export de données en CSV [N3WTS-5]

This commit is contained in:
N3WT DE COMPET
2026-04-04 13:51:43 +02:00
parent 2579af9b8b
commit f091fa0432
18 changed files with 796 additions and 134 deletions

View File

@ -11,6 +11,7 @@ import {
BE_SCHOOL_ESTABLISHMENT_COMPETENCIES_URL,
BE_SCHOOL_EVALUATIONS_URL,
BE_SCHOOL_STUDENT_EVALUATIONS_URL,
BE_SCHOOL_SCHOOL_YEARS_URL,
} from '@/utils/Url';
import { fetchWithAuth } from '@/utils/fetchWithAuth';
@ -46,10 +47,15 @@ export const fetchTeachers = (establishment) => {
return fetchWithAuth(`${BE_SCHOOL_TEACHERS_URL}?establishment_id=${establishment}`);
};
export const fetchClasses = (establishment) => {
return fetchWithAuth(
`${BE_SCHOOL_SCHOOLCLASSES_URL}?establishment_id=${establishment}`
);
export const fetchClasses = (establishment, options = {}) => {
let url = `${BE_SCHOOL_SCHOOLCLASSES_URL}?establishment_id=${establishment}`;
if (options.schoolYear) url += `&school_year=${options.schoolYear}`;
if (options.yearFilter) url += `&year_filter=${options.yearFilter}`;
return fetchWithAuth(url);
};
export const fetchSchoolYears = () => {
return fetchWithAuth(BE_SCHOOL_SCHOOL_YEARS_URL);
};
export const fetchClasse = (id) => {

View File

@ -124,7 +124,7 @@ export const searchStudents = (establishmentId, query) => {
return fetchWithAuth(url);
};
export const fetchStudents = (establishment, id = null, status = null) => {
export const fetchStudents = (establishment, id = null, status = null, schoolYear = null) => {
let url;
if (id) {
url = `${BE_SUBSCRIPTION_STUDENTS_URL}/${id}`;
@ -133,6 +133,9 @@ export const fetchStudents = (establishment, id = null, status = null) => {
if (status) {
url += `&status=${status}`;
}
if (schoolYear) {
url += `&school_year=${encodeURIComponent(schoolYear)}`;
}
}
return fetchWithAuth(url);
};