feature/#40-protocol-presence-status #44
3 changed files with 5 additions and 1 deletions
|
@ -6,4 +6,5 @@ export interface SynchronizeProtocolPresenceCommand {
|
|||
export interface ProtocolPresenceCommand {
|
||||
memberId: number;
|
||||
absent: boolean;
|
||||
excused: boolean;
|
||||
}
|
||||
|
|
|
@ -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 })
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue