CROSSLINK-213 Add items endpoint and populate items on SAM message#421
Merged
JanisSaldabols merged 4 commits intomainfrom Mar 2, 2026
Merged
CROSSLINK-213 Add items endpoint and populate items on SAM message#421JanisSaldabols merged 4 commits intomainfrom
JanisSaldabols merged 4 commits intomainfrom
Conversation
e85b39e to
699f620
Compare
jakub-id
requested changes
Feb 25, 2026
699f620 to
9dab4a3
Compare
418c228 to
4e5c011
Compare
jakub-id
approved these changes
Mar 2, 2026
Contributor
There was a problem hiding this comment.
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}/itemsAPI endpoint and OpenAPI schema forPrItem. - Add shared parsing/escaping helpers and shim logic to move item identifiers between
DeliveryInfo.ItemIdandMessageInfo.Note. - Persist parsed items when handling incoming
SupplyingAgencyMessagewith statusLoaned, 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 |
Contributor
|
@JanisSaldabols see Copilot comments |
4e5c011 to
1171739
Compare
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.