Skip to content

CROSSLINK-213 Add items endpoint and populate items on SAM message#421

Merged
JanisSaldabols merged 4 commits intomainfrom
CROSSLINK-213
Mar 2, 2026
Merged

CROSSLINK-213 Add items endpoint and populate items on SAM message#421
JanisSaldabols merged 4 commits intomainfrom
CROSSLINK-213

Conversation

@JanisSaldabols
Copy link
Collaborator

No description provided.

@JanisSaldabols JanisSaldabols force-pushed the CROSSLINK-213 branch 2 times, most recently from 418c228 to 4e5c011 Compare March 2, 2026 09:26
Copy link
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

This PR adds first-class support for patron-request “items” by encoding/decoding item lists in ISO18626 SAM notes, persisting items on incoming Loaned messages, and exposing a new API endpoint to retrieve items for a patron request.

Changes:

  • Add /patron_requests/{id}/items API endpoint and OpenAPI schema for PrItem.
  • Add shared parsing/escaping helpers and shim logic to move item identifiers between DeliveryInfo.ItemId and MessageInfo.Note.
  • Persist parsed items when handling incoming SupplyingAgencyMessage with status Loaned, and update related tests/repo methods.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
broker/patron_request/api/api-handler.go Adds items endpoint, refactors PR lookup helper to write HTTP errors directly, maps DB items to API model
broker/oapi/open-api.yaml Adds PrItem schema and /patron_requests/{id}/items path
broker/common/common.go Introduces #MultipleItems# encoding helpers for packing/unpacking items in notes
broker/shim/shim.go Adds Alma/ReShare logic to unify items into notes on incoming messages and set ItemId on outgoing messages
broker/patron_request/service/message-handler.go Saves parsed items on Loaned SAM messages
broker/shim/shim_test.go Adds shim round-trip tests for item encoding/decoding
broker/patron_request/service/message-handler_test.go Adds tests for saving items and updates Loaned SAM test to include item block
broker/patron_request/db/prrepo.go Renames repo method to GetItemsByPrId
broker/test/patron_request/api/api-handler_test.go Exercises new /items endpoint in an end-to-end test
broker/test/patron_request/db/prrepo_test.go Updates repo test to new method name
broker/patron_request/service/action_test.go Extends mock repo to capture saved items

@jakub-id jakub-id self-requested a review March 2, 2026 09:58
@jakub-id
Copy link
Contributor

jakub-id commented Mar 2, 2026

@JanisSaldabols see Copilot comments

@JanisSaldabols JanisSaldabols merged commit 5938306 into main Mar 2, 2026
5 checks passed
@JanisSaldabols JanisSaldabols deleted the CROSSLINK-213 branch March 2, 2026 12:46
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.

3 participants