From 21bcdde625d953a53630f1345f68ab6c06b68aa6 Mon Sep 17 00:00:00 2001 From: Blake Matthes Date: Fri, 2 May 2025 07:52:37 -0500 Subject: [PATCH] refactor(blocking query): changes made to only show 1 bo at a atime --- server/services/sqlServer/querys/notifications/blocking.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/services/sqlServer/querys/notifications/blocking.ts b/server/services/sqlServer/querys/notifications/blocking.ts index bc71846..a1f5676 100644 --- a/server/services/sqlServer/querys/notifications/blocking.ts +++ b/server/services/sqlServer/querys/notifications/blocking.ts @@ -1,5 +1,5 @@ export const blockQuery = ` -SELECT +SELECT TOP(1) 'Alert! new blocking order: #' + cast(HumanReadableId as varchar) + ' - ' + ArticleVariantDescription as subject, cast([HumanReadableId] as varchar) as blockingNumber, [ArticleVariantDescription] as article, @@ -41,5 +41,6 @@ on [test1_AlplaPROD2.0_Reporting].[reporting_blocking].[BlockingOrder].Producti where [test1_AlplaPROD2.0_Reporting].[reporting_blocking].[BlockingOrder].[BlockingDate] between getdate() - 1 and getdate() + 1 and [test1_AlplaPROD2.0_Reporting].[reporting_blocking].[BlockingOrder].BlockingTrigger = 1 -and HumanReadableId NOT IN ([sentBlockingOrders]) +--and HumanReadableId NOT IN ([sentBlockingOrders]) +and HumanReadableId > [lastBlocking] `;