Added Debug Log and info pickup older 6month + hygiene crt

This commit is contained in:
2025-12-16 12:05:16 +01:00
parent ca81121f3d
commit f4323e20de
9 changed files with 842 additions and 20 deletions

View File

@@ -199,10 +199,29 @@ async function sendTestNotification(profileId, channel) {
await Promise.all(tasks);
}
async function sendDormantPickupWarning({ profileId, storeName, storeId, reasonLines = [] }) {
if (!profileId || !Array.isArray(reasonLines) || reasonLines.length === 0) {
return;
}
const adminSettings = adminConfig.readSettings();
const userSettings = readNotificationSettings(profileId);
const storeLink = storeId ? `https://foodsharing.de/store/${storeId}` : null;
const title = `Prüfung fällig: ${storeName}`;
const messageBody = reasonLines.join('\n');
const message = storeLink ? `${messageBody}\n${storeLink}` : messageBody;
await sendTelegramNotification(adminSettings.notifications?.telegram, userSettings.notifications?.telegram, {
title,
message,
priority: 'high'
});
}
module.exports = {
sendSlotNotification,
sendStoreWatchNotification,
sendStoreWatchSummaryNotification,
sendTestNotification,
sendDesiredWindowMissedNotification
sendDesiredWindowMissedNotification,
sendDormantPickupWarning
};