import express from "express";
import { getClasses, getClassById, getStudentsByClassId, getClassForAdmin, getStudentsWithNoClass, createClass, updateClassById, deleteClassById, updateStudentClassByName } from "../../controllers/monitoringControllers/class.js";
import { verifyLoginUser, adminOrTeacherOnly } from "../../middlewares/User/authUser.js";

const router = express.Router();

router.get("/classes", verifyLoginUser, getClasses);

router.get("/class/admin", verifyLoginUser, getClassForAdmin);

router.get("/class/:id", verifyLoginUser, getClassById);

router.get("/class/student/unassigned", verifyLoginUser, adminOrTeacherOnly, getStudentsWithNoClass);

router.get("/class/student/:classId", verifyLoginUser, adminOrTeacherOnly, getStudentsByClassId);

router.post("/class", verifyLoginUser, createClass);

router.put("/class/update/:id", verifyLoginUser, updateClassById);

router.delete("/class/delete/:id", verifyLoginUser, deleteClassById);

router.post("/class/student/update", verifyLoginUser, updateStudentClassByName);

export default router