Skip to content

CROSSLINK-278 Add patron surname/given_name search parameters#608

Open
JanisSaldabols wants to merge 5 commits into
mainfrom
CROSSLINK-278
Open

CROSSLINK-278 Add patron surname/given_name search parameters#608
JanisSaldabols wants to merge 5 commits into
mainfrom
CROSSLINK-278

Conversation

@JanisSaldabols
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings May 20, 2026 13:54
@JanisSaldabols JanisSaldabols requested a review from jakub-id as a code owner May 20, 2026 13:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_name and surname backed by ill_request->'patronInfo' JSON paths.
  • Update the search tsvector trigger function so cql.serverChoice no 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.

Comment thread broker/migrations/038_update_search_field.up.sql Outdated
Comment thread broker/patron_request/db/prcql.go
Comment thread broker/migrations/038_update_search_field.up.sql Outdated
Comment thread broker/migrations/038_update_search_field.down.sql Outdated
Copilot AI review requested due to automatic review settings May 22, 2026 06:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comment thread broker/migrations/038_update_search_field.up.sql Outdated
Comment thread broker/migrations/038_update_search_field.down.sql Outdated
Comment thread broker/migrations/038_update_search_field.up.sql Outdated
Copilot AI review requested due to automatic review settings May 22, 2026 15:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants