[Koha-bugs] [Bug 16826] Add API routes for getting item availability and holdability
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Mon Aug 1 11:27:42 CEST 2016
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826
Jiri Kozlovsky <mail at jkozlovsky.cz> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #53826|0 |1
is obsolete| |
--- Comment #15 from Jiri Kozlovsky <mail at jkozlovsky.cz> ---
Created attachment 53827
-->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=53827&action=edit
Bug 16826: Add API route for getting item availability
GET /availability/items?itemnumber=123
GET /availability/items?itemnumber=123+456+789
GET /availability/items?biblionumber=321
GET /availability/items?biblionumber=321+654+987
This patch adds above routes for checking anonymous item availability. Patron
status is not checked.
The returned data is for example:
{
"checkout": {
"available": false,
"description": ["onloan"],
"expected_available": "2016-07-13"
},
"hold": {
"available": true,
"description": [],
"expected_available": null
},
"local_use": {
"available": false,
"description": ["onloan"],
"expected_available": "2016-07-13"
},
"onsite_checkout": {
"available": false,
"description": ["onsite_checkouts_disabled"],
"expected_available": null
},
"hold_queue_length": 1,
+ some basic item information on locations, bib/bib(item)numbers etc.
}
Possible values in availability description are an empty array and any of:
"onloan", "reserved", "damaged", "withdrawn", "itemlost", "restricted",
"notforloan", "ordered". (+"onsite_checkouts_disabled" for onsite_checkout)
To test:
1. Play around with an item. Place a hold on it, checkout, set it damaged etc.
2. Make GET requests to /api/v1/availability/items?itemnumber=YYY, where
YYY is an existing itemnumber. You can also try with biblionumber=XXX
query parameter, where XXX is an existing biblionumber.
3. Check that the availability statuses are correct and that availability
description lists the appropriate status for unavailability.
4. Repeat steps 1-3 until you are confident the route works as expected.
5. Run the following tests:
- t/Koha/Item/Availability.t
- t/db_dependent/Items.t
- t/db_dependent/api/v1/availability.t
Signed-off-by: Jiri Kozlovsky <mail at jkozlovsky.cz>
--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
More information about the Koha-bugs
mailing list