CROSSLINK-278 Add patron surname/given_name search parameters#608
Open
JanisSaldabols wants to merge 5 commits into
Open
CROSSLINK-278 Add patron surname/given_name search parameters#608JanisSaldabols wants to merge 5 commits into
JanisSaldabols wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds CQL support for searching patron requests by patron given name and surname, and adjusts how cql.serverChoice is populated to avoid matching on patron name fields.
Changes:
- Add new CQL fields
given_nameandsurnamebacked byill_request->'patronInfo'JSON paths. - Update the
searchtsvector trigger function socql.serverChoiceno longer indexes patronInfo name/id content. - Update OpenAPI docs and API tests to reflect the new CQL fields and the revised serverChoice behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| broker/test/patron_request/api/api-handler_test.go | Extends CRUD/CQL tests to include given_name/surname filters and updates serverChoice expectations. |
| broker/patron_request/db/prcql.go | Registers new CQL fields mapped to patronInfo.givenName and patronInfo.surname. |
| broker/oapi/open-api.yaml | Documents newly supported CQL fields (including given_name and surname). |
| broker/migrations/038_update_search_field.up.sql | Replaces the search tsvector trigger function to exclude patronInfo fields from serverChoice indexing. |
| broker/migrations/038_update_search_field.down.sql | Restores the prior search tsvector trigger function definition including patronInfo fields. |
adamdickmeiss
approved these changes
May 21, 2026
jakub-id
requested changes
May 21, 2026
Comment on lines
104
to
+121
| BibliographicInfo: iso18626.BibliographicInfo{ | ||
| SupplierUniqueRecordId: "WILLSUPPLY_LOANED", | ||
| Title: "Typed request round trip", | ||
| Author: "John Wick", | ||
| }, | ||
| ServiceInfo: &iso18626.ServiceInfo{ | ||
| ServiceLevel: &iso18626.TypeSchemeValuePair{ | ||
| Text: "Copy", | ||
| }, | ||
| ServiceType: iso18626.TypeServiceTypeCopy, | ||
| NeedBeforeDate: &utils.XSDDateTime{ | ||
| Time: time.Now().Add(24 * time.Hour), | ||
| }, | ||
| }, | ||
| PatronInfo: &iso18626.PatronInfo{ | ||
| GivenName: "John", | ||
| Surname: "Wick", | ||
| }, |
Comment on lines
+6
to
+11
| NEW.search := to_tsvector(NEW.language, | ||
| COALESCE(NEW.requester_req_id, '') || ' ' || | ||
| COALESCE(NEW.patron, '') || ' ' || | ||
| COALESCE(NEW.ill_request->'bibliographicInfo'->>'title', '') || ' ' || | ||
| COALESCE(NEW.ill_request->'bibliographicInfo'->>'author', '') || ' ' || | ||
| COALESCE( |
Comment on lines
+1
to
+3
| DROP INDEX IF EXISTS idx_pr_surname_lower; | ||
|
|
||
| DROP INDEX IF EXISTS idx_pr_given_name_lower; |
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.
No description provided.