ff-admin-server/src/routes/admin/protocol.ts

88 lines
2.5 KiB
TypeScript
Raw Normal View History

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-15 16:25:42 +02:00
createProtocolAgendaById,
createProtocolDecisonsById,
createProtocolVotingsById,
2024-10-11 14:44:09 +02:00
getAllProtocols,
getProtocolAgendaById,
getProtocolById,
getProtocolDecisonsById,
getProtocolPrecenseById,
getProtocolVotingsById,
2024-10-18 15:23:51 +02:00
printPdf,
2024-10-11 14:44:09 +02:00
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);
});
2024-10-15 16:25:42 +02:00
router.post("/:protocolId/agenda", async (req: Request, res: Response) => {
await createProtocolAgendaById(req, res);
});
router.post("/:protocolId/decision", async (req: Request, res: Response) => {
await createProtocolDecisonsById(req, res);
});
router.post("/:protocolId/voting", async (req: Request, res: Response) => {
await createProtocolVotingsById(req, res);
});
2024-10-18 15:23:51 +02:00
router.post("/:protocolId/render", async (req: Request, res: Response) => {
await printPdf(req, res);
});
2024-10-15 16:25:42 +02:00
router.patch("/:id/synchronize", async (req: Request, res: Response) => {
2024-10-11 14:44:09 +02:00
await synchronizeProtocolById(req, res);
});
2024-10-15 16:25:42 +02:00
router.patch("/:protocolId/synchronize/agenda", async (req: Request, res: Response) => {
2024-10-11 14:44:09 +02:00
await synchronizeProtocolAgendaById(req, res);
});
2024-10-15 16:25:42 +02:00
router.patch("/:protocolId/synchronize/decisions", async (req: Request, res: Response) => {
2024-10-11 14:44:09 +02:00
await synchronizeProtocolDecisonsById(req, res);
});
2024-10-15 16:25:42 +02:00
router.patch("/:protocolId/synchronize/votings", async (req: Request, res: Response) => {
await synchronizeProtocolVotingsById(req, res);
2024-10-11 14:44:09 +02:00
});
2024-10-15 16:25:42 +02:00
router.put("/:protocolId/synchronize/presence", async (req: Request, res: Response) => {
await synchronizeProtocolPrecenseById(req, res);
2024-10-11 14:44:09 +02:00
});
2024-10-03 13:31:05 +02:00
export default router;