2024-10-03 13:31:05 +02:00
|
|
|
import express, { Request, Response } from "express";
|
2024-10-11 14:44:09 +02:00
|
|
|
import {
|
2024-10-13 15:48:01 +02:00
|
|
|
createProtocol,
|
2024-10-11 14:44:09 +02:00
|
|
|
getAllProtocols,
|
|
|
|
getProtocolAgendaById,
|
|
|
|
getProtocolById,
|
|
|
|
getProtocolDecisonsById,
|
|
|
|
getProtocolPrecenseById,
|
|
|
|
getProtocolVotingsById,
|
|
|
|
synchronizeProtocolAgendaById,
|
|
|
|
synchronizeProtocolById,
|
|
|
|
synchronizeProtocolDecisonsById,
|
|
|
|
synchronizeProtocolPrecenseById,
|
|
|
|
synchronizeProtocolVotingsById,
|
|
|
|
} from "../../controller/admin/protocolController";
|
2024-10-03 13:31:05 +02:00
|
|
|
|
|
|
|
var router = express.Router({ mergeParams: true });
|
|
|
|
|
|
|
|
router.get("/", async (req: Request, res: Response) => {
|
|
|
|
await getAllProtocols(req, res);
|
|
|
|
});
|
|
|
|
|
2024-10-04 12:47:13 +02:00
|
|
|
router.get("/:id", async (req: Request, res: Response) => {
|
|
|
|
await getProtocolById(req, res);
|
|
|
|
});
|
|
|
|
|
2024-10-11 14:44:09 +02:00
|
|
|
router.get("/:protocolId/agenda", async (req: Request, res: Response) => {
|
|
|
|
await getProtocolAgendaById(req, res);
|
|
|
|
});
|
|
|
|
|
|
|
|
router.get("/:protocolId/decisions", async (req: Request, res: Response) => {
|
|
|
|
await getProtocolDecisonsById(req, res);
|
|
|
|
});
|
|
|
|
|
|
|
|
router.get("/:protocolId/presence", async (req: Request, res: Response) => {
|
|
|
|
await getProtocolPrecenseById(req, res);
|
|
|
|
});
|
|
|
|
|
|
|
|
router.get("/:protocolId/votings", async (req: Request, res: Response) => {
|
|
|
|
await getProtocolVotingsById(req, res);
|
|
|
|
});
|
|
|
|
|
2024-10-13 15:48:01 +02:00
|
|
|
router.post("/", async (req: Request, res: Response) => {
|
|
|
|
await createProtocol(req, res);
|
|
|
|
});
|
|
|
|
|
|
|
|
router.put("/:id/synchronize", async (req: Request, res: Response) => {
|
2024-10-11 14:44:09 +02:00
|
|
|
await synchronizeProtocolById(req, res);
|
|
|
|
});
|
|
|
|
|
2024-10-13 15:48:01 +02:00
|
|
|
router.put("/:protocolId/synchronize/agenda", async (req: Request, res: Response) => {
|
2024-10-11 14:44:09 +02:00
|
|
|
await synchronizeProtocolAgendaById(req, res);
|
|
|
|
});
|
|
|
|
|
2024-10-13 15:48:01 +02:00
|
|
|
router.put("/:protocolId/synchronize/decisions", async (req: Request, res: Response) => {
|
2024-10-11 14:44:09 +02:00
|
|
|
await synchronizeProtocolDecisonsById(req, res);
|
|
|
|
});
|
|
|
|
|
2024-10-13 15:48:01 +02:00
|
|
|
router.put("/:protocolId/synchronize/presence", async (req: Request, res: Response) => {
|
2024-10-11 14:44:09 +02:00
|
|
|
await synchronizeProtocolPrecenseById(req, res);
|
|
|
|
});
|
|
|
|
|
2024-10-13 15:48:01 +02:00
|
|
|
router.put("/:protocolId/synchronize/votings", async (req: Request, res: Response) => {
|
2024-10-11 14:44:09 +02:00
|
|
|
await synchronizeProtocolVotingsById(req, res);
|
|
|
|
});
|
|
|
|
|
2024-10-03 13:31:05 +02:00
|
|
|
export default router;
|