member communication

This commit is contained in:
Anton Schegg 2025-01-05 17:46:31 +01:00
parent 2398084764
commit 93afdec274

View file

@ -462,6 +462,7 @@ router.get("/", async (req, res) => {
} }
// add communications // add communications
if (!queryResultElement.verzogen) {
const createCommunicationCommands: CreateCommunicationCommand[] = []; const createCommunicationCommands: CreateCommunicationCommand[] = [];
let havePreferred = false; let havePreferred = false;
if (queryResultElement.Mobiltelefon && !queryResultElement.verstorben && !queryResultElement.verzogenDatum) { if (queryResultElement.Mobiltelefon && !queryResultElement.verstorben && !queryResultElement.verzogenDatum) {
@ -472,6 +473,7 @@ router.get("/", async (req, res) => {
city: "", city: "",
email: "", email: "",
mobile: queryResultElement.Mobiltelefon.trim(), mobile: queryResultElement.Mobiltelefon.trim(),
postalCode: "",
preferred: false, preferred: false,
street: "", street: "",
streetNumber: 0, streetNumber: 0,
@ -488,6 +490,7 @@ router.get("/", async (req, res) => {
email: queryResultElement.email, email: queryResultElement.email,
mobile: "", mobile: "",
preferred: queryResultElement.EinladungNurPerEmail, preferred: queryResultElement.EinladungNurPerEmail,
postalCode: "",
street: "", street: "",
streetNumber: 0, streetNumber: 0,
streetNumberAddition: "", streetNumberAddition: "",
@ -506,6 +509,7 @@ router.get("/", async (req, res) => {
city: "", city: "",
email: "", email: "",
mobile: queryResultElement.Mobiltelefon.trim(), mobile: queryResultElement.Mobiltelefon.trim(),
postalCode: "",
preferred: preferred, preferred: preferred,
street: "", street: "",
streetNumber: 0, streetNumber: 0,
@ -526,6 +530,7 @@ router.get("/", async (req, res) => {
email: "", email: "",
mobile: "", mobile: "",
preferred: preferred, preferred: preferred,
postalCode: queryResultElement.PLZ,
street: queryResultElement.street.trim(), street: queryResultElement.street.trim(),
streetNumber: queryResultElement.streetnumber, streetNumber: queryResultElement.streetnumber,
streetNumberAddition: queryResultElement.streetnumberaddition.trim(), streetNumberAddition: queryResultElement.streetnumberaddition.trim(),
@ -543,7 +548,7 @@ router.get("/", async (req, res) => {
console.log(`Adding communication for ${sCommTypesById[createCommunicationCommand.typeId]} to ${newMember.firstname} ${newMember.lastname}`) console.log(`Adding communication for ${sCommTypesById[createCommunicationCommand.typeId]} to ${newMember.firstname} ${newMember.lastname}`)
await CommunicationCommandHandler.create(createCommunicationCommand); await CommunicationCommandHandler.create(createCommunicationCommand);
} }
}
} }
res.sendStatus(200); res.sendStatus(200);