Merge branch 'main' into #3-calendar
# Conflicts: # package-lock.json # src/data-source.ts # src/routes/admin/index.ts # src/type/permissionTypes.ts
This commit is contained in:
commit
98eb870385
48 changed files with 2672 additions and 9 deletions
|
@ -8,6 +8,7 @@ import membershipStatus from "./membershipStatus";
|
|||
import qualification from "./qualification";
|
||||
|
||||
import member from "./member";
|
||||
import protocol from "./protocol";
|
||||
|
||||
import calendar from "./calendar";
|
||||
|
||||
|
@ -36,6 +37,7 @@ router.use("/qualification", PermissionHelper.passCheckMiddleware("read", "setti
|
|||
|
||||
router.use("/member", PermissionHelper.passCheckMiddleware("read", "club", "member"), member);
|
||||
|
||||
router.use("/protocol", PermissionHelper.passCheckMiddleware("read", "club", "protocol"), protocol);
|
||||
router.use("/calendar", PermissionHelper.passCheckMiddleware("read", "club", "calendar"), calendar);
|
||||
|
||||
router.use("/role", PermissionHelper.passCheckMiddleware("read", "user", "role"), role);
|
||||
|
|
138
src/routes/admin/protocol.ts
Normal file
138
src/routes/admin/protocol.ts
Normal file
|
@ -0,0 +1,138 @@
|
|||
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";
|
||||
import PermissionHelper from "../../helpers/permissionHelper";
|
||||
|
||||
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(
|
||||
"/",
|
||||
PermissionHelper.passCheckMiddleware("create", "club", "protocol"),
|
||||
async (req: Request, res: Response) => {
|
||||
await createProtocol(req, res);
|
||||
}
|
||||
);
|
||||
|
||||
router.post(
|
||||
"/:protocolId/agenda",
|
||||
PermissionHelper.passCheckMiddleware("create", "club", "protocol"),
|
||||
async (req: Request, res: Response) => {
|
||||
await createProtocolAgendaById(req, res);
|
||||
}
|
||||
);
|
||||
|
||||
router.post(
|
||||
"/:protocolId/decision",
|
||||
PermissionHelper.passCheckMiddleware("create", "club", "protocol"),
|
||||
async (req: Request, res: Response) => {
|
||||
await createProtocolDecisonsById(req, res);
|
||||
}
|
||||
);
|
||||
|
||||
router.post(
|
||||
"/:protocolId/voting",
|
||||
PermissionHelper.passCheckMiddleware("create", "club", "protocol"),
|
||||
async (req: Request, res: Response) => {
|
||||
await createProtocolVotingsById(req, res);
|
||||
}
|
||||
);
|
||||
|
||||
router.post(
|
||||
"/:protocolId/printout",
|
||||
PermissionHelper.passCheckMiddleware("create", "club", "protocol"),
|
||||
async (req: Request, res: Response) => {
|
||||
await createProtocolPrintoutById(req, res);
|
||||
}
|
||||
);
|
||||
|
||||
router.patch(
|
||||
"/:id/synchronize",
|
||||
PermissionHelper.passCheckMiddleware("update", "club", "protocol"),
|
||||
async (req: Request, res: Response) => {
|
||||
await synchronizeProtocolById(req, res);
|
||||
}
|
||||
);
|
||||
|
||||
router.patch(
|
||||
"/:protocolId/synchronize/agenda",
|
||||
PermissionHelper.passCheckMiddleware("update", "club", "protocol"),
|
||||
async (req: Request, res: Response) => {
|
||||
await synchronizeProtocolAgendaById(req, res);
|
||||
}
|
||||
);
|
||||
|
||||
router.patch(
|
||||
"/:protocolId/synchronize/decisions",
|
||||
PermissionHelper.passCheckMiddleware("update", "club", "protocol"),
|
||||
async (req: Request, res: Response) => {
|
||||
await synchronizeProtocolDecisonsById(req, res);
|
||||
}
|
||||
);
|
||||
|
||||
router.patch(
|
||||
"/:protocolId/synchronize/votings",
|
||||
PermissionHelper.passCheckMiddleware("update", "club", "protocol"),
|
||||
async (req: Request, res: Response) => {
|
||||
await synchronizeProtocolVotingsById(req, res);
|
||||
}
|
||||
);
|
||||
|
||||
router.put(
|
||||
"/:protocolId/synchronize/presence",
|
||||
PermissionHelper.passCheckMiddleware("update", "club", "protocol"),
|
||||
async (req: Request, res: Response) => {
|
||||
await synchronizeProtocolPrecenseById(req, res);
|
||||
}
|
||||
);
|
||||
|
||||
export default router;
|
Loading…
Add table
Add a link
Reference in a new issue