@@ -27,7 +27,7 @@ function chunkArray<T>(arr: Array<T>, size: number): Array<Array<T>> {
2727 * @param logger - Logger instance
2828 */
2929export async function pushPrescriptionToNotificationSQS ( requestId : string , data : Array < DataItem > , logger : Logger ) {
30- logger . info ( "Pushing data items up to the notifications SQS " , { count : data . length , sqsUrl} )
30+ logger . info ( "Checking if any items require notifications" , { numItemsToBeChecked : data . length , sqsUrl} )
3131
3232 if ( ! sqsUrl ) {
3333 logger . error ( "Notifications SQS URL not found in environment variables" )
@@ -45,7 +45,7 @@ export async function pushPrescriptionToNotificationSQS(requestId: string, data:
4545
4646 for ( const batch of batches ) {
4747 const entries = batch
48- . filter ( ( item ) => updateStatuses . includes ( item . Status ) )
48+ . filter ( ( item ) => updateStatuses . includes ( item . Status . toLowerCase ( ) ) )
4949 // Add the request ID to the SQS message
5050 . map ( ( item ) => ( { ...item , requestId} ) )
5151 . map ( ( item ) => ( { Id : v4 ( ) . toUpperCase ( ) , MessageBody : JSON . stringify ( item ) } ) )
@@ -62,7 +62,7 @@ export async function pushPrescriptionToNotificationSQS(requestId: string, data:
6262
6363 const messageIds = entries . map ( ( el ) => el . Id )
6464 logger . info (
65- "Notification required. Pushing prescriptions with the following SQS message IDs" ,
65+ "Notification required. Pushing prescriptions to the notifications SQS with the following SQS message IDs" ,
6666 { messageIds, requestId}
6767 )
6868
0 commit comments