Support SIP checkin 'cancel' operation (BI field)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
New
|
Wishlist
|
Unassigned |
Bug Description
Evergreen 3.5 / Wishlist
SIP supports a "cancel" operation on checkin (and checkout) requests via the "BI" SIP field. The purpose of this field is in effect to undo a checkout or checkin operation.
The use case driving checkin+cancel is handling error conditions with 3rd-party book lockers.
1. Patron authenticates with locker via SIP2
2. Locker checks items out to patron, fulfilling holds, etc. via SIP2.
3. Locker door fails to open or other error condition occurs.
4. Locker sends checkin+cancel request via SIP2 to undo the checkout from step 2.
The cancel operation should check the item in -- presumably a no-op checkin -- and return any fulfilled holds to their previously captured, but unfulfilled state.
I suspect there are unforeseen complexities with this. Thoughts appreciated.
SIPServer.pm already supports this field, so code changes only need to be made to the Evergreen SIP code.
Changed in evergreen: | |
milestone: | 3.6-beta → 3.next |
tags: |
added: circ-holds removed: holds |
Changed in evergreen: | |
milestone: | 3.next → none |
Here's a branch:
https:/ /git.evergreen- ils.org/ ?p=working/ Evergreen. git;a=shortlog; h=refs/ heads/user/ berick/ lp1893968- sip-checkin- with-cancel
In the interest of narrowing the scope, instead of a full rollback option, I have implemented a new flag for the open-ils. circ.checkin API called "revert_ hold_fulfillmen t", since this is the specific behavior I'm interested in.
It behaves like a No-Op checkin, with the addition that if a hold was fulfilled by the checked out item for the patron which circulated the item, the hold fulfillment is rolled back and the item is put back on the holds shelf.
Teaches the SIP Checkin code to pass the 'revert_ hold_fulfillmen t' flag to its checkin call when the SIP 'cancel' value is set, i.e. the SIP 'BI' field contains a 'Y' value.
To test without SIP, check an item out to patron which fulfills a hold. Then in srfsh:
srfsh% request open-ils.circ open-ils. circ.checkin "<AUTHTOKEN>" {"copy_ barcode" :"<COPY_ BARCODE" , "revert_ hold_fulfillmen t":1}
Confirm the hold in question has been un-fulfilled and the item in question is now back on the holds shelf.