7565-testToMaster #2567

Merged
alexm merged 250 commits from 7565-testToMaster into master 2024-06-11 06:31:18 +00:00
2 changed files with 8 additions and 1 deletions
Showing only changes of commit 35ae728e81 - Show all commits

View File

@ -17,18 +17,25 @@ module.exports = Self => {
const {backupPrinterNotificationDelay} = await models.ProductionConfig.findOne(); const {backupPrinterNotificationDelay} = await models.ProductionConfig.findOne();
if (backupPrinterNotificationDelay) { if (backupPrinterNotificationDelay) {
console.log('operator delay:',
backupPrinterNotificationDelay,
Date.vnNow(),
new Date(Date.vnNow() - (backupPrinterNotificationDelay * 1000))
);
const notifications = await models.NotificationQueue.find( const notifications = await models.NotificationQueue.find(
{where: {created: {gte: new Date(Date.vnNow() - (backupPrinterNotificationDelay * 1000))}, {where: {created: {gte: new Date(Date.vnNow() - (backupPrinterNotificationDelay * 1000))},
notificationFk: notificationName, notificationFk: notificationName,
status: 'sent' status: 'sent'
} }
}); });
console.log('notifications: ', notifications);
const criteria = {labelerId: labelerFk, sectorId: sectorFk}; const criteria = {labelerId: labelerFk, sectorId: sectorFk};
const filteredNotifications = notifications.filter(notification => { const filteredNotifications = notifications.filter(notification => {
const paramsObj = JSON.parse(notification.params); const paramsObj = JSON.parse(notification.params);
return Object.keys(criteria).every(key => criteria[key] === paramsObj?.[key]); return Object.keys(criteria).every(key => criteria[key] === paramsObj?.[key]);
}); });
console.log('filteredNotifications: ', filteredNotifications);
if (filteredNotifications.length >= 1) return; if (filteredNotifications.length >= 1) return;
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "salix-back", "name": "salix-back",
"version": "24.22.7", "version": "24.22.8",
"author": "Verdnatura Levante SL", "author": "Verdnatura Levante SL",
"description": "Salix backend", "description": "Salix backend",
"license": "GPL-3.0", "license": "GPL-3.0",