Added Debug Log and info pickup older 6month + hygiene crt
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user