CROSSLINK-274 patron request facets#615
Closed
adamdickmeiss wants to merge 36 commits into
Closed
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds faceting support to the broker’s /patron_requests listing endpoint (CROSSLINK-274), exposing aggregated counts (e.g., by requester/supplier symbol) alongside the normal paginated results.
Changes:
- Extend the OpenAPI spec and API handler to accept a
facetsquery parameter and return facet data inabout.facets. - Add SQL + repository/query-layer support to compute facet counts (with optional CQL filtering).
- Add API tests covering successful facet retrieval and bad facet input.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| broker/test/patron_request/api/api-handler_test.go | Adds tests for facets success and invalid facet handling. |
| broker/sqlc/pr_query.sql | Adds a SQLC query to compute facet counts. |
| broker/patron_request/db/prrepo.go | Introduces facet models and repo method to compute facets. |
| broker/patron_request/db/prcql.go | Adds CQL-aware facets query execution with dynamic SQL construction. |
| broker/patron_request/api/api-handler.go | Wires facets into /patron_requests response and adds toProAbout conversion helper. |
| broker/oapi/open-api.yaml | Adds facets parameter and schemas for facet results in About. |
Comments suppressed due to low confidence (1)
broker/oapi/open-api.yaml:1422
- The
/patron_requestsGET 200 response description says "Successful retrieval of events", which is misleading for API consumers. It should describe patron request retrieval to match the endpoint.
'200':
description: Successful retrieval of events
content:
application/json:
schema:
$ref: '#/components/schemas/PatronRequests'
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 8 comments.
Comments suppressed due to low confidence (1)
broker/oapi/open-api.yaml:1487
- The
/patron_requestsGET response description says "Successful retrieval of events", which doesn’t match the endpoint and can confuse API consumers. Consider updating it to "Successful retrieval of patron requests" (or similar).
- $ref: '#/components/parameters/Limit'
- $ref: '#/components/parameters/Offset'
- $ref: '#/components/parameters/Side'
- $ref: '#/components/parameters/Symbol'
- $ref: '#/components/parameters/Facets'
responses:
'200':
description: Successful retrieval of events
content:
application/json:
schema:
$ref: '#/components/schemas/PatronRequests'
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Comments suppressed due to low confidence (1)
broker/oapi/open-api.yaml:1484
- The response description under
GET /patron_requestssays “Successful retrieval of events”, which looks like a copy/paste error and makes the OpenAPI misleading for clients. Update it to describe patron requests instead.
- $ref: '#/components/parameters/Facets'
responses:
'200':
description: Successful retrieval of events
content:
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Now that the OpenAPI spec is validated. In fact , one could argue that it an error now should be seena as Internal Error.
jakub-id
approved these changes
May 27, 2026
Contributor
Author
|
Merged in #617 already. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://index-data.atlassian.net/browse/CROSSLINK-274
response in About. Should do facets for any patron_requests query.