member data service and factory

This commit is contained in:
Julian Krauser 2024-09-18 09:28:46 +02:00
parent e4e5f6dffb
commit f673dec5fa
2 changed files with 13 additions and 3 deletions

View file

@ -13,6 +13,7 @@ export default abstract class MemberQualificationFactory {
note: record.note,
start: record.start,
end: record.end,
terminationReason: record.terminationReason,
qualification: record.qualification.qualification,
};
}

View file

@ -26,13 +26,13 @@ export default abstract class MemberService {
)
.leftJoinAndSelect("membership_first.status", "status_first")
.leftJoinAndSelect("membership_last.status", "status_last")
.leftJoinAndSelect("member.sendNewsletter", "communication")
.leftJoinAndSelect("communication.type", "communicationtype")
.leftJoinAndSelect("member.sendNewsletter", "sendNewsletter")
.leftJoinAndSelect("sendNewsletter.type", "communicationtype")
.leftJoinAndMapMany(
"member.preferredCommunication",
"member.communications",
"preferredCommunication",
"preferredCommunication.preferred = TRUE"
"preferredCommunication.preferred = 1"
)
.leftJoinAndSelect("preferredCommunication.type", "communicationtype_preferred")
.offset(offset)
@ -72,6 +72,15 @@ export default abstract class MemberService {
)
.leftJoinAndSelect("membership_first.status", "status_first")
.leftJoinAndSelect("membership_last.status", "status_last")
.leftJoinAndSelect("member.sendNewsletter", "sendNewsletter")
.leftJoinAndSelect("sendNewsletter.type", "communicationtype")
.leftJoinAndMapMany(
"member.preferredCommunication",
"member.communications",
"preferredCommunication",
"preferredCommunication.preferred = 1"
)
.leftJoinAndSelect("preferredCommunication.type", "communicationtype_preferred")
.where("member.id = :id", { id: id })
.getOneOrFail()
.then((res) => {