ff-admin-server/src/routes/admin/protocol.ts
2024-10-19 16:24:41 +02:00

97 lines
2.9 KiB
TypeScript

import express, { Request, Response } from "express";
import {
createProtocol,
createProtocolAgendaById,
createProtocolDecisonsById,
createProtocolPrintoutById,
createProtocolVotingsById,
getAllProtocols,
getProtocolAgendaById,
getProtocolById,
getProtocolDecisonsById,
getProtocolPrecenseById,
getProtocolPrintoutByIdAndPrint,
getProtocolPrintoutsById,
getProtocolVotingsById,
synchronizeProtocolAgendaById,
synchronizeProtocolById,
synchronizeProtocolDecisonsById,
synchronizeProtocolPrecenseById,
synchronizeProtocolVotingsById,
} from "../../controller/admin/protocolController";
var router = express.Router({ mergeParams: true });
router.get("/", async (req: Request, res: Response) => {
await getAllProtocols(req, res);
});
router.get("/:id", async (req: Request, res: Response) => {
await getProtocolById(req, res);
});
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);
});
router.get("/:protocolId/printouts", async (req: Request, res: Response) => {
await getProtocolPrintoutsById(req, res);
});
router.get("/:protocolId/printout/:printoutId", async (req: Request, res: Response) => {
await getProtocolPrintoutByIdAndPrint(req, res);
});
router.post("/", async (req: Request, res: Response) => {
await createProtocol(req, res);
});
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);
});
router.post("/:protocolId/printout", async (req: Request, res: Response) => {
await createProtocolPrintoutById(req, res);
});
router.patch("/:id/synchronize", async (req: Request, res: Response) => {
await synchronizeProtocolById(req, res);
});
router.patch("/:protocolId/synchronize/agenda", async (req: Request, res: Response) => {
await synchronizeProtocolAgendaById(req, res);
});
router.patch("/:protocolId/synchronize/decisions", async (req: Request, res: Response) => {
await synchronizeProtocolDecisonsById(req, res);
});
router.patch("/:protocolId/synchronize/votings", async (req: Request, res: Response) => {
await synchronizeProtocolVotingsById(req, res);
});
router.put("/:protocolId/synchronize/presence", async (req: Request, res: Response) => {
await synchronizeProtocolPrecenseById(req, res);
});
export default router;