Bug 34950 - ILS DI Availability is not accurate for items on holds shelf or in transit
Summary: ILS DI Availability is not accurate for items on holds shelf or in transit
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Web services (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Laura Escamilla
QA Contact: Victor Grousset/tuxayo
URL:
Keywords:
: 32049 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-09-28 19:59 UTC by Brendan Lawlor
Modified: 2024-02-02 17:55 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.02,23.05.09


Attachments
Bug 34950: Add availability statuses for in transit and on hold items. (2.36 KB, patch)
2023-12-19 18:33 UTC, Laura Escamilla
Details | Diff | Splinter Review
Bug 34950: Add availability statuses for in transit and on hold items. (2.42 KB, patch)
2023-12-20 16:32 UTC, Brendan Lawlor
Details | Diff | Splinter Review
Bug 34950: Add availability statuses for in transit and on hold items. (2.47 KB, patch)
2024-01-14 20:32 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Brendan Lawlor 2023-09-28 19:59:36 UTC
The ILS DI web service is a handy way for a third party system, such as a mobile app, to check for the availability of items for a given bib record in your system.

If you make a call like https://{OPAC_DOMAIN}/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id={BIB_ID}&id_type=bib the response shows the availabilitystatus of items that are on the holds shelf or in transit as 'available'.

While these items may be technically available to be checked out, it's not ideal to send the message to patrons that these items are available because they may show up at the library to get the book and be disappointed :(

It would be more accurate and informative if ILS DI could show availabilitystatus 'not available' with availabilitymsg indicating 'on hold shelf' or 'in transit' for these items.

Alternatively it would be nice to have a REST API endpoint for item availability to easily get this info to third party developers.
Comment 1 Brendan Lawlor 2023-09-29 16:38:52 UTC
Just adding here that I found out the ILS DI service does have info on reserves in the response to GetRecords, you can see items on the hold shelf in <reserves> if you see <found>W</found> or a <waitingdate> then you know the item is on the hold shelf
Comment 2 Laura Escamilla 2023-12-19 18:33:48 UTC
Created attachment 160060 [details] [review]
Bug 34950: Add availability statuses for in transit and on hold items.

To test:
1. Enable the ILS-DI system preference.
2. Place a hold for a patron and put it in transit. Place another hold for a patron that is available for pickup at the local branch. And then select an item that is available for checkout but don’t change the status for it.
3. Go to your testing OPAC and make an ILS-DI “Get Availability” call using the item ids of the three items you worked with in step 2. (i.e. http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=321+323+214&id_type=item)
4. Notice that the availability status for all three items is showing as available. The item in transit and the item with a local hold should have a status of not available and a message of why they are not available.
5. Apply the patch
6. Use restart_all.
7. Refresh the page and notice that the statuses are now correct. The item in transit has a status of not available and an availability message of “In transit”. The item with the local hold has an availability status of not available with an availability message of “On hold”. Finally the available item is correctly showing up as available.
8. Sign off and have a wonderful day. :)
Comment 3 Brendan Lawlor 2023-12-20 16:32:39 UTC
Created attachment 160131 [details] [review]
Bug 34950: Add availability statuses for in transit and on hold items.

To test:
1. Enable the ILS-DI system preference.
2. Place a hold for a patron and put it in transit. Place another hold for a patron that is available for pickup at the local branch. And then select an item that is available for checkout but don’t change the status for it.
3. Go to your testing OPAC and make an ILS-DI “Get Availability” call using the item ids of the three items you worked with in step 2. (i.e. http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=321+323+214&id_type=item)
4. Notice that the availability status for all three items is showing as available. The item in transit and the item with a local hold should have a status of not available and a message of why they are not available.
5. Apply the patch
6. Use restart_all.
7. Refresh the page and notice that the statuses are now correct. The item in transit has a status of not available and an availability message of “In transit”. The item with the local hold has an availability status of not available with an availability message of “On hold”. Finally the available item is correctly showing up as available.
8. Sign off and have a wonderful day. :)

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Comment 4 Brendan Lawlor 2023-12-20 16:35:03 UTC
In testing I also learned that you can make a call for multiple items at once like this http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=321+323+214&id_type=item

Thanks Laura!
Comment 5 Laura Escamilla 2023-12-20 18:30:15 UTC
*** Bug 32049 has been marked as a duplicate of this bug. ***
Comment 6 David Nind 2023-12-21 12:34:03 UTC
Hi Brendan.

Could you change the status to "Signed Off"?

That way, you will get the credit on the dashboard (https://dashboard.koha-community.org/).

David
Comment 7 Brendan Lawlor 2023-12-21 14:03:13 UTC
I thought I did change the status when I added the last comment, but it reverted somehow, or I otherwise messed that up :) Thanks! 

(In reply to David Nind from comment #6)
> Hi Brendan.
> 
> Could you change the status to "Signed Off"?
> 
> That way, you will get the credit on the dashboard
> (https://dashboard.koha-community.org/).
> 
> David
Comment 8 Victor Grousset/tuxayo 2024-01-14 20:32:26 UTC
Created attachment 161029 [details] [review]
Bug 34950: Add availability statuses for in transit and on hold items.

To test:
1. Enable the ILS-DI system preference.
2. Place a hold for a patron and put it in transit. Place another hold for a patron that is available for pickup at the local branch. And then select an item that is available for checkout but don’t change the status for it.
3. Go to your testing OPAC and make an ILS-DI “Get Availability” call using the item ids of the three items you worked with in step 2. (i.e. http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=321+323+214&id_type=item)
4. Notice that the availability status for all three items is showing as available. The item in transit and the item with a local hold should have a status of not available and a message of why they are not available.
5. Apply the patch
6. Use restart_all.
7. Refresh the page and notice that the statuses are now correct. The item in transit has a status of not available and an availability message of “In transit”. The item with the local hold has an availability status of not available with an availability message of “On hold”. Finally the available item is correctly showing up as available.
8. Sign off and have a wonderful day. :)

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 9 Victor Grousset/tuxayo 2024-01-14 20:39:40 UTC
Works, makes sense, QA script happy, code looks good, passing QA :)
Comment 10 Katrin Fischer 2024-01-16 10:24:48 UTC
Small style tip: If you break the lines a bit more, the commit message will be easier to read on CLI and maybe in other spots :)
Comment 11 Katrin Fischer 2024-01-16 11:09:02 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 12 Fridolin Somers 2024-01-17 09:48:39 UTC
Pushed to 23.11.x for 23.11.02
Comment 13 Lucas Gass 2024-02-02 17:55:19 UTC
Backported to 23.05.x for upcoming 23.05.09