diff --git a/src/command/club/protocol/protocolPresenceCommand.ts b/src/command/club/protocol/protocolPresenceCommand.ts index 76c004a..134aeac 100644 --- a/src/command/club/protocol/protocolPresenceCommand.ts +++ b/src/command/club/protocol/protocolPresenceCommand.ts @@ -6,4 +6,5 @@ export interface SynchronizeProtocolPresenceCommand { export interface ProtocolPresenceCommand { memberId: number; absent: boolean; + excused: boolean; } diff --git a/src/command/club/protocol/protocolPresenceCommandHandler.ts b/src/command/club/protocol/protocolPresenceCommandHandler.ts index abdb82b..8d48fe6 100644 --- a/src/command/club/protocol/protocolPresenceCommandHandler.ts +++ b/src/command/club/protocol/protocolPresenceCommandHandler.ts @@ -74,6 +74,7 @@ export default abstract class ProtocolPresenceCommandHandler { .update(protocolPresence) .set({ absent: member.absent, + excused: member.excused, }) .where("memberId = :memberId", { memberId: member.memberId }) .andWhere("protocolId = :protocolId", { protocolId }) diff --git a/src/controller/admin/club/protocolController.ts b/src/controller/admin/club/protocolController.ts index bba8aa0..0a30b81 100644 --- a/src/controller/admin/club/protocolController.ts +++ b/src/controller/admin/club/protocolController.ts @@ -260,7 +260,8 @@ export async function createProtocolPrintoutById(req: Request, res: Response): P agenda, decisions, presence: presence.filter((p) => !p.absent).map((p) => p.member), - absent: presence.filter((p) => p.absent).map((p) => p.member), + excused_absent: presence.filter((p) => p.absent && p.excused).map((p) => p.member), + unexcused_absent: presence.filter((p) => p.absent && !p.excused).map((p) => p.member), votings, }, }); @@ -389,6 +390,7 @@ export async function synchronizeProtocolPrecenseById(req: Request, res: Respons members: presence.map((p) => ({ memberId: p.memberId, absent: p.absent, + excused: p.excused, })), protocolId, };