Skip to content

CROSSLINK-302 Clean up supplier NCIP requests - #683

Merged
adamdickmeiss merged 3 commits into
mainfrom
CROSSLINK-302-cleanup-supplier-ncip-requests
Jul 23, 2026
Merged

CROSSLINK-302 Clean up supplier NCIP requests#683
adamdickmeiss merged 3 commits into
mainfrom
CROSSLINK-302-cleanup-supplier-ncip-requests

Conversation

@adamdickmeiss

@adamdickmeiss adamdickmeiss commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

https://index-data.atlassian.net/browse/CROSSLINK-302

Cancel RequestItem before ask-retry, cannot-supply, and accept-cancel when a supplier request exists.
Compensate when saving the item after RequestItem fails.

Leave CheckOutItem/CheckInItem and manual termination flows unchanged.

Cancel RequestItem before ask-retry, cannot-supply, and accept-cancel
when a supplier request exists. Compensate when saving the item after
RequestItem fails.

Leave CheckOutItem/CheckInItem and manual termination flows unchanged.
Copilot AI review requested due to automatic review settings July 23, 2026 12:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the lender-side patron request action flow to proactively cancel NCIP RequestItem holds before sending certain ISO18626 status changes (ask-retry, cannot-supply, accept-cancel) when a supplier-side request exists, and adds compensation logic to cancel the hold if persisting the item fails after RequestItem succeeds.

Changes:

  • Pass LMS adapter + ISO18626 request into cannot-supply / ask-retry / accept-cancel handlers and cancel RequestItem first when items exist for the PR.
  • Add compensation: if SaveItem fails after a successful RequestItem, attempt CancelRequestItem and join the error if that compensation fails.
  • Expand unit tests and test doubles to cover the new cancellation behavior (including a new cannot-supply cancel-failure test).

Reviewed changes

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

File Description
broker/patron_request/service/action.go Cancels supplier-side LMS requests before certain lender actions; adds SaveItem failure compensation with CancelRequestItem.
broker/patron_request/service/action_test.go Updates mocks and tests to account for new CancelRequestItem behavior and adds a cancel-failure test for cannot-supply.

Comment thread broker/patron_request/service/action.go
Comment thread broker/patron_request/service/action.go
@adamdickmeiss
adamdickmeiss marked this pull request as draft July 23, 2026 12:21
@adamdickmeiss
adamdickmeiss marked this pull request as ready for review July 23, 2026 12:38
@adamdickmeiss
adamdickmeiss merged commit a0be11d into main Jul 23, 2026
6 checks passed
@adamdickmeiss
adamdickmeiss deleted the CROSSLINK-302-cleanup-supplier-ncip-requests branch July 23, 2026 12:53
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