protcol table services
This commit is contained in:
parent
dd74005043
commit
475a13ce36
19 changed files with 502 additions and 10 deletions
|
@ -1,6 +1,14 @@
|
|||
import { Request, Response } from "express";
|
||||
import ProtocolService from "../../service/protocolService";
|
||||
import ProtocolFactory from "../../factory/admin/protocol";
|
||||
import ProtocolAgendaService from "../../service/protocolAgendaService";
|
||||
import ProtocolAgendaFactory from "../../factory/admin/protocolAgenda";
|
||||
import ProtocolDecisionService from "../../service/protocolDecisionService";
|
||||
import ProtocolDecisionFactory from "../../factory/admin/protocolDecision";
|
||||
import ProtocolPresenceService from "../../service/protocolPrecenseService";
|
||||
import ProtocolPresenceFactory from "../../factory/admin/protocolPresence";
|
||||
import ProtocolVotingService from "../../service/protocolVotingService";
|
||||
import ProtocolVotingFactory from "../../factory/admin/protocolVoting";
|
||||
|
||||
/**
|
||||
* @description get all protocols
|
||||
|
@ -33,3 +41,119 @@ export async function getProtocolById(req: Request, res: Response): Promise<any>
|
|||
|
||||
res.json(ProtocolFactory.mapToSingle(protocol));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description get protocol agenda by id
|
||||
* @param req {Request} Express req object
|
||||
* @param res {Response} Express res object
|
||||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function getProtocolAgendaById(req: Request, res: Response): Promise<any> {
|
||||
let protocolId = parseInt(req.params.protocolId);
|
||||
|
||||
let agenda = await ProtocolAgendaService.getAll(protocolId);
|
||||
|
||||
res.json(ProtocolAgendaFactory.mapToBase(agenda));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description get protocol decisions by id
|
||||
* @param req {Request} Express req object
|
||||
* @param res {Response} Express res object
|
||||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function getProtocolDecisonsById(req: Request, res: Response): Promise<any> {
|
||||
let protocolId = parseInt(req.params.protocolId);
|
||||
|
||||
let decisions = await ProtocolDecisionService.getAll(protocolId);
|
||||
|
||||
res.json(ProtocolDecisionFactory.mapToBase(decisions));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description get protocol precense by id
|
||||
* @param req {Request} Express req object
|
||||
* @param res {Response} Express res object
|
||||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function getProtocolPrecenseById(req: Request, res: Response): Promise<any> {
|
||||
let protocolId = parseInt(req.params.protocolId);
|
||||
|
||||
let presence = await ProtocolPresenceService.getAll(protocolId);
|
||||
|
||||
res.json(ProtocolPresenceFactory.mapToBase(presence));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description get protocol votings by id
|
||||
* @param req {Request} Express req object
|
||||
* @param res {Response} Express res object
|
||||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function getProtocolVotingsById(req: Request, res: Response): Promise<any> {
|
||||
let protocolId = parseInt(req.params.protocolId);
|
||||
|
||||
let votings = await ProtocolVotingService.getAll(protocolId);
|
||||
|
||||
res.json(ProtocolVotingFactory.mapToBase(votings));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description synchronize protocol by id
|
||||
* @param req {Request} Express req object
|
||||
* @param res {Response} Express res object
|
||||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function synchronizeProtocolById(req: Request, res: Response): Promise<any> {
|
||||
let id = parseInt(req.params.id);
|
||||
|
||||
res.sendStatus(204);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description synchronize protocol agenda by id
|
||||
* @param req {Request} Express req object
|
||||
* @param res {Response} Express res object
|
||||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function synchronizeProtocolAgendaById(req: Request, res: Response): Promise<any> {
|
||||
let protocolId = parseInt(req.params.protocolId);
|
||||
|
||||
res.sendStatus(204);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description synchronize protocol decisions by id
|
||||
* @param req {Request} Express req object
|
||||
* @param res {Response} Express res object
|
||||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function synchronizeProtocolDecisonsById(req: Request, res: Response): Promise<any> {
|
||||
let protocolId = parseInt(req.params.protocolId);
|
||||
|
||||
res.sendStatus(204);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description synchronize protocol precense by id
|
||||
* @param req {Request} Express req object
|
||||
* @param res {Response} Express res object
|
||||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function synchronizeProtocolPrecenseById(req: Request, res: Response): Promise<any> {
|
||||
let protocolId = parseInt(req.params.protocolId);
|
||||
|
||||
res.sendStatus(204);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description synchronize protocol votings by id
|
||||
* @param req {Request} Express req object
|
||||
* @param res {Response} Express res object
|
||||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function synchronizeProtocolVotingsById(req: Request, res: Response): Promise<any> {
|
||||
let protocolId = parseInt(req.params.protocolId);
|
||||
|
||||
res.sendStatus(204);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue