Compare commits
2 commits
4dd6fa6d8a
...
eb8f3fef3e
Author | SHA1 | Date | |
---|---|---|---|
eb8f3fef3e | |||
b5509ba162 |
4 changed files with 18 additions and 3 deletions
|
@ -6,4 +6,5 @@ export interface SynchronizeProtocolPresenceCommand {
|
||||||
export interface ProtocolPresenceCommand {
|
export interface ProtocolPresenceCommand {
|
||||||
memberId: number;
|
memberId: number;
|
||||||
absent: boolean;
|
absent: boolean;
|
||||||
|
excused: boolean;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,6 +74,7 @@ export default abstract class ProtocolPresenceCommandHandler {
|
||||||
.update(protocolPresence)
|
.update(protocolPresence)
|
||||||
.set({
|
.set({
|
||||||
absent: member.absent,
|
absent: member.absent,
|
||||||
|
excused: member.excused,
|
||||||
})
|
})
|
||||||
.where("memberId = :memberId", { memberId: member.memberId })
|
.where("memberId = :memberId", { memberId: member.memberId })
|
||||||
.andWhere("protocolId = :protocolId", { protocolId })
|
.andWhere("protocolId = :protocolId", { protocolId })
|
||||||
|
|
|
@ -260,7 +260,9 @@ export async function createProtocolPrintoutById(req: Request, res: Response): P
|
||||||
agenda,
|
agenda,
|
||||||
decisions,
|
decisions,
|
||||||
presence: presence.filter((p) => !p.absent).map((p) => p.member),
|
presence: presence.filter((p) => !p.absent).map((p) => p.member),
|
||||||
absent: presence.filter((p) => p.absent).map((p) => p.member),
|
absent: presence.filter((p) => p.absent).map((p) => ({ ...p.member, excused: p.excused })),
|
||||||
|
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,
|
votings,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -389,6 +391,7 @@ export async function synchronizeProtocolPrecenseById(req: Request, res: Respons
|
||||||
members: presence.map((p) => ({
|
members: presence.map((p) => ({
|
||||||
memberId: p.memberId,
|
memberId: p.memberId,
|
||||||
absent: p.absent,
|
absent: p.absent,
|
||||||
|
excused: p.excused,
|
||||||
})),
|
})),
|
||||||
protocolId,
|
protocolId,
|
||||||
};
|
};
|
||||||
|
|
|
@ -14,9 +14,19 @@
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<h2>Anwesenheit ({{presence.length}})</h2>
|
<h2>Anwesenheit ({{presence.length}})</h2>
|
||||||
<p>{{#each presence}} {{this.firstname}} {{this.lastname}}{{#unless @last}}, {{/unless}} {{/each}}</p>
|
<p>
|
||||||
|
{{#each presence}}{{this.firstname}} {{this.lastname}}{{#unless @last}}, {{/unless}}{{/each}}{{#unless
|
||||||
|
presence.length}}---{{/unless}}
|
||||||
|
</p>
|
||||||
<h2>Abwesenheit ({{absent.length}})</h2>
|
<h2>Abwesenheit ({{absent.length}})</h2>
|
||||||
<p>{{#each absent}} {{this.firstname}} {{this.lastname}}{{#unless @last}}, {{/unless}} {{/each}}</p>
|
<p>
|
||||||
|
entschuldigt: {{#each excused_absent}}{{this.firstname}} {{this.lastname}}{{#unless @last}},
|
||||||
|
{{/unless}}{{/each}}{{#unless excused_absent.length}}---{{/unless}}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
unentschuldigt: {{#each unexcused_absent}}{{this.firstname}} {{this.lastname}}{{#unless @last}},
|
||||||
|
{{/unless}}{{/each}}{{#unless unexcused_absent.length}}---{{/unless}}
|
||||||
|
</p>
|
||||||
<br />
|
<br />
|
||||||
<h2>Agenda</h2>
|
<h2>Agenda</h2>
|
||||||
{{#each agenda}}
|
{{#each agenda}}
|
||||||
|
|
Loading…
Reference in a new issue