-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Poppy upgrade: Investigate how title-level request (TLR) changes impact us #2027
Comments
Title level request setting Record used for testing FOLIO UI and Title Level Requests:
API request In SubmitFolioRequestJob, the code calls the method "place_title_hold" https://github.com/sul-dlss/sul-requests/blob/main/app/jobs/submit_folio_request_job.rb#L114 which, in turn, will use Folio Client and call mod_patron API https://github.com/sul-dlss/sul-requests/blob/main/app/jobs/submit_folio_request_job.rb#L123). The corresponding mod_patron API reference is "POST /patron/account/{id}/instance/{instanceId}/hold" as described on https://s3.amazonaws.com/foliodocs/api/mod-patron/p/patron.html.
The error is a 500 response (although conversations on FOLIO slack indicate a 4xx may be returned in the future). There are multiple reasons returned for the failure: no pageable items found, no loan or recallable item, and hold requests are not allowed for this patron and title combination (which is the error that displays in the UI). |
It looks like FOLIO title level requests might use circulation rules to determine eligibility. Does sul-requests need changes to support these circ rules?
Based on bullet from Poppy changes slides/notes from lib sys
Steve notes:
First steps
The 'addition' note from the Poppy release notes:
The referenced setting:
The consideration:
sul-request code reference:
Submit FOLIO job: execute will place title hold if barcodes are empty:
https://github.com/sul-dlss/sul-requests/blob/main/app/jobs/submit_folio_request_job.rb#L55
place_title_hold:
https://github.com/sul-dlss/sul-requests/blob/main/app/jobs/submit_folio_request_job.rb#L114
Uses instance id, and requests folio_client.create_instance_hold
FOLIO Client create_instance_hold:
https://github.com/sul-dlss/sul-requests/blob/main/app/services/folio_client.rb#L127
Uses mod-patron
Under title level requests in this release notes section: https://folio-org.atlassian.net/wiki/spaces/REL/pages/16319169/Changes+and+required+actions , the linked issue refers only to UI changes (i.e. error messages obtained through the UI). For reference: https://folio-org.atlassian.net/browse/UXPROD-3981
I've asked on a FOLIO channel if mod-patron or edge-patron provide any error messages in this case (when the "fail to create title level hold" option is checked).
--> Response from folio slack thanks to Julian Ladisch:
curl -HX-Okapi-Tenant:diku -HContent-type:application/json -c cookies -d '{"username":"diku_admin","password":"admin"}' https://folio-snapshot-okapi.dev.folio.org/bl-users/login-with-expiry
curl -w"\n" -D - -HX-Okapi-Tenant:diku -HContent-type:application/json -b cookies -d '{"requestDate":"2024-02-16T12:12:12","pickupLocationId":"3a40852d-49fd-4df2-a1f9-6e2641a6e91f"}' https://folio-snapshot-okapi.dev.folio.org/patron/account/2205005b-ca51-4a04-87fd-938eefa8f6de/instance/5bf370e0-8cca-4d9c-82e4-5170ab2a0a39/hold
HTTP/2 500
date: Fri, 16 Feb 2024 17:55:56 GMT
content-type: text/plain
Failed to place a request for the instance. Reasons:
validation failure:
reason: "Cannot create page TLR for this instance ID - no pageable available items found", parameters: key: instanceId, value: 5bf370e0-8cca-4d9c-82e4-5170ab2a0a39%nvalidation failure:
reason: "Recall requests are not allowed for this patron and item combination", parameters: key: requestType, value: Recall%nvalidation failure:
reason: "Hold requests are not allowed for this patron and title combination", parameters: key: requesterId, value: 2205005b-ca51-4a04-87fd-938eefa8f6de%nkey: instanceId, value: 5bf370e0-8cca-4d9c-82e4-5170ab2a0a39
Currently a 500 response is returned, however, you should no rely on this because a 4xx response (400 or 422) is more appropriate and the module might fix this.
The text was updated successfully, but these errors were encountered: