import { dataSource } from "../data-source"; import { protocolPresence } from "../entity/protocolPresence"; import InternalException from "../exceptions/internalException"; export default abstract class ProtocolPresenceService { /** * @description get all protocolPresences * @returns {Promise>} */ static async getAll(protocolId: number): Promise> { return await dataSource .getRepository(protocolPresence) .createQueryBuilder("protocolPresence") .leftJoinAndSelect("protocolPresence.member", "member") .where("protocolPresence.protocolId = :protocolId", { protocolId }) .getMany() .then((res) => { return res; }) .catch((err) => { throw new InternalException("protocolPresence not found", err); }); } }