Incidents management implementation

This commit is contained in:
karenvicent committed 2025-11-18 16:01:47 -05:00
1 parent eb65c41d15
commit 131ced10fc
10 files changed
+713 -139

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
import { Router } from "express";
import { isAllowed } from "../../middleware/v1/isAllowed.js";
class IncidentRoutes {
constructor(incidentController) {
this.router = Router();
this.incidentController = incidentController;
this.initRoutes();
}
initRoutes() {
// Team routes
this.router.get("/team", this.incidentController.getIncidentsByTeam);
this.router.get("/team/summary", this.incidentController.getIncidentSummary);
// Individual incident routes
this.router.get("/:incidentId", this.incidentController.getIncidentById);
this.router.put("/:incidentId/resolve", isAllowed(["admin", "superadmin"]), this.incidentController.resolveIncidentManually);
}
getRouter() {
return this.router;
}
}
export default IncidentRoutes;