Skip to content

Commit

Permalink
Merge pull request #31 from pagopa/feat-bizEvent-status-query-filter
Browse files Browse the repository at this point in the history
[feat] Added bizEvent status filter in query
  • Loading branch information
pasqualespica authored Dec 14, 2023
2 parents 59180fd + 6be53de commit 70861bb
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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<BizEvent> queryResponse = cosmosContainer
Expand Down

0 comments on commit 70861bb

Please sign in to comment.