disable expired desired booking slots

This commit is contained in:
2025-11-11 09:51:42 +01:00
parent c49e270315
commit bbde08f89a
2 changed files with 129 additions and 5 deletions

View File

@@ -112,6 +112,23 @@ async function sendStoreWatchNotification({ profileId, storeName, storeId, regio
});
}
async function sendDesiredWindowMissedNotification({ profileId, storeName, desiredWindowLabel }) {
if (!profileId) {
return;
}
const title = `Keine Slots gefunden: ${storeName}`;
const messageBase = desiredWindowLabel
? `Für den gewünschten Zeitraum ${desiredWindowLabel} konnte kein Slot gefunden werden.`
: 'Für den gewünschten Zeitraum konnte kein Slot gefunden werden.';
const message = `${messageBase} Der Eintrag wurde deaktiviert.`;
await notifyChannels(profileId, {
title,
message,
link: null,
priority: 'default'
});
}
async function sendTestNotification(profileId, channel) {
const title = 'Pickup Benachrichtigung (Test)';
const message = 'Das ist eine Testnachricht. Bei Fragen wende dich bitte an den Admin.';
@@ -148,5 +165,6 @@ async function sendTestNotification(profileId, channel) {
module.exports = {
sendSlotNotification,
sendStoreWatchNotification,
sendTestNotification
sendTestNotification,
sendDesiredWindowMissedNotification
};