import express, { Request, Response } from "express"; import { createProtocol, createProtocolAgendaById, createProtocolDecisonsById, createProtocolVotingsById, getAllProtocols, getProtocolAgendaById, getProtocolById, getProtocolDecisonsById, getProtocolPrecenseById, 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.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.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;