Skip to content

Commit 3635fa0

Browse files
committed
Update log message to be less confusing. Make status check not case sensitive
1 parent 255fcb6 commit 3635fa0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/updatePrescriptionStatus/src/utils/sqsClient.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function chunkArray<T>(arr: Array<T>, size: number): Array<Array<T>> {
2727
* @param logger - Logger instance
2828
*/
2929
export 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

Comments
 (0)