@@ -59,6 +59,15 @@ export async function checkSiteOrSystemIsNotifyEnabled(
5959 const { enabledSiteODSCodes, enabledSystemAppNames, enabledSystemAppIds, blockedSiteODSCodes} = await loadConfig ( )
6060 const unfilteredItemCount = data . length
6161
62+ logger ?. info ( "Filtering items based on enabled sites and systems configuration" ,
63+ {
64+ enabledSystemAppIds : Array . from ( enabledSystemAppIds ) ,
65+ enabledSystemAppNames : Array . from ( enabledSystemAppNames ) ,
66+ enabledODSCodes : Array . from ( enabledSiteODSCodes ) ,
67+ blockedODSCodes : Array . from ( blockedSiteODSCodes )
68+ }
69+ )
70+
6271 const filteredItems = data . filter ( ( item ) => {
6372 const appId = item . current . ApplicationID . trim ( ) . toLowerCase ( )
6473 const appName = item . current . ApplicationName . trim ( ) . toLowerCase ( )
@@ -71,11 +80,13 @@ export async function checkSiteOrSystemIsNotifyEnabled(
7180
7281 // Is this item supplier enabled?
7382 if ( USE_APP_ID_FOR_NOTIFICATIONS_FILTERING ) {
83+ logger ?. info ( "Using application ID for notifications filtering" )
7484 const isEnabledApplication = enabledSiteODSCodes . has ( odsCode ) || enabledSystemAppIds . has ( appId )
7585 if ( ! isEnabledApplication ) {
7686 return false
7787 }
7888 } else {
89+ logger ?. info ( "Using application name for notifications filtering" )
7990 const isEnabledSystem = enabledSiteODSCodes . has ( odsCode ) || enabledSystemAppNames . has ( appName )
8091 if ( ! isEnabledSystem ) {
8192 return false
@@ -84,6 +95,7 @@ export async function checkSiteOrSystemIsNotifyEnabled(
8495
8596 // Cannot have a blocked ODS code
8697 if ( blockedSiteODSCodes . has ( odsCode ) ) {
98+ logger ?. info ( "Site ODS code is explicitly blocked" , { odsCode} )
8799 return false
88100 }
89101
0 commit comments