2025-04-20 11:29:53 -07:00
|
|
|
import { Router } from "express";
|
2025-09-22 12:53:44 -07:00
|
|
|
|
2026-01-21 10:36:03 -08:00
|
|
|
import { isAllowed } from "../middleware/isAllowed.js";
|
2026-06-09 12:34:15 -07:00
|
|
|
import { ICheckController } from "@/api/controllers/checkController.js";
|
2025-04-20 11:29:53 -07:00
|
|
|
|
|
|
|
|
class CheckRoutes {
|
2026-01-21 10:36:03 -08:00
|
|
|
private router: Router;
|
2026-03-20 11:52:53 -07:00
|
|
|
private checkController: ICheckController;
|
2026-01-21 10:36:03 -08:00
|
|
|
|
2026-03-20 11:52:53 -07:00
|
|
|
constructor(checkController: ICheckController) {
|
2025-04-20 11:29:53 -07:00
|
|
|
this.router = Router();
|
|
|
|
|
this.checkController = checkController;
|
|
|
|
|
this.initRoutes();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
initRoutes() {
|
2025-07-01 18:10:35 +05:30
|
|
|
this.router.get("/team/summary", this.checkController.getChecksSummaryByTeamId);
|
2025-07-21 09:55:49 -07:00
|
|
|
this.router.get("/team", this.checkController.getChecksByTeam);
|
2025-07-21 10:34:16 -07:00
|
|
|
this.router.delete("/team", isAllowed(["admin", "superadmin"]), this.checkController.deleteChecksByTeamId);
|
2025-07-14 09:38:00 -07:00
|
|
|
this.router.get("/:monitorId", this.checkController.getChecksByMonitor);
|
2025-07-21 11:54:04 -07:00
|
|
|
this.router.delete("/:monitorId", this.checkController.deleteChecks);
|
2025-04-20 11:29:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getRouter() {
|
|
|
|
|
return this.router;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default CheckRoutes;
|