Altersgrenze

This commit is contained in:
Anton Schegg 2025-01-09 20:56:10 +01:00
parent bd13a775c4
commit 32c5776fe8

View file

@ -241,11 +241,11 @@ router.get("/", async (req, res) => {
nn = nn.substring(0, nn.length - 6); nn = nn.substring(0, nn.length - 6);
} }
// before 1.7.2003: Altersobergrenze für Aktive: 60 // before 1.1.2009: Altersobergrenze für Aktive: 60
const limit60 = moment('2003-07-01'); const limit60 = moment('2009-01-01');
// 1.7.2003 bis 10.12.2011: 63 // before 1.7.2017: 63
const limit63 = moment('2011-12-10'); const limit63 = moment('2017-07-01');
// from 10.12.2011: 65 // from 1.7.2017: 65
const alter60 = moment(queryResultElement.Geboren).add(60, 'years'); const alter60 = moment(queryResultElement.Geboren).add(60, 'years');
const alter63 = moment(queryResultElement.Geboren).add(63, 'years'); const alter63 = moment(queryResultElement.Geboren).add(63, 'years');
@ -426,6 +426,25 @@ router.get("/", async (req, res) => {
await MembershipCommandHandler.update(updateMembership); await MembershipCommandHandler.update(updateMembership);
} }
if (!queryResultElement.Ausgetreten && !queryResultElement.verstorben && queryResultElement.verzogen) {
let end = new Date('2024-12-31');
if (queryResultElement.verzogenDatum) {
end = queryResultElement.verzogenDatum;
} else {
if (queryResultElement["Übergang Passiv"]) {
end = queryResultElement["Übergang Passiv"];
}
}
let updateMembership: UpdateMembershipCommand = {
end: end,
id: ms1,
memberId: memberId,
start: start,
statusId: stateId,
terminationReason: "verzogen",
};
await MembershipCommandHandler.update(updateMembership);
}
// add member's awards // add member's awards
for (const awardId in sAwardsById) { for (const awardId in sAwardsById) {