From 6be53def33ff044d6871cfd9ec33c8293b43b362 Mon Sep 17 00:00:00 2001 From: svariant Date: Thu, 14 Dec 2023 17:07:08 +0100 Subject: [PATCH] [feat] Added bizEvent status filter in query --- .../pdf/helpdesk/client/impl/BizEventCosmosClientImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/it/gov/pagopa/receipt/pdf/helpdesk/client/impl/BizEventCosmosClientImpl.java b/src/main/java/it/gov/pagopa/receipt/pdf/helpdesk/client/impl/BizEventCosmosClientImpl.java index f9897d9..a71dcd3 100644 --- a/src/main/java/it/gov/pagopa/receipt/pdf/helpdesk/client/impl/BizEventCosmosClientImpl.java +++ b/src/main/java/it/gov/pagopa/receipt/pdf/helpdesk/client/impl/BizEventCosmosClientImpl.java @@ -8,6 +8,7 @@ import com.azure.cosmos.util.CosmosPagedIterable; import it.gov.pagopa.receipt.pdf.helpdesk.client.BizEventCosmosClient; import it.gov.pagopa.receipt.pdf.helpdesk.entity.event.BizEvent; +import it.gov.pagopa.receipt.pdf.helpdesk.entity.event.enumeration.BizEventStatusType; import it.gov.pagopa.receipt.pdf.helpdesk.exception.BizEventNotFoundException; /** @@ -52,7 +53,7 @@ public BizEvent getBizEventDocument(String eventId) throws BizEventNotFoundExcep CosmosContainer cosmosContainer = cosmosDatabase.getContainer(containerId); //Build query - String query = String.format("SELECT * FROM c WHERE c.id = '%s'", eventId); + String query = String.format("SELECT * FROM c WHERE c.eventStatus = '%s' and c.id = '%s'", BizEventStatusType.DONE, eventId); //Query the container CosmosPagedIterable queryResponse = cosmosContainer